x86/umip: Fix decoding of register forms of 0F 01 (SGDT and SIDT aliases)
authorSean Christopherson <seanjc@google.com>
Fri, 8 Aug 2025 17:23:57 +0000 (10:23 -0700)
committerBorislav Petkov (AMD) <bp@alien8.de>
Fri, 19 Sep 2025 19:34:48 +0000 (21:34 +0200)
commit27b1fd62012dfe9d3eb8ecde344d7aa673695ecf
tree664736b26b6b8a2990b671472ad3d8931dcf378f
parent32278c677947ae2f042c9535674a7fff9a245dd3
x86/umip: Fix decoding of register forms of 0F 01 (SGDT and SIDT aliases)

Filter out the register forms of 0F 01 when determining whether or not to
emulate in response to a potential UMIP violation #GP, as SGDT and SIDT only
accept memory operands.  The register variants of 0F 01 are used to encode
instructions for things like VMX and SGX, i.e. not checking the Mod field
would cause the kernel to incorrectly emulate on #GP, e.g. due to a CPL
violation on VMLAUNCH.

Fixes: 1e5db223696a ("x86/umip: Add emulation code for UMIP instructions")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
arch/x86/kernel/umip.c