casaroli opened a new pull request, #22359:
URL: https://github.com/apache/nuttx/pull/22359

   ## Summary
   
   When the SYN-ACK retries of a connection in `TCP_SYN_RCVD` end, 
`tcp_timer()` sends a RST to the source address of the SYN and frees the 
connection. The peer never answered the SYN-ACK, so the RST has nothing to 
reset. When the source address of the SYN is spoofed, the RST goes to a host 
that sent nothing.
   
   Now the connection is freed and nothing is sent, as Linux does when a 
request in its SYN queue times out. RFC 9293 does not ask for a RST here. A 
connection that this side opened, and an established connection, still send a 
RST when their retries end. The TCP state machine page says so.
   
   ## Impact
   
   Passive open only (`net/tcp/tcp_timer.c`). No API, ABI or Kconfig change. A 
peer that never answers the SYN-ACK no longer gets a RST at the timeout.
   
   ## Testing
   
   Host: Fedora x86_64. Target: qemu-armv8a:nsh (flat build) under QEMU TCG, 
cortex-a53, 1 CPU, a TUN device. A test program (not part of this PR) writes 
SYNs from spoofed sources to the TUN device for 60 s, never answers, and counts 
the packets that the target sends to these sources in the next 60 s.
   
   | | master 4f8706c4b35 | this PR |
   |---|---|---|
   | RST to the spoofed sources after the SYN-ACK retries | 6 (one per 
connection that timed out) | 0 |
   
   - Build with `-Werror` (CI image, aarch64-none-elf-gcc 13.2.1): 
qemu-armv8a:nsh with TCP.
   - `tools/checkpatch.sh -c -u -m -g`: pass.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to