fix(libSceAppContent): guard add-on list outputs #17955

Merged
DonRyuzaki merged 1 commit from upstream-pr/17955 into main 2026-11-12 06:45:19 +00:00
DonRyuzaki commented 2026-11-10 00:54:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by DonRyuzaki on 2026-11-10T00:54:33Z.


What

Use GuestCopyOut_nid_no_patch for the add-on info list and hit count in sceAppContentGetAddcontInfoList. An unwritable non-null list could fault the host while copying entries; an unwritable hit-count pointer could fault even with zero add-ons. Attempted writes now return SCE_APP_CONTENT_ERROR_PARAMETER and preserve errno. An invalid list pointer remains ignored when there are no entries, while hit count is set to zero. The error for unmapped non-null pointers is a host-safety choice, not measured console behavior.

Tested

  • Clean head e85cfd044dbaf2fdbc5bfb06616cd95c483dc3e1 based on upstream main 3e089775b9a12e3d2e70ede255363c522dbf3135. Main subsequently gained unrelated AGC/Ngs2 changes at 65a80a5dc7a888fcfd67d57a22c8e863a99c59b0; this PR remains mergeable.
  • GuestAppContentEntitlements.cpp adds unmapped info-list and hit-count pointers with three add-ons, verifying unchanged hit count on list failure and preserved errno. GuestAppContent.cpp checks the zero-entry list-pointer edge case.
  • Shared full Linux Release integration build on main 3e089775b9a12e3d2e70ede255363c522dbf3135 plus all ten pinned candidate patches completed 3219/3219 incremental Ninja steps, including runtime libraries and relinker. Focused CTest passed 20/20 with no skips, including guest_appcontent and guest_appcontent_entitlements. Earlier full integration build on main 5e04f680ad completed 4369/4369 and 20/20 focused tests. These are integrated-tree results, not an isolated full build of this branch.
  • tools/check_conventions.py --base origin/main and git diff --check origin/main...HEAD passed on this branch.
  • Overlap review: #16797 and #16591 edit unrelated Download1Expand code in the same source; #13589 and #14212 affect separate debt text. No open PR found implementing this list output guard.
  • No console or game test was run for this change.

Checklist

  • Based on recent main; subsequent unrelated changes reviewed; no duplicate function fix
  • One topic per PR; generic behavior, not title specific
  • No new third-party code, notes or images
  • Unimplemented paths remain explicit; no new silent stubs
  • Depends on: none; Fixes: none; Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5233788580 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17955). Originally posted by [DonRyuzaki](https://github.com/DonRyuzaki) on 2026-11-10T00:54:33Z. --- ### What Use `GuestCopyOut_nid_no_patch` for the add-on info list and hit count in `sceAppContentGetAddcontInfoList`. An unwritable non-null list could fault the host while copying entries; an unwritable hit-count pointer could fault even with zero add-ons. Attempted writes now return `SCE_APP_CONTENT_ERROR_PARAMETER` and preserve `errno`. An invalid list pointer remains ignored when there are no entries, while hit count is set to zero. The error for unmapped non-null pointers is a host-safety choice, not measured console behavior. ### Tested - Clean head `e85cfd044dbaf2fdbc5bfb06616cd95c483dc3e1` based on upstream main `3e089775b9a12e3d2e70ede255363c522dbf3135`. Main subsequently gained unrelated AGC/Ngs2 changes at `65a80a5dc7a888fcfd67d57a22c8e863a99c59b0`; this PR remains mergeable. - `GuestAppContentEntitlements.cpp` adds unmapped info-list and hit-count pointers with three add-ons, verifying unchanged hit count on list failure and preserved `errno`. `GuestAppContent.cpp` checks the zero-entry list-pointer edge case. - Shared full Linux Release integration build on main `3e089775b9a12e3d2e70ede255363c522dbf3135` plus all ten pinned candidate patches completed 3219/3219 incremental Ninja steps, including runtime libraries and relinker. Focused CTest passed 20/20 with no skips, including `guest_appcontent` and `guest_appcontent_entitlements`. Earlier full integration build on main `5e04f680ad` completed 4369/4369 and 20/20 focused tests. These are integrated-tree results, not an isolated full build of this branch. - `tools/check_conventions.py --base origin/main` and `git diff --check origin/main...HEAD` passed on this branch. - Overlap review: #16797 and #16591 edit unrelated `Download1Expand` code in the same source; #13589 and #14212 affect separate debt text. No open PR found implementing this list output guard. - No console or game test was run for this change. ### Checklist - [x] Based on recent main; subsequent unrelated changes reviewed; no duplicate function fix - [x] One topic per PR; generic behavior, not title specific - [x] No new third-party code, notes or images - [x] Unimplemented paths remain explicit; no new silent stubs - [x] Depends on: none; Fixes: none; Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!17955
No description provided.