Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1729739 > unrolled thread

[PATCH 3.16 071/233] KVM: x86: zero base3 of unusable segments

Started byBen Hutchings <ben@decadent.org.uk>
First post2017-09-10 01:10 +0200
Last post2017-09-10 01:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.16 071/233] KVM: x86: zero base3 of unusable segments Ben Hutchings <ben@decadent.org.uk> - 2017-09-10 01:10 +0200

#1729739 — [PATCH 3.16 071/233] KVM: x86: zero base3 of unusable segments

FromBen Hutchings <ben@decadent.org.uk>
Date2017-09-10 01:10 +0200
Subject[PATCH 3.16 071/233] KVM: x86: zero base3 of unusable segments
Message-ID<unX2Z-3Jz-85@gated-at.bofh.it>
3.16.48-rc1 review patch.  If anyone has any objections, please let me know.

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

From: Radim Krčmář <rkrcmar@redhat.com>

commit f0367ee1d64d27fa08be2407df5c125442e885e3 upstream.

Static checker noticed that base3 could be used uninitialized if the
segment was not present (useable).  Random stack values probably would
not pass VMCS entry checks.

Reported-by:  Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 1aa366163b8b ("KVM: x86 emulator: consolidate segment accessors")
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/x86/kvm/x86.c | 2 ++
 1 file changed, 2 insertions(+)

--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4749,6 +4749,8 @@ static bool emulator_get_segment(struct
 
 	if (var.unusable) {
 		memset(desc, 0, sizeof(*desc));
+		if (base3)
+			*base3 = 0;
 		return false;
 	}
 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web