summaryrefslogtreecommitdiffstats
path: root/net/smc
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-04-14 01:04:28 +0200
committerJakub Kicinski <kuba@kernel.org>2023-04-14 01:04:28 +0200
commit800e68c44ffe71f9715f745b38fd1af6910b3773 (patch)
tree898caef9a109e429776e65c1083d1503207bebed /net/smc
parentMerge branch 'net-use-read_once-write_once-for-ring-index-accesses' (diff)
parentMerge tag 'net-6.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netd... (diff)
downloadlinux-800e68c44ffe71f9715f745b38fd1af6910b3773.tar.xz
linux-800e68c44ffe71f9715f745b38fd1af6910b3773.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Conflicts: tools/testing/selftests/net/config 62199e3f1658 ("selftests: net: Add VXLAN MDB test") 3a0385be133e ("selftests: add the missing CONFIG_IP_SCTP in net config") Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/smc')
-rw-r--r--net/smc/af_smc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index c6b4a62276f6..50c38b624f77 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -3270,6 +3270,17 @@ static int __smc_create(struct net *net, struct socket *sock, int protocol,
sk_common_release(sk);
goto out;
}
+
+ /* smc_clcsock_release() does not wait smc->clcsock->sk's
+ * destruction; its sk_state might not be TCP_CLOSE after
+ * smc->sk is close()d, and TCP timers can be fired later,
+ * which need net ref.
+ */
+ sk = smc->clcsock->sk;
+ __netns_tracker_free(net, &sk->ns_tracker, false);
+ sk->sk_net_refcnt = 1;
+ get_net_track(net, &sk->ns_tracker, GFP_KERNEL);
+ sock_inuse_add(net, 1);
} else {
smc->clcsock = clcsock;
}