net: the log list of blocked destinations grows without bound and is scanned under a global lock #220

Open
opened 2026-11-26 11:58:04 +00:00 by kekonn · 0 comments
kekonn commented 2026-11-26 11:58:04 +00:00 (Migrated from github.com)
Contributor

Imported from avatarmanz/VIctory-7900XTX. Originally posted by kekonn on 2026-11-26T11:58:04Z.


crates/victory-hle/src/modules/net.rs:71 keeps static SEEN: Mutex<Vec<(&str, String)>>, so that a blocked destination is logged only the first time. The key includes the port (shown(SocketAddr); WinHTTP logs {name}:{port}, ~738). Every blocked call scans the whole list linearly under one global lock, and nothing ever removes an entry.

When: the default path, on every blocked connect/sendto/name lookup/WinHTTP connect. It grows with each distinct (call, destination:port) pair, which is unbounded only if the title keeps trying new destinations or ports (per-peer UDP, NAT punching, scanning).

Proposed fix (~5 lines)

Stop adding after 256 entries and log once that further blocked destinations are not logged. Optionally use a HashSet for O(1) lookups.

Upstream: no open PR touches net.rs.
Status: a fix is being prepared in kekonn/VIctory-7900XTX on branch claude/gifted-clarke-uxuqw8.


Generated by Claude Code

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6626151602 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/issues/220). Originally posted by [kekonn](https://github.com/kekonn) on 2026-11-26T11:58:04Z. --- `crates/victory-hle/src/modules/net.rs:71` keeps `static SEEN: Mutex<Vec<(&str, String)>>`, so that a blocked destination is logged only the first time. The key includes the port (`shown(SocketAddr)`; WinHTTP logs `{name}:{port}`, ~738). Every blocked call scans the whole list linearly under one global lock, and nothing ever removes an entry. **When:** the default path, on every blocked `connect`/`sendto`/name lookup/WinHTTP connect. It grows with each distinct (call, destination:port) pair, which is unbounded only if the title keeps trying new destinations or ports (per-peer UDP, NAT punching, scanning). ### Proposed fix (~5 lines) Stop adding after 256 entries and log once that further blocked destinations are not logged. Optionally use a `HashSet` for O(1) lookups. **Upstream:** no open PR touches `net.rs`. **Status:** a fix is being prepared in kekonn/VIctory-7900XTX on branch `claude/gifted-clarke-uxuqw8`. --- _Generated by [Claude Code](https://claude.ai/code)_
Sign in to join this conversation.
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
avatarmanz/VIctory-7900XTX#220
No description provided.