Repository navigation
victory-gpu(shadow): flush SNAPS before dropping Shadow to prevent use-after-free - #936
faycalbaklouti wants to merge 2 commits into
Conversation
|
Thanks for the fix. On The new test sits in use super::{give_back, pooled, take_snapshots, SNAPS};With that line: |
…r runs across the cursor, snapshots flushed before a copy goes, changed runs reused, texture checks side by side, the card-copy census and its write-combining experiment From fxceless/victory-fork's open pull requests: - fxceless#911 (douline): a constant buffer view is at most 64 KiB; the title names larger ones and NVIDIA removes the device for them. - fxceless#932 (avt0m4t48): the search for free dynamic descriptor slots finds a run that lies across its starting point. - fxceless#936 (faycalbaklouti): queued snapshots are taken before a host copy is dropped (a use after free); its test's imports added for this tree. - fxceless#925 (alpz1000): changed-byte runs are found into one buffer reused across pages, the merge gap joined in the same pass. - fxceless#768 (KyleS98): a submission's texture checks run several at a time (`VICTORY_WIDE_TEXTURES=1`, off by default). - fxceless#868 (Chipsraine): a census of the card copies (`VICTORY_CENSUS=1`) and an EXPERIMENT, off by default: `VICTORY_SKIP_WC_COMPARE=1` leaves copies of write-combining title memory out of the compare and the copy-back. Here (RTX 4070, first gameplay scene) it took the median from 213 to 186 ms a frame, best 150 ms; not exact (the title must never read that memory after the card wrote it). With them gameplay went from a median of 233 to 213 ms a frame here. Tried and left off: `VICTORY_CARD_REHASH_RUNS=1` (1,735 passes a frame joined to about 220, no gain). victory-gpu: 174 tests pass (`inplace::...shows_its_bytes_at_its_offset` fails now and then, as before these); victory-hle: 99 pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Good catch, thanks for testing it! Added |
…APS flush, fxceless#827 skip_frames) + test fixes - PR fxceless#911: clamp HostHeap::constant_at CBV SizeInBytes to <= 64 KiB via constant_view_size() - PR fxceless#936: flush SNAPS via take_snapshots() before dropping Shadow to prevent UAF - PR fxceless#827 (crash-fix part): add opt-in VICTORY_TABLED_SKIP_FRAMES check in HostHeap::tabled_lately (omits copy_or_make VRAM growth and unsafe COPY_FAST) - Align merged unit tests in shadow.rs, host.rs, indirect.rs, indirect/bench.rs, texture.rs and deduplicate record_print_tests
…t, page arrays waited for, views of at most 64 KiB - The card's compare takes 64 threads a 64 KiB piece, and fills of upload memory are kept in their own lists (fxceless#929 by AlexMiu, d07e1eb). - Constant tables read on the card in place (VICTORY_TABLE_CBV_DIRECT=1; off by default here) (fxceless#929). - A DirectStorage request whose page array the title fills late waits up to 100 ms for it (fxceless#929). - A constant buffer view is at most 64 KiB (fxceless#911 by douline). - A shadow that goes takes its queued snapshots first (fxceless#936 by faycalbaklouti). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Target 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/)