Page MenuHomeFreeBSD

riscv: Avoid passing invalid addresses to pmap_fault()
ClosedPublic

Authored by markj on Jul 26 2022, 5:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 19, 11:50 AM
Unknown Object (File)
Oct 3 2024, 3:27 PM
Unknown Object (File)
Oct 3 2024, 8:16 AM
Unknown Object (File)
Oct 1 2024, 2:59 PM
Unknown Object (File)
Sep 27 2024, 5:37 PM
Unknown Object (File)
Sep 27 2024, 2:10 PM
Unknown Object (File)
Sep 24 2024, 6:22 PM
Unknown Object (File)
Sep 24 2024, 3:55 AM
Subscribers

Details

Summary

After the addition of SV48 support, VIRT_IS_VALID() does not exclude
addresses that are in the SV39 address space hole but not in the SV48
address space hole. This can result in mishandling of accesses to that
range.

Fix the problem by modifying VIRT_IS_VALID() to use the runtime address
space bounds. Then, if the address is invalid, and pcb_onfault is set,
give vm_fault_trap() a chance to veto the access instead of panicking.

PR: 265439
Fixes: 31218f3209ac ("riscv: Add support for enabling SV48 mode")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable