mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] tipc: zero the pad bytes between bundled messages
@ 2026-11-19 18:41 Andrew Stellman
  2026-11-23  2:37 ` Tung Quang Nguyen
  2026-11-25 15:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Stellman @ 2026-11-19 18:41 UTC (permalink / raw)
  To: Jon Maloy, Tung Quang Nguyen
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, netdev, tipc-discussion, linux-kernel

tipc_msg_bundle() places each message in a bundle at a 4-byte aligned
offset. It extends the bundle with skb_put() to cover both the padding
and the message, but copies only the message, so the 0 to 3 pad bytes
before it keep whatever was in the skb's tailroom, and they are sent to
the peer node.

Zero the pad bytes. Commit 81c600c26302 ("tipc: Dont send random pad
bytes in RESET/ACTIVATE messages") fixed the same kind of leak in link
protocol messages.

Reproduced on v7.4-rc3 with two QEMU guests as TIPC nodes, booted with
slub_debug=P, which fills free slab objects with 0x6b. One guest sends
60,000 SOCK_RDM messages with 41, 45 and 37 bytes of data to the other.
That fills the link window, so some are bundled, and a packet socket on
the sender captures the outgoing frames. Without this patch every
captured pad byte was 0x6b; with it they are all zero and every message
is still delivered. No other kernel changes, debug code or error
injection were needed, and there is no TIPC selftest 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 the same tool and reviewed
by me.

Fixes: b97bf3fd8f6a ("[TIPC] Initial merge")
Signed-off-by: Andrew Stellman <astellman@stellman-greene.com>
---
A reproducer is available on request.

 net/tipc/msg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/tipc/msg.c b/net/tipc/msg.c
index 39dfd33c8eec..b0d52609b03d 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -509,7 +509,8 @@ static bool tipc_msg_bundle(struct sk_buff *bskb, struct tipc_msg *msg,
 	if (unlikely(max < (offset + msz)))
 		return false;
 
-	skb_put(bskb, pad + msz);
+	skb_put_zero(bskb, pad);
+	skb_put(bskb, msz);
 	skb_copy_to_linear_data_offset(bskb, offset, msg, msz);
 	msg_set_size(bmsg, offset + msz);
 	msg_set_msgcnt(bmsg, msg_msgcnt(bmsg) + 1);

base-commit: 1e575bda30acc0bf01f799cee798d4a1c100d538
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH net] tipc: zero the pad bytes between bundled messages
  2026-11-19 18:41 [PATCH net] tipc: zero the pad bytes between bundled messages Andrew Stellman
@ 2026-11-23  2:37 ` Tung Quang Nguyen
  2026-11-25 15:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Tung Quang Nguyen @ 2026-11-23  2:37 UTC (permalink / raw)
  To: Andrew Stellman
  Cc: David S. Miller, Jon Maloy, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, netdev, tipc-discussion, linux-kernel

>Subject: [PATCH net] tipc: zero the pad bytes between bundled messages
>
>tipc_msg_bundle() places each message in a bundle at a 4-byte aligned offset.
>It extends the bundle with skb_put() to cover both the padding and the
>message, but copies only the message, so the 0 to 3 pad bytes before it keep
>whatever was in the skb's tailroom, and they are sent to the peer node.
>
>Zero the pad bytes. Commit 81c600c26302 ("tipc: Dont send random pad bytes
>in RESET/ACTIVATE messages") fixed the same kind of leak in link protocol
>messages.
>
>Reproduced on v7.4-rc3 with two QEMU guests as TIPC nodes, booted with
>slub_debug=P, which fills free slab objects with 0x6b. One guest sends
>60,000 SOCK_RDM messages with 41, 45 and 37 bytes of data to the other.
>That fills the link window, so some are bundled, and a packet socket on the
>sender captures the outgoing frames. Without this patch every captured pad
>byte was 0x6b; with it they are all zero and every message is still delivered. No
>other kernel changes, debug code or error injection were needed, and there is
>no TIPC selftest 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 the same tool and reviewed by
>me.
>
>Fixes: b97bf3fd8f6a ("[TIPC] Initial merge")
>Signed-off-by: Andrew Stellman <astellman@stellman-greene.com>
>---
>A reproducer is available on request.
>
> net/tipc/msg.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/net/tipc/msg.c b/net/tipc/msg.c index 39dfd33c8eec..b0d52609b03d
>100644
>--- a/net/tipc/msg.c
>+++ b/net/tipc/msg.c
>@@ -509,7 +509,8 @@ static bool tipc_msg_bundle(struct sk_buff *bskb,
>struct tipc_msg *msg,
> 	if (unlikely(max < (offset + msz)))
> 		return false;
>
>-	skb_put(bskb, pad + msz);
>+	skb_put_zero(bskb, pad);
>+	skb_put(bskb, msz);
> 	skb_copy_to_linear_data_offset(bskb, offset, msg, msz);
> 	msg_set_size(bmsg, offset + msz);
> 	msg_set_msgcnt(bmsg, msg_msgcnt(bmsg) + 1);
>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] tipc: zero the pad bytes between bundled messages
  2026-11-19 18:41 [PATCH net] tipc: zero the pad bytes between bundled messages Andrew Stellman
  2026-11-23  2:37 ` Tung Quang Nguyen
@ 2026-11-25 15:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-11-25 15:40 UTC (permalink / raw)
  To: Andrew Stellman
  Cc: jmaloy, tung.quang.nguyen, davem, edumazet, kuba, pabeni, horms,
	netdev, tipc-discussion, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Thu, 19 Nov 2026 13:41:27 -0500 you wrote:
> tipc_msg_bundle() places each message in a bundle at a 4-byte aligned
> offset. It extends the bundle with skb_put() to cover both the padding
> and the message, but copies only the message, so the 0 to 3 pad bytes
> before it keep whatever was in the skb's tailroom, and they are sent to
> the peer node.
> 
> Zero the pad bytes. Commit 81c600c26302 ("tipc: Dont send random pad
> bytes in RESET/ACTIVATE messages") fixed the same kind of leak in link
> protocol messages.
> 
> [...]

Here is the summary with links:
  - [net] tipc: zero the pad bytes between bundled messages
    https://git.kernel.org/netdev/net-next/c/504e306886ed

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-25 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19 18:41 [PATCH net] tipc: zero the pad bytes between bundled messages Andrew Stellman
2026-11-23  2:37 ` Tung Quang Nguyen
2026-11-25 15:40 ` patchwork-bot+netdevbpf

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®