Bounds-check pipeline stream subobjects before reading #350
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay!350
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@ahmetbagci8 on GitHub · 2026-11-27 19:09 UTC · original
ahmetbagci8:fix/gpu-pipeline-stream-bounds→main· +51 −3 · 1 files · 1 commits · merged 2026-11-27 19:37 UTCSummary
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)@TaynanGT on GitHub · 2026-11-27 19:37 UTC · original
@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.