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
F96229732: D35952.id108562.diff
Tue, Sep 24, 3:55 AM
Unknown Object (File)
Mon, Sep 16, 12:21 PM
Unknown Object (File)
Mon, Sep 9, 11:19 AM
Unknown Object (File)
Wed, Sep 4, 12:27 PM
Unknown Object (File)
Jul 1 2024, 2:21 AM
Unknown Object (File)
Jul 1 2024, 1:01 AM
Unknown Object (File)
Jun 27 2024, 4:29 AM
Unknown Object (File)
Jun 11 2024, 4:47 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