fix(libSceAppContent): guard integer parameter output #18516
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18516"
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 Ducengarth on 2026-11-11T19:44:45Z.
What
sceAppContentAppParamGetIntdirectly stored the SKU flag or a user-defined parameter through the guest output pointer. An inaccessible non-null output could terminate the host process. Resolve the existing parameter value into a local and write its four bytes withGuestCopyOut_nid_no_patch, preserving the copy's incomingerrno.Keep initialization, null-output and unknown-ID precedence unchanged. If a checked copy fails, return
SCE_APP_CONTENT_ERROR_PARAMETER, the code this export already returns for a null output and the onesceAppContentGetGameTrialsFlagreturns when the same checked copy fails. The console's result for invalid memory is unmeasured, so the debt file records the code as a host-safety fallback.Extend the existing AppContent regression across all five supported IDs, requiring
SCE_APP_CONTENT_ERROR_PARAMETERand preservederrnofor inaccessible output, the same values for valid output, unchanged surrounding canaries and preservederrno. Also check an inaccessible output before initialization and with an unsupported ID.Tested
BUILD_TESTING=ON, full runtime configuration, based on65351c2931ec7ed2be6a434d86468b897df3e0d1.guest_appcontent_tests,guest_appcontent_download_tests,guest_appcontent_license_testsandguest_appcontent_entitlements_testsagainst the real libraries and dependencies.mainproduction code causesguest_appcontentto fail with host access violation0xc0000005, writing address0x10; the other seven AppContent cases pass.ctest --test-dir <build> -R '^guest_appcontent($|_)' --output-on-failure: 8/8 passed. Refreshed the staged Windows test library after the incremental rebuild so the tests load the newly built module.29cb3ecef8returnsSCE_APP_CONTENT_ERROR_PARAMETERon a failed copy: rebuilt all four AppContent test executables on the same Windows machine and ranctest --test-dir build -R '^guest_appcontent'3 times, 8/8 passed each time.python tools/check_conventions.py --base upstream/mainwith this title and body passes. The required--base origin/maincheck was also run: the fork's stalemainincludes four pre-existing non-conventional subjects in the comparison (d95f1b7e5c,a9aa6f2f04,d9c8fd3a8d,84a205981a); none belongs to this PR.python tools/pr_overlap.py --branch codex/fix-app-content-param-output --repo boykopovar/AnyPS5 --jobs 8scanned 1,981 open PRs and found no confirmed line/export overlap. It failed closed only on #14212's existing conflicts with the base. Manually compared its current head6b4941bfe250142672c12b48b7b6c706b9691452: the shared AppContent debt file only gains spacing and removes a derived export count; that PR changes neither this function nor its regression. This new debt paragraph is separate from those edits. #17955 guards the add-on list getter and does not implement this integer-parameter fix.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 PrivacyOnion on 2026-11-12T06:08:27Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
d2add95476:tools/check_conventions.pypassed;git diff --checkclean.guest_appcontent_testsbuilt cleanly.guest_appcontent_download_0,guest_appcontent_download_1,guest_appcontent_download_18014398509481983,guest_appcontent_download_18014398509481984,guest_appcontent_download_18446744073709551615,guest_appcontent,guest_appcontent_license,guest_appcontent_entitlements):core/libs/prx/libSceAppContent/Export.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me