KVM: x86: zero base3 of unusable segments
authorRadim Krčmář <rkrcmar@redhat.com>
Thu, 18 May 2017 17:37:30 +0000 (19:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Jul 2017 12:37:23 +0000 (14:37 +0200)
commit77d977dd78b36385e5c284095ce28b3a6b8fe6fb
tree4b6834fa690f5930ccd8ee4132f8f523efa06e26
parent3b1609f6c436a83aa812c2632ae21a4345a333cb
KVM: x86: zero base3 of unusable segments

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/x86.c