fix(libSceAgc): validate suspend and fused-size inputs before use #17742
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17742"
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 tanmayvdani on 2026-11-09T13:50:32Z.
What
Validate
sceAgcSuspendPointAndCheckStatusandsceAgcGetFusedShaderSize_0080inputs before use: reject unreadable/null pointers withAPS5_INVALID_ARG_EX, validate the shader-halves pair before touching the output, and store the fused-size alignment as a 32-bit value at +8 preserving +12. Addsagc_suspend_statustests. Also drops the now-redundantlibSceAgcVshsceAgcSuspendPointAndCheckStatus_nid_no_patchstub: the sharedSuspend.cppsource already provides the real export under NIDb+fis+WZ3Ig, and keeping both double-exports the NID, which the Windowsnid_patcherrejects (same treatment asd3189e41fd).Tested
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -V -R "agc_suspend_status|agc_platform_tests|agc_shader_fusion", same machine and GPU onmain(eb3839d4f3) and on this branch. Main: 2/2 passed (agc_platform_tests,agc_shader_fusion). This branch: 3/3 passed (addsagc_suspend_status). Neither log containswas not found but was requested by env var VK_INSTANCE_LAYERS; the loader log confirmsInsert instance layer "VK_LAYER_KHRONOS_validation"with 0 load failures;VUID-count is 0 on both, so the change adds no new validation errors. Full logs are attached in a comment below.python3 tools/check_conventions.py --base origin/mainpasses;python3 tools/pr_overlap.pyreports no shared lines with #5021 (disjoint CMake hunk) or #14212 (whitespace-only) -- see comment.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T11:45:45Z.
Review: COMMENTED
Reviewed — no blocking findings
The prepared change is internally consistent in the code reviewed, but the suspend signature and firmware behavior remain unverified, so a formal approval is not justified.
What I ran
Reviewed head
1c3c2f0f90e2d2d5c5e03adf9f5fd2bc7a17d9causing the prepared diff and pinned repository readerrepo_read.py. No tests or build commands were run; the test results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
sceAgcSuspendPointAndCheckStatusaccepts any readable one-byte pointer, then maps everystd::exceptionfrom the driver suspend toGRAPHICS5_ERROR_SUSPEND_DISALLOWED. The code and debt note both say the signature and firmware behavior are unverified. Keep this contract explicitly provisional until it can be checked against firmware or console behavior. Changed line:core/libs/prx/libSceAgc/Misc/src/Suspend.cpp:39.Not verified
core/libs/prx/libSceAgc/Export.cpphas no head text to read. All other manifest entries marked included were read; no excluded-file inventory was available in the prepared artifacts.To get this to a good state
Nothing is required. Optional: confirm the suspend contract against firmware or console evidence and update the implementation and debt note if needed.
Pull request closed