Re: modules registering as sysctl handlers

Rusty Russell
2004-03-03T00:06:20Z

On Tue, 2004-03-02 at 23:41, viro@parcelfarce.linux.theplanet.co.uk
wrote:
> On Tue, Mar 02, 2004 at 02:29:09PM +0200, Muli Ben-Yehuda wrote:
> > Hi
> >
> > Looking at 2.6.3-bk, it appears that the sysctl code does not raise a
> > module's reference count before calling a sysctl handler registered by
> > that module.
> >
> > - are modules allowed to register sysctl handlers?
> > register_sysctl_table is exported, so I imagine so.
> >
> > - am I missing something and modules are in fact protected against
> > concurrent unloading and invocation of sysctl?
>
> They are not and no, bumping refcount would not be anywhere near enough.

Al is referring to the fact that there's no protection for a dynamically
allocated ctl_table.

However, an owner field and standard module_get() would solve the case
of statically declared ctl_table.

I don't know that there's a current user who requires it though?

Rusty.
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell