diff options
author | Nadav Amit <namit@cs.technion.ac.il> | 2014-10-13 06:04:14 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-10-24 07:30:36 -0400 |
commit | 3f6f1480d86bf9fc16c160d803ab1d006e3058d5 (patch) | |
tree | 988959255d9ac2f34c7fbc95af889f31ee4ef9d0 /arch/x86/kvm | |
parent | 13e457e0eebf0a0c82c38ceb890d93eb826d62a6 (diff) |
KVM: x86: PREFETCH and HINT_NOP should have SrcMem flag
The decode phase of the x86 emulator assumes that every instruction with the
ModRM flag, and which can be used with RIP-relative addressing, has either
SrcMem or DstMem. This is not the case for several instructions - prefetch,
hint-nop and clflush.
Adding SrcMem|NoAccess for prefetch and hint-nop and SrcMem for clflush.
This fixes CVE-2014-8480.
Fixes: 41061cdb98a0bec464278b4db8e894a3121671f5
Cc: stable@vger.kernel.org
Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/emulate.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 97da5034d812..749f9fa38254 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -3807,7 +3807,7 @@ static const struct opcode group11[] = { | |||
3807 | }; | 3807 | }; |
3808 | 3808 | ||
3809 | static const struct gprefix pfx_0f_ae_7 = { | 3809 | static const struct gprefix pfx_0f_ae_7 = { |
3810 | I(0, em_clflush), N, N, N, | 3810 | I(SrcMem | ByteOp, em_clflush), N, N, N, |
3811 | }; | 3811 | }; |
3812 | 3812 | ||
3813 | static const struct group_dual group15 = { { | 3813 | static const struct group_dual group15 = { { |
@@ -4024,10 +4024,11 @@ static const struct opcode twobyte_table[256] = { | |||
4024 | N, I(ImplicitOps | EmulateOnUD, em_syscall), | 4024 | N, I(ImplicitOps | EmulateOnUD, em_syscall), |
4025 | II(ImplicitOps | Priv, em_clts, clts), N, | 4025 | II(ImplicitOps | Priv, em_clts, clts), N, |
4026 | DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N, | 4026 | DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N, |
4027 | N, D(ImplicitOps | ModRM), N, N, | 4027 | N, D(ImplicitOps | ModRM | SrcMem | NoAccess), N, N, |
4028 | /* 0x10 - 0x1F */ | 4028 | /* 0x10 - 0x1F */ |
4029 | N, N, N, N, N, N, N, N, | 4029 | N, N, N, N, N, N, N, N, |
4030 | D(ImplicitOps | ModRM), N, N, N, N, N, N, D(ImplicitOps | ModRM), | 4030 | D(ImplicitOps | ModRM | SrcMem | NoAccess), |
4031 | N, N, N, N, N, N, D(ImplicitOps | ModRM | SrcMem | NoAccess), | ||
4031 | /* 0x20 - 0x2F */ | 4032 | /* 0x20 - 0x2F */ |
4032 | DIP(ModRM | DstMem | Priv | Op3264 | NoMod, cr_read, check_cr_read), | 4033 | DIP(ModRM | DstMem | Priv | Op3264 | NoMod, cr_read, check_cr_read), |
4033 | DIP(ModRM | DstMem | Priv | Op3264 | NoMod, dr_read, check_dr_read), | 4034 | DIP(ModRM | DstMem | Priv | Op3264 | NoMod, dr_read, check_dr_read), |