]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.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)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:42:34 +0000 (15:42 -0500)
commitf3a7bf8761536538c03e921a1a324112dcfc3e02
tree392ed38defba4fc378e3aa202d3b8acf2548d269
parent9e79cfa84cf65bb47f33102d6c26aa57d7082657
tcp: relookup sock for RST+ACK packets handled by obsolete req sock

BugLink: https://bugs.launchpad.net/bugs/1922601
[ 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>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
include/net/inet_connection_sock.h
net/ipv4/inet_connection_sock.c
net/ipv4/tcp_minisocks.c