test(relinker): cover augmentation length overflow in eh_frame CIE record #14573

Merged
slopgobblercobbler merged 2 commits from upstream-pr/14573 into main 2026-11-25 01:54:37 +00:00
slopgobblercobbler commented 2026-11-01 15:53:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by slopgobblercobbler on 2026-11-01T15:53:52Z.


What

Adds unit tests for DWARF .eh_frame CIE record with augmentation data length exceeding record boundary rejection in UnwindRecordBoundsTests.cpp.

Tested

  • Built and ran unwind_record_bounds_tests: all 84 cases passed.
  • Ran python tools/check_conventions.py --base upstream/main --head HEAD: 0 findings.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5108978601 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14573). Originally posted by [slopgobblercobbler](https://github.com/slopgobblercobbler) on 2026-11-01T15:53:52Z. --- ### What Adds unit tests for DWARF .eh_frame CIE record with augmentation data length exceeding record boundary rejection in UnwindRecordBoundsTests.cpp. ### Tested - Built and ran unwind_record_bounds_tests: all 84 cases passed. - Ran python tools/check_conventions.py --base upstream/main --head HEAD: 0 findings. ### Checklist - [x] Based on current main; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation .md files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
BunnyFl commented 2026-11-02 01:26:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T01:26:44Z.

Review: APPROVED


Windows 11, WinLibs GCC 15.2.0 r7, relinker-only Release. Head ad05d1f435 merged into upstream/main 93dbd0f82a:

  • unwind_record_bounds_tests: 32 unwind record cases passed.
  • Mutation check: with the position > end || size > end - position check in EhFrameReader.cpp:184 disabled, this branch's test fails (exit 1), while main's still passes. Both the single-byte and the two-byte LEB128 length reach the check, and the fresh cieAugLoad/cieAugEh headers keep it independent of the earlier cases.

Heads-up: #14513 and #14527 replace the same "30 unwind record cases passed" line, so this will conflict with whichever merges first.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5731231065 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14573#pullrequestreview-5731231065). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-02T01:26:44Z. **Review:** APPROVED --- Windows 11, WinLibs GCC 15.2.0 r7, relinker-only Release. Head ad05d1f435 merged into upstream/main 93dbd0f82a: - `unwind_record_bounds_tests`: `32 unwind record cases passed`. - Mutation check: with the `position > end || size > end - position` check in `EhFrameReader.cpp:184` disabled, this branch's test fails (exit 1), while main's still passes. Both the single-byte and the two-byte LEB128 length reach the check, and the fresh `cieAugLoad`/`cieAugEh` headers keep it independent of the earlier cases. Heads-up: #14513 and #14527 replace the same `"30 unwind record cases passed"` line, so this will conflict with whichever merges first.
MarcZX10 commented 2026-11-02 04:49:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T04:49:57Z.

Review: COMMENTED


Reviewed — no blocking findings

The two new cases feed the relinker's eh_frame reader a CIE whose augmentation data runs past the record, and expect the message "CIE augmentation exceeds record". The reader throws that message (EhFrameReader.cpp line 185), and the test checks the substring, so it fails for a different rejection. The relinker jobs passed at this head.

What I ran

  • Head ad05d1f4358a0200bdb98275a369a7eac9ad65c4; base f2d874c1fdccf781c0fa5d86619bb5dd8894b958. 1 file, +32/-1: core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp (test-only).
  • Read the full diff and the reader's message (EhFrameReader.cpp line 185 at base).
  • Read-only checks from the trusted main checkout (precheck not run: this session does not run code from PR heads): diff check, conventions, and the ABI audit (no export changed).
  • Hosted: the relinker ubuntu g++, windows g++, asan and macOS jobs passed; the main windows job was skipped.
  • No MarcZX10 review at this head.

Results

Check Result Note
Diff check passed
Conventions and PR template passed conventions check from the main checkout
Mergeability and dependencies passed depends on none; the stack check passed
Message the reader throws passed "CIE augmentation exceeds record" (line 185)
Test matches the message by substring passed read in the diff
Relinker jobs (hosted) passed ubuntu g++, windows g++, asan and macOS all passed
Whether those jobs run this file not confirmed the logs were not read
ABI audit not applicable no exported symbol changed
Build and runtime tests not run no local build
Negative controls not run no local build
Hosted CI passed relinker jobs passed; the main windows job was skipped
Read-only check output

Precheck was not run: this session does not run code from PR heads. Hosted: gh api repos/boykopovar/AnyPS5/commits/ad05d1f4358a0200bdb98275a369a7eac9ad65c4/check-runs.

Negative control

Not run here. A negative control needs a build, and code from this head is not run here.

Findings

Blocking

None.

Non-blocking

None.

Sources

Not verified

  • Whether the relinker jobs run UnwindRecordBoundsTests was not confirmed.

To get this to a good state

  • Nothing to change.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5732199806 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14573#pullrequestreview-5732199806). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T04:49:57Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The two new cases feed the relinker's `eh_frame` reader a CIE whose augmentation data runs past the record, and expect the message "CIE augmentation exceeds record". The reader throws that message (`EhFrameReader.cpp` line 185), and the test checks the substring, so it fails for a different rejection. The relinker jobs passed at this head. ## What I ran - Head `ad05d1f4358a0200bdb98275a369a7eac9ad65c4`; base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958`. 1 file, +32/-1: `core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp` (test-only). - Read the full diff and the reader's message (`EhFrameReader.cpp` line 185 at base). - Read-only checks from the trusted main checkout (precheck not run: this session does not run code from PR heads): diff check, conventions, and the ABI audit (no export changed). - Hosted: the relinker ubuntu g++, windows g++, asan and macOS jobs passed; the main windows job was skipped. - No MarcZX10 review at this head. ## Results | Check | Result | Note | | --- | --- | --- | | Diff check | passed | | | Conventions and PR template | passed | conventions check from the main checkout | | Mergeability and dependencies | passed | depends on none; the stack check passed | | Message the reader throws | passed | "CIE augmentation exceeds record" (line 185) | | Test matches the message by substring | passed | read in the diff | | Relinker jobs (hosted) | passed | ubuntu g++, windows g++, asan and macOS all passed | | Whether those jobs run this file | not confirmed | the logs were not read | | ABI audit | not applicable | no exported symbol changed | | Build and runtime tests | not run | no local build | | Negative controls | not run | no local build | | Hosted CI | passed | relinker jobs passed; the main windows job was skipped | <details><summary>Read-only check output</summary> Precheck was not run: this session does not run code from PR heads. Hosted: `gh api repos/boykopovar/AnyPS5/commits/ad05d1f4358a0200bdb98275a369a7eac9ad65c4/check-runs`. </details> ## Negative control Not run here. A negative control needs a build, and code from this head is not run here. ## Findings **Blocking** None. **Non-blocking** None. ## Sources - Reader message: https://github.com/boykopovar/AnyPS5/blob/f2d874c1fdccf781c0fa5d86619bb5dd8894b958/core/relinker/relinker/src/analysis/UnusedNidFilter/EhFrameReader.cpp#L185 - Changed test: https://github.com/boykopovar/AnyPS5/blob/ad05d1f4358a0200bdb98275a369a7eac9ad65c4/core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp ## Not verified - Whether the relinker jobs run `UnwindRecordBoundsTests` was not confirmed. ## To get this to a good state - Nothing to change.
MarcZX10 commented 2026-11-21 09:33:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T09:33:51Z.

Review: COMMENTED


Reviewed — no blocking findings

The added test exercises a multi-byte CIE augmentation length that exceeds the remaining record, and the parser rejects that boundary condition; execution checks were not available in this review environment.

What I ran

Reviewed head c7e08ffd24366d84bcbee389037b41fdb0d24270 using the repository reader. No build or test command was run.

Results

Check Result Note
Diff and changed test review passed One changed file read
Test execution not run No shell available
Negative control not run Could not run test

Findings

Blocking

None.

Non-blocking

None.

Sources

Not verified

The author reports that all 84 test cases passed and the conventions check found no issues; these were not run by me. Only core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp was read from the reviewed files; no files were excluded by the manifest.

To get this to a good state

Nothing is required. Optional: run the reported test and conventions checks on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6004418198 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14573#pullrequestreview-6004418198). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T09:33:51Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The added test exercises a multi-byte CIE augmentation length that exceeds the remaining record, and the parser rejects that boundary condition; execution checks were not available in this review environment. ## What I ran Reviewed head `c7e08ffd24366d84bcbee389037b41fdb0d24270` using the repository reader. No build or test command was run. ## Results | Check | Result | Note | |---|---|---| | Diff and changed test review | passed | One changed file read | | Test execution | not run | No shell available | | Negative control | not run | Could not run test | ## Findings ### Blocking None. ### Non-blocking None. ## Sources - [Changed test at the reviewed commit](https://github.com/boykopovar/AnyPS5/blob/c7e08ffd24366d84bcbee389037b41fdb0d24270/core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp#L1014-L1029) - [CIE augmentation record-bound check at the reviewed commit](https://github.com/boykopovar/AnyPS5/blob/c7e08ffd24366d84bcbee389037b41fdb0d24270/core/relinker/relinker/src/analysis/UnusedNidFilter/EhFrameReader.cpp#L181-L202) ## Not verified The author reports that all 84 test cases passed and the conventions check found no issues; these were not run by me. Only `core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp` was read from the reviewed files; no files were excluded by the manifest. ## To get this to a good state Nothing is required. Optional: run the reported test and conventions checks on this head.
MarcZX10 commented 2026-11-23 02:01:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T02:01:52Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this test-only change; the added case exercises a multi-byte augmentation length that exceeds the CIE record boundary.

What I ran

Reviewed head 24bee4be99f5ff72dce6b549858e8b8bd954b288. No commands or tests were run in this review.

Results

Check Result Note
Changed lines reviewed passed All 16 added lines read
Tests and conventions check not run Results in the PR description are author-reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

Tests and convention checks were not run by this review. The PR description reports 84 test cases passed and zero convention findings; this review did not verify those results. The only changed file was read: core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp. No changed files were excluded.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6015791918 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14573#pullrequestreview-6015791918). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-23T02:01:52Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this test-only change; the added case exercises a multi-byte augmentation length that exceeds the CIE record boundary. ## What I ran Reviewed head `24bee4be99f5ff72dce6b549858e8b8bd954b288`. No commands or tests were run in this review. ## Results | Check | Result | Note | |---|---|---| | Changed lines reviewed | passed | All 16 added lines read | | Tests and conventions check | not run | Results in the PR description are author-reported | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Tests and convention checks were not run by this review. The PR description reports 84 test cases passed and zero convention findings; this review did not verify those results. The only changed file was read: `core/relinker/relinker/tests/UnwindRecordBoundsTests.cpp`. No changed files were excluded. ## To get this to a good state Nothing is required.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!14573
No description provided.