Skip to content

fix(audioout2): guard user guest outputs - #18011

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
DonRyuzaki:fix/audioout2-user-guest-outputs
Nov 12, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
DonRyuzaki:fix/audioout2-user-guest-outputs

Conversation

@DonRyuzaki

Copy link
Copy Markdown
Contributor

What

sceAudioOut2UserCreate and sceAudioOut2UserGetSupportedAttributes directly wrote to non-null guest pointers. An unwritable pointer could terminate the host. This change uses GuestCopyOut_nid_no_patch while preserving host errno. A failed create copy removes the candidate handle without advancing the counter. sceAudioOut2UserCreateEx gets the same protection through its existing call to Create.

The console result for an unwritable non-null pointer is unmeasured. Existing invalid-argument codes are used as host-safety fallbacks and the uncertainty is recorded in technical debt. If the second attribute output fails, the first may already have been copied.

No open PR found in the current upstream search implements these AudioOut2User exports. #16614 changes a separate AudioOut port-state function; #14997 changes AudioOut2 context grain validation. Other audio PRs may edit the technical-debt file, especially format-only #14212, so a documentation rebase may be needed if those land first.

Tested

  • WSL2/Linux GCC 13.3 Release on upstream 1a13265 with this patch: CMake configured and the focused audio_out2_port_layouts_tests target built 580/580 Ninja steps with two below-normal-priority jobs. The CTest passed three consecutive runs.
  • Negative control: restored only original AudioOut2User.cpp, kept the new regression and rebuilt. The test SEGFAULTed on the invalid non-null output. Restored the patch, rebuilt and passed the test.
  • Final head 0544e31, based on upstream 015434d, tree 0d258f93fe6252f957d76eb199f0d92069acfbf6: all 14 paths changed since the pinned base matched the isolated WSL source after Windows line-ending normalization. CMake reconfigured; the focused target rebuilt and passed three consecutive CTests on the preceding e84886d base. After the one-file GuestSaveDataHostSpace.cpp upstream update, the focused target and CTest passed again. The 580-step build was on the earlier pinned base.
  • check_conventions.py --base origin/main and git diff --check origin/main...HEAD passed. pr_overlap.py --branch HEAD was attempted but could not run locally because gh is unavailable. Known neighboring audio PR patches were manually compared; none changes these exports or their test file.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; silent stubs are listed in technical debt
  • No notes, investigation files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@JJenkx

JJenkx commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Windows check of head 0544e31df3, merged onto main eaec74e322 (b92ffb9934, clean merge).

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.

  • audio_out2_port_layouts passes in 3 of 3 runs, none skipped.

AI-assisted: yes.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5021 docs/dev/debt/libSceAudioOut.md
PR 14212 docs/dev/debt/libSceAudioOut.md
PR 17468 docs/dev/debt/libSceAudioOut.md

@gabichuuuuu

Copy link
Copy Markdown
Contributor

Windows check of head 0544e31df3, merged onto main f57c971559 (clean merge, built together with other open PRs that touch different files).

Setup: Windows 11 x64, WinLibs GCC 15.2.0 (r7), Ninja, Release, BUILD_TESTING=ON, Python 3.15.

  • Tests built from this PR's test files: audio_out2_port_layouts.
  • All of them pass in 3 of 3 runs.
  • Negative control: with this PR's code reverted to main (files it adds removed) and rebuilt, audio_out2_port_layouts fails in 2 of 2 runs, so the tests detect the change.

AI-assisted: yes.

@oneandonlydean
oneandonlydean merged commit 04cb2c1 into boykopovar:main Nov 12, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants