consommé: Don't drop the connection when a stale SYN is received from the guest - #4149
Open
Blue (OneBlue) wants to merge 1 commit into
Open
consommé: Don't drop the connection when a stale SYN is received from the guest#4149Blue (OneBlue) wants to merge 1 commit into
Blue (OneBlue) wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a TCP port-forward edge case in the consomme user-mode TCP stack: when a new forwarded connection reuses a 4-tuple that the guest still associates with a recently-closed (stale) connection, an ACK-only response from the guest should no longer cause consomme to drop the newly accepted host-side socket. Instead, consomme resets the stale tuple state and retries the SYN to complete the handshake.
Changes:
- Prevent
send_nextfrom emitting data/ACK traffic while the connection is still inSynSent. - In
SynSent, detect an unacceptable/stale ACK-only response, send a RST to clear stale state, rewind the transmit sequence, and retry the active-open SYN. - Add a regression test that reproduces and validates recovery from the stale-ACK-on-reused-tuple scenario.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| vm/devices/net/net_consomme/consomme/src/tcp/tests.rs | Adds a regression test covering recovery from a stale guest ACK on a reused tuple during port-forward handshake. |
| vm/devices/net/net_consomme/consomme/src/tcp.rs | Adjusts SynSent behavior to avoid sending data/ACK prematurely and to reset+retry when a stale/unacceptable ACK arrives. |
Comment on lines
+923
to
+924
| let connector = std::net::TcpStream::connect(host_addr).unwrap(); | ||
| connector.set_nonblocking(true).unwrap(); |
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.
This change solves an issue where we incorrectly drop a connection if we receive a SYN packet that matches a stale tuple.
Sample repro: