fix(libSceSysmodule): guard handle in sceSysmoduleMapLibcForLibkernel with HostWrite #28900
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28900"
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:49:05Z.
What
sceSysmoduleMapLibcForLibkernelchecked itshandleout-pointer withGuestWritableonly. The test adds aHostWritehook case for 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_sysmodule: 3/3 passed (guest_sysmodule,guest_sysmodule_maps_scan,guest_sysmodule-invalid-ids). WithExport.cppreverted tomainguest_sysmoduleaborts.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:55:30Z.
Review: COMMENTED
Actionable comments
e18df791-6383-4021-bd43-6071bdf3ce5fReviewing files that changed from the base of the PR and between
8037ad561dand2ac586ccf6.core/libs/prx/libSceSysmodule/Export.cppcore/libs/tests/GuestSysmodule.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T15:01:41Z.
Review: APPROVED
Reviewed — looks good
The changed pointer check preserves
errno, rejects an invalid handle pointer, and has focused test coverage in the prepared source.What I ran
Reviewed head
c87fb163992f0a9b72e5397ac2691b6652c18c0ausing the prepared diff and full changed-file texts. Arepo_read.pysearch forsceSysmoduleMapLibcForLibkernelsucceeded; later reader calls could not run because the reader could not write its log in the read-only workspace. No tests were run. The author reports Linux x86_64 tests and a reverted-code negative control; those results were not independently verified.Files read:
core/libs/prx/libSceSysmodule/Export.cppandcore/libs/tests/GuestSysmodule.cpp.files.jsonlists no excluded files.Results
Negative control
I did not run a negative control or alter the code under test. The author reports that reverting the change caused
guest_sysmoduleto abort; this was not independently verified.Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
Windows, macOS, console behavior, and the author-reported test and negative-control results were not verified. Further repository context reads were unavailable because the reader could not write its log.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-04T15:47:30Z.
Review: APPROVED
Verified head
c87fb16399on Windows 11 with GCC 15.2, applied to main484b0368d3.guest_sysmodule: passes on main, and passes with this PR.Export.cppreverted and the new test block kept,guest_sysmoduleaborts. The rest of the test passes on main, so the failure comes from the added hook-count anderrnochecks.errnois restored after the guarded probe, and the valid&libcHandlecall later in the test still returns 0 with the guard in place. The invalid pointer still throws theruntime_error, as before. My own #28726 changesGuestWritable_nid_no_patchto accept watched pages; this guard is correct with or without it.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.