Skip to content

fix(clr): validate ELFIO note bounds - #10979

Draft
sstamenk wants to merge 2 commits into
developfrom
users/sstamenk/swsplat-24318-clr-note-bounds
Draft

sstamenk wants to merge 2 commits into
developfrom
users/sstamenk/swsplat-24318-clr-note-bounds

Conversation

@sstamenk

@sstamenk sstamenk commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

Motivation

Fix note indexing and parsing in CLR's embedded ELFIO copy, which is maintained separately from upstream.

Technical Details

  • Check indices against the parsed note count and revalidate cached offsets.
  • Share record decoding between scanning and retrieval, with alignment-safe header reads and complete padded-length checks.
  • Validate owner-name termination, preserve nameless notes, and leave outputs unchanged on validation failure.

Related: upstream ELFIO #173 and TheRock backport #7773.

Issue Tracking

JIRA ID: SWSPLAT-24318

Test Plan

Run local ELF32/ELF64 checks in both byte orders, covering invalid indices, record boundaries, owner names, data mutation, and serialized inputs.

Test Result

Local checks passed with MSVC ASan and GCC ASan/UBSan.

Submission Checklist

Prepared with AI assistance.

Reject invalid note indices and truncated or malformed padded note records before returning their fields or payloads.

Refs: SWSPLAT-24318
@therock-pr-bot

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ⚠️ Warning Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/clr/rocclr/elf/elfio/elfio_note.hpp; no test file found
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

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

🙋 Wish to Override Policy?

Use consistent record validation for scanning and retrieval, including owner string termination, while retaining nameless note support.

Refs: SWSPLAT-24318

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant