]> Gentwo Git Trees - linux/.git/commit
KVM: arm64: Fix page leak in user_mem_abort()
authorFuad Tabba <tabba@google.com>
Wed, 17 Sep 2025 13:07:37 +0000 (14:07 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 17 Sep 2025 16:37:47 +0000 (17:37 +0100)
commit5f9466b50c1b4253d91abf81780b90a722133162
tree40dc26de57f04b299a0928f22f048540e3900589
parent6515c612e79949b17ef4b8c4180c07bbeaf01e4d
KVM: arm64: Fix page leak in user_mem_abort()

The user_mem_abort() function acquires a page reference via
__kvm_faultin_pfn() early in its execution. However, the subsequent
checks for mismatched attributes between stage 1 and stage 2 mappings
would return an error code directly, bypassing the corresponding page
release.

Fix this by storing the error and releasing the unused page before
returning the error.

Fixes: 6d674e28f642 ("KVM: arm/arm64: Properly handle faulting of device mappings")
Fixes: 2a8dfab26677 ("KVM: arm64: Block cacheable PFNMAP mapping")
Signed-off-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
arch/arm64/kvm/mmu.c