]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86: Fix uninitialized op->type for some immediate values
authorNadav Amit <namit@cs.technion.ac.il>
Sun, 2 Nov 2014 09:54:47 +0000 (11:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Nov 2014 17:23:09 +0000 (09:23 -0800)
commit005eca960a867a58856b55cef19329935aa150ee
tree72e26df8212be8293a122a4fb19556fd8c072690
parentbed56c3e51507d68b031c360e338a13ab378111d
KVM: x86: Fix uninitialized op->type for some immediate values

commit d29b9d7ed76c0b961603ca692b8a562556a20212 upstream.

The emulator could reuse an op->type from a previous instruction for some
immediate values.  If it mistakenly considers the operands as memory
operands, it will performs a memory read and overwrite op->val.

Consider for instance the ROR instruction - src2 (the number of times)
would be read from memory instead of being used as immediate.

Mark every immediate operand as such to avoid this problem.

Fixes: c44b4c6ab80eef3a9c52c7b3f0c632942e6489aa
Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/emulate.c