net: bound the title's count in WSAConnectByList (#428) #472

Closed
JamesCicada wants to merge 1 commit from upstream-pr/472 into main
JamesCicada commented 2026-11-25 01:20:17 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by JamesCicada on 2026-11-25T01:20:17Z.


The shim built a slice from the SOCKET_ADDRESS_LIST's own count, with no upper bound, before vetting the entries: a list that claimed more entries than it held made the walk read past it.

A count over 64 (our limit; a title passes the few addresses one name resolved to) is now refused with WSAEINVAL before any entry is read. Entries are read one at a time, unaligned, stopping at the first one that is not loopback, and no slice is made over title memory.

Tests: a mixed loopback/off-machine list is still refused with WSAENETUNREACH; a count of 65, and i32::MAX over one real entry, are refused with WSAEINVAL.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6594911955 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/472). Originally posted by [JamesCicada](https://github.com/JamesCicada) on 2026-11-25T01:20:17Z. --- The shim built a slice from the SOCKET_ADDRESS_LIST's own count, with no upper bound, before vetting the entries: a list that claimed more entries than it held made the walk read past it. A count over 64 (our limit; a title passes the few addresses one name resolved to) is now refused with WSAEINVAL before any entry is read. Entries are read one at a time, unaligned, stopping at the first one that is not loopback, and no slice is made over title memory. Tests: a mixed loopback/off-machine list is still refused with WSAENETUNREACH; a count of 65, and i32::MAX over one real entry, are refused with WSAEINVAL.
kaayzouee commented 2026-11-25 02:10:09 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by kaayzouee on 2026-11-25T01:41:19Z.


Is this a duplicate of #466?

Both bound the WSAConnectByList count to 64 and read candidates individually.

This is an automated message. If you believe it is incorrect, please reply with the relevant technical differences.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7149839919 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/472#issuecomment-7149839919). Originally posted by [kaayzouee](https://github.com/kaayzouee) on 2026-11-25T01:41:19Z. --- Is this a duplicate of #466? Both bound the WSAConnectByList count to 64 and read candidates individually. This is an automated message. If you believe it is incorrect, please reply with the relevant technical differences.
upstream-sync closed this pull request 2026-11-25 03:06:14 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!472
No description provided.