android_kernel_oneplus_msm8998/arch/x86
Junaid Shahid c931360be6 kvm: mmu: Fix race in emulated page table writes
commit 0e0fee5c539b61fdd098332e0e2cc375d9073706 upstream.

When a guest page table is updated via an emulated write,
kvm_mmu_pte_write() is called to update the shadow PTE using the just
written guest PTE value. But if two emulated guest PTE writes happened
concurrently, it is possible that the guest PTE and the shadow PTE end
up being out of sync. Emulated writes do not mark the shadow page as
unsync-ed, so this inconsistency will not be resolved even by a guest TLB
flush (unless the page was marked as unsync-ed at some other point).

This is fixed by re-reading the current value of the guest PTE after the
MMU lock has been acquired instead of just using the value that was
written prior to calling kvm_mmu_pte_write().

Signed-off-by: Junaid Shahid <junaids@google.com>
Reviewed-by: Wanpeng Li <wanpengli@tencent.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:26 +01:00
..
boot x86/boot: #undef memcpy() et al in string.c 2018-11-27 16:07:59 +01:00
configs kconfig: tinyconfig: provide whole choice blocks to avoid warnings 2016-09-24 10:07:42 +02:00
crypto crypto, x86: aesni - fix token pasting for clang 2018-11-27 16:07:59 +01:00
entry x86/entry/64: Remove %ebx handling from error_entry/exit 2018-12-01 09:46:36 +01:00
ia32
include x86/mm/kaslr: Use the _ASM_MUL macro for multiplication to work around Clang incompatibility 2018-11-27 16:07:59 +01:00
kernel x86/fpu: Remove second definition of fpu in __fpu__restore_sig() 2018-11-21 09:27:31 +01:00
kvm kvm: mmu: Fix race in emulated page table writes 2018-12-13 09:21:26 +01:00
lguest
lib x86/cpufeature: Carve out X86_FEATURE_* 2018-07-17 11:31:44 +02:00
math-emu x86/fpu/math-emu: Fix possible uninitialized variable use 2018-02-25 11:03:43 +01:00
mm x86/mm/pat: Prevent hang during boot when mapping pages 2018-11-10 07:41:35 -08:00
net bpf, x64: increase number of passes 2018-03-28 18:40:17 +02:00
oprofile x86/cpufeature: Carve out X86_FEATURE_* 2018-07-17 11:31:44 +02:00
pci x86/PCI: Mark Broadwell-EP Home Agent 1 as having non-compliant BARs 2018-11-10 07:41:36 -08:00
platform x86/speculation: Use IBRS if available before calling into firmware 2018-07-25 10:18:21 +02:00
power x86/power: Fix swsusp_arch_resume prototype 2018-05-30 07:48:55 +02:00
purgatory x86/kexec: add -fno-PIE 2016-11-26 09:54:52 +01:00
ras
realmode x86/pti/efi: broken conversion from efi to kernel page table 2018-01-17 09:35:29 +01:00
tools x86: Treat R_X86_64_PLT32 as R_X86_64_PC32 2018-03-18 11:17:52 +01:00
um um: Avoid longjmp/setjmp symbol clashes with libpthread.a 2018-11-10 07:41:35 -08:00
video
xen xen: fix xen_qlock_wait() 2018-11-21 09:27:36 +01:00
.gitignore
Kbuild
Kconfig x86/kconfig: Fall back to ticket spinlocks 2018-11-21 09:27:30 +01:00
Kconfig.cpu
Kconfig.debug x86/cpufeature: Replace the old static_cpu_has() with safe variant 2018-07-17 11:31:44 +02:00
Makefile x86/build: Use cc-option to validate stack alignment parameter 2018-11-27 16:08:00 +01:00
Makefile.um
Makefile_32.cpu