fix(libSceHttp2): copy status output through guest memory #25663
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/25663"
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 malekaifa on 2026-11-22T13:55:22Z.
What
sceHttp2GetStatusCodepassed its guest output pointer directly into the transport, so a non-null inaccessible guest address could fault while publishing an otherwise valid status. Receive the transport status into a host local first, then publish it with the existing errno-preservingHttp2Guest::Storehelper. Existing invalid-id, null-pointer, transport-state and transport-error behavior is otherwise unchanged.Tested
Windows, MSYS2 UCRT64 GCC 16.2.0, Release,
BUILD_TESTING=ON.24836104d0f845d52f858c5f043aac1641e2846e:guest_http2_guest_pointersaccess-violated on a write to guest address0x10and CTest exited 8.guest_http2_guest_pointer_testsbuilt andguest_http2_guest_pointerspassed 1/1.c9bf4612bc60fe940d28f3208e879fd76cc0c054,guest_http2_guest_pointers,guest_http2, and all fourguest_http2_offline_*tests passed 6/6.python tools/check_conventions.py --base origin/mainpassed;git diff --check origin/main...HEADpassed.python tools/pr_overlap.py --branch prime-f/http2-status-guest-output-20261122 --jobs 16checked all 2,384 open PRs and reportedNo overlap with open pull requests.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 copilot-pull-request-reviewer[bot] on 2026-11-22T13:55:37Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-22T13:59:04Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
36c8f92b34:tools/check_conventions.pypassed.guest_http2_guest_pointer_testsbuilt cleanly.guest_http2_guest_pointers):core/libs/prx/libSceHttp2/Export.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.sceHttp2GetStatusCodein core/libs/prx/libSceHttp2/Export.cpp:270-278 handles nullptrstatus_codeby delegating torequest->Status(status_code)to preserve the existing transport status return behavior.Http2Guest::Store(status_code, status)returningERROR_NULL_POINTER(0x817B1225) on inaccessible guest addresses without crashing.ERROR_INVALID_ID(0x817B1100) first before interacting withrequestor pointers.RequireErrno(sceHttp2GetStatusCode(request, static_cast<int*>(unmapped)), nullPointer).Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by throny on 2026-11-22T14:04:51Z.
Review: APPROVED
Review: ✅ correct; three sibling exports still write through guest pointers
Basis: code read · head
36c8f92b34Checked
main,Request::Statuswrites*statusstraight through the guest pointer (Transport.cpp:1314,:1318), so an unmapped or read-only non-null pointer faults the host. Copying throughHttp2Guest::Storematches the sibling exports (Export.cpp:432,596,604,611,614).ERROR_INVALID_IDis still checked first, and a null output still reachesStatusunchanged.GuestHttp2GuestPointers.cppfaults onmain; existing callers inGuestHttp2.cpp/GuestHttp2Transport.cppuse valid pointers.Findings
Request::ContentLength(*kind,*length,Transport.cpp:1328-1329),Request::HeadersandRequest::TrailingHeaders(*header,*size,:1343-1348) still write straight through guest pointers forsceHttp2GetResponseContentLengthand the two header exports. A follow-up would close them.0x817B1225for an unwritable output follows this file's convention; the only console-backed instance indocs/dev/debt/libSceHttp2.mdissceHttp2GetCookieBox's null case, so for this export it's inferred. Worth a word in the description.Suggested action: merge.
AI-assisted review (Claude Code) · head
36c8f92b34· basemain337a948bf1Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T14:18:43Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; it stages the status in host memory and uses the guest-memory helper to publish it, with a regression assertion for an unmapped destination.
What I ran
Reviewed head
36c8f92b3466a8f22d7135e729a36ec4e0cbee89. I readdescription.md,commits.md,manifest.json,diff.patch, and both changed files plus the targetedGuestAccess.hpp,Transport.cpp, andTransport.hppcontext. All files listed underreviewedinfiles.jsonwere read. I did not run commands or tests; the described Windows test results are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run the build, tests, convention check, diff check, or PR overlap check. The review bundle listed two changed files and included both; no excluded files were reported.
To get this to a good state
Nothing is required.