VFS: protect game folders on network shares from direct writes (#961) #1068
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1077"
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?
Imported from ivall/xcl. Originally posted by mahfuzinam0045-spec on 2026-11-24T11:22:04Z.
Vfs::classify_withunconditionally returnedTarget::Passfor any path starting with\\\\before comparing the path with the game root. When the game root is hosted on a UNC network share (\\\\server\\share\\Game), any title access via its absolute path bypassed the copy-on-write overlay and wrote directly to the game folder, violating the invariant that the game folder is never modified.classify_withnow verifies whether a UNC path falls withingame_root_lc,data_root_lc, orown_roots_lcbefore letting external UNC paths pass through.Fixes #961.
What is in it
crates/xcl/src/vfs.rs: inclassify_with, check whether a\\\\-prefixed path matchesgame_root_lc,data_root_lc, orown_roots_lcbefore early-returningTarget::Pass.crates/xcl/src/vfs.rs: added unit testunc_game_root_protects_game_folder_from_writesverifying that paths inside a UNC game root classify asTarget::Gamewhile external UNC paths classify asTarget::Pass.Tested
unc_game_root_protects_game_folder_from_writes: fails withTarget::Passwithout the fix, and passes returningTarget::Game { rel: save.dat }with the fix.XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 736 passed, 0 failed, 41 ignored.Regression run
XCL_NETWORK=0, A pressed every 4 s from 20 s,scripts/smoke.ps1on a retail title for 60 s (courtesy of @Anon64).main:
this PR:
Not tested
AI use
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-24T11:32:13Z.
Regression run for Regression run,
scripts/smoke.ps1on a retail title, 60 s each: this PR's headb028903and themainit is based on (67a3735, the merge base), release builds, RTX 3060 12 GB (581.80), Windows 11 26200,XCL_NETWORK=0, A pressed every 4 s from 20 s (XCL_PRESS_A_AT).main:
this PR:
No device removals or crashes; 97 % of main's frames, 97 % of its peak commit. Both runs reach world loading, where frames fall off the same way on this card.
Not tested: the title runs from a local drive, so the UNC game-root path this PR changes is not reached; this is a regression check only.
Written with Claude Code (Claude Opus 5.5) from runs on this machine.
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:25:10Z.
Full-suite run, since this PR has no test report yet. Tested exact head
b028903(on its base67a3735).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 736 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.unc_game_root_protects_game_folder_from_writes.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T08:51:22Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:40:44Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:46:20Z.
Triage (#1607) – head
b028903#2797 also removes the UNC early return in vfs.rs:classify_with, but it comments it out for every UNC path and also changes launcher.rs; this PR lets only UNC paths under the game, data and XCL folders through. #579 (keep the UNC path of a game on a share) is the launcher side that #961 follows up.
Note:
game_root_lcis not passed throughstrip_verbatimin Vfs::new, so a game root given as\\?\UNC\server\share\...would not match the stripped path. The new test only uses a plain\\server\shareroot.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.