GPU: clamp Staging::detile slices and harden page readability checks #165
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!165
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-165"
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?
@HailLucifer666 on GitHub · 2026-11-24 22:06 UTC · original
HailLucifer666:fix/texture-staging-bounds-and-page-guards→main· +140 −10 · 1 files · 2 commits · openProblem
Staging::detile()built a mutable slice ofpitch * rows * deptheven whenGetCopyableFootprintsomits trailing row-pitch padding on the final row, exceedingself.bytes(UB).readable()usedat.saturating_add(len - 1), which saturates tousize::MAXon address overflow and loops across the 64-bit address space instead of rejecting the range.committed_by_query()used uncheckedp + len, and bothVirtualQuerypaths (committed_by_queryandmapped_bytes) countedPAGE_NOACCESSandPAGE_GUARDpages as readable committed memory.Fix
Staging::detile()slices viasubresource_len(..., self.bytes).checked_addinreadable(),committed_by_query(), andmapped_bytes().is_readable_commit()across bothVirtualQuerypaths to rejectPAGE_NOACCESSandPAGE_GUARD.Verification
subresource_lenand realVirtualAllocPAGE_NOACCESS/PAGE_GUARD/PAGE_READWRITE+usize::MAXoverflow cases.cargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test -p victory-gpu texture:: --locked(4/4 passed)cargo test -p xtask --locked(4/4 passed)readablehad no test that could see it 801eac5e28View 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.