http://bugs.winehq.org/show_bug.cgi?id=60205 Bug ID: 60205 Summary: accept() sockets are unconditionally inheritable Product: Wine Version: 11.15 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winsock Assignee: wine-bugs@list.winehq.org Reporter: me@purplesyringa.moe Target Milestone: --- Distribution: --- In Wine, executing accept() on a socket always produces a socket with the inheritable flag set [1]. Windows behaves differently; from testing, the accepted socket is marked inheritable if and only if the listener socket was inheritable during the original WSASocket() invocation [2]. This affects e.g. all Rust programs due to a combination of two factors: Rust spawns child processes without an inheritance allowlist, and it doesn't explicitly make accepted sockets non-inheritable because SetHandleInformation doesn't work in UWP apps, and normally they're already non-inheritable so there's no need to do it anyway. Security implications aside, this can at least keep connections open for longer than intended in some programs, though I didn't look for any real-world victims. I'm not sure how comfortable Wine is with replicating undocumented behavior, but I'd assume in this case it's not baseless because Rust already implicitly makes this assumption. [1]: https://gitlab.winehq.org/wine/wine/-/blob/9306b8e8de4efe3a6035bc5df878e7504... [2]: https://purplesyringa.moe/blog/accept-and-socket-inheritance/ -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.