Repository navigation
fix(elf): validate decoded section-name alignment - #9330
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. |
[Medium impact] The reviewed changes appear safe to merge; no actionable code defect was found. SummaryThe PR checks decoded section-name alignment in the shared ELF decoder before decompression.
Reviews (4) · Last reviewed commit: "Merge commit '2ac85788271f8650da0b46d680..." · Reviewed by Greptile |
…lidate-elf-compression-alignment
|
The current-base replacement is #12193. It validates decoded alignment in the shared ELF compression header reader before inflation, with ELF32 and ELF64 controls. The combined head is validated and queued for squash merge. Thanks for the original fix. |
* 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]>
Summary
Reject malformed decoded section-name alignment before interpreting ELF names. A compressed table declaring
ch_addralign = 3currently yields complete CLI/MCP Evidence with decoded names; the same inputs now return the existing input-format error. No separate issue is linked because this was independently reproduced.Problem and expected behavior
On frozen main
b81da90354e3ce4c1e01c5e5a06f4794f15f436a, changing only the compression header's decoded alignment to 3 (or the highest class bit plus 1) still returns.note.gnu.build-idand complete note coverage. The actual CLI exits 0, and the actual stdio SDK returns successful Evidence for all four malformed class/byte-order cases.The ELF gABI compression-header contract defines
ch_addralignbysh_addralign: zero or a positive power of two. Reject other alignments before decompression/name interpretation. Preserve zero, one, and large legal powers of two without converting ELF64 alignment to a lossy JavaScript Number.Change and scope
Validate the decoded alignment once in
decodeElfSectionNameTable, the existing owner used by both the note parser and native section-directory reader. Reuse its malformed outcome; the callers retain their existing error projection. There is no new decoder, parallel admission path, setting or capability. Ordinary passive format correction within existing scope; a separate maintainer scope decision is not applicable.Contract and boundary impact
invalid_request/invalid_input.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): none; the owning ELF guide documents the admission rule.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
checkis not claimed green; see below.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
Current head
7ea6912bfb7acccb9024763fbd2dadcefcc6ec51normally merges accepted main2ac85788271f8650da0b46d680a41c06e197cde2(#9332). That accepted one-line Knip entry registration repairs #9295. The original fix and all existing authors/commits remain; the PR diff still contains its original three files. No unmerged repair was copied.npm run build:cached: 3 successful / 3 cached. Matching runtime artifacts were restored; no fresh compilation is claimed.npm run knip: passed with the accepted entry present. This closes the recorded unused-verifier blocker; it is not a claim that the complete optional check chain passed.The complete
npm run checkarchitecture/production-Knip/typed-lint chain was not rerun. Broader platform/provider gaps below remain; no old CI checkout, unread shard or sibling platform result is borrowed.Previous revision validation at f260409
node scripts/run-exact-tests.mjs run src/native/elf/ElfNoteParser.test.ts src/native/elf/ElfNotesProvider.test.ts tests/acceptance/elfNotesCli.test.ts— 78 passed / 1 existing Windows host-ELF skip, no name filtering.npm run build:cached— frozen baseline and candidate each 3 successful / 1 cached, both with actual compilation.inspect-elf-notes <path> --json— baseline/candidate four-case matrices; complete legal results unchanged and malformed cases corrected to exit 1/input errors.inspect_elf_notesToolDefinition retrieved by name once per connection and used for all eight cases. Both declared schemas pass Ajv2020 meta-schema checks; actual input/success values validate through Ajv and SDK. Error projections validate against the canonical error schema. Selected artifact path/digest and file bytes are checked.npm run check:ci:fast,npm run docs:check,npm run verify:test-discovery,git diff --check— passed. Discovery verifies registration, not execution of the entire test corpus; repository lint warnings remain.npm run checkwas not repeated on this revision. The known main Knip failure is #9295, unusedscripts/verify-real-ghidra-function-bundle.mjs; repair #9300 remains open/unmerged. Fresh main Knip blob4d24b67dd53c1ec34568e26015b71974613554b2is unchanged and still lacks the entry. No unmerged repair was copied or gate disabled. Later full-check stages are unverified here.Windows, Node 24.22.1. New-head CI is pending after publication. No performance or process-memory claim.
Compatibility, safety, and release
Author readiness
Human owner: @wunianze666-netizen
Before merge
type(scope): outcome.