]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: arm64: Fix potential leak in hyp_trace_buffer_alloc_bpages_backing
authorVincent Donnefort <vdonnefort@google.com>
Fri, 10 Jul 2026 11:48:18 +0000 (12:48 +0100)
committerMarc Zyngier <maz@kernel.org>
Thu, 23 Jul 2026 08:56:57 +0000 (09:56 +0100)
commitdf7a9d376f7a388ecfacf8dfe0b5819ddfba6972
treef97ff33ba8770dd9afb3b2992116e5127cc2c449
parentbbece712cfc7f286b2908ac120dcf700279d87eb
KVM: arm64: Fix potential leak in hyp_trace_buffer_alloc_bpages_backing

In the very unlikely event of a failure in __map_hyp, the allocated
backing pages are leaked in hyp_trace_buffer_alloc_bpages_backing(). Fix
this by freeing the pages on error.

Fixes: 3aed038aac8d ("KVM: arm64: Add trace remote for the nVHE/pKVM hyp")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Reviewed-by: Fuad Tabba <fuad.tabba@linux.dev>
Tested-by: Fuad Tabba <fuad.tabba@linux.dev>
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Link: https://patch.msgid.link/20260710114819.2689386-2-vdonnefort@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp_trace.c