fix(tools): validate empty ELF dynamic symbol table bounds #4825
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4825"
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 StefanBuc on 2026-10-12T23:02:23Z.
What
An empty ELF dynamic symbol table beyond EOF currently becomes an empty export set, so the import audit can report an absent import and write a misleading report instead of rejecting the malformed library. Validate the complete declared table range before iterating. Keep valid empty ranges at EOF accepted.
Regression tests cover invalid and extreme offsets, truncated tables, valid EOF boundaries, and CLI exit 2 with a file/table diagnostic; the audit does not write a JSON report on this error. Related #4559 has merged into main, but the existing sectioned built-library export-parser gap remains reproducible. This branch retains upstream's import-reader test and all three bounds regression tests. The change only validates the existing sectioned export path; it does not change the new import parser or sectionless path.
Tested
Based on upstream main
dacd78525e537a779682032c0ace7f7af120af05, adopting blawesom's independently reviewed rebase handoff89a8ec58b14c661a52641728fa6f083081ae5578. Author metadata is preserved. Validation below was performed on October 13, 2026.1dca84000, based on upstream18c438b10: full Linux tools suite 282/282; documented relinker-only configuration and registeredimport_auditCTest 1/1 (0.53 s), using GCC 13.3.0, CMake 3.28.3 and Ninja 1.11.1. These broader checks were not rerun for the handoff.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 xXPBSXx on 2026-10-13T11:51:54Z.
Windows test: head
2f238ebd6merged onto currentmain5d50886ee, together with 9 other open pull requests in one build (the merges were conflict-free); a failure would have been bisected per PR. Windows 10, MinGW GCC (WinLibs), Ninja Release,-j2: full build 0 errors; ctest for the tests this change adds or touches: import_audit passed;python tools/check_conventions.py --base upstream/mainpassed for the combined tree. I did not run the new tests againstmainwithout the change.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-13T19:09:10Z.
Rebase handoff — rebased onto current
main(staleness only, applied cleanly), authorship unchanged.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesmainregression (agc_driver_tessellationsegfault, #4727) — not caused by this PRTo pick it up:
Head is
89a8ec58b.