fix(libSceAgc): read sceAgcAcbSetWorkloadsActive's workload ids through a checked copy #22495
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22495"
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 milescoviello on 2026-11-17T17:51:43Z.
What
sceAgcAcbSetWorkloadsActiveread the caller's workload ids straight through the guest pointer while building the active mask. For a registered stream, an unmapped id array crashed the host.GuestCopyIn_nid_no_patchinto a host array, and the mask is built from that copy.Results for readable ids are unchanged. The checks before the read (null buffer, null ids, count 0 or above 63, unregistered stream) still run first, so an unregistered stream still returns null without touching the ids, as the debt entry for the DCB form records the console doing. #22417 (domx4q) makes the same change to
sceAgcDcbSetWorkloadsActiveinDcbState/src/Workload.cpp. This PR changes only the ACB form inAcb/src/Control.cpp, so the two don't overlap.Tested
Linux (Ubuntu 26.04.1, kernel 7.0), GCC 15.2, Ninja, Release,
-DBUILD_TESTING=ON:agc_commandsgains one check after the registered-stream ACB checks: ids at0x10with a count of 2 return null and leave the buffer's cursor where it was.agc_commandspasses, 3 runs.main'sControl.cppand the new check, it ends infatal SIGSEGV (code 1) at address 0x0000000000000010.c4c8723a96merged intomaine069a7562f(Windows 11, i7-12700K, RTX 2070 SUPER, WinLibs GCC 15.2.0, Release, Khronos validation layer 1.4.366): theagc,guest_video_out,video_outandpad_sdltests pass 2050 of 2054 on bothmainand this PR with the same set ofVUID-messages,agc_commandsandagc_initializationpass, and the three failures also fail onmainthere.git merge-treeagainstmainis clean. #22417 doesn't editControl.cpp. ItsCommands.cpphunk adds a test function aftertestMemory, away from the line this PR adds, andgit apply -3of both diffs ontomainis clean.tools/check_conventions.pypasses on the branch and this body.tools/debt_fold.py --checkreports nothing for this fragment.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)Pull request closed