Repository navigation
fix(libSceUserService): reject a null account id output before the user check - #14862
Merged
oneandonlydean merged 1 commit intoNov 3, 2026
Conversation
…er check Firmware 13.42 libSceUserService.sprx returns INVALID_ARGUMENT (0x80960005) from sceUserServiceGetNpAccountId for a null output before it looks at the user, as BunnyFl showed with its disassembly and a native run with stubbed imports on boykopovar#12165. The UserService tests now expect INVALID_ARGUMENT for a null output with an unknown or logged-out user, and the debt entry names that source and the unmodelled not-initialized order. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
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.
|
BunnyFl
approved these changes
Nov 1, 2026
BunnyFl
left a comment
Contributor
There was a problem hiding this comment.
Reviewed at ed71528da4, merged locally into main 7fad683776 (clean merge; GitHub also reports it mergeable). Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0, Release, Ninja.
Firmware check (disassembly only, not run on a console). libSceUserService.sprx from firmware 13.42:
sceUserServiceGetNpAccountId(6dfDreosXGY,0x4940) is a tail call through a handler table at0x1c230, slot+0x10, with setting0x100inesiand the output inrdx.- That table is filled at
0x47d6from the static table at0x18000; its+0x10entry relocates to0x3e10:So once initialized, a null output returns3e17: mov 0x1c220(%rip),%rdi ; service object 3e1e: test %rdi,%rdi ; je -> mov $0x80960002,%eax ; ret 3e23: test %rcx,%rcx ; jne 0x410 ; the per-user query 3e2c: mov $0x80960005,%eax ; ret0x80960005before0x410looks at the user, as this PR does. - The only other writer of
0x1c230(0x1ad8, in the shared initialize body at0x1930) copies a caller-supplied table, and only when its fourth argument is non-null.sceUserServiceInitialize(0x2850) andsceUserServiceInitialize2(0x2880) both passrcx = 0; onlysceUserServiceInitializeForShellCore(0x28a0) passes one. So the0x3e10handler is the one titles get.
What I ran
ctest -R '^guest_user_service' --repeat until-fail:3:guest_user_service,guest_user_service_user_name,guest_user_service_lifecyclepass, 3 of 3 runs.- Negative control:
main'slibSceUserService/Export.cppwith this PR's test:guest_user_serviceaborts (0xc0000409). python tools/check_conventions.py --base upstream/main: passes.
The debt entry keeps the PS4 10.71 measurement for a non-null output, adds this source and records the unmodelled 0x80960002 gap. Looks good.
AI-assisted: yes (Claude Code)
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
sceUserServiceGetNpAccountIdnow returnsUSER_SERVICE_ERROR_INVALID_ARGUMENT(0x80960005) for a null output before it checks whether the user is logged in. Before, a user who is not logged in gotUSER_SERVICE_ERROR_UNKNOWN_USER(0x80960105) even with a null output. With a non-null output nothing changes: a user who is not logged in still gets 0x80960105 with the output untouched, and a logged-in user still gets account id 0.Behaviour source: firmware 13.42's
libSceUserService.sprx, read from its disassembly and run natively on x86-64 with its imports stubbed, not measured on a console: #12165 (comment). Its handler returns 0x80960002 while the module is not initialized, then 0x80960005 for a null output, and only after that looks at the user; once initialized, null-output calls returned 0x80960005 for users 0x10000000, 0x10000001, 1, 123, 255, -1 and 0. The non-null result for a user who is not logged in stays as measured on a PS4 Pro (firmware 10.71). The not-initialized check that comes first is not modelled; thesceUserServiceGetNpAccountIdentry indocs/dev/debt/libSceUserService.mdnow names this source and that gap.The four null-output calls in
core/libs/tests/GuestUserService.cppfor users that are not logged in now expectUSER_SERVICE_ERROR_INVALID_ARGUMENTinstead ofUSER_SERVICE_ERROR_UNKNOWN_USER.Tested
Microsoft Windows [Version 10.0.26300.9711], gcc 16.1.0 (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r4), cmake 4.0.3. Commit ed71528 on
mainat 5bae1a4. Not tested with a title.git submodule update --init --recursive --jobs 8 && cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBUILD_TESTING=ON -DPython3_EXECUTABLE=C:/Python314/python.exe && cmake --build build --parallel 4onmainat 5bae1a4: exit 0. After the changes,cmake --build build --parallel 4: exit 0, with noerror:orFAILED:lines.ctest --test-dir build -R '[Uu]ser_?[Ss]ervice' --no-tests=error --output-on-failure --timeout 60:guest_user_service,guest_user_service_user_nameandguest_user_service_lifecyclepassed, 3/3.python tools/check_conventions.py --base origin/main: "All conventions checks passed."python tools/pr_overlap.py --branch fix/libSceUserService-npaccountid-null-output: exit 2. It reported 15 open PRs that share files or exports with this branch and merged 15/15 into the base, but couldn't compare feat(libSceUserService): take the user name from ANYPS5_USER_NAME #9345 oncore/libs/prx/libSceUserService/Export.cppor docs(debt): separate entries with blank lines and drop derived export totals #14212 ondocs/dev/debt/libSceUserService.md, because both conflict withmain. I compared them by hand: inExport.cpp, feat(libSceUserService): take the user name from ANYPS5_USER_NAME #9345's only hunk is insceUserServiceGetUserName, and none of its changed lines mention the account id. In the debt file, docs(debt): separate entries with blank lines and drop derived export totals #14212 separates entries with blank lines and drops the derived export totals; none of its changed lines namesceUserServiceGetNpAccountId.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)🤖 Generated with Claude Code