lkml.org 
[lkml]   [2005]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Notifier chains are unsafe
From
Date
On Fri, 2005-10-28 at 10:23 -0400, Alan Stern wrote:
> On Thu, 27 Oct 2005, Chandra Seetharaman wrote:
>
> > So, requirements to fix the bug are:
> > - no sleeping in register/unregister(if we want to keep the
> > current way of use. We can change it and make the relevant
> > changes in the kernel code, if it is agreeable)
>
> I think we will have to make these changes. In principal it shouldn't be
> hard to add a simple "enabled" flag to each callout which currently is
> registered/unregistered atomically or while running. We could even put
> such a flag into the notifier_block structure and add routines to set or
> clear it, using appropriate barriers.

I do not understand the purpose of enabled flag. Can you clarify
>
> > - notifier_call_chain could be called from any context
> > - callout function could sleep
> > - no acquiring locks in notifier_call_chain
> > - make sure the list is consistent :) (which is problem Alan
> > started to fix)
> > - anything else ?
>
> Let's clarify the "list is consistent" statement. Obviously it implies
> that no more than one thread can modify the list pointers at any time.
> Beyond that, there should be a guarantee that when unregister returns, the
> routine being removed is not in use and will not be called by any thread.
> Likewise, after register returns, any invocation of notifier_call_chain
> should see the new routine.

true
>
> Alan Stern
>
>
--

----------------------------------------------------------------------
Chandra Seetharaman | Be careful what you choose....
- sekharan@us.ibm.com | .......you may get it.
----------------------------------------------------------------------


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

\
 
 \ /
  Last update: 2005-10-29 00:18    [W:0.129 / U:2.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site