fix(relinker): bound ELF symbol name reads #1682
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1682"
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-08T16:20:46Z.
What
Validate the ELF symbol table base and the selected symbol's four-byte name-offset field with subtraction-based bounds checks before deriving the field address. This prevents a malformed
DT_OS_SYMTABfile offset from wrapping into the input image. The relinker only reads this four-byte field from each symbol entry, so the check covers the bytes it accesses.Add parser integration cases for an out-of-file base, an offset near
UINT64_MAXthat previously wrapped, and a truncated name-offset field. Existing System V/OS-tag valid fixtures remain controls.Tested
Linux: built
relinker;ctest --test-dir build -R '^(string_table_bounds|optional_plt)$' --output-on-failurepassed (2/2). Conventions andgit diff --checkpassed.Checklist
main; no other open PR implements this symbol-table bounds fixNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T17:08:45Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/relinker/relinker/src/pipeline/RelinkerPipeline.cppL219-220Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T17:27:19Z.
Closing this as a duplicate of #1272: its current head already contains the same subtraction-based symbol-entry bounds check and has all four upstream checks passing. #1690 supplies the broader symbol-range regression coverage on top of #1272. Keeping both implementations open would leave competing guards in RelinkerPipeline.cpp.
Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-08T18:05:45Z.
Thanks for closing this in favour of #1272 — worth recording what I checked on the pair so a reviewer has it in one place:
#1272isMERGEABLE/CLEANon currentmainwith all four checks green; I re-ran its negative control (implementation reverted, test kept -> fails; restored -> passes).#1690is stacked on it and supplies the integration coverage: both merge in order without conflict on today'smain(2b297842), the full relinker suite is 38/38 on Linux, and with the bound reverted tomain'ssymOff + 4 > raw.size()its two new tests fail — so they gate the fix.UNSTABLEstatus is only the two Build jobs waiting for approval, not a failure.No action needed from you; the evidence is in both threads for whoever takes the merge.
Written with AI assistance.
Pull request closed