]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tcp: Fix imbalanced icsk_accept_queue count.
authorKuniyuki Iwashima <kuniyu@google.com>
Wed, 6 May 2026 03:59:19 +0000 (03:59 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jun 2026 15:46:25 +0000 (17:46 +0200)
[ Upstream commit 7eca3292cac7c26dad4c236f51ba225c39a0523f ]

When TCP socket migration happens in reqsk_timer_handler(),
@sk_listener will be updated with the new listener.

When we call __inet_csk_reqsk_queue_drop(), the listener must
be the one stored in req->rsk_listener.

The cited commit accidentally replaced oreq->rsk_listener with
sk_listener, leading to imbalanced icsk_accept_queue count.

Let's pass the correct listener to __inet_csk_reqsk_queue_drop().

Fixes: e8c526f2bdf1 ("tcp/dccp: Don't use timer_pending() in reqsk_queue_unlink().")
Reported-by: Damiano Melotti <melotti@google.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260506035954.1563147-3-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/inet_connection_sock.c

index bf4e5f49030b7d8534f8b97d0e2b2ae6406d474c..dd39cabb39001e4ae98e73db0d92af524c017ac7 100644 (file)
@@ -1172,7 +1172,7 @@ no_ownership:
        }
 
 drop:
-       __inet_csk_reqsk_queue_drop(sk_listener, oreq, true);
+       __inet_csk_reqsk_queue_drop(oreq->rsk_listener, oreq, true);
        reqsk_put(oreq);
 }