fix(libkernel): allow sceKernelMprotect on committed host memory outside the guest registry #3788
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3788"
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 xXPBSXx on 2026-10-11T16:43:32Z.
What
sceKernelMprotectthrew "guest protection or unmap range is not registered" for committed private host memory that is not in the guest allocation registry (seen on a thread stack: 0xf8380000+0x580000, prot 0xc2). On Windows it now sets the native protection for such a range and returns 0 when the range is a committed private region that does not overlap any registered guest allocation. Everything else keeps its previous path. Related: #3143.Tested
maina11c8f7f7plus this commit:ctest -R "^guest_memory$"passes, including the newCheckMprotectOfHostMemoryOutsideTheGuestRegistry(VirtualAlloc'd region: protect to read/write, write and read back, read-only, read/write again, native protection checked withVirtualQuery). That check failed before the change (verified on the earlier branch version).python tools/check_conventions.py --base upstream/mainpasses._WIN32only).Checklist
main; no other open PR implements the same functions (#1330, #1360 and #3684 touch other code)NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt (none added).mdfiles or images added to the repository🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T22:01:47Z.
Checked the diff against
DoMprotect: the new branch only applies to committed private regions that do not overlap a registered guest allocation (RegionSize >= bytes), everything else keeps its previous path. Linux build andguest_memorypass; the new code and test are_WIN32only, so the Windows run in the PR description is what covers them. Merging.