fix(libSceAudioOut): refuse a null attribute list in sceAudioOut2ContextSetAttributes with the console code #18401
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18401"
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 xXPBSXx on 2026-11-11T13:25:22Z.
What
sceAudioOut2ContextSetAttributes returned 0 for a null attribute list with count 0 and 0x80260502 for one with a count; a PS5 returns 0x80268001 for both (measured). Three commits, one file each: test (red on main: the first new Require, the null list with count 0, aborts; the null list with count 1 is covered only by the green run), fix (AudioOut2Context.cpp: a null list returns 0x80268001, no id or value check; a context that is not live keeps INVALID_HANDLE first), docs (the sceAudioOut2ContextSetAttributes entry of docs/dev/debt/libSceAudioOut.md, 864 characters; its old half sentence about a null list with a count (INVALID_ARGUMENT) now says 0x80268001, and the entry states that a PS5 answered 0 for context 0, which this library refuses). Not changed on purpose: the console refused ids 0, 3, 4, 0x100 and 0xffffffff, a null value and size 0 for id 2, and answered 0 for context 0; the library still accepts every id and value because the set of valid ids is not measured (only 0 to 4, 0x100 and 0xffffffff), and a title may set an id above 4. The function is imported by PPSA02225, PPSA02530, PPSA07411, PPSA23126 and PPSA30601 among the titles I ran (relinker registries, NID 4dq2rblWlg0); this is an import, not a call count, and the change unblocks no title by itself. The 0x8026800x codes against the 0x8026050x family are not touched here. The entry:
INVALID_HANDLE, a null list 0x80268001); what a context attribute changes on a console is unknown. A PS5 (firmware 11.60, payload process; a title process may differ) accepted ids 1 and 2 with a 4-byte value 1 and refused with 0x80268001 a null list with count 0 or 1, as this library does, and ids 0, 3, 4, 0x100 and 0xffffffff, a null value and size 0 for id 2, which it still accepts; it answered 0 for context 0, which this library refuses; ids above 4 other than 0x100 are not measured. PPSA25286 01.000.568 sets attribute 2 to a 4-byte 1 at start-up, and PPSA02225 passes two attributes from an object at its single call.Tested
ctest audio_out2_context_handles, ASan + UBSan, WSL, same base for both runs: the test commit alone Subprocess aborted at the first new Require ('an empty null attribute list was not refused with the console code'; the count-1 answer is shown only by the green run), with the fix Passed. Console measurement (payload process, firmware 11.60; a title process may differ), 13 SetAttributes cases (19 cases in all) on a context made by the second sceAudioOut2ContextCreate of the process (the first returned handle 0): ids 1 and 2 with a 4-byte value 1 return 0; ids 0, 3, 4, 0x100, 0xffffffff, a null value, size 0, and a null list with count 0 or 1 return 0x80268001; size 8 returns 0; context 0 returns 0. The probe source and raw log go in the first comment. check_conventions passes.
Overlap: the 21 other open pull requests that change
AudioOut2Context.cpp,AudioOut2ContextHandles.cppordocs/dev/debt/libSceAudioOut.md(found by reading the changed files of all 1986 open pull requests) were checked on 2026-11-11 at about 13:10 UTC againstmained4b2e4cd8; the branch merges into it without a conflict (it is based on the olderaece3f1a22). #5021, #14212 and #18044 already conflict withmainwithout this change; 17 merge cleanly with and without it. #18040 (guard the queue-level outputs) conflicts only with this change, inAudioOut2ContextHandles.cpp, where both add tests in the same place; whichever merges second needs a small rebase.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)AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-11T15:35:15Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
9f80273ba3:tools/check_conventions.pypassed;git diff --checkclean.audio_out2_context_handles_testsbuilt cleanly.audio_out2_context_handles):core/libs/prx/libSceAudioOut/src/AudioOut2Context.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Generated withfooter from the description; the AI-assisted checkbox can stay.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T14:25:26Z.
Review: COMMENTED
Reviewed sceAudioOut2ContextSetAttributes null-list fix — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
9f80273ba3189720a41d758faeed279b025a8b59, basemain.core/libs/prx/libSceAudioOut/src/AudioOut2Context.cpplines 505 to 520.Results
audio_out2_context_handlesFindings
Blocking
None.
Non-blocking
core/libs/prx/libSceAudioOut/src/AudioOut2Context.cpp:512: the new line writes the raw code,static_cast<int>(0x80268001). The same file already names that code at head, insceAudioOut2ContextBedWrite(constexpr int ErrorInvalidParam = static_cast<int>(0x80268001);, line 520). A named constant would read more clearly. The inline form also matches the test, so leaving it is consistent too.Not verified
audio_out2_context_handleson this head. The claim in the description that the test is red onmainis not checked.SCE_AUDIO_OUT2_ERROR_INVALID_ARGUMENTis still used elsewhere after this change. The reader's search returned no lines for a pattern that the head file contains, so this name check was not done.AudioOut2Context.cpp(diff, and head lines 505 to 520).AudioOut2ContextHandles.cppanddocs/dev/debt/libSceAudioOut.mdwere read as diff hunks only, not as full text at head. Excluded by rule: none.To get this to a good state
Nothing is required. The non-blocking point above is optional.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T11:40:47Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the updated null-list behavior is consistent with the console result reported in the PR description.
What I ran
Reviewed head
6207e4d567fafdf056cb3a1ac5789d86b31b0524. No commands or tests were run. Readdescription.md,commits.md,manifest.json,diff.patch, and all five changed files at the pinned head:AudioOut2Context.cpp,AudioOut2ContextHandles.cpp,AudioOut2DeviceState.cpp,AudioOut2Timing.cpp, andlibSceAudioOut.md.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The reported test runs, console measurement, and check_conventions were not independently verified. No files were excluded from the reviewed change set;
files.jsonwas not available as a document, so the changed-file listing inmanifest.jsonand the review directory listing were used to identify files.To get this to a good state
Nothing is required.