Bounds-check pipeline stream subobjects before reading #350
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/350"
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 TaynanGT/Vice-Tay. Originally posted by ahmetbagci8 on 2026-11-27T19:09:29Z.
Summary
In
crates/victory-gpu/src/pipeline.rs,create_streamchecked onlyat + 8 <= desc.sizebefore reading each subobject (whose size ranges from 8 to 336 bytes) and created an aligned reference&*toBytecodeinside the byte-aligned stream buffer. A truncated subobject would read pastdesc.stream + desc.size(violatingGraphicsState::read's safety contract and reading out-of-boundsBytecode).Changes
size > desc.size - at.Bytecodewithread_unaligned().truncated_pipeline_stream_is_not_read_past_size.Tested
cargo test -p victory-gpu --lib pipeline:35 passed; 0 failed; 1 ignoredcargo clippy -p victory-gpu --tests: clean (0 warnings)Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T19:37:54Z.
@ahmetbagci8 This is on
mainasbc78af6. The stream reader now checks the whole subobject before reading it and accepts bytecode from unaligned streams. Both test suites and Clippy passed.