KVM: x86 emulator: fix memory access during x86 emulation
authorGleb Natapov <gleb@redhat.com>
Fri, 19 Mar 2010 14:47:31 +0000 (15:47 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Apr 2010 14:41:20 +0000 (07:41 -0700)
commit2f4415466842f786b38bd28dcaf7c85b2f7a9c8f
tree063d613c2201fcc01ac9a8b6cb70693ecf41e00c
parent10a505e60e897f3f4efaf8dbe9db40b3cdca23b4
KVM: x86 emulator: fix memory access during x86 emulation

commit 1871c6020d7308afb99127bba51f04548e7ca84e upstream

Currently when x86 emulator needs to access memory, page walk is done with
broadest permission possible, so if emulated instruction was executed
by userspace process it can still access kernel memory. Fix that by
providing correct memory access to page walker during emulation.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/include/asm/kvm_emulate.h
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/emulate.c
arch/x86/kvm/mmu.c
arch/x86/kvm/mmu.h
arch/x86/kvm/paging_tmpl.h
arch/x86/kvm/x86.c