mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
KVM: x86: Bail to userspace if emulation of atomic user access faults
commit 5d6c7de644
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>
This commit is contained in:
parent
a7c6a643b2
commit
bd9a25a022
1 changed files with 1 additions and 1 deletions
|
@ -7108,7 +7108,7 @@ static int emulator_cmpxchg_emulated(struct x86_emulate_ctxt *ctxt,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
goto emul_write;
|
return X86EMUL_UNHANDLEABLE;
|
||||||
if (r)
|
if (r)
|
||||||
return X86EMUL_CMPXCHG_FAILED;
|
return X86EMUL_CMPXCHG_FAILED;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue