summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-07-22 18:21:17 -0700
committerJakub Kicinski <kuba@kernel.org>2025-07-22 18:21:17 -0700
commit9f9a14a88c62a02439893197b96553d629cc1ce8 (patch)
treef01f7761091af9c48eeac8295d838ca67c984384
parent8839d1cc6ce0d38b4799380eae0c31bb0f07928b (diff)
parentb115c7758802f8d14ba8797e0ba979c47d78f310 (diff)
Merge branch 'tcp-a-couple-of-fixes'
Paolo Abeni says: ==================== tcp: a couple of fixes This series includes a couple of follow-up for the recent tcp receiver changes, addressing issues outlined by the nipa CI and the mptcp self-tests. Note that despite the affected self-tests where MPTCP ones, the issues are really in the TCP code, see patch 1 for the details. v1: https://lore.kernel.org/cover.1752859383.git.pabeni@redhat.com ==================== Link: https://patch.msgid.link/cover.1753118029.git.pabeni@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--net/ipv4/tcp_input.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 672cbfbdcec1..71b76e98371a 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5549,6 +5549,10 @@ static int tcp_prune_queue(struct sock *sk, const struct sk_buff *in_skb)
{
struct tcp_sock *tp = tcp_sk(sk);
+ /* Do nothing if our queues are empty. */
+ if (!atomic_read(&sk->sk_rmem_alloc))
+ return -1;
+
NET_INC_STATS(sock_net(sk), LINUX_MIB_PRUNECALLED);
if (!tcp_can_ingest(sk, in_skb))
@@ -5911,7 +5915,11 @@ step1:
if (!th->rst) {
if (th->syn)
goto syn_challenge;
- NET_INC_STATS(sock_net(sk), LINUX_MIB_BEYOND_WINDOW);
+
+ if (reason == SKB_DROP_REASON_TCP_INVALID_SEQUENCE ||
+ reason == SKB_DROP_REASON_TCP_INVALID_END_SEQUENCE)
+ NET_INC_STATS(sock_net(sk),
+ LINUX_MIB_BEYOND_WINDOW);
if (!tcp_oow_rate_limited(sock_net(sk), skb,
LINUX_MIB_TCPACKSKIPPEDSEQ,
&tp->last_oow_ack_time))