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)
Fri, Jul 4, 9:07 PM
Unknown Object (File)
Fri, Jun 20, 9:59 AM
Unknown Object (File)
Wed, Jun 18, 4:22 AM
Unknown Object (File)
Tue, Jun 17, 11:24 AM
Unknown Object (File)
Tue, Jun 17, 10:38 AM
Unknown Object (File)
Tue, Jun 17, 10:38 AM
Unknown Object (File)
Tue, Jun 17, 1:00 AM
Unknown Object (File)
Jun 2 2025, 6:33 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