fix(libSceNKWebKit): validate guest pointers in JscDumps exports #27945
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27945"
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:51:41Z.
What
Validate guest pointers in
JSC::CellAttributes::dumpandJSC::DOMJIT::HeapRange::dumpincore/libs/prx/libSceNKWebKit/src/JscDumps.cpp:CellAttributesandHeapRangeselfstructs throughGuestCopyIn_nid_no_patch.WTF::PrintStreamvtable pointers and required dispatch slots (PrintStreamVprintf,PrintStreamBegin,PrintStreamEnd) throughGuestCopyIn_nid_no_patchwith address-overflow checks for both the outer stream and any inner stream returned byBegin, callingNotImplementedAt_nid_no_patchon unmapped, unreadable, or null-slot guest memory while preservingstd::invalid_argumentfor nullself, nullout, nullvtable, and invalid enum values.docs/dev/debt/changes/fix-libSceNKWebKit-jsc-dumps-guest-pointers.mdand add guarded-page and split-page regression tests incore/libs/prx/libSceNKWebKit/tests/JscDumps.cpp.Tested
/mnt/sas-ssd/AnyPS5-work/agy/build-spec):TestGuestPointers()againstorigin/mainJscDumps.cpp):ctest --test-dir build-spec -R '^nkwebkit_jscdumps$' --output-on-failure-> failed withSEGFAULT.fa7bb2d2149):ctest --test-dir build-spec -R '^nkwebkit_jscdumps$' --output-on-failure-> 1/1 passed (0.01 sec).python3 tools/guest_pointer_audit.py libSceNKWebKit: 0 hits inJscDumps.cpp.python3 tools/check_conventions.py --base origin/main: All conventions checks passed.python3 tools/pr_overlap.py --branch fix/libSceNKWebKit-jsc-dumps-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-27T21:53:44Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
fa7bb2d214:tools/check_conventions.pypassed.nkwebkit_jscdumps_testsbuilt cleanly.nkwebkit_jscdumps):core/libs/prx/libSceNKWebKit/src/JscDumps.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 PrivacyOnion on 2026-11-27T22:29:09Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
aa6df6dd4b:tools/check_conventions.pypassed.nkwebkit_jscdumps_testsbuilt cleanly.nkwebkit_jscdumps):core/libs/prx/libSceNKWebKit/src/JscDumps.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:35Z.
Review: APPROVED
Checked head
aa6df6dd4b. 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, #27946, #27943, #27938, #27936.tools/check_conventions.py --headandtools/debt_fold.py --checkpassed and the full build succeeded.nkwebkit_jscdumpspasses. 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:14:14Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing in the inspected changes shows a verified defect; the candidate tests and checks were not run in this review.
What I ran
aa6df6dd4bd4c424c8c9afe118ed09f0a1e42502usingrepo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceNKWebKit/src/JscDumps.cpp,core/libs/prx/libSceNKWebKit/tests/JscDumps.cpp,docs/dev/debt/changes/fix-libSceNKWebKit-jsc-dumps-guest-pointers.md, plusreview/description.md,review/commits.md,review/manifest.json, andreview/diff.patch. No changed files were excluded from review.To get this to a good state
Nothing is required. Optional: run the candidate tests and checks on this exact head, and verify invalid guest-pointer behavior on console hardware.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T08:12:52Z.
Review: COMMENTED
The JSC dump fixture passed for valid output and for rejection of protected or split heap ranges and inaccessible print streams.
I ran the exact fixture and changed translation unit in a focused Linux build linked against the project’s guest libraries.
AI-assisted: yes.