android_kernel_motorola_sm6375/virt/kvm
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nicholas Piggin bb85717e37 KVM: do not allow mapping valid but non-reference-counted pages
commit f8be156be163a052a067306417cd0ff679068c97 upstream.

It's possible to create a region which maps valid but non-refcounted
pages (e.g., tail pages of non-compound higher order allocations). These
host pages can then be returned by gfn_to_page, gfn_to_pfn, etc., family
of APIs, which take a reference to the page, which takes it from 0 to 1.
When the reference is dropped, this will free the page incorrectly.

Fix this by only taking a reference on valid pages if it was non-zero,
which indicates it is participating in normal refcounting (and can be
released with put_page).

This addresses CVE-2021-22543.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-30 08:47:50 -04:00
..
arm KVM: arm/arm64: Fix KVM_VGIC_V3_ADDR_TYPE_REDIST read 2021-06-23 14:41:31 +02:00
async_pf.c
async_pf.h
coalesced_mmio.c KVM: Stop looking for coalesced MMIO zones if the bus is destroyed 2021-05-14 09:44:15 +02:00
coalesced_mmio.h
eventfd.c
irqchip.c
Kconfig
kvm_main.c KVM: do not allow mapping valid but non-reference-counted pages 2021-06-30 08:47:50 -04:00
vfio.c
vfio.h