๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #18047

Re: [PATCH net v3 2/7] tipc: fix dangling link in cluster_scope list in tipc_service_delete()

#18047
From: netdev-bot+sashiko
Date: Tue, 17 Nov 2026 18:37
99 lines
11442 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] The commit message presents this change as a bug fix and carries
  a Fixes: tag (1bb8dce57f4d), but it names no consequence anyone couldโ€ฆ

--

tipc: fix dangling link in cluster_scope list in tipc_service_delete()

This patch makes tipc_service_delete() remove the local node's own
TIPC_NODE_STATE publication from nt->cluster_scope before it is freed
with kfree_rcu(). The commit message calls the leftover entry a
dangling list entry and adds a Fixes: tag for 1bb8dce57f4d.

> diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
> index 6fda36ab17669..73b032ba2f8d0 100644
> --- a/net/tipc/name_table.c
> +++ b/net/tipc/name_table.c

[ ... ]

> @@ -941,6 +942,13 @@ static void tipc_service_delete(struct net *net, struct tipc_service *sc)
>  	rbtree_postorder_for_each_entry_safe(sr, tmpr, &sc->ranges, tree_node) {
>  		list_for_each_entry_safe(p, tmp, &sr->all_publ, all_publ) {
>  			tipc_service_remove_publ(sr, &p->sk, p->key);
> +			if (p->sr.type == TIPC_NODE_STATE &&
> +			    p->sr.lower == tn->node_addr &&
> +			    p->sr.upper == tn->node_addr &&
> +			    p->key == tn->node_addr &&
> +			    p->sk.ref == 0 && p->sk.node == tn->node_addr)
> +				list_del(&p->binding_node);
> +
>  			kfree_rcu(p, rcu);
>  		}
>  		rb_erase_augmented(&sr->tree_node, &sc->ranges, &sr_callbacks);

[Severity: Low]

Can anything actually reach the leftover cluster_scope entry?

tipc_service_delete() is only called from tipc_nametbl_stop(). That
function frees the name table, including the cluster_scope list head,
right after the purge loop:

net/tipc/name_table.c:tipc_nametbl_stop() {
    ...
	spin_unlock_bh(&tn->nametbl_lock);

	/* TODO: clear tn->nametbl, implement proper RCU rules ? */
	kfree_rcu(nt, rcu);
}

tipc_nametbl_stop() is called from the tipc_init_net() error path and
from tipc_exit_net():

net/tipc/core.c:tipc_exit_net() {
    ...
	tipc_net_stop(net);
	/* Make sure the tipc_net_finalize_work() finished */
	cancel_work_sync(&tn->work);
	tipc_bcast_stop(net);
	tipc_nametbl_stop(net);
    ...
}

By that point tipc_net_stop() has already removed the bearers and
nodes, so tipc_named_node_up() can't run. cancel_work_sync() has
stopped tn->work, so tipc_named_reinit() can't run either.
tipc_named_publish() and tipc_named_withdraw() only run from socket
operations.

Is there a path that walks nt->cluster_scope between the purge and
kfree_rcu(nt, rcu), or after it?

If there isn't, this looks like cleanup at teardown rather than a fix
for a bug that can be hit. Should the commit message describe a failure
that can be observed? If not, could it present this as cleanup and drop
the Fixes: tag, so stable trees don't pick it up?

Separately, the commit message says:

  Fix this by calling list_del() before freeing TIPC_NODE_STATE
  publications in tipc_service_delete().

The code only removes the local node's own publication: type
TIPC_NODE_STATE, lower == upper == key == sk.node == tn->node_addr, and
sk.ref == 0. Remote TIPC_NODE_STATE publications are left alone. That
looks correct, because their binding_node sits on the peer node's
publ_list.

Could that sentence name the self-node publication specifically?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116063529.6185-1-tung.quang.nguyen%40est.tech
Technical Details
Message-ID: <179494067383.3136.15883783633463671421@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-365535-linux-kernel-netdev=dewy.ru
References: <20261116063529.6185-3-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-365535-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v3 2/7] tipc: fix dangling link in cluster_scope list
 in tipc_service_delete()
