KVM: x86: fix information leak to userland
authorVasiliy Kulikov <segooon@gmail.com>
Sat, 30 Oct 2010 18:54:47 +0000 (22:54 +0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Dec 2010 21:32:45 +0000 (13:32 -0800)
commitc829f3431b6fe186c37bad3a5e1dbb8084de0581
treef802fd934d96ee364e4fd4077e05823a2246b7de
parente04e1834f740d225f6c70e6a49643261e7ee6a74
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