Re: [RFC PATCH] kvm: x86/vmx: Use kzalloc for cached_vmcs12

From: Jim Mattson
Date: Mon Jan 14 2019 - 19:03:50 EST


On Mon, Jan 14, 2019 at 3:48 PM Tom Roeder <tmroeder@xxxxxxxxxx> wrote:
>
> 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.
>
> The email from Syszkaller led to a discussion about a patch in early
> November on the KVM list (I've made this a reply to that thread), but
> the current upstream kernel still has kmalloc instead of kzalloc for
> cached_vmcs12 and cached_shadow_vmcs12. This RFC proposes changing to
> kzalloc for defense in depth.
>
> Tested: rebuilt but not tested, since this is an RFC
>
> Reported-by: syzbot+ded1696f6b50b615b630@xxxxxxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Tom Roeder <tmroeder@xxxxxxxxxx>
Reviewed-by: Jim Mattson <jmattson@xxxxxxxxxx>