fix(libSceNKWebKit): validate guest pointers in WtfStringDump exports #27946
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27946"
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-27T21:58:48Z.
What
Validate guest pointers in
WTF::printInternal(PrintStream&, const StringImpl*)andWTF::URL::dump(PrintStream&)incore/libs/prx/libSceNKWebKit/src/WtfStringDump.cpp:WTF::URL,WTF::StringImplheaders and character buffers throughGuestCopyIn_nid_no_patchinto host-ownedWTF::Stringcopies before invokingStringImpl::utf8, preservingstd::invalid_argumenton null character storage and leaving guest refcounts untouched.WTF::PrintStreamvtable pointers and required dispatch slots (PrintStreamVprintf,PrintStreamBegin,PrintStreamEnd) throughGuestCopyIn_nid_no_patchwith address-overflow checks for both the outer stream and the inner stream returned byBegin, callingNotImplementedAt_nid_no_patchon unmapped, unreadable, or null-slot guest memory.docs/dev/debt/changes/fix-libSceNKWebKit-wtf-string-dump-guest-pointers.mdand add guarded-page and split-page regression coverage incore/libs/prx/libSceNKWebKit/tests/WtfStringDump.cpp.Tested
/mnt/sas-ssd/AnyPS5-work/agy/build-spec):TestGuestPointers()againstorigin/mainWtfStringDump.cpp):ctest --test-dir build-spec -R '^nkwebkit_wtfstringdump$' --output-on-failure-> failed withSEGFAULT.b64065cf87c):ctest --test-dir build-spec -R '^nkwebkit_wtfstringdump$' --output-on-failure-> 1/1 passed (0.01 sec).python3 tools/guest_pointer_audit.py libSceNKWebKit: 0 hits inWtfStringDump.cpp.python3 tools/check_conventions.py --base origin/main: All conventions checks passed.python3 tools/pr_overlap.py --branch fix/libSceNKWebKit-wtf-string-dump-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-27T22:01:02Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
b64065cf87:tools/check_conventions.pypassed.nkwebkit_wtfstringdump_testsbuilt cleanly.nkwebkit_wtfstringdump):core/libs/prx/libSceNKWebKit/src/WtfStringDump.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-27T22:05:14Z.
Review: COMMENTED
Actionable comments posted: 1
1c69e3fc-fa12-46d8-a3ca-e518a82fb92bReviewing files that changed from the base of the PR and between
680d66c1b0andb64065cf87.core/libs/prx/libSceNKWebKit/src/WtfStringDump.cppcore/libs/prx/libSceNKWebKit/tests/WtfStringDump.cppdocs/dev/debt/changes/fix-libSceNKWebKit-wtf-string-dump-guest-pointers.mdLimit details: You’ve used all 10 included reviews currently available.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-27T22:28:36Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
fd781cd5e9:tools/check_conventions.pypassed.nkwebkit_wtfstringdump_testsbuilt cleanly.nkwebkit_wtfstringdump):core/libs/prx/libSceNKWebKit/src/WtfStringDump.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 Plyxen on 2026-11-28T05:39:32Z.
Review: APPROVED
Checked head
fd781cd5e9. All on Windows 11 with WinLibs GCC 15.2 (Release), applied tomain4c7578e0a4together with #27997, #27996, #27978, #27975, #27973, #27971, #27969, #27967, #27964, #27958, #27950, #27949, #27945, #27943, #27938, #27936.tools/check_conventions.py --headandtools/debt_fold.py --checkpassed and the full build succeeded.nkwebkit_wtfstringdumppasses. 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:15:05Z.
Review: COMMENTED
Reviewed — comments
This review covers head
fd781cd5e9027b4715526e9fba696ee08305476f; the reported Linux test results are author-supplied and were not run here.What I ran
No commands were run. I read the prepared diff and all three changed files through the pinned reader, plus targeted context in
General.cpp,WtfString.cpp, andWtfStringAbi.hpp.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The PR description reports a passing Linux x86_64 Release test and convention checks, but those results were not independently verified. Console behavior remains unmeasured as stated in the added debt note.
files.jsonwas unavailable, so I could not compare files read against its reviewed list. No changed files were excluded according to the manifest; all three listed changed files were read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T08:12:50Z.
Review: COMMENTED
The WTF string dump fixture verified that invalid input produces no output before a valid control call writes the expected characters. Guarded stream and string cases passed.
I ran the exact fixture and changed translation unit in a focused Linux build linked against the project’s guest libraries.
AI-assisted: yes.