--- a/net/smc/af_smc.c 2022-03-05 18:57:30.117068900 +0800 +++ b/net/smc/af_smc.c 2022-03-05 21:12:36.514451200 +0800 @@ -218,6 +218,7 @@ static int smc_release(struct socket *so sock_orphan(sk); sock->sk = NULL; release_sock(sk); + synchronize_rcu(); sock_put(sk); /* sock_hold above */ sock_put(sk); /* final sock_put */ --- a/net/smc/smc_close.c 2022-03-05 20:52:07.514821000 +0800 +++ b/net/smc/smc_close.c 2022-03-05 21:02:42.136301400 +0800 @@ -29,6 +29,7 @@ void smc_clcsock_release(struct smc_sock cancel_work_sync(&smc->smc_listen_work); mutex_lock(&smc->clcsock_release_lock); if (smc->clcsock) { + rcu_assign_sk_user_data(smc->clcsock->sk, NULL); tcp = smc->clcsock; smc->clcsock = NULL; sock_release(tcp);