]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
KVM: x86: Set error code to segment selector on LLDT/LTR non-canonical #GP
authorSean Christopherson <seanjc@google.com>
Mon, 11 Jul 2022 23:27:49 +0000 (23:27 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 17 Oct 2022 09:55:46 +0000 (11:55 +0200)
commit71283634bb10c545769cd14ef37d17691639d9f7
treed4f709cc24b108c38e98f50ec6550e82be1dc34e
parentdf7544b46f184bb95472299449bdcc76d23c2e9f
KVM: x86: Set error code to segment selector on LLDT/LTR non-canonical #GP

BugLink: https://bugs.launchpad.net/bugs/1990162
commit 2626206963ace9e8bf92b6eea5ff78dd674c555c upstream.

When injecting a #GP on LLDT/LTR due to a non-canonical LDT/TSS base, set
the error code to the selector.  Intel SDM's says nothing about the #GP,
but AMD's APM explicitly states that both LLDT and LTR set the error code
to the selector, not zero.

Note, a non-canonical memory operand on LLDT/LTR does generate a #GP(0),
but the KVM code in question is specific to the base from the descriptor.

Fixes: e37a75a13cda ("KVM: x86: Emulator ignores LDTR/TR extended base on LLDT/LTR")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20220711232750.1092012-3-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