Skip to content

Commit 3949e28

Browse files
misalehoupton
authored andcommitted
KVM: arm64: Fix memory check in host_stage2_set_owner_locked()
I found this simple bug while preparing some patches for pKVM. AFAICT, it should be harmless (besides crashing the kernel if it was misbehaving) Fixes: e94a7de ("KVM: arm64: Move host page ownership tracking to the hyp vmemmap") Signed-off-by: Mostafa Saleh <smostafa@google.com> Link: https://lore.kernel.org/r/20250501162450.2784043-1-smostafa@google.com Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
1 parent ef296ee commit 3949e28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/kvm/hyp/nvhe/mem_protect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ int host_stage2_set_owner_locked(phys_addr_t addr, u64 size, u8 owner_id)
503503
{
504504
int ret;
505505

506-
if (!addr_is_memory(addr))
506+
if (!range_is_memory(addr, addr + size))
507507
return -EPERM;
508508

509509
ret = host_stage2_try(kvm_pgtable_stage2_set_owner, &host_mmu.pgt,

0 commit comments

Comments
 (0)