]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86: Bail to userspace if emulation of atomic user access faults
authorSean Christopherson <seanjc@google.com>
Wed, 2 Feb 2022 00:49:45 +0000 (00:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:37 +0000 (16:19 +0200)
commitbd9a25a0228e557209f6e9bec4eae4c6d801e3ea
treee87dd23a6bbc8970016d71a2c374106a982c0ebd
parenta7c6a643b25bb48998ad2056092247c96298801b
KVM: x86: Bail to userspace if emulation of atomic user access faults

commit 5d6c7de6446e9ab3fb41d6f7d82770e50998f3de upstream.

Exit to userspace when emulating an atomic guest access if the CMPXCHG on
the userspace address faults.  Emulating the access as a write and thus
likely treating it as emulated MMIO is wrong, as KVM has already
confirmed there is a valid, writable memslot.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220202004945.2540433-6-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/x86.c