objdump: fix out-of-bounds read in ExtractStringLiteral #6968
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.89 · 2 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
 <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>
Approved
nice, thank you
Please click/sign Contributor's License Agreement
dneto0
Hsnmohd
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.