Article View: linux.kernel.netdev
Article #21380Re: [PATCH net] tipc: free the tunnel packets when failover tunnelling stops early
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 00:03
Date: Tue, 24 Nov 2026 00:03
101 lines
11282 bytes
11282 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The patch leaves one early exit in tipc_link_tnl_prepare()
(net/tipc/link.c) that still skips the FAILOVER_MSG receive-side hand-…
--
tipc: free the tunnel packets when failover tunnelling stops early
The three early returns inside the tunnelling loop of
tipc_link_tnl_prepare() now jump to a new out: label. That label purges
any tunnel packets left on tnlq. It then runs the FAILOVER_MSG receive
side hand-over (drop_point, failover_reasm_skb, deferdq).
> diff --git a/net/tipc/link.c b/net/tipc/link.c
> index 6427c69f89294..2fead2f4ed0fa 100644
> --- a/net/tipc/link.c
> +++ b/net/tipc/link.c
[ ... ]
> @@ -2073,6 +2073,9 @@ void tipc_link_tnl_prepare(struct tipc_link *l, struct tipc_link *tnl,
> }
>
> tipc_link_xmit(tnl, &tnlq, xmitq);
> +out:
> + /* Empty unless tunnelling stopped early */
> + __skb_queue_purge(&tnlq);
>
> if (mtyp == FAILOVER_MSG) {
> struct sk_buff_head *fdefq = &tnl->failover_deferdq;
[Severity: Medium]
The commit message says the fix is to "go on with the hand-over" when
tunnelling stops early. Should the earlier exit, taken when the dummy
packet can't be allocated, also jump to out?
That path in tipc_link_tnl_prepare() still returns directly:
net/tipc/link.c:tipc_link_tnl_prepare() {
...
skb = tipc_msg_create(TIPC_LOW_IMPORTANCE, TIPC_DIRECT_MSG,
BASIC_H_SIZE, 0, l->addr, tipc_own_addr(l->net),
0, 0, TIPC_ERR_NO_PORT);
if (!skb) {
pr_warn("%sunable to create tunnel packet\n", link_co_err);
return;
}
...
}
tipc_msg_create() allocates with tipc_buf_acquire(..., GFP_ATOMIC), so it
can fail under memory pressure. If it fails for FAILOVER_MSG, this code
never runs:
tnl->drop_point = l->rcv_nxt;
tnl->failover_reasm_skb = l->reasm_buf;
skb_queue_splice_init(&l->deferdq, fdefq);
The caller goes into failover anyway:
__tipc_node_link_down()
tipc_link_tnl_prepare(l, tnl, FAILOVER_MSG, xmitq);
tipc_link_reset(l); <- frees l->reasm_buf, purges l->deferdq
tipc_link_fsm_evt(l, LINK_RESET_EVT);
tipc_link_fsm_evt(l, LINK_FAILOVER_BEGIN_EVT);
tipc_node_fsm_evt(n, NODE_FAILOVER_BEGIN_EVT);
tnl->drop_point then keeps a stale value. That is 0 from link creation,
1 from tipc_link_failover_prepare(), or whatever an earlier failover left.
tipc_link_failover_rcv() then does this:
if (unlikely(less(seqno, l->drop_point))) {
kfree_skb(iskb);
continue;
}
if (unlikely(seqno != l->drop_point)) {
__tipc_skb_queue_sorted(fdefq, seqno, iskb);
continue;
}
Could this drop the peer's tunnelled messages? Could it also leave them
in failover_deferdq for good, since drop_point only moves forward on an
exact match?
tnlq is already initialised and empty at that point, and the out: block
only touches tnlq, l and tnl. So changing that return to goto out looks
safe.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261122233958.10462-1-astellman%40stellman-greene.com
Technical Details
Message-ID:
<179547862919.3135.6087887655063297728@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369852-linux-kernel-netdev=dewy.ruReferences:
<20261122233958.10462-1-astellman@stellman-greene.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369852-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net] tipc: free the tunnel packets when failover tunnelling stops early Date: Tue, 24 Nov 2026 00:03:49 +0000 Organization: Usenet Network Message-ID: <179547862919.3135.6087887655063297728@kernel.org> References: <20261122233958.10462-1-astellman@stellman-greene.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="4012566"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Pd7WtLzzmnI+MdImlDoXNZixiSY= sha256:lQLqOWHSafiSC3qBMVPq6+klVlvZWy75Uyo6RFkmDvQ= sha1:9L+VpEkFpR765GaE9vQwibXajZI= sha256:ixp6OkBdyCBOlmTzqc71E09HOBqKFKDZN1Q+SJp3BaE= 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 38AF2125DC7; Tue, 24 Nov 2026 03:04:10 +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 vrMDNCscVFk1; Tue, 24 Nov 2026 03:04:05 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-369852-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 D5FD6125DC8; Tue, 24 Nov 2026 03:03:55 +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 98A7B606245; Tue, 24 Nov 2026 00:03:54 +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=1795478631; b=gGBiR/7lmJp6RXMJ3N9rKRKlt2QPtbZuj98tSfULWZOxP2M2cBQPQe9o7w7VU53y+OdD Si9eeeBPUbLjQ2XschxkPjPgrZzpqHPlidVPgkP7k6agti5d1+lnbYc74ZSgAWUAw03W7 sz+ZxZB+FX5EjR2ZK3jOPKzNw9IXtSZb07niFOmeoqtUGbso6N8+DzNf7oAJSlDWjSSBL wErZ7BwQ8CNJ44BoWY4+Rhx2sIAq9RmHzV/aLCygcHnZVVg7ASlAnvrdTP3bXisLeZHSE Bvd4wwoZQsjv/NbpuTFUKQLMhxnMkw2Xm1kYnsoHSgwB5IFVkLR2YSP4xYYWhcQc2FQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795478631; 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=uhLm4YyQicFoJX+Exw7k19Cw4KlzHU0mutOb3HgYX+4=; b=GsCf/tY1g/VY284kyGFvCCtVnNRWNAOGHFFsASoNgrPrE3U0TN378XWv7CFcseLKEBYA Ma7phIzi79KxivDj4wvDGTkYkzvxy0NmXQ/ZuS1iZs9nRMcJSCYI37P/zbVAobTR4J0ED MOBI1Os2SATtjnDSPYVxQHIhg+ezyKbXvYO6XCA+gssoH4JRuW8fHkmB9atDRbZ3hiFsK oZ1IMUGPLVMm9kYu6FmFowTEoBi+CQbsqXImAEpqH/4Ll8rC03mi50JTDpvYJ1uKEZdLv YNfxpCbmdXLDcwAPfgqwe6le88chRfT4t3VTAQwGdbgF2CN/0N7Y+5VnKglB5UJsVhg== 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=eCraPmZx; 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 D767D606A331; Tue, 24 Nov 2026 00:03:51 +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=eCraPmZx 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=1795478631; b=Usnteoznd3Tzup5g9+wzQqPUvOIYjqJ9215LwtxLwKC9AykaG3ai+6gPMUQGxK5q18be cgiBRnCk234KPJ0JcbzbSYOGIc78wJP8m7M3oyVATF1m7N7Y1+r1YHZbjjedUnfWnBynA GXyELwEZuylt9ZIZMT7hIOP5i5Yt6FLh8ARVrC51FL9Eo9dUdo2Mcr1S8H3LitZN33RUQ zkOM6MKdKXibTaTGcW1ZxQm9lw8xdZbsj8ZLNfeYkR5QhmJ0LOVI7fxEdtmZkfK56XCkh OLUxu/p9rP6Ft47IWJTSglnt97j59goP83bAvBWjHcZuUKM6JkCoUnHg7MfZKHbNccg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795478631; 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=uhLm4YyQicFoJX+Exw7k19Cw4KlzHU0mutOb3HgYX+4=; b=S2Fkrr3Eqj2Lu2/Gtx5HW6huSL9pEpyz23TkMSve0mMUU0S25Wc90KmJuY5YScQfRqxY nMgACmDmfeZ+tAtA1OkAqpwTenJ6XwPDfVnBs1i3Bt2ccB/vYUtFFnzPKfhp+ShY1G2eh UUztyMqcp9+ArC1InIusme9zqaxMehuCBJxklq0L2klQrlHZ2gJodGMNoqpKdVhzfsXya lLTZfJNhhGoJnKO0J/h1YHO5w0qPWGSkELyAbufJdTptn0lglEzDIlVLmvErg9/iS1zH9 gU1MGFuk56UbU6XaDWav3MyWNYrHPLs/ohralZo6PI5QZz90ME1rpDuuoynL+KIcS6w== 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=eCraPmZx; 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 EE455606A31E; Tue, 24 Nov 2026 00:03:50 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABC161F000C4; Tue, 24 Nov 2026 00:03:49 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795478630; bh=uhLm4YyQicFoJX+Exw7k19Cw4KlzHU0mutOb3HgYX+4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=eCraPmZxbkmw5AtVz+bpDxqclOYcbi09vSCwcRyJIV7W2LvXj22Z9I4lyYybAnVM8 /3UseCfM3GahiQHYbXioswx4BG13KYDaO5N7AU1Y8O7r6kp57bunmKmQQf+gy2+Ori 8bhEQUXNj3YAl3tuzwt4TbzlCPHDQipVwgctxuQ3kaQQNfhOc72whof3nYlaFrls2G bpbt/eb95q+V22al1lGcRFLWRlJMizBtfLRf0V4WMHO4aegd3gtRNyDROUNXXFqkN+ /jd/SNY0NZ4zpvHA3joDxPY4p98lrVB8hNu/Zv7NEkV7MQl4bRaGHd4GtbeX6ghjcO mJaXCzqkz/89g== X-Cc: jmaloy@redhat.com, tung.quang.nguyen@est.tech, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, tuong.t.lien@dektech.com.au, ying.xue@windriver.com, netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org X-In-Reply-To: <20261122233958.10462-1-astellman@stellman-greene.com> X-sashiko-severity: Medium 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