(I'm so sorry!) Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

RISC-V: KVM: Guard HFENCE range loops against overflow

The local HFENCE range helpers build the loop end with addr + size and then step through the range by the requested page order. If addr + size wraps, a small range near the top of the address space can be treated as empty and skip the intended fence. The final loop step can also wrap before the loop condition is evaluated again. Treat wrapped ranges conservatively as full-range HFENCE requests and stop each bounded loop before the next step can wrap past the computed end. This keeps the existing large-range fallback and only changes local GVMA/VVMA range construction. Fixes: 2415e46e3a9a ("RISC-V: KVM: Introduce range based local HFENCE functions") Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260718040000.008.17bfd3bd-caplitmus-rv@iscas.ac.cn Signed-off-by: Anup Patel <anup@brainfault.org>


Author Pengpeng Hou Committer Anup Patel Date Commit Parent 0e3d7d8c
+59 -12
1 changed file
+59 -12
1 changed file