Repository navigation
fix(elf): reject reserved direct section counts - #10149
Closed
wunianze666-netizen wants to merge 2 commits into
Closed
wunianze666-netizen wants to merge 2 commits into
wunianze666-netizen wants to merge 2 commits into
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. |
3 tasks
Owner
morluto
added a commit
that referenced
this pull request
Nov 19, 2026
* fix(elf): reject invalid section table and zlib declarations Refs #10149, #10148, #9330. Co-authored-by: Nianze Wu <[email protected]> * fix(elf): share section count admission with carrier readers (#12196) fix(elf): admit section tables before carrier recognition --------- Co-authored-by: Nianze Wu <[email protected]>
15 of 22 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reject reserved direct ELF section counts before reading section headers.
Problem and expected behavior
An ELF64 object declared
0xff00directly ine_shnum, backed the declared table with bytes, and produced completeinspect-elf-notesandinspect_elf_notesEvidence. The ELF header contract uses zero ine_shnumand places the actual count in section zero when the count reaches0xff00. This case came from inspecting the shared declaration reader. ELF gABI header fieldsChange and scope
Validate the raw direct count in the shared section table admission used by native directory and note readers. The guard runs before either reader interprets table rows. Legal direct counts and the existing extended-numbering outcomes are covered by the controls. Related table bounds repair
Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.
Contract and boundary impact
e_shnumvalue.docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): existing error schemas and tool metadata.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
047d75a4accepted the 4,178,432-byte reserved-count fixture on both compiled surfaces. The candidate refused the same path and digest. The highest legal direct count and valid extended-encoding controls matched their baseline outcomes.invalid_requestand categoryinvalid_input. The named SDK call returns the same typed refusal with snapshot evidence.For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.
For evidence-bearing changes:
Validation performed
CI fixture follow-up
The Source job found one initializer test fixture with 65,535 sections encoded directly in
e_shnum. The fixture now uses the ELF extended encoding, with zero ine_shnumand the count in section zero'ssh_size. Its table size, full initializer slot budget, time assertion, and result assertions are retained. Original Source jobOn Windows Node 24.22.1, the selected case reproduced the CI failure and passed after the fixture correction. The full initializer parser file passed all 107 tests. This revision changes the initializer test fixture.
Compatibility, safety, and release
Author readiness
Human owner: @wunianze666-netizen
Before merge
type(scope): outcome.