victory-shader: malformed signature or native data can abort the process or overflow (capacity, mask, user SGPR, thread-group size) #222
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from avatarmanz/VIctory-7900XTX. Originally posted by kekonn on 2026-11-26T11:59:12Z.
Four small guards on the runtime translation path. Each needs a malformed container: real console shaders don't hit these. Two of them can still kill the process or panic in a debug build.
crates/victory-shader/src/emit/mod.rs:900Vec::with_capacity(count), withcountthe first dword of ISG1/OSG1/PSG1. A count of0xFFFFFFFFasks for about 206 GB; the allocation fails and Rust aborts the process, whichcatch_unwindcannot catch. Fix:count.min(part.len() / 32), followingshader_cache::decode'sn.min(…).emit/mod.rs:908reads the mask byte as is.0xFFgivescols = 8, and(1u8 << 8) - 1atcontainer.rs:63(alsorect.rs:88/114,host.rs:708) panics in debug and gives mask 0 in release. Fix:& 0xF(or returnMalformed) where the byte is read.crates/victory-shader/src/native.rs:161doesindex + 8on a rawu8from the root table. Values of 248 and up panic in debug and wrap in release, so the wrong root parameter gets matched (resource.rsparam_of~579). Fix:index.saturating_add(8), andchecked_add(1)atresource.rs~975.native.rs~729-735) and FSPX (~571) copy thread counts unchecked.product::<u32>()(lower.rs~1842) andx * y(~5135, ~5167) then overflow. Fix: agroup()check innative.rsthat returnsMalformedwhen a dimension or the product is above 1024 (zeros stay accepted; a fixture uses[0,0,0]).Upstream: none of the open PRs fix these. #81, #18 and #109 add more unchecked thread products in
lower.rs, which a check innative.rscovers too.Status: a fix is being prepared in kekonn/VIctory-7900XTX on branch
claude/gifted-clarke-uxuqw8.Generated by Claude Code