GPU: fix integer-overflow bounds checks in resolve_queries, execute_i… #537
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/537"
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 fxceless/victory-fork. Originally posted by pug205gti6 on 2026-11-25T02:01:37Z.
…ndirect, and State::rectangles
list::resolve_queries: replace uncheckedoffset + u64::from(count) * bytes > sizewith checked multiplication and addition so wrapping offsets cannot panic in debug builds or bypass the buffer bounds check in release builds and schedule an out-of-boundsdefer_write.list::execute_indirect: validatearguments([offset, offset + stride * max.max(1))) andcount([count_offset, count_offset + 4)) against each buffer's recorded byte size using checked arithmetic (checked_buffer_offset), preventing out-of-bounds or wrapping offsets from aliasing adjacentShadowbuffers.draw::State::rectangles: widenu64::from(first) + u64::from(count)before multiplying bystride(avoidingu32wrap onfirst + count), use checked addition forv.address + first * stride, and checku32::try_from(rects * 6 * stride)soD3D12_VERTEX_BUFFER_VIEW::SizeInBytescannot silently truncate.Add synthetic unit tests in
list::testsanddraw::tests.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.