* [PATCH net] tipc: don't set SYN on multicast from connection-oriented sockets
@ 2026-11-29 14:49 Andrew Stellman
0 siblings, 0 replies; only message in thread
From: Andrew Stellman @ 2026-11-29 14:49 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
From: Andrew Stellman <astellman@stellman-greene.com>
__tipc_sendmsg() sets the SYN bit on every message sent from an
unconnected SEQPACKET or STREAM socket, including messages sent to a
service range, which go out as multicast. A range send doesn't connect
the socket, so every range send from it carries SYN.
Since commit c55c8edafa91 ("tipc: smooth change between replicast and
broadcast"), multicast receivers treat SYN as the marker for a switch
between replicast and broadcast: tipc_mcast_filter_msg() puts a SYN
message in the receiving socket's deferred queue until its twin
arrives by the other method. tipc_mcast_xmit() sends a twin only when
the sending socket switches method. The first range send from a new
socket can get one, because it switches from the default method. A
later range send that doesn't switch method has no twin, so a remote
receiver defers it instead of delivering it.
Don't set SYN when the destination is a service range. Connection
setup to a service or socket address still sets it. This changes
existing behaviour: range sends from these sockets no longer carry
SYN, so remote receivers deliver the ones they used to defer.
Tested on net-next (f89726ffabef) in arm64 QEMU with KASAN, with two
TIPC nodes in network namespaces linked by veth, an unprivileged
sender and RDM receivers with a 3-second receive timeout. Each socket
made two range sends. Without this patch, in each of five runs, the
remote receiver got the first range send from the SEQPACKET socket
and the first from the STREAM socket, but not the second from either.
With it, in each of two runs, it got all four. RDM multicast and a
SEQPACKET unicast were received in every run, and KASAN reported
nothing.
Fixes: c55c8edafa91 ("tipc: smooth change between replicast and broadcast")
Signed-off-by: Andrew Stellman <astellman@stellman-greene.com>
---
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 was drafted with OpenAI GPT-6 (Codex) and this changelog with
Claude Opus 5.5, and both were reviewed by me.
SYN has been set on these sends since commit 25b9221b9594 ("tipc: add
SYN bit to connection setup messages"), but multicast receivers act
on it only since c55c8edafa91, so that's the Fixes target.
net/tipc/socket.c is identical in net (28a371228d4e), net-next
(f89726ffabef) and mainline (bb13fcd7f438).
A reproducer is available on request.
net/tipc/socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 26771a98dc7a6..27af43bce0b11 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1460,7 +1460,7 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen)
return -EOPNOTSUPP;
if (atype == TIPC_SERVICE_ADDR)
tsk->conn_addrtype = atype;
- msg_set_syn(hdr, 1);
+ msg_set_syn(hdr, atype != TIPC_SERVICE_RANGE);
}
memset(&skaddr, 0, sizeof(skaddr));
--
2.53.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-29 14:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-29 14:49 [PATCH net] tipc: don't set SYN on multicast from connection-oriented sockets Andrew Stellman
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®