KVM: x86: fix information leak to userland
authorVasiliy Kulikov <segooon@gmail.com>
Mon, 29 Nov 2010 15:00:14 +0000 (13:00 -0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Dec 2010 21:26:48 +0000 (13:26 -0800)
commit91445a8f6fee2f78680bae847cabe237a6e57eb9
tree65902b5b6b4b3554435d91a8f5f57838922b4f4f
parent370c6b5200b04645ab1b00bad931ae899cd55471
KVM: x86: fix information leak to userland

commit 97e69aa62f8b5d338d6cff49be09e37cc1262838 upstream.

Structures kvm_vcpu_events, kvm_debugregs, kvm_pit_state2 and
kvm_clock_data are copied to userland with some padding and reserved
fields unitialized.  It leads to leaking of contents of kernel stack
memory.  We have to initialize them to zero.

In patch v1 Jan Kiszka suggested to fill reserved fields with zeros
instead of memset'ting the whole struct.  It makes sense as these
fields are explicitly marked as padding.  No more fields need zeroing.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kvm/x86.c