Re: ESP corruption bug - what CPUs are affected?

From: Stas Sergeev
Date: Sat Sep 18 2004 - 14:15:10 EST


Hi,

Petr Vandrovec wrote:
Does this look reasonable? If it does, I think I
should just start implementing that.
Do not forget that you have to implement also return to CPL1, as
NMI may arrive while you are running on CPL1. So it may not be
as trivial as it seemed.
I am not sure what special actions have to be
taken here compared to returning to ring-3 from NMI.
Is there anywhere in the sources an example to take
a look at? (sorry for the newbie questions)

Maybe all these programs survive that
their CPL3 stack changes,
Most likely they will, I am just not sure. What
if they disabled interrupts and are switching the
stack by loading the SS and ESP separately? If we
interrupt it there, there may be the problems, which
would be almost impossible to track down later.
It just looks a bit unsafe to me. Or maybe exploit
a sigaltstack for that? Hmm, is implementing the
CPL1 trampoline really that difficult after all?
I think it is somewhat cleaner and maybe safer.

Only problem is how to find that old SS points to 16bit segment.
You need LAR and/or you have to peek GDT/LDT to find stack size,
Yes, I was thinking about using LAR - looks like the
most easy and fast way to just get that single bit
out of LDT.

and AFAIK LAR is microcoded on P4.
Where does this lead us to? Some other problems I
am not aware about?

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