History

conntrack: RFC5961 challenge ACK confuse conntrack LAST-ACK transition

In compliance with RFC5961, the network stack send challenge ACK in response to spurious SYN packets, since commit 0c228e833c88 ("tcp: Restore RFC5961-compliant behavior for SYN packets"). This pose a problem for netfilter conntrack in state LAST_ACK, because this challenge ACK is (falsely) seen as ACKing last FIN, causing a false state transition (into TIME_WAIT). The challenge ACK is hard to distinguish from real last ACK. Thus, solution introduce a flag that tracks the potential for seeing a challenge ACK, in case a SYN packet is let through and current state is LAST_ACK. When conntrack transition LAST_ACK to TIME_WAIT happens, this flag is used for determining if we are expecting a challenge ACK. Scapy based reproducer script avail here: https://github.com/netoptimizer/network-testing/blob/master/scapy/tcp_hacks_3WHS_LAST_ACK.py

Jesper Dangaard Brouer committed 11 years ago

Commit b3cad281 parent 595ca582 files · +35 −3Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/netfilter/nf_conntrack_tcp.h+3−0
@@ -42,6 +42,9 @@ enum tcp_conntrack { · 41 unmodified lines
4242 /* The field td_maxack has been set */
4343 #define IP_CT_TCP_FLAG_MAXACK_SET 0x20
4444
45+/* Marks possibility for expected RFC5961 challenge ACK */
46+#define IP_CT_EXP_CHALLENGE_ACK 0x40
47+
4548 struct nf_ct_tcp_flags {
4649 __u8 flags;
4750 __u8 mask;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t