sock_hc: only report releases for listening TCP sockets#75
Draft
lacraig2 wants to merge 1 commit into
Draft
Conversation
Contributor
Author
|
Paired host-side change: rehosting/penguin#822 (NetBinds debounce + transient lifecycle tracking). |
igloo_sock_release fired for any socket release, including accepted and connected sockets that share a listener's local port. A client disconnecting from a service therefore looked like the listener itself closing — most damaging for loopback services bound to 127.0.0.1, whose connections share the bound address. Gate TCP releases on sk_state == TCP_LISTEN so only genuine listener shutdowns are reported; UDP behavior is unchanged. This pairs with the host-side NetBinds lifecycle tracking in rehosting/penguin.
9e60552 to
8336a3b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
igloo_sock_releasefired a release hypercall for any socket release, including accepted/connected sockets that share a listener's local port. A client disconnecting from a service therefore looked like the listener itself closing — most damaging for loopback services bound to127.0.0.1, whose connections share the bound address.Gate TCP releases on
sk->sk_state == TCP_LISTEN(both IPv4 and IPv6) so only genuine listener shutdowns are reported. UDP behavior is unchanged. Adds#include <net/tcp_states.h>for the constant.The hook runs before
inet_release/tcp_close(it already reads a liveinet_sport), so a listener is still inTCP_LISTENat this point.Why
Pairs with the host-side socket lifecycle tracking in rehosting/penguin#822 (NetBinds debounce + transient labeling): without this guard, connection teardowns would be mislabeled as service closes / flaps.
Validation
./build.sh(no warnings fromsock_hc.c); module loads in-guest.TCP_LISTEN/sk_stateare stable across 4.10 and 6.13.