]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
KVM: x86: Mark TSS busy during LTR emulation _after_ all fault checks
authorSean Christopherson <seanjc@google.com>
Mon, 11 Jul 2022 23:27:48 +0000 (23:27 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 17 Oct 2022 09:55:46 +0000 (11:55 +0200)
commitdf7544b46f184bb95472299449bdcc76d23c2e9f
tree432e27f67c46e65eaabd5e592cf2b1a9e45a80ab
parent594ea2814343130a3865dd841af7341b16394d12
KVM: x86: Mark TSS busy during LTR emulation _after_ all fault checks

BugLink: https://bugs.launchpad.net/bugs/1990162
commit ec6e4d863258d4bfb36d48d5e3ef68140234d688 upstream.

Wait to mark the TSS as busy during LTR emulation until after all fault
checks for the LTR have passed.  Specifically, don't mark the TSS busy if
the new TSS base is non-canonical.

Opportunistically drop the one-off !seg_desc.PRESENT check for TR as the
only reason for the early check was to avoid marking a !PRESENT TSS as
busy, i.e. the common !PRESENT is now done before setting the busy bit.

Fixes: e37a75a13cda ("KVM: x86: Emulator ignores LDTR/TR extended base on LLDT/LTR")
Reported-by: syzbot+760a73552f47a8cd0fd9@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: Hou Wenlong <houwenlong.hwl@antgroup.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20220711232750.1092012-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/kvm/emulate.c