From: "Jérémy Jean" <Jeremy.Jean@oss.cyber.gouv.fr>
To: Tung Quang Nguyen <tung.quang.nguyen@est.tech>,
Jon Maloy <jmaloy@redhat.com>
Cc: netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net,
linux-kernel@vger.kernel.org,
"Jérémy Jean" <Jeremy.Jean@oss.cyber.gouv.fr>,
stable@vger.kernel.org
Subject: [PATCH v2 1/2] tipc: skip socketless connections in topsrv teardown
Date: Sun, 4 Oct 2026 21:00:15 +0000 [thread overview]
Message-ID: <20261004210016.3051310-2-Jeremy.Jean@oss.cyber.gouv.fr> (raw)
In-Reply-To: <20261004210016.3051310-1-Jeremy.Jean@oss.cyber.gouv.fr>
Kernel subscription connections have no socket but can remain in conn_idr
after unsubscribe while send work is pending.
Skip tipc_conn_close() for these entries to avoid a NULL dereference
during netns teardown.
Fixes: e88f2be83282 ("tipc: fix race condition at topology server receive")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
---
net/tipc/topsrv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/tipc/topsrv.c b/net/tipc/topsrv.c
index af530c9..01dd34b 100644
--- a/net/tipc/topsrv.c
+++ b/net/tipc/topsrv.c
@@ -706,7 +706,8 @@ static void tipc_topsrv_stop(struct net *net)
if (con) {
conn_get(con);
spin_unlock_bh(&srv->idr_lock);
- tipc_conn_close(con);
+ if (con->sock)
+ tipc_conn_close(con);
conn_put(con);
spin_lock_bh(&srv->idr_lock);
}
--
2.47.3
next prev parent reply other threads:[~2026-10-04 21:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-04 21:00 [PATCH v2 0/2] tipc: fix topology server teardown Jérémy Jean
2026-10-04 21:00 ` Jérémy Jean [this message]
2026-10-05 1:45 ` [PATCH v2 1/2] tipc: skip socketless connections in topsrv teardown Tung Quang Nguyen
2026-10-05 21:03 ` netdev-bot+sashiko
2026-10-04 21:00 ` [PATCH v2 2/2] tipc: fix use-after-free in netns teardown Jérémy Jean
2026-10-05 1:45 ` Tung Quang Nguyen
2026-10-05 21:03 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261004210016.3051310-2-Jeremy.Jean@oss.cyber.gouv.fr \
--to=jeremy.jean@oss.cyber.gouv.fr \
--cc=jmaloy@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tipc-discussion@lists.sourceforge.net \
--cc=tung.quang.nguyen@est.tech \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox