lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 03 Jun 2010 00:01:25 +0300
From:	Luciano Coelho <luciano.coelho@...ia.com>
To:	ext Jan Engelhardt <jengelh@...ozas.de>
Cc:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"netfilter-devel@...r.kernel.org" <netfilter-devel@...r.kernel.org>,
	"kaber@...sh.net" <kaber@...sh.net>, Timo Teras <timo.teras@....fi>
Subject: Re: [PATCH v2] netfilter: Xtables: idletimer target implementation

On Wed, 2010-06-02 at 22:04 +0200, Coelho Luciano (Nokia-D/Helsinki)
wrote:
> What causes printk to appear under /sys/module even when compiled in, is
> that it uses a module param.  This line:
> 
> module_param_named(time, printk_time, bool, S_IRUGO | S_IWUSR);
> 
> ...is what triggers the printk directory to be created in sysfs.  If I
> add a similar line in my module, it shows up there too.
> 
> I still don't know if there is an actual kobject associated with it,
> I'll check that next.

Okay, so here is how it goes: if the module is linked into the kernel
and it has module parameters, the kernel creates a kobj for it as a
module_ktype without parent, which will cause it to show up
in /sys/modules.

I could do the same in the module initialization when THIS_MODULE ==
NULL, but I don't see any other module doing this.  In fact, I only see
the kernel itself creating kobjects of module_ktype (in load_module()
and in the case I just described).  Smells like a terrible hack to do
that in the module itself... :(

Adding bogus parameters to the module just to trig the kernel to create
the kobject also seems to be too hacky...

-- 
Cheers,
Luca.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