fix(audioout2): guard context memory guest output #18039
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18039"
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 DonRyuzaki on 2026-11-10T07:17:58Z.
What
Guard the output pointer of sceAudioOut2ContextQueryMemory with GuestCopyOut_nid_no_patch. Valid calls still return the same context memory size; an unwritable output now returns the existing invalid-argument code without crashing the host or changing errno. The console result for this invalid pointer remains unmeasured and is documented as a host-safety fallback. Open #14997 changes ContextCreate and #12863 changes a context callback, not this export; #14212 may require an ordinary debt-file rebase.
Tested
53bb992782passed the full default Linux runtime build, 3095/3095 Ninja steps. audio_out2_timing passed three consecutive focused CTest runs. The full CTest suite was not run.96606c6208on reviewed main1539313883changes the same AudioOut2 source, test and debt blobs as the tested head. The rebase added only unrelated AGC, library and debt changes. No full build was rerun on the submitted head.Checklist
Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-10T11:12:29Z.
Review: COMMENTED
Read
96606c6208againstmain.Correctness.
AudioOut2Context.cpp:sceAudioOut2ContextQueryMemorykeeps the null checks and now writes the size throughGuestCopyOut_nid_no_patch. It returnsSCE_AUDIO_OUT2_ERROR_INVALID_ARGUMENT(0x80260502) when the copy fails. A valid output still receivesCONTEXT_MEMORY. Saving and restoringerrnois redundant on Linux, whereGuestCopyOut_nid_no_patchalready restores it onEFAULT. It is harmless and matches existing callers such aslibSceAcm.Test. On
main,sceAudioOut2ContextQueryMemory(¶ms, (size_t*)0x10)stores straight through the pointer and faults, so the new rows inTestLowLatencyCallsRejectBadArgumentsfail there. With the change they check both the return code anderrno.Debt. The new entry says this is a host-safety fallback and the console result is unmeasured, which is what the code does.
Not run here; this is from reading the code.
AI-assisted: yes.