test(libc): stop the sce v2 thrower cases reading past an 8-byte exception object #10829
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10829"
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 MarcZX10 on 2026-10-25T03:18:42Z.
What
guest_sce_v2_exceptionsread 16 bytes of every caught object in its inspection hook, but the plain throwers (such as_Xbad_alloc) allocate onlysizeof(void*)bytes for the exception object. AddressSanitizer reports a 16-byte heap-buffer-overflow read inSceV2Inspect. The thrower cases only compare the type name and message, so the hook now copies the pointer size for them and restores the full size afterwards. Test-only change, one commit; no product code changes.Tested
Linux x86-64 (Debian 12, GCC 12), ASan+UBSan build. On current
mainguest_sce_v2_exceptionsfails withheap-buffer-overflow ... READ of size 16; with this change it passes.python3 tools/check_conventions.py --base upstream/main --head HEADandgit diff --check upstream/mainpass. Windows, macOS and hardware were not run.Rebase validation (2026-10-25)
Rebased the single test-only commit onto current
main451e21f4aea0e59ff60f2df0056184cc3c41d320; it applied cleanly and preserved the MarcZX10 author and committer.git diff --check upstream/main...HEADandpython3 tools/check_conventions.py --base upstream/main --head HEADpass. The ASan/UBSan runtime test was not rerun after this rebase. Local CMake configuration remains unavailable because the isolated worktree lacks initialized SDL2 and this host lacks XRandR development support; the earlier Linux ASan/UBSan result above is the previously reported run.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 THEMANnt on 2026-10-25T04:03:14Z.
Review: APPROVED
Reviewed
006b5839f52c83cf17174585dd896692adeb1253against25c1aa1e79329e0e2957b4fdd731144dad8be724. No actionable findings in this focused review.Source review: Inspected the complete change, SceV2Inspect/Run and subsequent copy checks. The thrower-only cases need the vtable-sized prefix, so reducing their memcpy length avoids reading a message pointer from smaller exception objects. Type and what() assertions still execute. The length is restored before CheckCopies, which retains its full object/message and system-error payload checks.
Validation: Exact head and baseline GuestSceV2Exceptions.cpp both pass MinGW GCC C++23 syntax compilation against their respective headers. Conventions, whitespace and script registration passed. This is source and compilation evidence: no linked native test or sanitizer run was performed locally. Hosted metadata/conventions succeeded, but all product and relinker jobs were skipped; their workflow success is not a runtime test pass.
Scope: Approval covers the bounded test-only read-length correction and preservation of adjacent assertions. It does not claim native exception execution or an ASan reproduction.