lkml.org 
[lkml]   [2005]   [Oct]   [27]   [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:48 +1000, Keith Owens wrote:
> On Thu, 27 Oct 2005 16:02:08 -0700,
> Chandra Seetharaman <sekharan@us.ibm.com> wrote:
> >On Thu, 2005-10-27 at 17:21 -0400, Alan Stern wrote:
> >> The other problem is that you violated Keith's statement that
> >> notifier_call_chain shouldn't take any locks. On the other hand, if we
> >
> >I would interpret Keith's comment like this: callout should not be
> >called with any locks held (because that would limit the callouts from
> >blocking).
>
> We should be able to call notifier_call_chain() from any context. That
> includes oops, panic, NMI and other unmaskable machine check events.
> If you can call notifier_call_chain() from an unmaskable context then
> it follows that the callbacks cannot take any locks. Locks are not
> safe in NMI context.

Thanks Keith.

That really ties our hands down.

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)
- 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 ?

Alan, i think your solution of maintaining two notifier chains satisfies
all the needs mentioned. Will look at it more closely and respond
tomorrow.

Thanks & Regards,

chandra

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

----------------------------------------------------------------------
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-28 03:36    [W:5.308 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site