XGameRuntime: support IPv4 loopback subnets and validate async result buffers #1372
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1382"
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 mahfuzinam0045-spec on 2026-11-24T15:25:17Z.
Under RFC 1122 and standard IPv4 specifications, the entire
127.0.0.0/8range represents loopback addresses.url_host_and_is_plain_loopbackincrates/xcl/src/hle/xgameruntime/networking.rspreviously checked only127.0.0.1and::1. Local test servers, proxies, and backends bound to other loopback addresses (such as127.0.0.2or127.0.1.1) were not recognized as plain HTTP loopbacks, triggering unexpected server certificate verification attempts on plain HTTP requests. Replacing manual string comparisons withstd::net::IpAddr::is_loopback()correctly recognizes all IPv4 loopback addresses in127.0.0.0/8as well as IPv6::1.In addition,
security_info_resultnow enforces non-nullbufferandout_ptrchecks per the GDK_COM_Outptr_contract, returningE_INVALIDARGinstead of reporting an insufficient buffer error whenbufferis null or silently finishing with a nullout_ptr. It also resetsbuffer_usedto 0 on entry and nullsout_ptron failure, andXNetworkingQueryPreferredLocalUdpMultiplayerPortAsyncResultinitializes*port = 0on entry so it is never left uninitialized if result retrieval fails.What is in it
crates/xcl/src/hle/xgameruntime/networking.rs:IpAddr::is_loopback()inurl_host_and_is_plain_loopbackto cover all IPv4 loopback subnets (127.0.0.0/8) and IPv6 (::1).bufferandout_ptrinsecurity_info_result, resetbuffer_usedto 0 on entry, and nullout_ptron error.*port = 0inXNetworkingQueryPreferredLocalUdpMultiplayerPortAsyncResult.connectivity_hint_and_pin_verificationwith loopback subnet tests (127.0.0.2,127.1.2.3), and addedsecurity_info_result_validates_pointers_and_nulls_on_errorchecking pointer validation, null safety, and error handling.Tested
cargo check -p xcl --testspasses with 0 errors and 0 warnings.url_host_and_is_plain_loopbackcorrectly classifieshttp://127.0.0.2:8080/testandhttp://127.1.2.3:8080/testas plain loopback HTTP.security_info_resultproperly rejects nullout_ptrand nullbufferwithE_INVALIDARG, clearsbuffer_usedto 0 on failure, and nullsout_ptr.Regression run
crates/xcl/src/hle/xgameruntime/networking.rs, verified with self-contained unit tests.Not tested
AI use
cargo check -p xcl --tests, and prepared this pull request.Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T15:34:02Z.
Full-suite run, since this PR has no test report yet. Tested exact head
2b765d2(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.security_info_result_validates_pointers_and_nulls_on_error.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T16:49:47Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-27T21:26:22Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:35:42Z.
Triage (#1607) – head
2b765d2No open or merged PR makes the same change; main's
url_host_and_is_plain_loopbackstill matches only127.0.0.1/::1, andsecurity_info_resultstill accepts a nullout_ptr/buffer. #808 parses loopback addresses for sockets (local_name), a different function.No problems found in the diff. The early
E_INVALIDARGreturns beforeXAsyncGetResult, so the result is not consumed by a rejected call, which the test relies on. The failing check is the PR description check (no regression run), and the branch conflicts with main.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.