aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_bitmap.c
diff options
context:
space:
mode:
authorQuentin Perret <[email protected]>2025-02-13 15:36:14 +0000
committerMarc Zyngier <[email protected]>2025-02-13 17:57:27 +0000
commitb938731ed2d4eea8e268a27bfc600581fedae2a9 (patch)
tree51f03a7fb0c8fd13a2c27783dfc1e9b6b8fe8f59 /lib/test_bitmap.c
parentKVM: arm64: Convert timer offset VA when accessed in HYP code (diff)
downloadkernel-b938731ed2d4eea8e268a27bfc600581fedae2a9.tar.gz
kernel-b938731ed2d4eea8e268a27bfc600581fedae2a9.zip
KVM: arm64: Fix alignment of kvm_hyp_memcache allocations
When allocating guest stage-2 page-table pages at EL2, pKVM can consume pages from the host-provided kvm_hyp_memcache. As pgtable.c expects zeroed pages, guest_s2_zalloc_page() actively implements this zeroing with a PAGE_SIZE memset. Unfortunately, we don't check the page alignment of the host-provided address before doing so, which could lead to the memset overrunning the page if the host was malicious. Fix this by simply force-aligning all kvm_hyp_memcache allocations to page boundaries. Fixes: 60dfe093ec13 ("KVM: arm64: Instantiate guest stage-2 page-tables at EL2") Reported-by: Ben Simner <[email protected]> Signed-off-by: Quentin Perret <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
Diffstat (limited to 'lib/test_bitmap.c')
0 files changed, 0 insertions, 0 deletions