HLE/net: refuse a WSAConnectByList count the list cannot back #476
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!476
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/476/head"
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?
@iloveslopware on GitHub · 2026-11-25 01:22 UTC · original
iloveslopware:wsaconnectbylist-count→main· +42 −0 · 1 files · 1 commits · closed without mergingWSAConnectByListturnediAddressCountinto a&[SocketAddress]of that length before any address was vetted, so a list holding one 16-byte entry withiAddressCount = 0x7FFFFFFFproduced a ~34 GB slice and read far past the title's allocation as pointers and lengths — undefined behavior beforereachable()could weigh in (#428).A
SOCKET_ADDRESS_LISTcarries no size the count could be checked against, so the count is the title's word alone. More candidates than any title offers (MAX_CONNECT_LIST, 64) are now refused withWSAEINVALand aFALSEreturn — the same fail-closed posture as the rest of this module — while honest lists reach the host unchanged and the vetting loop is untouched.The new test builds a one-entry list whose count claims
i32::MAXand asserts the call returns 0 withWSAEINVALset, refusing before the entries are walked.Fixes #428.
Verification:
cargo clippy --target x86_64-pc-windows-msvc --workspace --all-targets --locked -- -D warnings(clang-cl 23.1.5, cross-checked from Linux) passes on default features and on--all-features; this compiles the new test, which then runs in this repo's Windows CI.#[cfg(windows)]-gated, so the Linux build is untouched by construction;main's pre-existing non-Windows test-compile gaps are outside this change and covered by #449.No formatting-only churn: one const with its rationale, a four-line guard, one test.
Disclosure: written with AI assistance (GLM via OpenCode) — the fix, test, and cross-verification were drafted and run with the tool, following the report in #428. Reviewed and understood by the human submitting it.
@kaayzouee on GitHub · 2026-11-25 01:41 UTC · original
Is this a duplicate of #466?
Both address #428 by rejecting oversized WSAConnectByList counts.
This is an automated message. If you believe it is incorrect, please reply with the relevant technical differences.
@iloveslopware on GitHub · 2026-11-25 01:44 UTC · original
Yes — #466 was opened five minutes before this one and covers the same defect more completely: it also refuses a negative
iAddressCount(which this change left falling to 0 and forwarding the list to the host unvetted), and it reads the entries one at a time withread_unalignedrather than forming a&[SocketAddress]. Its tests cover more ground too, including the host-connect path on real hardware. The cap (64) and the failure mode (WSAEINVAL+FALSE) are identical, so there is nothing here that #466 lacks — closing in its favor.Pull request closed