fix(libkernel): keep the nice value at 0 after setpriority as measured on a PS5 #11108
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11108"
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 orezraey on 2026-10-25T17:52:38Z.
What
getpriorityandsetprioritymeasured on a retail PS5 (firmware 13.60) with a homebrew probe callinglibkernel_sys.sprxfrom a payload process (pid 128, process group 105, uid 1, euid 0). The source and console log are in this gist (pnice). The probe restores the starting value after every set.setpriorityclamped the value to -20…20 and stored it, andgetpriorityreturned the stored value. On the consolesetpriority(PRIO_PROCESS, 0, v)returns 0 for -25, -5, 5 and 25, andgetpriorityreads 0 after every one of them: raising the value does not stick either, so it is not a privilege question.setprioritynow keeps itswhich/whochecks and returns 0 without storing anything, andgetpriorityalways returns 0.Already matching:
getpriorityreturns 0 forPRIO_PROCESS0 and the own pid,PRIO_PGRP0 andPRIO_USER0,ESRCHfor an unknown pid or user, andEINVALforwhich3 and -1.Not measured: the probe set only
PRIO_PROCESS0.setprioritywithPRIO_PGRPorPRIO_USERand a valid id now throws, naming the selector and value, and the debt entry says that this is unverified; unknown ids andwhichvalues still fail withESRCHandEINVALfirst.Not changed: on the console
PRIO_PROCESSwith pid 1,PRIO_PGRPwith the loader's group (105) andPRIO_USERwith uid 1 also return 0. A payload is not a title and has other processes around it, so these ids say nothing about what a title sees; AnyPS5 keepsESRCHfor ids other than its own.Before and after
setpriority(PRIO_PROCESS, 0, v)for -25, -5, 5, 25getpriorityafter itgetprioritywith an unknown id,which3 or -1ESRCH,EINVALsetprioritywithPRIO_PGRPorPRIO_USERand a valid idTested
Head
757e90c8c5onmain7a25f87620.guest_sched_prioritypasses three runs in a row.guest_sched_prioritypasses three runs in a row.PRIO_PROCESS0 and checks thatgetpriorityreads 0 for the process, its pid, its group and its user after each, next to the existing target and error checks. ThePRIO_PGRPandPRIO_USERsets still throw in the code, but no test asserts it, so implementing them later does not break a test.2a0604d3e9the stored value was read back.tools/check_conventions.pypasses.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.mdfiles or images added to the repository (attach them to this PR)lchflagsentry on the line next to thegetpriorityone; merge order only); #11403 edits the neighbouringlibkernel.mdlines (merge order only)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T18:07:29Z.
Review: CHANGES_REQUESTED
Reviewed exact head
642f6fc7ef2cacb2a6b6b6d2aea6bd3063705dc0.The PS5 probe evidence supports the
PRIO_PROCESS, 0case, and the description/debt entry now correctly says the group and user selector behavior is unverified. However,setpriority_nid_postfixstill returns success without storing for validPRIO_PGRPandPRIO_USERinputs as well. The repository guidance says to throw and record behavior that is not known; documenting the uncertainty alone does not make the current no-op implementation conform to that rule.Please either provide matching PS5 set/readback evidence for the accepted group and user selectors, with tests, or have those unverified cases fail explicitly and retain the debt entry. The tested
PRIO_PROCESS, 0behavior can remain as implemented.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T18:36:37Z.
Review: APPROVED
Reviewed exact head
fc938dcedb. The update resolves my prior request: only the measured PRIO_PROCESS path returns success without storing, while valid PRIO_PGRP and PRIO_USER sets now throw and the debt entry records that those cases remain unverified. Invalid selectors and unknown IDs retain the existing EINVAL/ESRCH behavior. The focused test now checks the measured process values and explicitly exercises the unverified selector failures. The author reports three focused test runs on Linux and Windows; the current hosted product test jobs are marked skipped, and I did not run the full local build. I found no remaining blocking issue in this change.