Skip to content

[SWSPLAT-24296] Backport ELFIO hash table bounds validation - #7772

Draft
sstamenk wants to merge 3 commits into
mainfrom
users/sstamenk/swsplat-24296-elfio-hash-bounds
Draft

sstamenk wants to merge 3 commits into
mainfrom
users/sstamenk/swsplat-24296-elfio-hash-bounds

Conversation

@sstamenk

@sstamenk sstamenk commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

Motivation

Backport ELFIO #174 to TheRock's pinned ELFIO 3.12.

JIRA ID: SWSPLAT-24296

Technical Details

Ports serge1/ELFIO#174 at c6e67fa to ELFIO 3.12 (on top of the existing 0001 patch). The changes:

  • Validate SysV and GNU hash tables before use, and bound chain traversal, with endian-aware, alignment-safe reads.
  • A miss on a well-formed table rules out the non-local symbols it covers. Local symbols, symbols outside the covered range, and unnamed symbols are still searched linearly, as are unusable tables.
  • Treat a GNU bloom filter whose size is not a power of two as unusable.
  • Name lookups write output parameters only on a match.
  • Read symbol records with memcpy, including in arrange_local_symbols().

The public API is unchanged. Compared with the upstream PR, only the 3.12 adaptations differ: the convertor is a reference rather than a pointer, plain uint32_t is used, and doc comments follow 3.12 style.

Remove the patch when upgrading to an ELFIO release containing the upstream change.

Test Plan

  • Apply the patches with TheRock's patch_third_party_source.py to a fresh elfio-3.12.tar.gz (SHA512 matching third-party/elfio).
  • Build ELFIO 3.12's test suite with this patch, [SWSPLAT-24318] Backport ELFIO note bounds validation #7773's note patch, and the upstream PRs' bounds tests, using GCC ASan/UBSan.
  • Look up every symbol of every symbol table in ELFIO's tests/elf_examples by name, patched vs. unpatched 3.12.

Test Result

  • Patch application passed with no rejects, and the patched headers match the tested source.
  • 73/73 tests pass with ASan/UBSan. On unpatched 3.12, 31 of those tests fail.
  • All 10,859 example-file symbol lookups succeed (237 through hash tables), with no sanitizer reports.

Submission Checklist

Prepared with AI assistance.

🤖 Generated with Claude Code

Add the ELFIO 3.12 backport for bounded SysV and GNU hash lookup while the upstream fix is reviewed in serge1/ELFIO#174.

Refs: SWSPLAT-24296
@therock-pr-bot

therock-pr-bot Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot therock-pr-bot Bot added the Not ready to Review PR has unresolved policy failures — reviews blocked label Aug 31, 2026
@therock-pr-bot

therock-pr-bot Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@therock-pr-bot therock-pr-bot Bot removed the Not ready to Review PR has unresolved policy failures — reviews blocked label Aug 31, 2026
Align the ELFIO 3.12 lookup updates with upstream and simplify the patch notes.

Refs: SWSPLAT-24296
Rebase the backport onto serge1/ELFIO#174 at c6e67fa. Adds authoritative
misses on well-formed SysV and GNU hash tables (local and unhashed symbols
are still searched linearly), rejection of non-power-of-two bloom sizes,
output parameters written only on a match, and alignment-safe symbol
record access including arrange_local_symbols().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: TODO

Development

Successfully merging this pull request may close these issues.

1 participant