]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
tcp: drop SYN+FIN messages
authorEric Dumazet <eric.dumazet@gmail.com>
Fri, 2 Dec 2011 23:41:42 +0000 (23:41 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 25 Jul 2012 03:10:55 +0000 (04:10 +0100)
commit fdf5af0daf8019cec2396cdef8fb042d80fe71fa upstream.

Denys Fedoryshchenko reported that SYN+FIN attacks were bringing his
linux machines to their limits.

Dont call conn_request() if the TCP flags includes SYN flag

Reported-by: Denys Fedoryshchenko <denys@visp.net.lb>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/ipv4/tcp_input.c

index 97269278355a6d1f8184c9b45b3a184547fc113b..32e6ca282be147bec39fcfb0f9182227afd46490 100644 (file)
@@ -5836,6 +5836,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
                        goto discard;
 
                if (th->syn) {
+                       if (th->fin)
+                               goto discard;
                        if (icsk->icsk_af_ops->conn_request(sk, skb) < 0)
                                return 1;