On Tue, 18 Oct 2005 21:11:45 -0700, Greg KH <[EMAIL PROTECTED]> wrote:
> > Woops, I assumed that notifier_call_chain had one inside. It was > > inconceivable to me that you would neglect to lock the chain. > > > > Very well, what does prevent a module to call usb_register_notify > > (on a context of a modprobe) in the same time as khubd is adding > > a new device and is walking the chain with usb_notify_device_add()? > > It looks like it's safe to walk the list and add a new notifier at the > same time. Take a look at kernel/sys.c::notifier_chain_register() to > see if I missed something. Yes, I looked. It cannot possibly be safe. It may be possibly argued, that on strictly cache-coherent machines, the *list=n; is safe versus the list traversal. But what about removal then? Also, do you see that rwlock which IS TAKEN FOR WRITE ONLY? Why? The only explanation is: the author intended read locks in notifier_call_chain, but either forgot them, or they were dropped by other person. The code style is quite dirty, too. What a crock of fecalia. Unfortunately, I have to be away from any computers for a couple of days. -- Pete ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
