]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tcp: relookup sock for RST+ACK packets handled by obsolete req sock
authorAlexander Ovechkin <ovov@yandex-team.ru>
Mon, 15 Mar 2021 11:05:45 +0000 (14:05 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:30:20 +0000 (14:30 +0200)
commit191d215957883d560073cebe6f3d487be89ff8a4
tree61b430bcb39aea19bde2e70f1f5b3116ba35d80d
parentea9f7fa30ba71c2550bd556de30eabed6f1b0c6e
tcp: relookup sock for RST+ACK packets handled by obsolete req sock

[ Upstream commit 7233da86697efef41288f8b713c10c2499cffe85 ]

Currently tcp_check_req can be called with obsolete req socket for which big
socket have been already created (because of CPU race or early demux
assigning req socket to multiple packets in gro batch).

Commit e0f9759f530bf789e984 ("tcp: try to keep packet if SYN_RCV race
is lost") added retry in case when tcp_check_req is called for PSH|ACK packet.
But if client sends RST+ACK immediatly after connection being
established (it is performing healthcheck, for example) retry does not
occur. In that case tcp_check_req tries to close req socket,
leaving big socket active.

Fixes: e0f9759f530 ("tcp: try to keep packet if SYN_RCV race is lost")
Signed-off-by: Alexander Ovechkin <ovov@yandex-team.ru>
Reported-by: Oleg Senin <olegsenin@yandex-team.ru>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/inet_connection_sock.h
net/ipv4/inet_connection_sock.c
net/ipv4/tcp_minisocks.c