[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 09 Sep 2017 22:47:39 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, "Marcelo Tosatti" <mtosatti@...hat.com>,
"Gleb Natapov" <gleb@...hat.com>
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@...hat.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@...hat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@...hat.com>
Signed-off-by: Ben Hutchings <ben@...adent.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;
Powered by blists - more mailing lists