linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: arm64: Fix the upper limit of the walker range
@ 2025-01-14 14:50 Sebastian Ene
  2025-01-14 14:55 ` Marc Zyngier
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Sebastian Ene @ 2025-01-14 14:50 UTC (permalink / raw)
  To: catalin.marinas, joey.gouly, kvmarm, linux-arm-kernel,
	linux-kernel, maz, oliver.upton, sebastianene, suzuki.poulose,
	will, yuzenghui

Prevent the walker from running into weeds when walking an
entire address range.

Signed-off-by: Sebastian Ene <sebastianene@google.com>
---
 arch/arm64/kvm/hyp/pgtable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
index 40bd55966..2ffb5571e 100644
--- a/arch/arm64/kvm/hyp/pgtable.c
+++ b/arch/arm64/kvm/hyp/pgtable.c
@@ -260,7 +260,7 @@ static int _kvm_pgtable_walk(struct kvm_pgtable *pgt, struct kvm_pgtable_walk_da
 {
 	u32 idx;
 	int ret = 0;
-	u64 limit = BIT(pgt->ia_bits);
+	u64 limit = BIT(pgt->ia_bits) - 1;
 
 	if (data->addr > limit || data->end > limit)
 		return -ERANGE;
-- 
2.47.1.688.g23fc6f90ad-goog



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-01-16 14:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-14 14:50 [PATCH] KVM: arm64: Fix the upper limit of the walker range Sebastian Ene
2025-01-14 14:55 ` Marc Zyngier
2025-01-14 15:03   ` Sebastian Ene
2025-01-14 15:08     ` Marc Zyngier
2025-01-14 15:07 ` Marc Zyngier
2025-01-16  1:16 ` Mark Brown
2025-01-16  2:07   ` Mark Brown
2025-01-16 10:55   ` Marc Zyngier
2025-01-16 13:49     ` Suzuki K Poulose
2025-01-16 14:50       ` Sebastian Ene

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).