Repository navigation
fix(elf): validate section-name backing before decode budget - #12449
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryMoves the ELF section-name decode budget into the shared directory reader, after it checks the section type and file range.
No actionable issues found. Tests were not run during this review. Reviews (2) · Last reviewed commit: "fix(elf): validate section-name backing ..." · Reviewed by Greptile |
|
#12416 overlaps the shared ELF codec and section reader. This PR moves the caller budget into the owner that has already validated the table declaration. Its regressions use zlib and cover an unbacked span and a non-string section. Please retain those outcomes when aligning #12416's synchronous and cooperative decode paths. |
Summary
ELF debug-link inspection previously read a second copy of the section-name table declaration to enforce the caller's decode budget. That check treated an unbacked span or non-string section as a valid compression header, then reported a capacity refusal. The shared section-directory reader now applies the caller's decode budget after it validates the declared type and file extent. It still checks the decoded size before inflation and keeps the existing structural allowance.
The image and candidate use the same directory boundary. ELF notes and the directory now share the typed source-plus-decoded-name limit and its existing recovery fields.
Validation
Both authored fixtures failed before the fix with a limit error and now report a format error without inflation. Existing controls passed for genuine decoded-size limits, candidate limitations, unsupported compression, and extended section numbering. All 672 tests passed with one existing skip across 14 CI-selected suites.
check:fastand diff checks passed.Author readiness
Human owner: @morluto