Repository navigation
VFS: validate CreateFile2 parameters before reading flags - #1433
hajduzsolt wants to merge 1 commit into
Conversation
Read only fields covered by the caller size and leave invalid parameter handling to the native API. Co-Authored-By: Codex GPT-6 <noreply@openai.com>
…README Integrates 12 additional open upstream PRs on top of upstream/main (b7aa9f3): - xcl-dev#1432: GFX10 to DXGI format mappings, depth SRVs, and byte sizing - xcl-dev#1447: Arena::take overflow/alignment and Uma::free pool validation - xcl-dev#1441: drop SC_KEYMENU so the window is never frozen in menu mode - xcl-dev#1431, xcl-dev#1436: TLS directory sizing/alignment and RegisterClassExA checks - xcl-dev#1430, xcl-dev#1446: XGameSave quota/URL and XAudio2 XMA channel validation - xcl-dev#1415, xcl-dev#1433: VFS merged-directory sync and CreateFile2 checks - xcl-dev#1418: XGameRuntime device association synchronization - xcl-dev#1410, xcl-dev#1413: wave64 form logging and XCL_SAFE_BARRIER cache bypass Also removes duplicate a_huge_constant_count_has_no_layout test left from pre-applying xcl-dev#1290 before upstream merged it, and updates README.md. Verified under GE-Proton11-14 (RX 9060 XT / RADV): - Release build (x86_64-pc-windows-msvc): ok (22.05s) - Proton unit test sweep across all merged/touched modules: 209 passed, 2 failed (known Wine/vkd3d-proton diffs: xma2_source_voice current_buffer_context before Start, and vkd3d-proton accepting UNORDERED_ACCESS without UAV flag), 1 ignored, 0 skipped.
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Test report for Tested
Not tested
AI use: Claude Code (Claude Opus 5.5) ran the commands on this machine and wrote this report from those runs. |
…ading flags Windows vfs_hooks.rs hunk verbatim (reference-only on Linux): create_file_2_flags (null->Some(0), dwSize<12->None, unreadable->None via ReadProcessMemory) + hk_create_file_2 passthrough-on-None + test. Linux live path is kernelx_linux.rs CreateFile2 (vfs_hooks_linux.rs has no CreateFile2): pread(/proc/self/mem) twin helper (never a raw guest deref; same syscall-only discipline as eh copy_stack/code_at), None -> ERROR_INVALID_PARAMETER + INVALID_HANDLE_VALUE (no orig on Linux; ExA reject-vs-passthrough precedent), NULL -> flags 0. Failing-first: new test E0425 x4 pre-impl, green post-impl. Gates: both checks 0 errors, zero new warnings; lib 609/0/1; title 12 GPU-only; retail SIGSEGV +0x2237320 frontier HOLDS, M1-RE TERMINAL.
…upstream xcl-dev#1038) Reference-only on Linux (vfs_hooks.rs is cfg(windows)): apply_open_decision takes Option<OpenCommit> and commits via commit_open(rel, is_new) so only a new overlay entry clears a whiteout; new open_file wrapper stages via open_decision_staged_for (keeps xcl-dev#1362 fail-before-commit + xcl-dev#1433 CreateFile2 flags validation a verbatim open_decision_for port would regress) and records the whiteout via commit_overlay_removal on successful DELETE_ON_CLOSE open of a game-original file. README 2-line hunk verbatim. Title/e2e delete-on-close hunks NOT ported: title is cfg(windows) using std::os::windows APIs (link.exe absent per PROMPT.md 0.9); the prebuilt PE is stale so the e2e whiteout assert would newly FAIL. Linux behavior for the same shape is pinned by vfs.rs reopening-keeps-whiteout + vfs_hooks_linux + kernelx_linux delete-on-close tests.
|
NVIDIA test report for
|
|
merge-check claim |
|
merge-check claim |
|
merge-check |
|
merge-check |
|
No open or merged PR makes the same change; main still reads dwFileFlags at params+8 without looking at dwSize. No problems found in the diff: a too-small or unreadable CREATEFILE2_EXTENDED_PARAMETERS now goes to the original CreateFile2, which reports the error itself. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
|
merge-check Same settings on main 5ad98ad, two runs: into the world at 94 s with 145 s there and no frame presented (ran to the 240 s limit); into the world at 80 s with 59 s there and 90 frames, then stopped by our RAM guard (free RAM under 1 GB). "In the world" here means the first 2 s window of the activity log with 5,000+ draws and dispatches. AI use: Claude Code (Claude Opus 5.5) ran the build, tests and title runs and wrote this; a Claude Sonnet subagent read the diff and I checked its points. |
What is in it
crates/xcl/src/vfs_hooks.rs: size-aware parameter reads and synthetic tests for null, short, unreadable and valid structures.Tested
cargo test -p xcl --lib createfile2_flags_require_a_readable_sized_structure: 1 passed, 0 failed.cargo test --workspace -- --test-threads=4 --nocapture: 752 passed, 0 failed, 41 ignored. The reported passes include tests that return early.test_title_draws_with_a_root_signature_under_the_debug_layeranduploads_start_from_each_subresources_state(D3D12 debug layer unavailable).Regression run
main:
PR:
Not tested
AI use