8000 Validate ELF note sizes against section bounds by dajiaohuang · Pull Request #1774 · dominikh/go-tools · GitHub
[go: up one dir, main page]

Skip to content

Validate ELF note sizes against section bounds - #1774

Closed
dajiaohuang wants to merge 3 commits into
dominikh:masterfrom
dajiaohuang:fix/buildid-elf-note-bounds
Closed

dajiaohuang wants to merge 3 commits into
dominikh:masterfrom
dajiaohuang:fix/buildid-elf-note-bounds

Conversation

@dajiaohuang
@dajiaohuang dajiaohuang commented Oct 1, 2026 •
Copy link
Copy Markdown

Validate ELF note headers and padded field lengths against the containing section. Reject negative sizes and avoid int32 overflow while aligning fields. Add focused tests for alignment and truncated data. Validation: go test ./go/buildid; git diff --check.

Review update: the unrelated generic-instantiation change and its fixture were removed through a normal follow-up commit; #1764 tracks that fix separately. Current-head validation: go test ./go/buildid (two tests) passed; git diff --check passed. Prior validation text above is historical unless repeated here.

@dajiaohuang
Copy link
Copy Markdown
Author

Withdrawing this proposal after checking the actual entry points. It changes ReadELFNote/readAligned4, which have no tracked consumers, and no supported external use or documented consumer contract has been established for this copied helper. The actual build-ID consumers call ReadFile and reach the separate readELF path addressed by #1797. The added helper-only malformed-note tests do not establish a current supported-use failure for this PR.

@dajiaohuang dajiaohuang closed this Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0