Shaders: bounds-check DXBC signature table before Vec::with_capacity #1499
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1499
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1499/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@b3IKK on GitHub · 2026-11-24 16:59 UTC · original
b3IKK:gpu/dxbc-signature-bounds→main· +16 −2 · 1 files · 1 commits · closed without mergingdxbc::signature()calledVec::with_capacity(count)with the rawu32element count from anISG1/OSG1/ISGN/OSGNpart before verifying thatfirst + count * size <= d.len(). A small malformed signature part claimingcount = u32::MAXaborted the process on an unbounded ~206 GiB allocation instead of returningNone.This validates
first + count * size <= d.len()with checked arithmetic before allocating, and uses checked additions inrd32andpsv.What is in it
crates/xcl/src/gpu/dxbc.rs: bounds-check the signature table beforeVec::with_capacity(count), use checked additions inrd32andpsv, and add unit testtruncated_or_oversized_signature_returns_none_without_allocating.Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 771 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2no wave64—gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)cargo test -p xcl --lib gpu::dxbc::tests: 3 passed, 0 failedRegression run
main:
PR:
Not tested
AI use
gpu/dxbc.rs, wrote the fix and unit test, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@DavidM1911 on GitHub · 2026-11-24 18:53 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@Belox17 on GitHub · 2026-11-24 20:02 UTC · original
Test report for
8afc955don NVIDIA (RTX 3060 Ti): passes, and without the fix the test aborts on the allocation it guardsTested
8afc955das is (baseb7aa9f3), clean tree.truncated_or_oversized_signature_returns_none_without_allocating) withcargo test -p xcl --lib <name>: 1 passed.cargo test --workspace -- --test-threads=4on the head: 771 passed, 0 failed, 41 ignored; its baseb7aa9f3on the same machine: 770 passed, 0 failed, 41 ignored. SKIPPED on both:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).mainc160d86e(clean merge): 859 passed, 0 failed, 42 ignored;mainalone: 858 passed, 0 failed, 42 ignored, the same three SKIPPED as above.gpu/dxbc.rsreverted (test kept), the test process aborts withmemory allocation of 206158430160 bytes failed.Not tested
AI use: Claude Code (Claude Opus 5.5) ran the commands on this machine and wrote this report from those runs.
@b3IKK on GitHub · 2026-11-25 00:04 UTC · original
On #1607's group D61: #1116 came first and makes the same change in
signature. I am leaving this one open for now only because #1116'sPR descriptioncheck currently fails, so it cannot be merged as it stands, while this one passes and was run in batches B2 / B13. If #1116's check goes green I will close this in its favour; the two extrachecked_addcalls here (rd32,psv) can then be a follow-up. AI use: OpenCode, Claude Fable 5.2.@CalvyPZ on GitHub · 2026-11-25 22:45 UTC · original
This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
Pull request closed