Date: Tue, 17 Nov 2026 18:37:53 +0000
Organization: Usenet Network
Message-ID: <179494067383.3136.15883783633463671421@kernel.org>
References: <20261116063529.6185-3-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="2400708"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Thzp5zmc1x84HGbto4TEYQD+yvY= sha256:vJwMPBLOUDu4EAJM/V6AftKci2eryRDCuF+Q28ZFNys=
	sha1:Xs0hzIOHGiQln+RLX36eAEKXdDk= sha256:c5dsUr2IkYpvA3Lr+SL3QjGewVXm6TXsn3lneXVNqRA=
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 80B45115043; Tue, 17 Nov 2026 21:38:11 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.501
X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31
	tests=[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 wc9f9MVlfxRs;
	Tue, 17 Nov 2026 21:38:07 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-365535-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 5ABBE115041; Tue, 17 Nov 2026 21:37:58 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 068ED60B8F3; Tue, 17 Nov 2026 18:37:57 +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=1794940675;
	b=289L9DzrTVp9NEG6eoaKXB0CGRCv+sUbDZ+3NiRekWlU4ZnqM9o5bAOaTxxv8Bc8W5qE
	 ipJH7L6cUeoCt9c6xB5U8AL0p5V3JKZ03frWhjJGbBRki/Fp42pLxXK0fBKFaXUIZhOK5
	 AEqmDC6y3qdgGxjyMasUGqXm1QHwl6cnU1IkCChiEUs2A6/kKVavmrOC/oj2zE1l9UthL
	 oGcrojho10fP65R+3B9B9HoWNUpJh8b4a/236CVprof0M4XUFLEF05pplb7e3gFduNOvZ
	 T2Z7ReesaOPvLxd7eyxLJvYSCRJbIkFCrVsH8B4qs3FynqdhOL/cIeFMIVAfzgmWJag==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794940675;
	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=geeUyO7cZivhCRc1DxWCwBnoorGlSSok9IVOjAm8wwM=;
	b=1g9lHzKakLgFLR1xLf3hzZyR7wR9l4aiSLovblRSDQqeXAJK+S+3k36g/lj6Xz1K1Zpl
	 XtZrhx7Zd/rTWfODT3nZg7UbR24qsk8e1Lqp3ZSngPmNBCT+n/LG2btITrjoWuWlkvH6e
	 mh2/3s/6c/H1Qm3cmpIehUuDpuepmBEGKY51S2oRjxOPttYreTXyyyKSPpfayQ6rXjHcD
	 eSGhenbgcdmfJKenzQDyUBka7ua56sn9JThutPszp+zn7Hn7Z6cRjBbP+Qo0jA4+QR89y
	 5z3OqVdAWAYNpxjjdoNJYvRPg9JGSFaufOpWKZvoP+lT0+w9wnAZpif6Sn5DipDqB4Q==
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=YvVnoDJx;
	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 CF5E7606A333;
	Tue, 17 Nov 2026 18:37:55 +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=YvVnoDJx
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=1794940675;
	b=iUubGI3XKr7sWhYem6Kca3I7Ltg0a+rOOLbA96hfCVu2kia/OTLFW9sMIMA0ZJqJJegW
	 OGcaC/CRp22m1Iq0riDSytwx+B0bIw4zbmqgJHqAi3roIp/LphABe3u7IEBjlD82RmBWT
	 ml3HV0K7wl8f1yz6MR3p3VcQfE8vSPdHHsW0JcCC96c4jV6tdB6//ZtH8u+FidQF4R0WK
	 EQndOHgciUj53zEYZkBEdBi+iV0j4pIPnKK2eEAUC/IgbylYm3DJkC/q/3CHH27OMBxaN
	 UFy1jvOGGMTEP7zdQMhRgcKKY+Y88oeU/b7rFu2ai2erRjawV1h7/YPenOsK7jnx7zg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794940675;
	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=geeUyO7cZivhCRc1DxWCwBnoorGlSSok9IVOjAm8wwM=;
	b=F+VRQGoKu6o6JfbL1GvRS7Tra6NBoLOVnwlky/neLOxg4peRl9SekyPl5a0tMsmTiPEN
	 vGQ5BMy2JYFZQS9JhqkhWp+W1B8ZIHb6Bpc4FdRks5k9LWEKl+8QMCzMIRi67yQ4U8z71
	 qvNP6W6sk2Shff2JkoXC9zbIV2FCp+wbRh078XNEaJeKAaK3sroUr6hOfiR0OjGnrXxHs
	 Rz/BscmcSlSD56gPEx6aVvds/Ck8+wDaRJoj4Bdu4a3uLrrYBWSNbRxy3W3VawWu2zW98
	 zJWQrI6Kp/IjXN+6/hLjFtCwV+J2td3TsO3qoLVgAZkPd6CmVRzb5+RODsG34hMwNZw==
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=YvVnoDJx;
	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 ED675606A31C
	for <netdev@vger.kernel.org>; Tue, 17 Nov 2026 18:37:54 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4771F1F000C4;
	Tue, 17 Nov 2026 18:37:54 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794940674;
	bh=geeUyO7cZivhCRc1DxWCwBnoorGlSSok9IVOjAm8wwM=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=YvVnoDJxWSA6oa3bIiGpkt8vd82BUV6+8anfwBzwMOdfLE8Dq+8e6QvXeihmGiJxT
	 XNyj1SOtXPPs5pQHpIoxzvHD6PAYfgnvm08FqL2ZalgpgkvcDNP0PTQJAboXpdJSGA
	 Mn/uj32Rg7uh9Mt2aSrlaHUDSqoBLfJpu0VAgf5YnmO+7BEbkJN1oWFbCc2qj3BwpD
	 hPxm3w4+aJsq8/TUNKVxKgk945fBZGLgZT8EWlb94NLUTWXkQ5d+tB4Dx8WWQf6QB4
	 w5wkUfMgRgYL0myOSB+MduiDzVMj1Z2kPTQIHarC84Jh8VQA19kLIpmLB1bJ9ncZJW
	 SovaiFxXxsy8w==
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-3-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