Re: modules registering as sysctl handlers

viro
2004-03-02T12:41:11Z

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.
It's not just modules - no module refcount will help e.g. per-interface
sysctls. All dynamic sysctls are b0rken and the best course of action
is to avoid using that crap.

We'll need to fix that mess, but it won't be easy.