GPU: hold SHADER_HEAPS across descriptor mirror and check query offsets #52
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!52
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/52/head"
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?
@AndyLatimer on GitHub · 2026-11-23 23:52 UTC · original
AndyLatimer:fix/gpu-descriptor-mirror-and-query-bounds→main· +83 −15 · 3 files · 1 commits · merged 2026-11-25 00:10 UTCFixes a concurrent lifetime bug in descriptor mirroring and three bounds/overflow edge cases in
victory-gpu:descriptor::mirrorconcurrentHeap::dropUAF (descriptor.rs):shader_slotpreviously lockedSHADER_HEAPS, dereferenced the raw*const Heapinto&Heap, and dropped theSHADER_HEAPSlock before returning tomirror. A concurrentHeap::dropon another thread could free the heap beforemirroraccessedheap.pending/heap.host.mirrornow holds theSHADER_HEAPSlock across the access (matchingrelease_dynamic's locking discipline;HostHeap::mirrornever locksSHADER_HEAPS).descriptor::copy_simpleandcreate_heapguards (descriptor.rs): returns early on an unknown descriptor heap kind instead of loopingcounttimes callingmirror(dst), and rejects placed heaps whoseaddress + sizeoverflowsu64.list::resolve_queriesoffset overflow (list.rs):offset + u64::from(count) * bytes > sizecould overflowu64(panic in debug builds, wrap in release into an out-of-bounds write). Now useschecked_addwith a regression test (resolve_queries_rejects_overflowing_offset).Testing
cargo test -p victory-gpu: 37 passed, 0 failed (including the newresolve_queries_rejects_overflowing_offsettest).cargo clippy -p victory-gpu --all-targets: 0 warnings.cargo xtask policy: pass (148 files).@lordon1a on GitHub · 2026-11-24 00:19 UTC · original
Verified
628b95da5on Windows 11 (x86_64-pc-windows-gnullvm,rustc 1.100.0, applied cleanly tomain@35b054ec0): pass.cargo xtask policy: 150 files okcargo test -p victory-gpu: 40 passed, 0 failed (including the new query offset / descriptor heap mirror test + host D3D12 tests).AI-assisted.
@DaviTostes on GitHub · 2026-11-24 00:57 UTC · original
Tested
628b95dunder Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build withcargo xwin ... --target x86_64-pc-windows-msvc: pass, no regression.victory_gpu: 35 passed, 2 failed — the PR adds one test, and the two failures are the environment-only ones present on this base (argument_clamp_builds,buffer_data_reaches_the_host_texture, the latter now tracked as #128).97c78d1; the pipeline-library test that fails on vkd3d only exists on newermain, so this run is otherwise clean.No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).