]> git.baikalelectronics.ru Git - 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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Mar 2021 21:34:29 +0000 (14:34 -0700)
commit7233da86697efef41288f8b713c10c2499cffe85
tree84b39d3cfd527e860a52f874390cae3e5fbe2c15
parent0217ed2848e8538bcf9172d97ed2eeb4a26041bb
tcp: relookup sock for RST+ACK packets handled by obsolete req sock

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>
include/net/inet_connection_sock.h
net/ipv4/inet_connection_sock.c
net/ipv4/tcp_minisocks.c