fix(libSceUserService): guard nameList and count with HostWrite #28899
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28899"
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 NobleBrains on 2026-12-04T14:47:37Z.
What
sceUserServiceGetUserGroupNameListcheckedcountandnameListwithGuestWritableonly. The test counts theHostWritecalls (at least two) and checks thaterrnosurvives a hook that changes it.The pointer is now checked through
GuestArena::HostWritefirst, as in the merged #28246 and #28267: the result ofOpen()is not ignored,errnois saved and restored, and the guard covers only the check. Behaviour for writable pointers is unchanged.Tested
On Linux x86_64 (Release, container),
ctest -R '^guest_user_service$': 1/1 passed. WithExport.cppreverted tomainthe same test aborts.check_conventions.pypasses.Not run: Windows, macOS and any title.
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
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-04T14:53:39Z.
Review: COMMENTED
Actionable comments
906101c0-9951-4588-ae60-2cbd00358acdReviewing files that changed from the base of the PR and between
8037ad561dandaafaa76031.core/libs/prx/libSceUserService/Export.cppcore/libs/tests/GuestUserService.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T15:07:42Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
aafaa760318e0e28a0b1c6f4b633a2133a5852e1. I inspected the changed hunks, the affected function, and theHostWriteand guest-copy helpers withrepo_read.py. No tests or builds were run; the Linux test and conventions check in the description are author-reported.Results
Negative Control
Not run; no test was executed.
Findings
Blocking
None.
Non-blocking
GuestCopyOut_nid_no_patchcalls also invoke the HostWrite hook for both output buffers. ThushostWriteCalls >= 2can pass even if the added checks are removed. Consider asserting that the hook observes each expected pointer during a path that returns before copying outputs. Changed test lineSources
Not verified
The remainder of both changed files was not read. No tests were run on this head; Windows, macOS, and console behavior were not verified. The prepared manifest lists two reviewed files and no excluded files.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T15:30:22Z.
Review: APPROVED
Reviewed — looks good
The reviewed change at
b23d7f3aba062adb3c38aabd66e32ce301906930correctly guards both output buffers and preserveserrno; I found no blocking defects.What I ran
Read the prepared diff and both changed files, then used
repo_read.pyat the pinned head to inspectHostWrite,GuestWritable_nid_no_patch, the function’s output-copy path, and related test call sites. No tests or builds were run. The author reportsctest -R '^guest_user_service$'andcheck_conventions.pypassed; those results were not independently verified.Results
Negative control
Not run; no source was changed for a negative control.
Findings
Blocking
None.
Non-blocking
None.
Sources
Export.cppat the reviewed head: both guards are opened before the writability checks, anderrnois restored before the result is returned.GuestArena.hppat the reviewed head:HostWritecloses only an opened guard.GuestUserService.cppat the reviewed head: the test checks the two target addresses, sizes, and preservederrno.Not verified
No tests, builds, other host operating systems, or console/title behavior were run. The only changed files reviewed were
core/libs/prx/libSceUserService/Export.cppandcore/libs/tests/GuestUserService.cpp;files.jsonlists no exclusions.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-04T15:32:05Z.
Review: COMMENTED
Actionable comments
f498f43f-6143-4995-980e-5a62c36a332eReviewing files that changed from the base of the PR and between
aafaa76031andb23d7f3aba.core/libs/tests/GuestUserService.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-04T15:47:32Z.
Review: APPROVED
Verified head
b23d7f3abaon Windows 11 with GCC 15.2, applied to main484b0368d3.guest_user_service*: 15 of 15 pass on main, and 15 of 15 pass with this PR, including the new checks that the twoHostWriteranges are exactly&groupNameCountandgroupNameListwith their sizes.Export.cppreverted and the test kept,guest_user_servicefails. The other 14 still pass.errnois saved before both probes and restored after them, so the hook's clobbering does not leak to the caller.AI-assisted: yes (Claude Code)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.