fix(libkernel): fail madvise MADV_PROTECT with EPERM #3795
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3795"
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 13hourstilliland on 2026-10-11T16:44:42Z.
What
madvisethrew onMADV_PROTECT. It now fails withEPERM, as an unprivileged process does on FreeBSD 11.4. There,MADV_PROTECTis handled before the address and length checks and becomesPROC_SPROTECT. That call requiresPRIV_VM_MADV_PROTECT. This keeps the same order, so an invalid range withMADV_PROTECTstill getsEPERM. Whether PS5 titles hold that privilege isn't verified; it's noted in TechnicalDebt.Tested
Linux (GCC 14.2):
guest_memorychecks thatMADV_PROTECTreturns -1 with errno 1 on a mapped page and on an out-of-range address. The test aborts on currentmainand passes with this change.check_conventions.pypasses. Not tested with a title.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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T16:47:19Z.
Progress report (
11d9c00→0e00e27)📈 System libraries: 86.23% (+0.03%, +1 implemented functions)
✅ 1 implemented
madvise_nid_postfixImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:17:12Z.
Which title calls
madvisewithMADV_PROTECT? With the ID and the log line where it stops on main this can go in; otherwise I'll close it until one does.Imported from boykopovar/AnyPS5. Originally posted by 13hourstilliland on 2026-10-12T07:36:16Z.
No title: I can't give a title ID or a log line where a title calls
madvisewithMADV_PROTECT— the change is FreeBSD-fidelity only (thePRIV_VM_MADV_PROTECTrequirement mapped to an unprivilegedEPERM), with a host test showing the errno on a mapped page.If title evidence is the bar for this kind of turn, close it until a title calls it.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T20:07:28Z.
Closing as agreed in the thread: @oneandonlydean asked which title calls
madvisewithMADV_PROTECT, and there is none, so the change has no consumer and whether PS5 titles holdPRIV_VM_MADV_PROTECTis unverified. The branch also conflicts withmainnow.Feel free to reopen, rebased, once a title ID and the log line where it stops on
mainare available.Pull request closed