fix(libkernel): refuse fixed no-overwrite mappings over live memory with ENOMEM #994
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/994"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-06T22:15:04Z.
What
A direct or flexible mapping with
MAP_FIXED | MAP_NO_OVERWRITE(0x90) over a range that already holds an allocation threw "fixed mapping ... overlaps a registered guest allocation". The kernel refuses it with ENOMEM and leaves the existing mapping alone; fpPS4'sTVirtualManager.check_fixed(kernel/mm_adr_virtual.pas) returns ENOMEM for an allocated node whenMAP_NO_OVERWRITEis set, and allows it over a reservation.DoMapDirectandDoMapAnonnow returnSCE_KERNEL_ERROR_ENOMEMin that case. A range entirely covered bysceKernelReserveVirtualRangereservations keeps the previous path. To test for overlap the guest allocation registry getsGuestAllocationsOverlaps(Mutation::Overlaps).UFC 6 (PPSA23566) maps fixed no-overwrite at
0xfbffffc000repeatedly to find a free slot and aborted on the second attempt.Tested
edf90b16: 365/365 CTest. NewCheckNoOverwriteRefusesLiveMappinginguest_memory: direct and flexible 0x90 mappings over a live direct mapping return0x8002000c, the output address is unchanged, and the original mapping's contents and physical offset survive. The existingCheckNamedAndHintedMappingsexpected a throw for the same flexible case; it now expects ENOMEM.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code