XCL_NETWORK=0: WSAConnectByList refuses all but loopback #821
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!821
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-821"
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?
@mastrr9 on GitHub · 2026-11-24 06:02 UTC · original
mastrr9:fix/netoff-wsaconnectbylist→main· +110 −0 · 1 files · 1 commits · openWith
XCL_NETWORK=0,WSAConnectByListwas hooked neither in the title's import table nor inws2_32.dll, and connects without passing through the hookedconnectorWSAConnect. On Windows 11 withinstall_system_hooks()active, callingWSAConnectByListwith192.0.2.1:80bypassed every hook and attempted a live TCP connect untilWSAETIMEDOUT(10060) after 21.04 s. (WSAConnectByNameWandWSAConnectByNameAare already blocked because they call the hookedGetAddrInfoExWinternally and fail in microseconds withWSAHOST_NOT_FOUND.)What is in it
crates/xcl/src/hle/netoff.rs:WSAConnectByListin bothtable()andinstall_system_hooks()(using a dedicated trampolineO_WSA_CONNECT_BY_LIST, placed after the main hook array to avoid textual conflicts with #807/#808/#462/#570/#612/#619).SOCKET_ADDRESS_LISTlayout (count at offset 0, 16-byteSOCKET_ADDRESSentries from offset 8): refuses lists with no loopback entry (FALSE+WSAENETUNREACH), passes loopback-only lists through unchanged, and filters mixed lists to a copy containing only the loopback entries in order.wsa_connect_by_list_refuses_all_but_loopbackverifying both title-side import and systemGetProcAddress("WSAConnectByList")behavior on non-loopback, mixed, and loopback-only lists.Tested
617.42/32.0.16.1742), Windows 11 Pro 25H2 (26200.9974), D3D12 debug layer installed (d3d12SDKLayers.dll),rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC from Windows SDK10.0.26100.0, debug build.maind208e14): empirical Windows 11 probe withinstall_system_hooks()confirmedWSAConnectByList(192.0.2.1:80)bypassed all hooks and timed out withWSAETIMEDOUT(10060) after 21.04 s.fdabe7392327c5472ddad9cbfccbbdb07a135f69):cargo build --workspace && cargo test --workspace -- --test-threads=4hle::netoff::tests::wsa_connect_by_list_refuses_all_but_loopback—okgpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64).Regression run
Smoke run by @Toons29 in comment below: #821
Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted.
main:
PR:
Tester's setup and limits: AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.Tester's AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; the tester checked the blocks before posting.Not tested
AI use
WSAConnectByListlead and wrote the hook implementation and unit test.WSAConnectByNameW/Awere already blocked), audited the x64SOCKET_ADDRESS_LISTlayout, ran the full Windows RTX 5080 MSVC + D3D12 debug-layer workspace suite, and drafted this PR description.@SlopTart on GitHub · 2026-11-24 06:40 UTC · original
2|
3|AMD/wave64 + release-build datapoint, plus a Wine caveat: the new unit test cannot run under Wine at all.
4|
5|Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Wine = Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust 1.100.0 cross
x86_64-pc-windows-gnu, release profile,XCL_NETWORK=0, native wave64. Same rig as my Linux rows in #42 / #718.6|
7|Merged state: head
fdabe7392onto mainbeaa245, clean merge.8|
9|Full suite,
cargo test --workspace --release --no-fail-fast -- --test-threads=4: 703 passed, 11 failed, 41 ignored (17 suites). 10 of the 11 are known: this rig's 7 stable Wine-lane failures (my #42 row) + the #718 flaky trio (~2/5 rate at threads=4, PR-independent). The 11th is yours:10|
11|-
hle::netoff::tests::wsa_connect_by_list_refuses_all_but_loopbackfails under Wine: it panics atnetoff.rs:403on.expect("export")—GetProcAddress(ws2_32.dll, "WSAConnectByList")returns NULL under Proton Experimental (wine-11.0). Wine's ws2_32 does not exportWSAConnectByList, so the test's system-address lookup dies before any assertion. Your sibling testthe_systems_own_network_functions_refusepasses here, so the netoff lane itself is fine; it is specifically theWSAConnectByListbinding. If the function genuinely does not exist in Wine, a Wine-visible skip (#[cfg]-style or a runtimeGetProcAddress-NULL skip) would keep the suite green on Linux/Wine lanes like mine — but if titles running under Wine call it through some other path, worth checking what that means for the hook.12|
13|Your
the_systems_own_network_functions_refuseunit test passes here.14|
15|Not tested: retail titles /
scripts/smoke.ps1(none here), Windows, MSVC.16|Counts only, no game data.
17|AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@mastrr9 on GitHub · 2026-11-24 07:06 UTC · original
Thanks for the Wine/Proton catch! Squashed a fix into
28fd53d829a5c4d9dd0b43b952c7f4493a57c146:GetProcAddress(ws2_32.dll, "WSAConnectByList")returnsNone(Wine/Proton), the test still verifies that ourwsa_connect_by_listdetour refuses non-loopback withWSAENETUNREACHand returns cleanly instead of panicking on.expect("export").WSAConnectByListis exported, both the title import and system detour continue to be exercised in full.Re-tested on native Windows 11 + NVIDIA RTX 5080 (
28fd53d829a5c4d9dd0b43b952c7f4493a57c146, driver617.42,rustc 1.100.0):cargo build --workspaceclean,cargo test --workspace -- --test-threads=4: 714 passed, 0 failed, 41 ignored (SKIPPED: only the 2no wave64tests).(Assisted-by: Antigravity / Gemini 4 Neon + Claude Sonnet 5.5)
@dcastell1 on GitHub · 2026-11-24 07:09 UTC · original
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on
main@beaa245:XCL_NETWORK=0 and WSAConnectByList is green here and the workspace keeps its verdict (737 passed on
mainon this box). Tree restored afterwards; hardware adapter, no Wine, no game data.AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
@OrangeCrane1738 on GitHub · 2026-11-24 16:48 UTC · original · edited 2026-11-24 17:52 UTC
Test report for
f9ef768on the retail title: one 120 s smoke run without this PR and one with it.Tested
scripts/smoke.ps1 -Seconds 120on the retail title, no input.maindies early on the XAsync routing that #235 fixes. Both builds therefore include #235:main930e8b4+ #235, and the same + this PR (f9ef768). Their commits are local merges, so the blocks below can't stand in for the main / PR-head pair the PR check needs.title:line is the game folder's name, shortened.WSAConnectByListin that time.XCL_NETWORK=0: the system's WinHTTP, WinINet and Winsock refuse the network for the whole process, which XCL prints only when every system hook went in.Smoke runs
main
930e8b4+ #235main
930e8b4+ #235 + #821 (f9ef768)Not tested
mainand of this PR's head as they are (no Gaming Services here, see above).WSAConnectByList.AI use
@Toons29 on GitHub · 2026-11-25 03:02 UTC · original
Regression run of
f9ef7685on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.@DavidM1911 on GitHub · 2026-11-25 10:48 UTC · original
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!
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.