XGameRuntime: XNetworkingVerifyServerCertificate reads URLs of any length #1282
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1292"
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 emirduran707 on 2026-11-24T14:21:09Z.
XNetworkingVerifyServerCertificateread the request's URL (WINHTTP_OPTION_URL) into a fixed 2048-character buffer. For a URL of 2048 characters or more,WinHttpQueryOptionfails withERROR_INSUFFICIENT_BUFFER, and the verification returned 0x8007007A, failing the title's request. libHttpClient calls this on every request when the XNetworking feature is available. Measured on this machine: a 2100-character path gives error 122 and 4236 bytes required.The documentation of
WinHttpQueryOptionsays that onERROR_INSUFFICIENT_BUFFERthe length "receives the number of bytes required to hold the requested information".request_urlnow queries into a buffer it grows to that size and queries once more. The length checks after the query are unchanged.What is in it
crates/xcl/src/hle/xgameruntime/networking.rs:request_url, used byXNetworkingVerifyServerCertificate;request_url_reads_a_url_of_any_length. Its query answers asWinHttpQueryOptiondoes on Windows: too small a buffer fails with 122 and the bytes needed, a big enough one gets the URL and its length without the terminator. A short and a 3000-character URL are read whole, and another error is passed on.XCL_NETWORK=0test hooksWinHttpConnectfor the whole test process, so a real WinHTTP request depends on test order. A first version of this test did that and failed in the full suite.Tested
cargo test --workspace -- --test-threads=4on2bf1b58: 742 passed, 0 failed, 41 ignored; no SKIPPED GPU testsURL read: 122); with the change it passes, also in one run with thenetofftestsRegression run
main:
this PR:
Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T14:33:25Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Thanks!
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:37:48Z.
Full-suite run to go with the subset check above. Tested exact head
2bf1b58(on its base47efa2e).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.request_url_reads_a_url_of_any_length.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T16:02:00Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib -- --test-threads=1: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodifiedmain.)Thanks!
upstream-sync referenced this pull request2026-11-24 19:06:45 +00:00
Imported from ivall/xcl. Originally posted by S1m0ne1997 on 2026-11-25T14:48:32Z.
Test report for
2bf1b58d17601ece270e42b457c4af1a2933bf41(this PR's head), for #1607.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09)x86_64-pc-windows-msvc, debug.cargo build --workspace, thencargo test --workspace -- --test-threads=4at the head: 742 passed, 0 failed, 41 ignored.gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64).Regression run (retail title,
scripts/smoke.ps1 -Seconds 60, release;mainbuilt from the commit in its block, this PR from its head with no changes tocrates/, both run with thescripts/smoke.ps1ofmain, which hashes the name of the game folder)main:
this PR:
Peak commit is over the 125 % rule: this PR's run peaked at 22295 MB, 136 % of
main's 16384 MB (frames: within 80 %). I can't tell from this whether the PR causes it: this branch is based on47efa2e, 490 commits older than themaincommit (06c9f55) its run is compared with, and each side was run once. A smoke run of the base itself, or of this PR rebased onto currentmain, would separate the two.Not tested
AI use: Claude Code with Claude Opus 5.5 ran the build, the suite and the regression run and wrote this report at my request.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T04:47:30Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by throny on 2026-11-28T16:54:45Z.
merge-check claim
head:
2bf1b58d17Imported from ivall/xcl. Originally posted by throny on 2026-11-28T17:10:40Z.
merge-check
base:
db3921dchead:
2bf1b58d17merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2146 passed, 0 failed, 48 ignored (26 SKIPPED lines). Base alone at
db3921dc: 2145 passed, 0 failed, 48 ignored.review: no blocking finding; all hunks read. Bytes and UTF-16 units are kept apart correctly, the second query happens only after "buffer too small" with the size the system reported (no loop), and the result does not rely on a terminator. Minor: there is no upper limit on the size the system reports. One earlier report in the thread measured a higher peak commit against a much newer main; this code cannot allocate that much and the pair in the description is level.
performance: none.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by relativespace2K on 2026-11-30T02:05:05Z.
merge-check
base:
53e85fb1head:
2bf1b58d17merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2789 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in
--test gpu_two_pass_cache_e2e, so 5 failing tests give 6 failures). The same five fail on base53e85fb1alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its new test passed. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused.review: no blocking finding; one file plus its test, every hunk read.
request_urlretries only when WinHTTP answersERROR_INSUFFICIENT_BUFFERand reports more bytes than the buffer it was given, so a driver that answers the same size cannot spin it, and the second query's error is handed back as the Win32 error the caller already knew how to turn into an HRESULT. The buffer is resized by the reported byte count, and the caller's existing sanity checks (0, odd length, larger than the buffer) still run before the string is read. The test answers as measured WinHTTP does (insufficient buffer plus the bytes needed, then the URL without its terminator) for a short and a 3000-character URL, and covers the error path withERROR_INVALID_HANDLE; mocking the query rather than calling WinHTTP is right here, becauseXCL_NETWORK=0hooksWinHttpConnectfor the whole test process. Not tested: a URL so long that even the second query needs more room, which is not a state WinHTTP can reach.performance: none: one option query at certificate verification, the same call the old code made, plus one retry only for URLs longer than 4 KB.
verdict: safe to merge
hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.