mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tung Quang Nguyen <tung.quang.nguyen@est.tech>
To: Andrew Stellman <astellman@stellman-greene.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"tipc-discussion@lists.sourceforge.net"
	<tipc-discussion@lists.sourceforge.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jon Maloy <jmaloy@redhat.com>
Subject: RE: [PATCH net v3] tipc: free the tunnel packets when failover tunnelling stops early
Date: Thu, 26 Nov 2026 08:36:05 +0000	[thread overview]
Message-ID: <AM7P189MB1137C196F7F626007C9C71D5C6422@AM7P189MB1137.EURP189.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20261125155411.66090-1-astellman@stellman-greene.com>

>Subject: [PATCH net v3] tipc: free the tunnel packets when failover tunnelling
>stops early
>
>tipc_link_tnl_prepare() returns from the middle of its tunnelling loop when a
>packet does not fit the tunnel link MTU and the peer lacks
>TIPC_TUNNEL_ENHANCED, when fragmenting such a packet fails, and when a
>tunnel packet cannot be allocated. The tunnel packets already built on the
>local tnlq are leaked, and for FAILOVER_MSG the receive side hand-over at the
>end of the function (drop_point, failover_reasm_skb,
>deferdq) is skipped.
>
>Purge tnlq on these paths and go on with the hand-over. The earlier return
>taken when the dummy tunnel packet can't be allocated leaks nothing but
>skips the same hand-over, so take the same exit there.
>
>Reproduced on net (af6737b90668) under QEMU with kmemleak, with two
>guests joined by two TIPC eth links: MTU 9000 (active) and MTU 1500
>(standby). The receiving guest runs the same kernel with
>TIPC_TUNNEL_ENHANCED removed from TIPC_NODE_CAPABILITIES, to stand
>in for a peer whose kernel predates that capability; the sending guest's kernel
>is unmodified. The sender blocks the MTU 9000 link in both directions with tc,
>sends three 100 byte messages and one 4000 byte message, and waits for the
>link to fail. Without this patch that logs
>
>  tipc: Link tunneling error, too large msg <0, 2>: 4040!
>
>In four runs without this patch, kmemleak reported three skbs (six
>objects) allocated by tipc_link_tnl_prepare() in two, five leaks whose details
>were not captured in one, and nothing in one. From one of the two, run on a
>rebuild of the same commit with debug info enabled, decoded and trimmed:
>
>  unreferenced object 0xff11000005117b80 (size 472):
>    backtrace (crc 539599dc):
>      __alloc_skb (net/core/skbuff.c:705 (discriminator 2))
>      tipc_buf_acquire (include/linux/skbuff.h:1441 net/tipc/msg.c:72)
>      tipc_link_tnl_prepare (net/tipc/link.c:2055)
>      __tipc_node_link_down (net/tipc/node.c:1053)
>      tipc_rcv (net/tipc/node.c:2008 net/tipc/node.c:2186)
>      tipc_l2_rcv_msg (net/tipc/bearer.c:721 (discriminator 1))
>
>In one run with this patch the same test logs the warning and kmemleak
>reports nothing. With a 1000 byte message instead of the 4000 byte one, all
>four messages reach the receiver over the tunnel with and without this patch.
>The allocation failure paths and the skipped hand-over were found by reading
>the code and were not exercised. Apart from the receiver's capability change,
>no kernel changes, fault injection, debug code or delays were used. There are
>no TIPC selftests to run.
>
>Fixes: 2320bcdae628 ("tipc: fix changeover issues due to large packet")
>Signed-off-by: Andrew Stellman <astellman@stellman-greene.com>

Reviewed-by: Tung Nguyen <tung.quang.nguyen@est.tech>

      reply	other threads:[~2026-11-26  8:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 15:54 Andrew Stellman
2026-11-26  8:36 ` Tung Quang Nguyen [this message]

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=AM7P189MB1137C196F7F626007C9C71D5C6422@AM7P189MB1137.EURP189.PROD.OUTLOOK.COM \
    --to=tung.quang.nguyen@est.tech \
    --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 \
    /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

all inboxes | Powered by JetHome®