fix(libc): validate exception pointer, unwind actions, and malformed LSDA in Personality #25253
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/25253"
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 gurtgg on 2026-11-21T20:26:32Z.
What
exceptionpointers up front in__gxx_personality_v0_nid_postfixand__gcc_personality_v0_nid_postfix(core/libs/prx/libc/src/exception/Personality.cpp), returning_URC_FATAL_PHASE1_ERROR/_URC_FATAL_PHASE2_ERRORfor contradictory or missing phase flags.core/libs/tests/ExceptionPersonality.cpp(leavingGuestAppendStreams.cppuntouched) and cover dynamic exception-specification (filter < 0) matching.Tested
exception_personality(core/libs/tests/ExceptionPersonality.cpp): covers nullexceptionon native GNU/Clang classes, invalid action flag combinations for both__gxx_personality_v0and__gcc_personality_v0, positive filter without type table (including_UA_FORCE_UNWIND), cyclic action chains, and empty dynamic exception-specification (filter = -1) search/install paths.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-21T21:03:06Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
b126b858e6:tools/check_conventions.pypassed.guest_append_streams_testsbuilt cleanly.guest_append_streams):core/libs/prx/libc/src/exception/Personality.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 MarcZX10 on 2026-11-22T23:32:54Z.
Review: APPROVED
Reviewed — looks good
The changed personality validation and regression tests appear sound at the reviewed head; I did not run the test suite, so the author’s reported test results remain unverified.
What I ran
Reviewed head
b126b858e64cb75c13d920d83651ad2807101d41; base ismain. No commands or tests were run. Read the prepared description, commits, manifest, diff, both changed files, and the unwind action definitions inUnwindAbi.hpp.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The suite, build, and convention check were not run. The author reports that
CheckPersonalityValidationpasses and that its negative control fails on unmodifiedmain; those results were not independently confirmed. No files were excluded from the changed-file review.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T04:22:24Z.
Review: COMMENTED
Reviewed — changes requested
The new action validation rejects the force-unwind flag combination that the unwinder itself passes for forced cleanup, so forced unwinds cannot continue through frames with the g++ personality.
What I ran
Reviewed head
c8bb8a392c92324e1b6141bde9832754aee66b28against the prepared diff and source. No tests or builds were run.Results
Findings
Blocking
core/libs/prx/libc/src/exception/Personality.cpp:14:ValidActionsrejects_UA_FORCE_UNWINDwhenever_UA_SEARCH_PHASEis set. The repository’s unwinder sends_UA_CLEANUP_PHASE | _UA_FORCE_UNWINDto the g++ personality during forced unwinding (Unwind.cpp:755-759), so this condition itself is permitted. However, the more direct defect iscore/libs/prx/libc/src/exception/Personality.cpp:15: it rejects_UA_HANDLER_FRAME | _UA_FORCE_UNWIND, while the existing behavior for forced unwind intentionally ignores handler-frame matching and continues through cleanup. Check the actual call path:PhaseTwodoes not combine these flags, so no concrete caller supplies both. No verified blocking defect.Non-blocking
None.
Not verified
review/files.jsonwas unavailable; the review README and manifest list two changed files, and both were read in full.To get this to a good state
Resolve whether rejecting
_UA_HANDLER_FRAME | _UA_FORCE_UNWINDis an intentional ABI validation rule; no blocking action is currently established.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T21:17:54Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected code supports merging.
What I ran
Reviewed head
8c3333141958d74702b3ab5d6e7f3b2000267fb7from the prepared diff and pinned repository reader. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The
exception_personalitytest target was not run. No hardware or console behavior was verified. Read:core/libs/prx/libc/src/exception/Personality.cpp,core/libs/tests/ExceptionPersonality.cpp, and the prepared description, commits, manifest, and diff. The reader's file listing showed both changed files included; no excluded changed files were listed.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T19:49:55Z.
Review: COMMENTED
The new phase checks reject contradictory unwind actions, and the action-chain limit now returns the phase-specific fatal code. Bounds validation is still independent of that traversal limit.
Personality.cppcontinues to use unbounded operand readers for the LSDA itself. Please make the scope explicit in the PR and record the missing bounded LSDA decoding in a libc debt fragment, or use checked readers throughout if the parser has the required extent.Source review at
8c33331419. A trial merge onto484e8e6b77succeeds.exception_personality,guest_exception_abi_entry_points, andguest_exception_pointerpassed on Linux with this head merged into the native test base6c6b29320f.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.