]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: use __vcalloc for very large allocations
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Mar 2022 09:49:37 +0000 (04:49 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Mar 2022 14:30:57 +0000 (09:30 -0500)
commitc92df34afd875ea05c5044bec175f2b90f2aed0a
treefb2d48b31b583fff946d7472ecfb8d89ad70f7fe
parentdf50ec7dec3d7e11e2161632b7dc9c449a7645b7
KVM: use __vcalloc for very large allocations

Allocations whose size is related to the memslot size can be arbitrarily
large.  Do not use kvzalloc/kvcalloc, as those are limited to "not crazy"
sizes that fit in 32 bits.

Cc: stable@vger.kernel.org
Fixes: 7376f3330a82 ("mm: don't allow oversized kvmalloc() calls")
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/powerpc/kvm/book3s_hv_uvmem.c
arch/x86/kvm/mmu/page_track.c
arch/x86/kvm/x86.c
virt/kvm/kvm_main.c