]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: emulator: em_sysexit should update ctxt->mode
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 25 Oct 2022 12:47:28 +0000 (15:47 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2022 16:57:57 +0000 (17:57 +0100)
commit78af8fad88fecf2d56e636678eeb111cd216ed76
treeb004b0a46f80f242d7ac2da4a8c05f5712489369
parent0b9917edbb2a7e2ae5916690132533dcb14b1a08
KVM: x86: emulator: em_sysexit should update ctxt->mode

commit 05c68ab53e271f20d62e7e5677110c7b84f270aa upstream.

SYSEXIT is one of the instructions that can change the
processor mode, thus ctxt->mode should be updated after it.

Note that this is likely a benign bug, because the only problematic
mode change is from 32 bit to 64 bit which can lead to truncation of RIP,
and it is not possible to do with sysexit,
since sysexit running in 32 bit mode will be limited to 32 bit version.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20221025124741.228045-11-mlevitsk@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/emulate.c