xcl run: filter the title host’s inherited environment #766
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!766
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-766"
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?
@Abuudiii on GitHub · 2026-11-24 04:51 UTC · original
Abuudiii:xcl-702-crash-privacy→main· +355 −7 · 5 files · 2 commits · openPart of #702. Create the title host with a filtered Unicode environment by default. This reduces inherited credential exposure; it does not sandbox the title or scrub arbitrary dumps.
What is in it
Tested
ce9ad38, the allowlist unit test passed under Proton. Independent native Windows AMD and NVIDIA runs reproduced a connection reset in the old loopback fixture.55bdcbbeec, Rust 1.99.1 built both Windows GNU test executables on Arch. With GE-Proton 11-7, both direct WinHTTP round trips passed (synthetic secret absent and present) without launching XCL. The fullcargo test --locked -p xcl --test crash_privacy_e2e --target x86_64-pc-windows-gnurun timed out before a POST: 0 passed, 1 failed, 0 ignored.Regression run
Source: @Anon64’s clean native Windows runs. Same title and 60-second duration on both commits; smoke payloads copied verbatim.
Main (
f4ce27c):PR (
55bdcbb):Not tested
55bdcbbeec. The smoke run did not exercise crash reporting (no crash report was written). The direct WinHTTP check did not exercise the launcher filter or offline blocking.AI use
github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@upipibi on GitHub · 2026-11-24 05:07 UTC · original
For the maintainers' dedupe: this is the third PR for #702. #730 (
e494814, earlier) takes the same route, a filtered block passed toCreateProcessWinspawn_host, and already has AMD and NVIDIA runs on native Windows. A comparison of the approaches is in #702. Differences from #730: this one keeps onlySystemRoot,windir,LOCALAPPDATA,TEMPandTMP(noPATH), usesXCL_INHERIT_ENVrather thanXCL_KEEP_ENV, sorts the block (which #730 doesn't, and Windows asks for), and adds an end-to-end crash/WinHTTP fixture, which so far has only run under Wine (where it timed out). Folding the sorting and the fixture into one of the two would avoid two opt-out variable names.AI-assisted (Claude Code), read-only review.
@MesshM on GitHub · 2026-11-24 05:08 UTC · original
Native Windows run of
ce9ad385b75f580b37a281879cf9806a4d7ed4df, which Not tested lists. I merged it onto currentmaind5442d2locally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge:xcllib tests 664 passed, 0 failed, 21 ignored; 0SKIPPED;title_crash_report_environment_and_offline_winhttp(crates/xcl/tests/crash_privacy_e2e.rs) fails, exit code 101.cargo test -p xcl --test crash_privacy_e2e, 2 more runs: 2 of 2 failed the same way, so 3 of 3 here.crash_privacy_e2e.rs:104:42,request.read_line(&mut line).unwrap()→Os { code: 10054, kind: ConnectionReset }. The listener accepted the POST's connection, then the first read got a reset.What I think happens (not proven): the comment just above says the guest's synchronous send completes before it exits and no response is needed. On native Windows, when the peer's socket is closed abortively (as process exit or WinHTTP's teardown can do) before the listener reads,
recvreportsWSAECONNRESETeven if the request bytes had arrived; Wine does not behave that way, which would fit the test passing under Proton. Having the fixture answer the request (or keep the guest alive until it gets a response), or reading the request before the guest can exit, should make it deterministic. One caveat about this machine: it runs Kaspersky with web-traffic scanning, which can also reset HTTP connections, loopback included; I did not disable it, so I cannot fully rule that out.Overlap: #730 (open) also replaces the inherited environment of the title process with an allow-list (the same #702), so the two will want reconciling; this one adds the WinHTTP fixture and the e2e test.
Not tested: no retail title or regression run (I have no unpacked game), release build; not rerun with the antivirus off.
Run and report by Claude Code (Claude Opus 5.5) on this machine.
@mastrr9 on GitHub · 2026-11-24 05:14 UTC · original
Independent native Windows NVIDIA RTX 5080 build/test run and code review at head
ce9ad385b75f580b37a281879cf9806a4d7ed4df.Failure Reproduced (2/2 runs):
crash_privacy_e2e::title_crash_report_environment_and_offline_winhttpcrates\xcl\tests\crash_privacy_e2e.rs:104:42:called Result::unwrap() on an Err value: Os { code: 10054, kind: ConnectionReset, message: "An existing connection was forcibly closed by the remote host." }xcl run(andxcl_privacy_probe.exe) to completely exit viarun_launcherbefore callinglistener.accept()andrequest.read_line(). Inprivacy.rs, the probe callsWinHttpSendRequestand immediately closes the handles and exits without callingWinHttpReceiveResponse/ reading a reply. On Windows 11 loopback, closing the client socket before the server accepts/reads sends a TCPRST(WSAECONNRESET10054), causingread_line()to fail deterministically once the child has exited.run_launcher(sending a minimalHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\nresponse and joining the thread afterrun_launcher), or havexcl_privacy_probewait for the response withWinHttpReceiveResponsewhile the listener thread serves it.Code Review Notes
CreateProcessWtime (CREATE_UNICODE_ENVIRONMENT) is much cleaner than post-start scrubbing since title DLLs/CRTs never see the parent environment, andlauncher::tests::host_environment_is_a_sorted_unicode_allowlistpassed cleanly.SYSTEM_VARS: Only keepingSystemRoot,windir,LOCALAPPDATA,TEMP,TMP(plusXCL_*) works withdxc.rswhen Windows Kits is installed inC:\Program Files (x86)\Windows Kits\10\binorXCL_DXC_DIRis set, but note that strippingSystemDrive,ProgramData,ProgramFiles,ProgramFiles(x86),NUMBER_OF_PROCESSORS,PROCESSOR_ARCHITECTURE, and Wine/Proton/Vulkan driver variables (WINE*,VKD3D*,DXVK*,VK_*,PROTON*) could affect GPU driver shader caches or Linux/Wine runs (andcrash_privacy_e2e.rscurrently setsgraphics = 'null', so it does not exercise real D3D12/DXC init under the filtered environment).Tested
617.42/32.0.16.1742), Windows 11 Pro 25H2 (26200.9974),rustc 1.100.0 (0ef1bc386 2026-11-09), debug build.cargo build --workspace && cargo test --workspace -- --test-threads=4cargo teststopped oncrash_privacy_e2e(0 new compiler warnings;title_crash_report_environment_and_offline_winhttpfailed identically on 2/2 runs).launcher::tests::host_environment_is_a_sorted_unicode_allowlist—oktitle_crash_report_environment_and_offline_winhttp(tests/crash_privacy_e2e.rs) —FAILED(WSAECONNRESET10054 at line 104)gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64)gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64)Not tested
crash_privacy_e2e, real D3D12 graphics initialization under the filtered environment, AMD/wave64 hardware, and retail titles.AI use: Antigravity (Gemini 4 Neon) performed the code review, ran the RTX 5080 workspace tests, diagnosed the
WSAECONNRESETtest failure, and drafted this comment.@Abuudiii on GitHub · 2026-11-24 05:24 UTC · original
Thanks @MesshM and @ethandepstein-del for reproducing the reset.
55bdcbbeecstarts the loopback worker before launch; the probe now waits for its response. Both direct WinHTTP round trips passed under Proton, but the full launcher test timed out here before reaching the loopback listener. If one of you can retest the new head on native Windows, the focused commands are:This overlaps #730. I would keep one process-creation filter and am happy to fold the sorted Unicode block and fixture into the PR the maintainers prefer.
Drafted with omp (GPT-6.2 Sol).
@Anon64 on GitHub · 2026-11-24 07:35 UTC · original
Regression runs for this PR's head
55bdcbband for its basemainf4ce27c, on a retail title (same title, 60 s each), made withscripts/smoke.ps1(release, clean tree at each commit) and pasted unedited, for Regression run.main:
this PR:
Tested
Not tested
Report written with Claude Code (Claude Opus 5.5) from runs on this machine.
@throny on GitHub · 2026-11-24 19:38 UTC · original
Two contributors checked independently and found that #730 #740 solves the same problem (for #702) in a different way: #1607, group D17. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@DavidM1911 on GitHub · 2026-11-25 11:17 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
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.