]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86: fix typo in __try_cmpxchg_user causing non-atomicness
authorMaxim Levitsky <mlevitsk@redhat.com>
Thu, 12 May 2022 10:14:20 +0000 (13:14 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jun 2022 06:48:55 +0000 (08:48 +0200)
commit7cef7042458c52a401d30f2823ae9e9f22f3a90c
treea372b25d08faa732a01268926989688e1abad681
parente964665cc7ca13a16992b205fce63554b9efc78b
KVM: x86: fix typo in __try_cmpxchg_user causing non-atomicness

commit 33fbe6befa622c082f7d417896832856814bdde0 upstream.

This shows up as a TDP MMU leak when running nested.  Non-working cmpxchg on L0
relies makes L1 install two different shadow pages under same spte, and one of
them is leaked.

Fixes: 1c2361f667f36 ("KVM: x86: Use __try_cmpxchg_user() to emulate atomic accesses")
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20220512101420.306759-1-mlevitsk@redhat.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/x86.c