fix(libSceAjm.native): refuse a nonzero reserved in sceAjmInitialize #15906
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15906"
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 zaryabzip on 2026-11-04T22:54:23Z.
What
sceAjmInitializenow refuses a nonzeroreservedwithINVALID_PARAMETER(0x80930005) and writes no context, as obSCEne's census measured. It ran in its own title (PPSA90000) on a PS5 with system software 12.40.mainignoredreservedand handed out a context.mainreserved= a stack address,context= a valid pointer0x80930005, output unchanged0x809300050x80930005The same results came back in that log's sibling runs,
report-20261013-184500.logandreport-20261014-004800.log. This is thesceAjmInitializecounterpart of @BunnyFl's #15491, which refuses a nonzeroreservedinsceAjmModuleRegister. A new debt entry records the measurement.Test.
TestBatchContextOwnershipnow first callssceAjmInitializewith a stack address asreserved, as the probe did. It expects0x80930005and checks that its0xdeadbeefoutput is unchanged. Onmainthe test fails there.Overlap:
git merge-treemerges this cleanly withmainand with every open PR that touches these three files and merges withmain. Those are #12613, #14226 and #15846 (mine), #15491 (BunnyFl) and #14078. #14212 already conflicts withmain.Tested
3a1d204d60(comment):main1e24993fa3.ctest -R "guest_ajm"passes all 5 tests.guest_ajm_teardownis Linux-only).--repeat until-fail:3passes every round on both.Ajm.cppfrommain,guest_ajmaborts on both:sceAjmInitialize(<stack address>, &refused)returns 0 and writes 2.Checked so far, on macOS (arm64, where no full build is possible):
GuestAjm.cppand the changed lines ofAjm.cpppass an x86-64clang++ -fsyntax-only.tools/check_conventions.py --base mainpasses.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 BunnyFl on 2026-11-05T15:58:07Z.
Review: APPROVED
@zaryabzip looks right. I read the census lines you cite (
report-20261013-172400.log, lines 26104-26116):call-buffers, with every argument a buffer address, returns0x80930005and changes no argument, andcall-zerosreturns the same.Firmware 13.42, for comparison
Disassembly only, not measured on a console.
system/common/lib/libSceAjm.native.sprx(SHA-2568eea270172e7ea177e69fa7865493b72131670f87afa91798d7d749ac183d5c0),sceAjmInitializeat0xd0, read to its return:So the module checks only the null output itself and passes
reservedto the kernel driver; what the driver answers for a nonzero one isn't visible here, which is what your console measurement settles. Either way the output is written only on success, as your test checks.Non-blocking, in case it matters later:
system/common/lib/libSceAjm.sprx(SHA-256a65a690c00ec74f107e2fbde3ee782206d994bfdeb108f924e2c8abeddc861e3) has its ownsceAjmInitializeat0xd0that writes0xffffffffto the output before refusing a nonzeroreserved:The census saw the output unchanged, which fits the native module, the one this PR changes.
What I ran
Head
3a1d204d60merged ontomain78e4248fea(clean merge), Windows 11, WinLibs GCC 15.2.0, Release,BUILD_TESTING=ON:guest_ajm,guest_ajm_aac_multichannel,guest_ajm_vibrationandguest_ajm_wvorbispass, 4 of 4;main'score/libs/prx/libSceAjm.native/src/Ajm.cpp,guest_ajmaborts and the other three pass;check_conventions.pypasses;pr_overlap.py --branchfinds no PR sharing lines or exports among those it could compare (2 conflict withmain).Approving.
AI-assisted: yes (Claude Code)