fix(libSceNKWebKit): validate guest pointers in ResourceRequestBase exports #27973
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27973"
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 JJenkx on 2026-11-27T23:47:58Z.
What
Validate guest memory reads and writes across all 55
WebCore::ResourceRequestBaseexports incore/libs/prx/libSceNKWebKit/src/ResourceRequest.cpp:ResourceRequestBase*,LegacyResourceRequestBase*,FormData**,HTTPHeaderMap*,FormData*refcount updates) with activeGuestArena::HostWritescopes checkingGuestWritable_nid_no_patchand required readability, preserving existing null-argumentstd::invalid_argumentbehavior.GuestArenaPrepareHostRead_nid_no_patch+GuestReadable_nid_no_patch) beforeGuestCopyIn_nid_no_patchfor request structs,WTF::URL/WTF::String/StringImplheaders and character buffers,FormDataheaders and byte/element storage,HTTPHeaderMapand fallback array vector buffers, andResourceResponseStatusLayout::httpStatusCode(usingoffsetofinredirectedRequest).guest_pointer_audit.pyhits insrc/ResourceRequest.cpp(setHTTPBody,partitionName,setHTTPHeaderFields,redirectedRequest).TestGuestPointers) incore/libs/prx/libSceNKWebKit/tests/ResourceRequestBaseOps.cppand record the unmeasured console fault behavior indocs/dev/debt/changes/fix-libSceNKWebKit-resource-request-guest-pointers.md.Tested
TestGuestPointerstests inResourceRequestBaseOps.cppagainst unmodifiedResourceRequest.cpp):nkwebkit_resourcerequestbaseopsfailed with***Exception: SegFault(0/1 passed).nkwebkit_resourcerequest*test targets with 0 warnings onResourceRequest.cpp;ctest -R '^nkwebkit_resourcerequest'passed (8/8,0.24 sec).python3 tools/guest_pointer_audit.py libSceNKWebKitreports 0 direct guest pointer accesses insrc/ResourceRequest.cpp.python3 tools/check_conventions.py --base origin/mainpassed.python3 tools/pr_overlap.py --branch fix/libSceNKWebKit-resource-request-guest-pointers:No 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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-27T23:49:38Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
529043aa5c:tools/check_conventions.pypassed.nkwebkit_resourcerequestbaseops_testsbuilt cleanly.nkwebkit_resourcerequestbaseops):core/libs/prx/libSceNKWebKit/src/ResourceRequest.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 coderabbitai[bot] on 2026-11-27T23:58:18Z.
Review: COMMENTED
Actionable comments posted: 7
2ecd2f94-793e-481b-9ed6-913ed6ae5da8Reviewing files that changed from the base of the PR and between
f1fbda2a71and529043aa5c.core/libs/prx/libSceNKWebKit/src/ResourceRequest.cppcore/libs/prx/libSceNKWebKit/tests/ResourceRequestBaseOps.cppdocs/dev/debt/changes/fix-libSceNKWebKit-resource-request-guest-pointers.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-28T03:30:51Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
0ad9e107e8:tools/check_conventions.pypassed.nkwebkit_resourcerequestbaseops_testsbuilt cleanly.nkwebkit_resourcerequestbaseops):core/libs/prx/libSceNKWebKit/src/ResourceRequest.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 coderabbitai[bot] on 2026-11-28T03:38:31Z.
Review: COMMENTED
Actionable comments posted: 1
6554bc30-522c-4ba2-b43a-d745fc66e29bReviewing files that changed from the base of the PR and between
529043aa5cand0ad9e107e8.core/libs/prx/libSceNKWebKit/src/ResourceRequest.cppcore/libs/prx/libSceNKWebKit/tests/ResourceRequestBaseOps.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 Plyxen on 2026-11-28T05:39:12Z.
Review: APPROVED
Checked head
0ad9e107e8. All on Windows 11 with WinLibs GCC 15.2 (Release), applied tomain4c7578e0a4together with #27997, #27996, #27978, #27975, #27971, #27969, #27967, #27964, #27958, #27950, #27949, #27946, #27945, #27943, #27938, #27936.tools/check_conventions.py --headandtools/debt_fold.py --checkpassed and the full build succeeded.nkwebkit_resourcerequestbaseopspasses. In the full CPU suite (5,131 tests) the only failures are unrelated:windows_read_trap_unknownfails onmaintoo (fixed in #28028), andframe_capture_minimizeis a timeout under load that passes on its own.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T08:24:28Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected portions show no verified blocking defect, but the full source review and checks were not completed, so a formal approval is not justified.
What I ran
Reviewed head
0ad9e107e830df5f2034beb205200f655103c496using the prepared review bundle and pinned repository reader; no commands or tests were run.Results
Findings
Blocking
None verified in the inspected portions.
Non-blocking
None.
Not verified
ResourceRequest.cpplines 181–399 were not read, so the review does not cover the entire changed implementation. No tests or prechecks were run. Linux test results and audit results in the PR description are author-reported, not independently confirmed. All three changed files listed in the manifest were read at least in part; the source file was only partially read.To get this to a good state
Nothing is required. Optional: complete review of the unread source section and run the reported checks on this head before treating this review as approval.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T08:12:39Z.
Review: COMMENTED
The request fixture exercised read-only request state, rejected changes to URL and header fields, and verified that a failed body update leaves the caller’s incoming reference and the old body unchanged.
I ran the exact fixture and changed translation unit in a focused Linux build linked against the project’s guest libraries.
AI-assisted: yes.
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.