From e10b517065fa5fc02bc791b10d830a19a84f271a Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Tue, 17 May 2022 11:35:57 +0000 Subject: [PATCH] Revert "SUNRPC: attempt AF_LOCAL connect on setup" mainline inclusion from mainline-v5.18-rc6 commit a3d0562d4dc039bca39445e1cddde7951662e17d category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I57MRF CVE: NA ------------------------------------------- This reverts commit 7073ea8799a8cf73db60270986f14e4aae20fa80. We must not try to connect the socket while the transport is under construction, because the mechanisms to safely tear it down are not in place. As the code stands, we end up leaking the sockets on a connection error. Reported-by: wanghai (M) Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust Signed-off-by: Wang Hai Reviewed-by: Zhang Xiaoxu Reviewed-by: Wei Yongjun Signed-off-by: Yongqiang Liu --- net/sunrpc/xprtsock.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index f93d386ae923..38598edcd86e 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -2978,9 +2978,6 @@ static struct rpc_xprt *xs_setup_local(struct xprt_create *args) } xprt_set_bound(xprt); xs_format_peer_addresses(xprt, "local", RPCBIND_NETID_LOCAL); - ret = ERR_PTR(xs_local_setup_socket(transport)); - if (ret) - goto out_err; break; default: ret = ERR_PTR(-EAFNOSUPPORT); -- GitLab