Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: astellman@stellman-greene.com
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
Subject: Re: [PATCH net] tipc: free the tunnel packets when failover tunnelling stops early
Date: Tue, 24 Nov 2026 00:03:49 +0000	[thread overview]
Message-ID: <179547862919.3135.6087887655063297728@kernel.org> (raw)
In-Reply-To: <20261122233958.10462-1-astellman@stellman-greene.com>

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

  reply	other threads:[~2026-11-24  0:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 23:39 [PATCH net] tipc: free the tunnel packets when failover tunnelling stops early Andrew Stellman
2026-11-24  0:03 ` netdev-bot+sashiko [this message]
2026-11-24  0:14   ` Andrew Stellman

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=179547862919.3135.6087887655063297728@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=astellman@stellman-greene.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=jmaloy@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=tung.quang.nguyen@est.tech \
    --cc=tuong.t.lien@dektech.com.au \
    --cc=ying.xue@windriver.com \
    /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