lkml.org 
[lkml]   [2017]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 3.2 036/106] KVM: x86: fix use of uninitialized memory as segment descriptor in emulator.
3.2.93-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Gleb Natapov <gleb@redhat.com>

commit 378a8b099fc207ddcb91b19a8c1457667e0af398 upstream.

If VMX reports segment as unusable, zero descriptor passed by the emulator
before returning. Such descriptor will be considered not present by the
emulator.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
arch/x86/kvm/x86.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4611,8 +4611,10 @@ static bool emulator_get_segment(struct
kvm_get_segment(emul_to_vcpu(ctxt), &var, seg);
*selector = var.selector;

- if (var.unusable)
+ if (var.unusable) {
+ memset(desc, 0, sizeof(*desc));
return false;
+ }

if (var.g)
var.limit >>= 12;
\
 
 \ /
  Last update: 2017-09-10 00:40    [W:0.427 / U:5.152 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site