]> www.infradead.org Git - users/dwmw2/linux.git/commit
kvm: x86/vmx: Use kzalloc for cached_vmcs12
authorTom Roeder <tmroeder@google.com>
Thu, 24 Jan 2019 21:48:20 +0000 (13:48 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jan 2019 07:15:42 +0000 (08:15 +0100)
commitdcc1097e511f7b66e9beba63443408c86b2f3ee2
tree3a5f11cd643092a132b5c9a43fa01832350aa382
parent56b6631bd63b59993295babf2fc12d8cfbc6a07e
kvm: x86/vmx: Use kzalloc for cached_vmcs12

commit 3a33d030daaa7c507e1c12d5adcf828248429593 upstream.

This changes the allocation of cached_vmcs12 to use kzalloc instead of
kmalloc. This removes the information leak found by Syzkaller (see
Reported-by) in this case and prevents similar leaks from happening
based on cached_vmcs12.

It also changes vmx_get_nested_state to copy out the full 4k VMCS12_SIZE
in copy_to_user rather than only the size of the struct.

Tested: rebuilt against head, booted, and ran the syszkaller repro
  https://syzkaller.appspot.com/text?tag=ReproC&x=174efca3400000 without
  observing any problems.

Reported-by: syzbot+ded1696f6b50b615b630@syzkaller.appspotmail.com
Fixes: 8fcc4b5923af5de58b80b53a069453b135693304
Cc: stable@vger.kernel.org
Signed-off-by: Tom Roeder <tmroeder@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/vmx.c