]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: Don't call connect() more than once on a TCP socket
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 16 Mar 2022 23:10:43 +0000 (19:10 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 22 Mar 2022 19:52:55 +0000 (15:52 -0400)
commit6063992264cb52f34e38da967a2fd5ba123a26b9
treef71b09bc13d49289b34edaec3e3cb8bca5193707
parent58c4286dfde0b8bcd8d4e25eb5abd24a4760d45f
SUNRPC: Don't call connect() more than once on a TCP socket

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: a883d0ce4a15 ("SUNRPC: Prevent immediate close+reconnect")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
include/linux/sunrpc/xprtsock.h
net/sunrpc/xprtsock.c