]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: emulator: Fix illegal LEA handling
authorMichal Luczaj <mhal@rbox.co>
Fri, 29 Jul 2022 13:48:01 +0000 (15:48 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 10 Aug 2022 19:08:23 +0000 (15:08 -0400)
commitb0c2f78fd15807fdbde6b7863946f6c3dd0a3a05
tree461433f0ce837f6b255fdac1af359880a00ec5e1
parent242b07e18ab3124ee756b1cacc512581723ee06c
KVM: x86: emulator: Fix illegal LEA handling

The emulator mishandles LEA with register source operand. Even though such
LEA is illegal, it can be encoded and fed to CPU. In which case real
hardware throws #UD. The emulator, instead, returns address of
x86_emulate_ctxt._regs. This info leak hurts host's kASLR.

Tell the decoder that illegal LEA is not to be emulated.

Signed-off-by: Michal Luczaj <mhal@rbox.co>
Message-Id: <20220729134801.1120-1-mhal@rbox.co>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c