fix(libkernel): drop undefined protection bits in sceKernelMprotect #5770
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5770"
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 simonbronk on 2026-10-14T09:55:43Z.
What
Onimusha: Way of the Sword (PPSA27836 01.000.001) maps direct memory with
prot=0xf2and then callssceKernelMprotecton the same range with0xfffffff2.LinuxProtFromScerefuses any bit outside0x3F7, so the title aborts at boot:FreeBSD 11's
sys_mprotectmasks the argument (prot = uap->prot & VM_PROT_ALL;, vm_mmap.c#L606) instead of refusing it.sceKernelMprotectnow drops the bits outside0x3F7the same way. Here the result is0x3f2, which gives the same host protection as the0xf2of the map. The map calls andsceKernelMtypeprotectstill refuse undefined bits; the debt entry says so, and that the console was not measured.Tested
main0b97f8b9f: fullctest -j 8, 1142/1142 pass.guest_memorygainsCheckMprotectIgnoresUndefinedBits: map flexible memory with3, protect it with0xfffffff2, write and read it back. Withmain'sExport.cppit fails with the title's message (Unsupported memory protection bits: -14); with the change it passes.--windows-fixed-base 0x400000000and with the missinglibSceHttp2export from #5771: it passes this call, creates its GPU device and registers its shaders, and stops later insceConvertKeycodeGetCharacter(#5726). The stops are listed in #5769.python tools/check_conventions.py --base upstream/main: passes.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file — not applicable, no stub.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T19:57:38Z.
Rebased onto
main411e5e6d9(ce074f930). The only conflict was indocs/dev/debt/libkernel.md:mainadded the sceKernelMprotect gap entry, and both entries are kept. The code is unchanged, and conventions pass.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:09:24Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestMemory.cppcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/DirectMemory/Export.cppcore/libs/tests/GuestMemory.cppdocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mdcore/libs/tests/GuestMemory.cppcore/libs/prx/libkernel/DirectMemory/Export.cppdocs/dev/debt/libkernel.mdImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T12:49:47Z.
Checked the FreeBSD 11
sys_mprotectmask (prot = uap->prot & VM_PROT_ALL, vm_mmap.c L606), the0x3F7mask (0xfffffff2becomes0x3f2, same host protection as the0xf2map), the debt entry and its section.guest_memorypasses on the merged tree and fails without theExport.cppchange; scoped ctest 173/173. Merging once the full Build is green.