linux/include
Sheng Yang 571008dacc KVM: x86 emulator: Only allow VMCALL/VMMCALL trapped by #UD
When executing a test program called "crashme", we found the KVM guest cannot
survive more than ten seconds, then encounterd kernel panic. The basic concept
of "crashme" is generating random assembly code and trying to execute it.

After some fixes on emulator insn validity judgment, we found it's hard to
get the current emulator handle the invalid instructions correctly, for the
#UD trap for hypercall patching caused troubles. The problem is, if the opcode
itself was OK, but combination of opcode and modrm_reg was invalid, and one
operand of the opcode was memory (SrcMem or DstMem), the emulator will fetch
the memory operand first rather than checking the validity, and may encounter
an error there. For example, ".byte 0xfe, 0x34, 0xcd" has this problem.

In the patch, we simply check that if the invalid opcode wasn't vmcall/vmmcall,
then return from emulate_instruction() and inject a #UD to guest. With the
patch, the guest had been running for more than 12 hours.

Signed-off-by: Feng (Eric) Liu <eric.e.liu@intel.com>
Signed-off-by: Sheng Yang <sheng.yang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-01-30 18:01:21 +02:00
..
acpi x86: dummy placeholder for acpi/reboot.h 2008-01-30 13:31:17 +01:00
asm-alpha x86: remove flush_agp_mappings() 2008-01-30 13:34:07 +01:00
asm-arm ext4: Add ext4_find_next_bit() 2008-01-28 23:58:27 -05:00
asm-avr32
asm-blackfin
asm-cris
asm-frv
asm-generic x86: add testcases for RODATA and NX protections/attributes 2008-01-30 13:34:08 +01:00
asm-h8300
asm-ia64 x86: remove flush_agp_mappings() 2008-01-30 13:34:07 +01:00
asm-m32r core: remove last users of empty FASTCALL macro 2008-01-30 13:31:17 +01:00
asm-m68k ext4: Add ext4_find_next_bit() 2008-01-28 23:58:27 -05:00
asm-m68knommu ext4: Add ext4_find_next_bit() 2008-01-28 23:58:27 -05:00
asm-mips [MIPS] Malta, Atlas: move an extern function declaration to the header file 2008-01-29 10:15:05 +00:00
asm-parisc x86: remove flush_agp_mappings() 2008-01-30 13:34:07 +01:00
asm-powerpc x86: remove flush_agp_mappings() 2008-01-30 13:34:07 +01:00
asm-ppc
asm-s390 percpu: move arch XX_PER_CPU_XX definitions into linux/percpu.h 2008-01-30 13:32:52 +01:00
asm-sh
asm-sparc
asm-sparc64 x86: remove flush_agp_mappings() 2008-01-30 13:34:07 +01:00
asm-um git-x86: unbreak UML 2008-01-30 13:32:38 +01:00
asm-v850
asm-x86 KVM: x86 emulator: Only allow VMCALL/VMMCALL trapped by #UD 2008-01-30 18:01:21 +02:00
asm-xtensa
crypto
keys
linux KVM: MMU: Switch to mmu spinlock 2008-01-30 18:01:21 +02:00
math-emu
media
mtd
net [NET_SCHED]: act_api: use PTR_ERR in tcf_action_init/tcf_action_get 2008-01-28 15:11:17 -08:00
pcmcia
rdma
rxrpc
scsi
sound
video
xen x86: page.h: make pte_t a union to always include 2008-01-30 13:32:57 +01:00
Kbuild