]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tcp: call tcp_drop() from tcp_data_queue_ofo()
authorEric Dumazet <edumazet@google.com>
Mon, 23 Jul 2018 16:28:20 +0000 (09:28 -0700)
committerBrian Maly <brian.maly@oracle.com>
Fri, 14 Sep 2018 03:14:23 +0000 (23:14 -0400)
[ Upstream commit 8541b21e781a22dce52a74fef0b9bed00404a1cd ]

In order to be able to give better diagnostics and detect
malicious traffic, we need to have better sk->sk_drops tracking.

Fixes: 9f5afeae5152 ("tcp: use an RB tree for ooo receive queue")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(adapted from v4.9.x commit 94623c7463f3424776408df2733012c42b52395a)

Orabug: 28639707
CVE: CVE-2018-5390

Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
net/ipv4/tcp_input.c

index 9cd7d990cc288f5fd3cc9a2992917cf4f54c22f8..9023441b6865ad737e462fce64bd0a8ed378e8a1 100644 (file)
@@ -4376,7 +4376,7 @@ coalesce_done:
                                /* All the bits are present. Drop. */
                                NET_INC_STATS(sock_net(sk),
                                              LINUX_MIB_TCPOFOMERGE);
-                               __kfree_skb(skb);
+                               tcp_drop(sk, skb);
                                skb = NULL;
                                tcp_dsack_set(sk, seq, end_seq);
                                goto add_sack;
@@ -4395,7 +4395,7 @@ coalesce_done:
                                                 TCP_SKB_CB(skb1)->end_seq);
                                NET_INC_STATS(sock_net(sk),
                                              LINUX_MIB_TCPOFOMERGE);
-                               __kfree_skb(skb1);
+                               tcp_drop(sk, skb1);
                                goto add_sack;
                        }
                } else if (tcp_try_coalesce(sk, skb1, skb, &fragstolen)) {