summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2024-02-12 15:34:02 +0100
committerDavid S. Miller <davem@davemloft.net>2024-02-14 11:56:02 +0100
commit6cf9ff463317217d95732a6cce6fbdd12508921a (patch)
treec3d7e8060b29e57930892d7c690c5c5133adfeff /net
parentMerge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/n... (diff)
downloadlinux-6cf9ff463317217d95732a6cce6fbdd12508921a.tar.xz
linux-6cf9ff463317217d95732a6cce6fbdd12508921a.zip
net: smc: fix spurious error message from __sock_release()
Commit 67f562e3e147 ("net/smc: transfer fasync_list in case of fallback") leaves the socket's fasync list pointer within a container socket as well. When the latter is destroyed, '__sock_release()' warns about its non-empty fasync list, which is a dangling pointer to previously freed fasync list of an underlying TCP socket. Fix this spurious warning by nullifying fasync list of a container socket. Fixes: 67f562e3e147 ("net/smc: transfer fasync_list in case of fallback") Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/smc/af_smc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index a2cb30af46cb..0f53a5c6fd9d 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -924,6 +924,7 @@ static int smc_switch_to_fallback(struct smc_sock *smc, int reason_code)
smc->clcsock->file->private_data = smc->clcsock;
smc->clcsock->wq.fasync_list =
smc->sk.sk_socket->wq.fasync_list;
+ smc->sk.sk_socket->wq.fasync_list = NULL;
/* There might be some wait entries remaining
* in smc sk->sk_wq and they should be woken up