GPU: fix integer-overflow bounds checks in resolve_queries, execute_i… #537
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/fxceless--victory-fork!537
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@pug205gti6 on GitHub · 2026-11-25 02:01 UTC · original
pug205gti6:pr/480-gpu-list-draw-fix→main· +186 −13 · 2 files · 1 commits · open…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
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.