linux/virt/kvm
Huang Ying bf998156d2 KVM: Avoid killing userspace through guest SRAO MCE on unmapped pages
In common cases, guest SRAO MCE will cause corresponding poisoned page
be un-mapped and SIGBUS be sent to QEMU-KVM, then QEMU-KVM will relay
the MCE to guest OS.

But it is reported that if the poisoned page is accessed in guest
after unmapping and before MCE is relayed to guest OS, userspace will
be killed.

The reason is as follows. Because poisoned page has been un-mapped,
guest access will cause guest exit and kvm_mmu_page_fault will be
called. kvm_mmu_page_fault can not get the poisoned page for fault
address, so kernel and user space MMIO processing is tried in turn. In
user MMIO processing, poisoned page is accessed again, then userspace
is killed by force_sig_info.

To fix the bug, kvm_mmu_page_fault send HWPOISON signal to QEMU-KVM
and do not try kernel and user space MMIO processing for poisoned
page.

[xiao: fix warning introduced by avi]

Reported-by: Max Asbock <masbock@linux.vnet.ibm.com>
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2010-08-01 10:35:26 +03:00
..
assigned-dev.c KVM: fix assigned_device_enable_host_msix error handling 2010-05-17 12:15:36 +03:00
coalesced_mmio.c KVM: coalesced_mmio: fix kvm_coalesced_mmio_init()'s error handling 2010-05-17 12:15:53 +03:00
coalesced_mmio.h KVM: Simplify coalesced mmio initialization 2010-03-01 12:35:41 -03:00
eventfd.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ioapic.c KVM: read apic->irr with ioapic lock held 2010-06-10 20:29:03 +03:00
ioapic.h KVM: convert ioapic lock to spinlock 2010-05-13 01:23:55 -03:00
iodev.h KVM: remove in_range from io devices 2009-09-10 08:33:05 +03:00
iommu.c KVM: Fix order passed to iommu_unmap 2010-06-09 18:48:38 +03:00
irq_comm.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
Kconfig KVM: Add KVM_MMIO kconfig item 2010-03-01 12:35:41 -03:00
kvm_main.c KVM: Avoid killing userspace through guest SRAO MCE on unmapped pages 2010-08-01 10:35:26 +03:00