]> git.baikalelectronics.ru Git - 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)
committerSean Christopherson <seanjc@google.com>
Thu, 14 Jul 2022 01:14:06 +0000 (18:14 -0700)
commit8d2a5ab552d3d53665362cc55964d1af72b76161
treedd1a5b75a9141a9ee314693fae2c7aa1199c39b6
parent1b81d1d45d06fa54fbc50e109335741b1a547c19
KVM: x86: Set error code to segment selector on LLDT/LTR non-canonical #GP

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: 2268660cef03 ("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>
arch/x86/kvm/emulate.c