← Back to Pull requests

objdump: fix out-of-bounds read in ExtractStringLiteral #6968

Open
Hsnmohd opened this pull request with 28 lines diff across 2 files
View on GitHub
Hsnmohd Hsnmohd commented on Oct 14, 2026 08:54 UTC
Author

ExtractStringLiteral walks an OpString/OpSource/OpSourceContinued string operand and, on a backslash, skips the next byte as an escaped character. The binary parser stops at the first NULL terminator and pads the operand to a word boundary without requiring the trailing bytes to be zero, so a crafted module can place a backslash at the final byte of the operand range; the ++readIndex then reads one byte past it. spirv-objdump --source on such a module is a heap-buffer-overflow read. The guard breaks to the existing missing-terminator error path when the escaped byte would fall outside the range.

Repro, built RelWithDebInfo + ASan, feeding the crafted binary to ExtractSourceFromModule:

ERROR: AddressSanitizer: heap-buffer-overflow READ of size 1
#0 ExtractStringLiteral extract_source.cpp:57
#1 extractOpString extract_source.cpp:81
#2 ExtractSourceFromModule extract_source.cpp:161
0x... is located 0 bytes after 32-byte region

Added a regression test that builds the crafted module by hand (the assemble + ToBinary helper emits zero padding, so the operand bytes cannot be produced through assembly); it over-reads before the fix and returns a clean missing-terminator failure after. The existing extract_source tests still pass.

Diff: 28 lines (+28 / -0) across 2 files Reviewer: dneto0 Review duration: 17344m
All Vouch review confidence checks passed
Residual risk 0.03 = Change Risk (0.25) × (1 − Review Confidence (0.89)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.25 · 28 lines diff across 2 files
0.25
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.89 · 2 substantive comment(s)
0.89
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
89%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.201
Real PR Conversation Timeline
4 items
CLAassistant CLAassistant commented on Oct 14, 2026 08:54 UTC
Contributor

![CLA assistant check](https://cla-assistant.io/KhronosGroup/SPIRV-Tools?pullRequest=6968) <br/>Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.<br/><sub>You have signed the CLA already but the status is still pending? Let us recheck it.</sub>

dneto0 dneto0 approved these changes on Oct 24, 2026 16:35 UTC
Approved Reviewer

nice, thank you

dneto0 dneto0 commented on Oct 24, 2026 16:36 UTC
Contributor

Please click/sign Contributor's License Agreement

Reviewers
Assignees
Hsnmohd Hsnmohd
Labels
risk: low confidence: 89.1% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 24.6% (LOW) · Higher = larger blast radius
24.6%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 89.1% · Lower = rushed or shallow review
89.1%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 2.7% · Safe to merge
2.7%