RE: [PATCH net v2] tipc: free the tunnel packets when failover tunnelling stops early
From: Tung Quang Nguyen
Date: Wed Nov 25 2026 - 05:55:41 EST
>Subject: [PATCH net v2] 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!
>
>and kmemleak reports three skbs (six objects) allocated by
>tipc_link_tnl_prepare():
>
> unreferenced object 0xff11000004d34780 (size 472):
> backtrace (crc dd2ea0a1):
> kmem_cache_alloc_node_noprof+0x296/0x3a0
> __alloc_skb+0xde/0x890
> tipc_buf_acquire+0x1d/0xe0
> tipc_link_tnl_prepare+0x94b/0x1960
> __tipc_node_link_down+0x4ae/0x13e0
> tipc_rcv+0x2187/0x2e20
> tipc_l2_rcv_msg+0x1d8/0x2e0
>
Can you update your change log with decoded stack trace ?
(using linux/scripts/decode_stacktrace.sh)
>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.
>
>The issue was found by Claude Opus 5.5 running Quality Playbook, an LLM-
>driven code review tool:
>https://github.com/andrewstellman/quality-playbook
>The fix and this changelog were drafted with Claude Opus 5.5 and reviewed by
>me.
Please move above LLM stuff below "---". It should not be included in the changelog.
---
pw-bot: cr