Repository navigation
VFS: treat a MAXIMUM_ALLOWED open as a write open (#2682) - #2708
Open
kotekompotek wants to merge 1 commit into
Open
kotekompotek wants to merge 1 commit into
kotekompotek wants to merge 1 commit into
Conversation
MAXIMUM_ALLOWED asks for every right the ACL grants - on a writable game folder that includes write, but WRITE_ACCESS lacked the bit, so CreateFileW(GAME:\file, MAXIMUM_ALLOWED, OPEN_EXISTING) took the read branch of open_decision_for and the real open ran on the original with whatever rights the ACL gave. A WriteFile on that handle changed the game folder, bypassing the overlay the README promises is never modified. With the bit in the mask the open goes to the overlay copy, the same as an explicit write open. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
This is the same change as #2694 (opened about an hour earlier for #2682): both add AI use: Claude Code (Claude Opus 5.5) compared the two diffs and wrote this comment. |
|
Test report: passes on NVIDIA. Exact head Tested
Not tested
Claude Code (Claude Opus 5.5) ran the tests and wrote this report. |
rootw0rm
pushed a commit
to rootw0rm/xcl
that referenced
this pull request
Nov 26, 2026
…t, readonly-aware delete) Port upstream xcl-dev#2708 (live head 15393dc): the MAXIMUM_ALLOWED bit itself landed earlier via xcl-dev#2694 (91e37a8); this takes the remaining regression test a_maximum_allowed_open_takes_the_write_path verbatim into vfs.rs, pinning the write-path overlay copy plus the read-only-bit read path. Port upstream xcl-dev#2809 (live head 80cf435): whiteout_original_file(rel, check_readonly) verbatim into shared vfs.rs (Linux containment via checked_original_path), with delete_file delegating the hide-original half with check_readonly=false (move-retire keeps its policy, as upstream). The Windows-native hook half (MAX_PATH/extended-prefix juggling, native DeleteFileW sharing checks) stays out; the Linux twin vfs_hooks_linux::delete_file carries the readonly-check shape (symlink_metadata dir/readonly gates, overlay remove + commit, else whiteout_original_file(rel, true)), and kernelx_linux DeleteFileA/W route Game deletes through it. Close-time/best-effort removals and move_impl retire keep Vfs::delete_file directly (no readonly gate). Tests: vfs::tests +1, vfs_hooks_linux::tests +1 (Linux twin of the cfg(windows) vfs_readonly_delete: readonly original/overlay denied and still visible, writable paths unchanged, retire-after-move unaffected). Failing-first: readonly delete returned Ok before (scratch test), both upstream artifacts absent (grep 0). Gates: both checks 0 errors; lib 766/0/1 threads=4 (+2); title e2e 12 unique FAILs all D3D12.X 0 non-GPU; retail fresh root SIGSEGV exe+0x2237320 fault 0x0 unmapped stubs 20 xgr exactly 3 HOLDS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2682.
WRITE_ACCESSlacksMAXIMUM_ALLOWED(0x0200_0000), sois_writetakes the read branch forCreateFileW(GAME:\file, MAXIMUM_ALLOWED, ..., OPEN_EXISTING):open_decision_forreturns the original path andhk_create_file_wruns the real open on it with every right the ACL grants - on a writable game folder that includes write, so aWriteFileon the handle changes the game folder the README promises is never modified, bypassing the overlay.With the bit in the mask the open takes the same copy-on-write path as an explicit write open; a title that only wants to read gets the overlay copy instead, same content.
What is in it
crates/xcl/src/vfs.rs:MAXIMUM_ALLOWEDinWRITE_ACCESS; a unit test asserting aMAXIMUM_ALLOWED + OPEN_EXISTINGopen of a game file gets the overlay copy while a plainGENERIC_READopen still gets the original.Tested
cargo test -p xcl --lib a_maximum_allowed_open_takes_the_write_path: fails without the fix (the original path is returned), passes with it.cargo test --workspace --no-fail-fast -- --test-threads=4on15393dc5(parentb49be183, which merges cleanly): 1433 passed / 3 failed / 47 ignored, 357 GPU tests SKIPPED. The 3 failures are the known environment-bound ones (SM 6.5 / driver HRESULT / DXC barrier diff), same set as upstreamb49be183.Regression run
Run under load-matched conditions on
D:\GTA6.Xbox.v1.0.2.1,-Seconds 0(the only window that reliably precedes the title's entry-point int3 on this hardware), both binaries release-built.Main
b49be183:PR head
15393dc5:Not tested
MAXIMUM_ALLOWED(the issue rates it rare); verified on the synthetic decision only.AI use
Devin (SWE-2 High) implemented the fix and test, ran the suite and smoke runs, and wrote this PR.