HLE: return Winsock sockaddr errors from getnameinfo on invalid input #2995
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2995
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2995"
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?
@fuzeofficlal on GitHub · 2026-11-26 02:47 UTC · original
fuzeofficlal:fix/hle-net-getnameinfo-malformed-addr→main· +154 −13 · 1 files · 1 commits · closed without mergingProblem
name_info_flagsincrates/victory-hle/src/modules/net.rsrelied onsocket_addr(sa, len)returningOption<SocketAddr>. When a caller passed a nullsockaddr, a negative/shortsa_len(< 2), a truncatedAF_INET(< 16) orAF_INET6(< 28) address, or an unsupported address family,socket_addrreturnedNone, causingreverse_resolvable(None)to emit a spurious"network reverse lookup blocked"log and returnWSAHOST_NOT_FOUND(11001) underNI_NAMEREQD.Native Windows
ws2_32.dll(getnameinfo/GetNameInfoW) instead sets and returnsWSAEFAULT(10014) for null/undersizedsockaddrinputs andWSAEAFNOSUPPORT(10047) for unsupported address families.Fix
name_info_addrto parsesockaddrforgetnameinfo/GetNameInfoW, returningErr(WSAEFAULT)for null or undersized buffers andErr(WSAEAFNOSUPPORT)for unsupported families.name_info_flagsreturnResult<i32, i32>, settingWSASetLastError(err)and returningerron invalid inputs before applying the offline reverse-lookup policy for valid IPv4/IPv6 addresses.getnameinfoandGetNameInfoW.Verification
modules::net::tests::getnameinfo_reports_winsock_address_errors_instead_of_host_not_foundcovering bothgetnameinfoandGetNameInfoWacross nullsockaddr(NI_NAMEREQD&NI_NUMERICHOST), negative length, short header (len = 1), truncatedAF_INET/AF_INET6, unsupported family (99), and valid non-loopback IPv4 (203.0.113.1with and withoutNI_NAMEREQD), asserting both return values andWSAGetLastError().cargo test --locked -p victory-hle -- --test-threads=1: 153/153 unit + 2/2 integration tests passed.cargo clippy --locked -p victory-hle --tests -- -D warnings(default &--all-features): 0 warnings.cargo xtask policy: 191 files ok.@futurepro62 on GitHub · 2026-11-26 04:49 UTC · original
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head
306a4b7(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.getnameinfo_reports_winsock_address_errors_instead_of_host_not_found.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
@Marvisak on GitHub · 2026-11-26 05:41 UTC · original
Automated triage for the maintainers.
Needs work.
name_info_flags(crates/victory-hle/src/modules/net.rs) now parses thesockaddritself (name_info_addr). For a null, short or unknown-family address it returnsWSAEFAULT/WSAEAFNOSUPPORTwithout calling the host'sgetnameinfo/GetNameInfoW. The offline guard is not loosened. Valid non-loopback addresses still getNI_NUMERICHOSTorWSAHOST_NOT_FOUND, and invalid ones no longer reach the host at all.What this actually changes is narrow. On
main, an invalid address withoutNI_NAMEREQDalready went to the host withNI_NUMERICHOSTadded, and the host returned the sameWSAEFAULT/WSAEAFNOSUPPORT. The only different result is invalid input withNI_NAMEREQD, which now gets the address error instead ofWSAHOST_NOT_FOUND. Both are failures, and nothing shows the title passing a malformedsockaddrto these calls. To make this worth merging, please show that the title reaches this case: a log from a title run, or the call site in the title's code. Without that, it is a guard for input the title does not send, and it would be proposed for closing.CI: passing (
check).Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-26 06:09 UTC · original
Fair point from triage — without
NI_NAMEREQD,mainalready returns the host'sWSAEFAULT/WSAEAFNOSUPPORT, and I have no title-run evidence showing malformedsockaddrinputs withNI_NAMEREQD. Closing to keep the queue focused on higher-impact changes; happy to reopen if a title log ever hits this path.Pull request closed