Re: [PATCH 1/2] i386: Disallow kprobes on NMI handlers - try #2

From: Andi Kleen
Date: Thu Aug 10 2006 - 07:49:53 EST

On Thursday 10 August 2006 13:36, Fernando Luis Vázquez Cao wrote:
> A kprobe executes IRET early and that could cause NMI recursion and stack
> corruption.
> Note: This problem was originally spotted and solved by Andi Kleen in the
> x86_64 architecture. This patch is an adaption of his patch for i386.

Originally Jan Beulich discovered these classes of bugs actually

I applied the two patches (after fixing lots of rejects because that
code had already changed a lot). But I have my doubts it is complete.

e.g. the NMI watchdog nmi code has lots of callees which you don't
handle (notifier chains, spinlocks, printks which can call practically everything, ...)

The printk in the NMI handler look pretty bogus so I just removed it.

But all the other code would be tricky. but .e.g. marking up
spinlocks would be probably not a good idea.

When we oops (call die) perhaps we can force kprobes to be disabled?

Also everybody hooking into the die chain would need to be covered too.

Probably some followon work is needed.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at