]> git.baikalelectronics.ru Git - kernel.git/commit
lguest: Fix Malicious Guest GDT Host Crash
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 9 Aug 2007 10:57:13 +0000 (20:57 +1000)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 9 Aug 2007 15:14:56 +0000 (08:14 -0700)
commitc64211983d8af2ec8a68e46b9d5dee958cfc201e
tree21dde51409ab83cbb3ce7200393b3a0acb76388d
parenta9155b9cb8aefd78879ead456b0d0300e92706e7
lguest: Fix Malicious Guest GDT Host Crash

If a Guest makes hypercall which sets a GDT entry to not present, we
currently set any segment registers using that GDT entry to 0.
Unfortunately, this is not sufficient: there are other ways of
altering GDT entries which will cause a fault.

The correct solution to do what Linux does: let them set any GDT value
they want and handle the #GP when popping causes a fault.  This has
the added benefit of making our Switcher slightly more robust in the
case of any other bugs which cause it to fault.

We kill the Guest if it causes a fault in the Switcher: it's the
Guest's responsibility to make sure it's not using segments when it
changes them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/lguest/core.c
drivers/lguest/interrupts_and_traps.c
drivers/lguest/lguest.c
drivers/lguest/segments.c
drivers/lguest/switcher.S