mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* rmmod whilst reading/writing sysctl
@ 2001-10-31  2:21 John Levon
  2001-10-31  2:33 ` Alexander Viro
  0 siblings, 1 reply; 2+ messages in thread
From: John Levon @ 2001-10-31  2:21 UTC (permalink / raw)
  To: linux-kernel


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/...
case

If there is none, how do I support sysctl from a module safely ?

thanks
john

-- 
"I'm dismayed whenever libertarianism and programming are associated; in my
 mind, it is as nebulous as associating people who write books as communists or
 those who read newspapers as capitalists."
	- graydon

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: rmmod whilst reading/writing sysctl
  2001-10-31  2:21 rmmod whilst reading/writing sysctl John Levon
@ 2001-10-31  2:33 ` Alexander Viro
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Viro @ 2001-10-31  2:33 UTC (permalink / raw)
  To: John Levon; +Cc: linux-kernel



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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-10-31  2:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-31  2:21 rmmod whilst reading/writing sysctl John Levon
2001-10-31  2:33 ` Alexander Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®