Re: [RFC][PATCH 0/7]: Fix for unsafe notifier chain

From: Keith Owens
Date: Thu Dec 08 2005 - 23:51:41 EST


On Wed, 7 Dec 2005 15:36:12 -0800,
Andrew Morton <akpm@xxxxxxxx> wrote:
>As for the NMIs and RCU: I suspect it was simply a mistake to try to use
>notifier chains for NMI registration in the first place - they are simply
>too complex a data structure for this. I think I previously suggested
>removing that code and using just a fixed-size array of function pointers.

The notifier chain is a priority ordered list. Registration and
unregistration must be able to insert and delete anywhere in the list,
which does not fit with a fixed-size array of pointers.

There is also the problem that unregister must not return to its caller
if any NMI type callback is running on any cpu. The list and function
body are held in caller defined storage and if unregistration returns
too soon then the storage could be freed while the callback is still
executing.

I do not understand why people think that NMI callbacks are a hard
problem to solve. Besides RCU type solutions, there is also a patch
based on an idea by Corey Minyard, see
http://marc.theaimsgroup.com/?l=linux-kernel&m=113392370322545&w=2.

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