Re: [PATCH][GIT PULL][v3.3] x86: Test saved %rip in NMI todetermine nested NMI

From: Steven Rostedt
Date: Mon Feb 20 2012 - 09:41:48 EST


On Mon, 2012-02-20 at 09:10 +0100, Ingo Molnar wrote:
> >
> > Note, it does not seem to cause any destruction, but screw up
> > profiling.
>
> Except if the source of the NMI was not profiling, right?

Well, what else are NMIs used for? All I can think of is profiling and
watchdogs. I'm not sure how much damage a watchdog NMI being missed in
userspace will hurt it. Unless it takes a watchdog to set off the next
watchdog. That is, if watchdogs are enabled in a one shot mode. Then a
missed NMI could cause the watchdog to shut off. This is all theory.

The test that %cs is __KERNEL_CS before considering the NMI nested seems
to fix this bug. And if userspace really can't change the %cs to
__KERNEL_CS than we are safe. The bug only exists in the 3.3-rc releases
and by fixing it now we don't need to worry about what problems the
original bug can cause.

Thanks,

-- Steve


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