victory-gpu(shadow): flush SNAPS before dropping Shadow to prevent use-after-free #936
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!936
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-936"
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?
@faycalbaklouti on GitHub · 2026-11-25 13:14 UTC · original
faycalbaklouti:fix/shadow-snaps-uaf-flush→main· +21 −0 · 1 files · 2 commits · openTarget upstream:
fxceless/victory-fork(note:SNAPS/VICTORY_WIDE_BACKis specific tofxceless/victory-forkand does not exist inMarvisak/VIctoryorBelobug/VIctory-Belobug-AMD)Problem
When
VICTORY_WIDE_BACK=1is enabled,Shadow::writingqueues raw pointer tuples(data_ptr, snapshot_ptr, len)into the globalSNAPSqueue for deferred parallel copying intake_snapshots(). If aShadowis dropped whileSNAPSstill holds pointers into its backing mapping or pooled snapshot buffer, the subsequenttake_snapshots()call reads/writes freed memory (use-after-free).Solution
impl Drop for Shadow, flush any queued entries inSNAPSviatake_snapshots()before releasing theShadow's resources.take_snapshots_flushes_queued_snaps_before_release.Verification
git apply --checkpasses cleanly onfxceless/victory-forkmain.About our fork & censorship-resistant preservation effort:
This fix comes from gta6-vi-port, our open-source Linux (GE-Proton) + NVIDIA RTX 4090 fork of VIctory and peer-to-peer Radicle archival effort (mirroring 92+ community porting repositories across public Radicle seeds so open-source porting research survives centralized takedowns; open-source code only, no game files/keys/binaries).
rad:z39ofPhQC1siudH9BF3xsmAMmUqxc).onionVP9+Opus viewer:http://kwnoaeecpmxd6eetqfa7fxlymvxnh5du2i6wxr44t4mc7cgch5pw23id.onion/)@tikD1337 on GitHub · 2026-11-25 13:50 UTC · original
Thanks for the fix. On
main@a253706(Windows 11, RTX 4070 Ti SUPER, Rust 1.98.1), the library builds, but the test target does not:The new test sits in
mod merge_tests, which only importsPIECE, back_piece, changed_runs. One line fixes it:With that line:
take_snapshots_flushes_queued_snaps_before_releasepasses, andcargo test --release -p victory-gpu --lib -- --test-threads=1gives 170 passed, 1 failed. The failure is the known flakyindirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fieldsthat #849 fixes.@faycalbaklouti on GitHub · 2026-11-25 14:18 UTC · original
Good catch, thanks for testing it! Added
use super::{give_back, pooled, take_snapshots, SNAPS};tomod merge_testsinc00ac40and verified thevictory-gpuWindows test target compiles cleanly (cargo xwin test --target x86_64-pc-windows-msvc -p victory-gpu --no-run).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.