Skip to content

[rocjitsu] Harden code object parsing - #13704

Merged
kuhar merged 1 commit into
developfrom
users/jakub/rocjitsu-code-object-loader-fixes
Oct 21, 2026
Merged

kuhar merged 1 commit into
developfrom
users/jakub/rocjitsu-code-object-loader-fixes

Conversation

@kuhar

@kuhar kuhar commented Oct 18, 2026

Copy link
Copy Markdown
Member

Malformed ELF and HIP bundle metadata can overflow table arithmetic, trigger unaligned reads or drive allocations and copies from unchecked offsets. Program-header loads and kernel descriptor entry calculations also trust wrapped addresses.

Read ELF records through bounds-checked copies that honor entry strides. Validate section, symbol, program-header and bundle tables before allocation; retain validated load segments; and use checked signed arithmetic for kernel entry addresses.

Cover null storage, truncated and strided tables, impossible bundle counts, wrapped descriptor entries and standalone device ELF loading.

@kuhar
kuhar requested review from Groverkss and newling and a balanced review from Copilot October 18, 2026 18:27
@kuhar
kuhar requested review from a team and atgutier as code owners October 18, 2026 18:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@therock-pr-bot

therock-pr-bot Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
📝 PR Description ❌ Fail Error: PR description must reference a JIRA ID, ISSUE ID, or a GitHub closing keyword.
Expected: include a JIRA ID / ISSUE ID line (separator : or -, or omitted; value may be a JIRA key, a number with/without #, or a link), OR a closing keyword + issue reference. Accepted examples:
• JIRA ID : TESTAUTO-6039
• JIRA ID - #330
• JIRA ID #330
• JIRA ID (on separate line)
ROCM-25757
• ISSUE ID : TESTUTO-3334
• ISSUE ID #3334
• ISSUE ID - TESTAUTO-3433
• ISSUE ID (on separate line)
AIRUNTIME-2352
• ISSUE ID : https://github.com/<org_name>/<repo_name>/issues/1234
• Closes #10
• Fixes octo-org/octo-repo#100
• Resolves: #123
• #123
• https://github.com/<org_name>/<repo_name>/issues/123
Current: no valid JIRA/ISSUE/closing-keyword reference found
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

⚠️ 1 policy check(s) failed. Please address the issues above before this PR can be Reviewed.

🚫 Please fix the failed policies

  • ❌ PR Description

The Not ready to Review label was added to this PR. Once all policies pass, the label is removed automatically.

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

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Description

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

@atgutier atgutier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One agent comment inline

@kuhar
kuhar force-pushed the users/jakub/rocjitsu-code-object-loader-fixes branch from 4e1085a to cb2cc03 Compare October 19, 2026 23:34
@kuhar
kuhar requested a review from atgutier October 20, 2026 00:23

@atgutier atgutier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another major agent finding.

Malformed ELF and HIP bundle metadata can overflow table arithmetic, trigger
unaligned reads or drive allocations and copies from unchecked offsets.
Program-header loads and kernel descriptor entry calculations also trust
wrapped addresses.

Read ELF records through bounds-checked copies and require the fixed table
strides supported by code-object rewriting. Validate section, symbol,
program-header and bundle extents before allocation; retain validated load
segments and descriptor offsets across moves; and use checked arithmetic for
kernel entry addresses and load ranges. Reject invalid objects before DBI
and keep bundle payloads inside their owning section. This retires the old
reference-scoped tolerance for malformed unreferenced symbol tables: rewriting
can visit every symbol table, so all must use the supported record size.
Relocation tables affecting loaded code/data follow the same rule; explicit
nonallocated relocation targets retain their established ignore policy.

Cover malformed and unsupported tables, wrapped descriptor and load ranges,
bundle payload escapes, move construction, and standalone device ELF loading.
@kuhar
kuhar force-pushed the users/jakub/rocjitsu-code-object-loader-fixes branch from cb2cc03 to 9891d8e Compare October 21, 2026 00:34
@kuhar
kuhar merged commit 676f2d6 into develop Oct 21, 2026
70 of 71 checks passed
@kuhar
kuhar deleted the users/jakub/rocjitsu-code-object-loader-fixes branch October 21, 2026 16:24
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

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.

4 participants