]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit - arch/x86/kvm/x86.c
KVM: MMU: fix SMAP virtualization
authorXiao Guangrong <guangrong.xiao@linux.intel.com>
Mon, 11 May 2015 14:55:21 +0000 (22:55 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 11 May 2015 15:17:50 +0000 (17:17 +0200)
commit0be0226f07d14b153a5eedf2bb86e1eb7dcefab5
treea69e9c24597cd620922617e6315ba07b7bd63ca3
parent898761158be7682082955e3efa4ad24725305fc7
KVM: MMU: fix SMAP virtualization

KVM may turn a user page to a kernel page when kernel writes a readonly
user page if CR0.WP = 1. This shadow page entry will be reused after
SMAP is enabled so that kernel is allowed to access this user page

Fix it by setting SMAP && !CR0.WP into shadow page's role and reset mmu
once CR4.SMAP is updated

Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Documentation/virtual/kvm/mmu.txt
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu.c
arch/x86/kvm/mmu.h
arch/x86/kvm/x86.c