Re: Notifier chains are unsafe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 26 Oct 2005, Andi Kleen wrote:

> Like I wrote earlier: as long as the notifier doesn't unregister itself
> the critical RCU section for the list walk is only a small part of notifier_call_chain.
> It's basically a stable anchor in the list that won't change.

I have to disagree with you.  The critical section is the entire dynamic
scope of notifier_call_chain.  After all, what if a _different_ thread
unregisters a notifier routine while the routine is running?  What if the 
_following_ routine is unregistered also?

The desired behavior for notifier_unregister is that when it returns, the
notifier routine is not running on any processor and will not start
running.  The only way to guarantee this is to put the entire routine into
the critical section.  And that means putting the entire chain into the 
critical section.

Alan Stern

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux