Re: rmmod whilst reading/writing sysctl

Alexander Viro (viro@math.psu.edu)
Tue, 30 Oct 2001 21:33:09 -0500 (EST)


On Wed, 31 Oct 2001, John Levon wrote:

>
> Where is the prevention of module unload whilst a sysctl from a module is being read/written ?
>
> sysctl syscall is protected by BKL, but I can't see similar code for the cat >/proc/sys/...

... and that protection is worth nothing, since we copy data to/from
userland. Forget about BKL - it doesn't prevent races.

There is a shitload of rmmod (and plain "we remove the object" - it doesn't
have to be a module) races in that area. Composite trees _suck_. sysctls,
devfs, ddfs - whatever. If tree is served by several drivers - it's broken.

In case of sysctls I have an old patch that could be turned into something
working, but that will take a lot of changes in code that exports sysctls,
so that may be very painful.

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