mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-30 19:20:26 -04:00
KVM: x86 emulator: fix faulty check for two-byte opcode
Right now, the bug is harmless as we never emulate one-byte 0xb6 or 0xb7. But things may change. Noted by the mysterious Gabriel C. Signed-off-by: Avi Kivity <avi@qumranet.com>
This commit is contained in:
@@ -819,7 +819,7 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
|
||||
case DstReg:
|
||||
dst.type = OP_REG;
|
||||
if ((d & ByteOp)
|
||||
&& !(twobyte_table && (b == 0xb6 || b == 0xb7))) {
|
||||
&& !(twobyte && (b == 0xb6 || b == 0xb7))) {
|
||||
dst.ptr = decode_register(modrm_reg, _regs,
|
||||
(rex_prefix == 0));
|
||||
dst.val = *(u8 *) dst.ptr;
|
||||
|
||||
Reference in New Issue
Block a user