]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: arm64: Check range args for pKVM mem transitions
authorVincent Donnefort <vdonnefort@google.com>
Thu, 16 Oct 2025 16:45:41 +0000 (17:45 +0100)
committerMarc Zyngier <maz@kernel.org>
Thu, 30 Oct 2025 16:14:37 +0000 (16:14 +0000)
commitf71f7afd0a0cd3f044cd2f8aba71a1a7229df762
tree6cfea9191eb5b78ff705e54a50ffef12e51819a5
parenta186fbcfd845699d51809f7c7e54cf997fe32820
KVM: arm64: Check range args for pKVM mem transitions

There's currently no verification for host issued ranges in most of the
pKVM memory transitions. The end boundary might therefore be subject to
overflow and later checks could be evaded.

Close this loophole with an additional pfn_range_is_valid() check on a
per public function basis. Once this check has passed, it is safe to
convert pfn and nr_pages into a phys_addr_t and a size.

host_unshare_guest transition is already protected via
__check_host_shared_guest(), while assert_host_shared_guest() callers
are already ignoring host checks.

Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Link: https://patch.msgid.link/20251016164541.3771235-1-vdonnefort@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/nvhe/mem_protect.c