Trond Myklebust 5d69622eb0 SUNRPC: Don't call connect() more than once on a TCP socket
commit 89f42494f92f448747bd8a7ab1ae8b5d5520577d upstream.

Avoid socket state races due to repeated calls to ->connect() using the
same socket. If connect() returns 0 due to the connection having
completed, but we are in fact in a closing state, then we may leave the
XPRT_CONNECTING flag set on the transport.

Reported-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Fixes: 3be232f11a3c ("SUNRPC: Prevent immediate close+reconnect")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-13 20:59:26 +02:00
..
2022-03-11 12:22:36 +01:00
2021-06-30 15:51:09 -07:00
2021-06-29 11:28:21 -07:00
2022-04-08 14:24:14 +02:00
2022-04-08 14:23:36 +02:00
2021-06-03 15:13:56 -07:00
2021-07-29 15:06:49 +01:00
2021-07-29 15:06:49 +01:00