Re: modules registering as sysctl handlers

From: viro
Date: Tue Mar 02 2004 - 07:42:17 EST


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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/