GPU: check subobject size against remaining stream bytes in create_st… #1537
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1538"
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 Marvisak/VIctory. Originally posted by Texbirds on 2026-11-24T18:58:19Z.
Problem
create_streamincrates/victory-gpu/src/pipeline.rschecks onlywhile at + 8 <= desc.sizebefore reading a subobject header, then immediately dereferencesBytecodeatat + 8and callsgraphics.read(kind, desc.stream.add(at))(which reads up to 336 bytes for blend statekind == 8) without checking thatsize <= desc.size - at. A truncated trailing subobject reads past the end of the title's stream buffer.Fix
size > desc.size - atimmediately aftersubobject(kind)and stop parsing with a warning if truncated.truncated_stream_subobject_does_not_read_past_endplacing 8-byte truncatedkind = 1(24-byte shader) andkind = 8(336-byte blend) subobjects right before aPAGE_NOACCESSguard page.Verification
windows-latestCI (cargo clippydefault +--all-featuresandcargo test --workspace --locked).Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:42:11Z.
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.Already in main: read_stream checks
at + size > stream.len()before reading a subobject (pipeline.rs).If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed