]> git.baikalelectronics.ru Git - kernel.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)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Jan 2019 17:53:10 +0000 (18:53 +0100)
commit89d4381537b601724e21e4358c8f6d17320938fd
treed9b8869868cac17b60e9db17605047669209d28d
parent7914b38f5d8cc69e0374cc838ccfc6886dd3f8a2
kvm: x86/vmx: Use kzalloc for cached_vmcs12

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: 75a15e08645720cc7541f244a54c933873b382ab
Cc: stable@vger.kernel.org
Signed-off-by: Tom Roeder <tmroeder@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c