Article View: linux.kernel.netdev
Article #18049Re: [PATCH net v3 6/7] tipc: fix self-deadlock in tipc_named_node_up
From: netdev-bot+sashiko
Date: Tue, 17 Nov 2026 18:37
Date: Tue, 17 Nov 2026 18:37
180 lines
13811 bytes
13811 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] In net/tipc/node.c, the call to tipc_node_lxc_xmit() inside the
new tipc_node_distribute() (line 1847) can never do anything, so it is…
- [Low] tipc_named_node_up() (net/tipc/name_distr.c, around lines
227-231) maps -ELINKCONG to 0, with the comment "The link is congested…
--
tipc: fix self-deadlock in tipc_named_node_up
This patch removes cluster_scope_lock and uses nametbl_lock to protect
the cluster_scope list. That avoids a self-deadlock when
tipc_node_xmit() reaches tipc_node_link_down() while the read lock is
held. It also adds tipc_node_distribute(), which sends the bulk list
without calling tipc_node_link_down(), and moves the link reset on
-ENOBUFS into tipc_node_write_unlock().
> diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
> index 1fe650a95eb42..2e07d50a29437 100644
> --- a/net/tipc/name_distr.c
> +++ b/net/tipc/name_distr.c
[ ... ]
> @@ -202,25 +198,39 @@ static void named_distribute(struct net *net, struct sk_buff_head *list,
[ ... ]
> -void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities)
> +int tipc_named_node_up(struct net *net, u32 dnode,
> + u16 capabilities, int *bearer_id)
> {
[ ... ]
> __skb_queue_head_init(&head);
> spin_lock_bh(&tn->nametbl_lock);
> if (!(capabilities & TIPC_NAMED_BCAST))
> nt->rc_dests++;
> - seqno = nt->snd_nxt;
> + named_distribute(net, &head, dnode, &nt->cluster_scope, nt->snd_nxt);
> + if (!skb_queue_empty(&head))
> + rc = tipc_node_distribute(net, &head, dnode, bearer_id, 0);
> spin_unlock_bh(&tn->nametbl_lock);
>
> - read_lock_bh(&nt->cluster_scope_lock);
> - named_distribute(net, &head, dnode, &nt->cluster_scope, seqno);
> - tipc_node_xmit(net, &head, dnode, 0);
> - read_unlock_bh(&nt->cluster_scope_lock);
> + /* The link is congested after the list is inserted into
> + * the link's send queue. Return 0, as this is normal.
> + */
> + if (rc == -ELINKCONG)
> + rc = 0;
[Severity: Low]
Can tipc_link_xmit() return -ELINKCONG for this list?
Every buffer that named_distribute() builds has user NAME_DISTRIBUTOR.
msg_importance() maps that user to TIPC_SYSTEM_IMPORTANCE:
net/tipc/msg.h:msg_importance() {
if (likely((usr <= TIPC_CRITICAL_IMPORTANCE) && !msg_errcode(m)))
return usr;
if ((usr == MSG_FRAGMENTER) || (usr == MSG_BUNDLER))
return msg_bits(m, 9, 0, 0x7);
return TIPC_SYSTEM_IMPORTANCE;
}
In tipc_link_xmit(), a SYSTEM importance list that hits the backlog limit
is purged and gets -ENOBUFS. That means link_schedule_user(), the only
source of -ELINKCONG, is never called for it:
net/tipc/link.c:tipc_link_xmit() {
...
if (unlikely(l->backlog[imp].len >= l->backlog[imp].limit)) {
if (imp == TIPC_SYSTEM_IMPORTANCE) {
pr_warn("%s<%s>, link overflow", link_rst_msg, l->name);
__skb_queue_purge(list);
return -ENOBUFS;
}
rc = link_schedule_user(l, hdr);
}
...
}
When transmq is full, the buffers just move to the backlog and rc stays
0.
If that's right, this branch is dead code. The comment also says
congestion is a normal result here, but for this traffic congestion ends
in -ENOBUFS and a link reset. The -ELINKCONG entry in the
tipc_node_distribute() kernel-doc has the same problem.
Later in the series, the same branch and comment are copied into
tipc_named_distribute().
> diff --git a/net/tipc/node.c b/net/tipc/node.c
> index dfbeed21dbc1b..77979a850df24 100644
> --- a/net/tipc/node.c
> +++ b/net/tipc/node.c
[ ... ]
> @@ -1737,44 +1792,72 @@ int tipc_node_xmit(struct net *net, struct sk_buff_head *list,
[ ... ]
> +int tipc_node_distribute(struct net *net, struct sk_buff_head *list,
> + u32 dnode, int *bearer_id, int selector)
> +{
> + struct tipc_media_addr maddr;
> + struct sk_buff_head xmitq;
> + struct tipc_node *n;
> + int rc;
> +
> + n = tipc_node_find(net, dnode);
> + if (unlikely(!n)) {
> __skb_queue_purge(list);
> return -EHOSTUNREACH;
> }
>
> + if (tipc_node_lxc_xmit(n, list)) {
> + tipc_node_put(n);
> + return 0;
> + }
[Severity: Low]
Can this tipc_node_lxc_xmit() call ever consume the list?
tipc_named_node_up() is the only caller of tipc_node_distribute(), and
it passes the bulk list from named_distribute(). named_prepare_buf()
builds each of those buffers with user NAME_DISTRIBUTOR:
net/tipc/name_distr.c:named_prepare_buf() {
...
tipc_msg_init(self, msg, NAME_DISTRIBUTOR,
type, INT_H_SIZE, dest);
...
}
For that user, tipc_lxc_xmit() returns without touching the list:
net/tipc/node.c:tipc_lxc_xmit() {
...
case LINK_PROTOCOL:
case NAME_DISTRIBUTOR:
case TUNNEL_PROTOCOL:
case BCAST_PROTOCOL:
return;
...
}
So skb_queue_empty(list) is always false and tipc_node_lxc_xmit() always
returns 0 here. All it adds is an extra rcu_read_lock() and a node read
lock round trip before tipc_node_build_list().
Runtime behavior doesn't change, because the old tipc_node_xmit() never
delivered named bulk messages over lxc either. This is still true at the
end of the series. The tipc_named_distribute() caller added later also
only passes named_distribute() output.
Could this call be dropped from tipc_node_distribute()? The commit
message says:
Both functions call the newly introduced tipc_node_build_list(),
which clones a list of messages in sequence and tipc_node_lxc_xmit()
which delivers the list to the peer namespace.
The v3 changelog also says "Introduce tipc_node_lxc_xmit() for container
communication", but tipc_node_distribute() never does that delivery.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116063529.6185-1-tung.quang.nguyen%40est.tech
Technical Details
Message-ID:
<179494067734.3136.14054050575784099743@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365538-linux-kernel-netdev=dewy.ruReferences:
<20261116063529.6185-7-tung.quang.nguyen@est.tech>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365538-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v3 6/7] tipc: fix self-deadlock in tipc_named_node_up Date: Tue, 17 Nov 2026 18:37:57 +0000 Organization: Usenet Network Message-ID: <179494067734.3136.14054050575784099743@kernel.org> References: <20261116063529.6185-7-tung.quang.nguyen@est.tech> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2400813"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:xoYvDekNcI5tvzp2CmUADJIg9kY= sha256:5MplYlijJyze9t7dMdYRMzprb4bVSgUAgKowfuca73o= sha1:aslnLQthPRztJH88Me71+Xrga4w= sha256:dc8C8R0+ihc2oizqsmRV9z5mhje0CDe3IKN9KYf59jo= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 53749115044; Tue, 17 Nov 2026 21:38:20 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NPBhAob-4lno; Tue, 17 Nov 2026 21:38:16 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-365538-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 23776115006; Tue, 17 Nov 2026 21:38:07 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 0557333813; Tue, 17 Nov 2026 18:38:02 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794940679; b=Ox8xS8eYqnG9LG915yaCkDl7+aPPW4L25juhfE94Ql2YetRMN+ZpDAVRVijI+9oERBh7 5fa3BzvZ2RQcXakAjWZmKoMB8NhvBSMhJQxbG417EU8ckiyWIUXeM7R3s/ya/wFQhiRIg G6CRGAWuGBEmA66oh7/Ey0puTpiuhlJPGGKjGkZ3yUnsI5YNuf41e+qObj064DMu7hJBJ ltFSslNPltSAEazZNs0deLzvPMCHc4Bld2vfRpfronowTtbAz/1m0teSeZFRIbDj4sDyK ExJj2eluENNt07iEBbPRlw8PS3HNXfgqOs4pFWEmTFRbtB1WCZ8xFxfXnPhQZdhrcOA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794940679; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=ckhCEAkRR8doUuJC+rABzk69KEWU/YIQOM2FH80JRM4=; b=GKQa/v/UTCVQYUUrhxYeJdkkKJZMuf1o50edFsZ50DC9zcHv4q+TICUIZMa3eIA7Qoz2 XM0sD8g6q3aTbkZWwDg0IegNs9hqBh05t9xxgcsL6HMbF2Jepwh4ypLmQRD/3/jRSykyw ENh0gLxZ5TNzooSOcblZDeF++WwR39j0ir32N8xxixyBIwd6i2H1Sp9srFt/kMaTA8UNh 5jOehFqCTxcGbV92GahUl8+uM5lEST2vGheF4DeduWL1MxN1OO0LF0DgD20J0HgvVii7l SJ5v+b3Fb0yiWYV8wNLiBdym4WEiAdNzgvk0Ip5Np+J6TytTrQRQPfwFPi/5zuH3Uvg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UsppJVVs; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D05D606A32F; Tue, 17 Nov 2026 18:37:59 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UsppJVVs X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794940678; b=z/G/EKnIgYK5nWFCKYiO9k5Nfz53ikaM4R4U4uA44txKyfkOrAMyFqBvTC9E1DsbAzIn sQdZeqg1G3tiTeDSIyjEVGWdbrXInlRkjB4Gd3OdVNcgSmbMJvDVcV5Z+fmdeZVjiEECh ozpBmc0Yxnr4/0WAtgVF1c3TyHTRcFH986vOP/D+lyWjmXou0xQHHZrIGYMLq/2zx/V/7 yFNpDwXp0ybTRwo6qEcXR+1MsmdT1SD3b1uM+TzEbLJM1P3e5pxqAwE/UtwO5MsEjxSkP 9AoxpT4ZHtOpfmYpVJmsLxyTACnslyz1n9++Yom7KgsUeadMvhhrAx+8nfMlMW/+syg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794940678; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=ckhCEAkRR8doUuJC+rABzk69KEWU/YIQOM2FH80JRM4=; b=FpbOtwCQiEcY0At91QHEdCnZJ2cer5/bHTDblOrBl3iP468hVmWKWDnvs2Lpshlpa1JD Bme6W8MNgo0WASARC8cvvddYsxTONtW8P5YfdJn0KKRTGjSv5AF9r9pAENklDSozkDWJi CwEKyb+CVkxnPTnaKj5MZBtSxMKVNxiOFTiVB2KscsKknEYliCkaVk5SRW/ZyOxlzmioO LUDKLb8igDTuUNa2kYkTSacOL0TEsszGsadei3VZRH5Ti+Dcov6cDzkvqs5BFYUZHS04H El87JUB0rFfJwEdbVBWPxDRavcHXR2uReKybO/bJqDpQdVos/lh3rkWY4GeSLYK+UQg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UsppJVVs; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E1ED606A33A for <netdev@vger.kernel.org>; Tue, 17 Nov 2026 18:37:58 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C24E81F000C8; Tue, 17 Nov 2026 18:37:57 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794940678; bh=ckhCEAkRR8doUuJC+rABzk69KEWU/YIQOM2FH80JRM4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=UsppJVVsNaq/KIYwhPi3280Hfxo6BmviioCI+wRrSAVIGqoxK/cKc+BZdbjiXacXu R+Tfq5lA5bICnEBTm8zK7YLPb0Kj+/e4dBEC1uasXBd1jko3nqBvRmMC/Qr+2gsJQ0 EBKjREfY7mbDCJnY5NYonfbmUoY7gJHNMhoW9hOPxhR6UBU1ab1KOvk2Yo1b8zDCae KBq+uR7xrhta/Z3VIy0M/Zcm28VAqI9pfZgqato9D00uEpyCYoFq7fNCpi0xO8NKZB R3zH8wH9DVxGVjJTPtoJKDqxYTqoCXEiKL12N5itHJ8N0IKwkxYk//SHC0N4iTBbD8 d1gAof/jaK5ig== X-Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, edumazet@kernel.org, pabeni@redhat.com, jmaloy@redhat.com, horms@kernel.org, tipc-discussion@lists.sourceforge.net, syzbot+64197f7577a09686ffdb@syzkaller.appspotmail.com, lkp@intel.com X-In-Reply-To: <20261116063529.6185-7-tung.quang.nguyen@est.tech> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list