test(relinker): audit eh_frame_hdr bounds and author fuzzer harnesses #15642
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15642"
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 slopgobblercobbler on 2026-11-03T22:49:20Z.
What
eh_frame_hdrbinary search table bounds inUnwindDescriptorNegativeBoundsTests.cpp, validating rejection of truncated segments, unsupported versions, omitted encodings, invalid frame counts, out-of-bounds tables, and verifying idempotent handling of duplicate search table entries.ElfParserFuzzer.cppandUnwindDescriptorFuzzer.cpp) underANYPS5_BUILD_FUZZERS(off by default) targeting ELF parsing and DWARF exception function reconstruction, catching onlyRelinkerException..eh_frame_hdrbinary search table bounds debt indocs/dev/debt/relinker.md.Tested
python tools/check_conventions.py --base upstream/main).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 adriadam10 on 2026-11-07T18:52:11Z.
Review: CHANGES_REQUESTED
The negative-bounds suites look reasonable. Points to fix before merge:
core/relinker/fuzz/ElfParserFuzzer.cpp:46andUnwindDescriptorFuzzer.cpp:46:catch (const std::exception&)swallows everything, so astd::length_error/out_of_rangefrom an unchecked size counts as a clean rejection. Catch onlyRelinkerException(andstd::bad_allocif you want it), so the harness fails on any other exception.ElfParserFuzzTests.cpp:36-40:seed[80] = 0x1000,seed[88] = 0x1000write a value above 255 into a single byte (it becomes 0). Use a 16/64-bit write likeElfParserNegativeBoundsTests.cppdoes, otherwise the seed being mutated is not the ELF you describe.ElfParserFuzzTests.cpp/UnwindDescriptorFuzzTests.cpp: the runners assert nothing beyond "does not crash". Please assert that the unmutated seed is accepted (headers parsed / one region returned), so a seed that is rejected at byte 0 can't pass as 1000+ cases.ElfParserNegativeBoundsTests.cpp:24:Requireis never used; remove the dead helper.Feel free to push the fixes and ping for a re-review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T05:14:01Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this review; the change adds test and fuzz harnesses without changing parser implementation behavior.
What I ran
Reviewed head
7e3ff9c3a1fd64c8087350eafbff9c0c83549fb1against the prepared diff. No build or test commands were run; author-reported checks are not independently verified.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No compilation or CTest run was performed. The stated Windows x64/MSVC C++20 results and convention check were not independently confirmed. The repository reader exposes no
files.json; the changed-file inventory was checked through the review folder listing and manifest. The full changed text was read for all eight files.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T12:27:53Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the review supports adding the bounds tests and optional fuzz targets, but builds and tests were not run here.
What I ran
Reviewed head
2004699d1663e0b5c218ae14b310231b02f76d17using the prepared diff and the pinned repository reader. No commands, builds, or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and test results reported in the PR description were not independently verified. The full review bundle listed five files under
reviewed; all five were read:core/relinker/CMakeLists.txt,core/relinker/fuzz/ElfParserFuzzer.cpp,core/relinker/fuzz/UnwindDescriptorFuzzer.cpp,core/relinker/relinker/tests/UnwindDescriptorNegativeBoundsTests.cpp, anddocs/dev/debt/relinker.md. No changed files were excluded.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T13:48:17Z.
Review: COMMENTED
The exact branch passed the unwind descriptor bounds CTest in a Linux relinker-only build. This run covered the registered unit test.
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.