fix(libc): guard FloatingPrefix guest write checks with HostWrite #28246
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28246"
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-11-29T12:08:42Z.
What
core/libs/prx/libc/src/FloatingPrefix.cpp(ParsePrefix) checked the guestcursorandendpointers viaGuestWritable_nid_no_patchwithout an enclosingGuestArena::HostWriteguard.GuestArena::HostWritebefore each writability check and fail whenguard.Open()is false; hosterrnois still restored afterwards.endonly after thecursorcheck succeeded.core/libs/tests/GuestFloatingPrefix.cppwithHostWritehook tests covering read-onlycursor/end, valid outputs anderrnopreservation.Tested
Linux (Distrobox build):
ctest -R guest_floating_prefixpassed (4/4, narrow/wide unpatched and patched);python3 tools/check_conventions.pypassed;python3 tools/pr_overlap.py --branchreported 0 overlapping open PRs. Windows: not tested.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)Summary by CodeRabbit
errnoand return the expected results.Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-29T12:11:23Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
647a8a04c9:tools/check_conventions.pypassed.guest_floating_prefix_testsbuilt cleanly.guest_floating_prefix_narrow,guest_floating_prefix_narrow_patched,guest_floating_prefix_wide,guest_floating_prefix_wide_patched):core/libs/prx/libc/src/FloatingPrefix.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T12:26:59Z.
Review: COMMENTED
Reviewed — no blocking findings
The change appears sound from the code reviewed; the reported tests were not run here, so a formal approval is not justified.
What I ran
Reviewed head
647a8a04c9d1f19c64fcc9b615656a563f043ef8usingrepo_read.pyto inspect the prepared diff and changed files. No build or tests were run. The base ismain; no merged-preview check was run.Results
Negative control
Not run. No test change was made during this review.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
Builds and tests were not run. The Linux test and conventions results in the PR description are author-reported. Windows behavior is not verified. Both changed files listed in the manifest were read; no excluded files were identified there. The separate excluded-file inventory was unavailable.
To get this to a good state
Nothing is required. Optional: run the reported Linux checks and Windows tests when available.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T06:32:25Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the modified pointer checks are guarded with
HostWrite, and the added tests cover read-only outputs anderrnopreservation.What I ran
Reviewed head
6298404039a46b2cfaf0540f45862661539b86b0usingrepo_read.pyto inspect the prepared diff and targeted source context. No commands or tests were run by the reviewer.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports
ctest -R guest_floating_prefixpassed (4/4),python3 tools/check_conventions.pypassed, andpython3 tools/pr_overlap.py --branchfound no overlapping open PRs; these were not run during this review. Windows behavior was not tested. Read:core/libs/prx/libc/src/FloatingPrefix.cpp,core/libs/tests/GuestFloatingPrefix.cpp, plus targeted context incore/libs/prx/libc/include/GuestArena.hpp,core/libs/prx/libc/src/General.cpp, andcore/libs/prx/libc/src/GuestArena.cpp. No changed files were excluded; both files listed in the manifest were read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T06:43:15Z.
Review: COMMENTED
Ran all four floating-prefix CTests on Linux. The narrow and wide variants passed with both patched and unpatched libc, including the added guest write-watch output case.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T15:51:38Z.
Review: APPROVED
I read the diff at
c9627469d6. Windows 11 with GCC 15.2 and Linux (Ubuntu 24.04 in WSL2, GCC 13.3), merged intomainatc1593e4e1ddtogether with other open PRs (so not an isolated build).guest_floating_prefixtests: pass on both.main's): all four fail with "hostwrite readonly cursor hits".Not checked: a page that the GPU write watch really protects: the test counts the write brackets.
AI-assisted: yes (Claude Code)