Article View: linux.kernel.netdev
Article #27195Re: [PATCH net v2 2/2] tipc: reject SYN sent from a connection-oriented socket to a datagram server
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 01:11
Date: Sat, 05 Dec 2026 01:11
100 lines
11297 bytes
11297 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 ยท High: 1 ยท Medium: 0 ยท 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).
- [High] This patch has no effect: a datagram server still accepts the
SYN that the commit message says it rejects.
--
tipc: reject SYN sent from a connection-oriented socket to a datagram server
The patch tries to make a connectionless (SOCK_RDM/SOCK_DGRAM) TIPC
server socket reject SYN or implicit-connect messages from
connection-oriented clients with TIPC_ERR_NO_PORT. To do this it adds a
clause to the receive filter in tipc_sk_filter_rcv().
Closes: https://lore.kernel.org/netdev/20261129144901.90934-1-bugs@stellman-greene.com/
> diff --git a/net/tipc/socket.c b/net/tipc/socket.c
> index 4ed895b75bf3a..e606954fbd2c3 100644
> --- a/net/tipc/socket.c
> +++ b/net/tipc/socket.c
> @@ -2379,6 +2379,8 @@ static void tipc_sk_filter_rcv(struct sock *sk, struct sk_buff *skb,
> hdr = buf_msg(skb);
> limit = rcvbuf_limit(sk, skb);
> if ((sk_conn && !tipc_sk_filter_connect(tsk, skb, xmitq)) ||
> + (!sk_conn && msg_connected(hdr) &&
> + (mtyp == TIPC_NAMED_MSG || mtyp == TIPC_DIRECT_MSG)) ||
> (!sk_conn && msg_connected(hdr)) ||
[Severity: High]
Can this new clause ever be true for a SYN?
msg_connected() only checks the message type:
net/tipc/msg.h:
static inline u32 msg_connected(struct tipc_msg *m)
{
return msg_type(m) == TIPC_CONN_MSG;
}
The SYN built by __tipc_sendmsg() is never a TIPC_CONN_MSG. It is a
NAMED or DIRECT message with the SYN bit set:
net/tipc/socket.c:__tipc_sendmsg() {
...
msg_set_syn(hdr, 1);
...
if (atype == TIPC_SERVICE_ADDR) {
msg_set_type(hdr, TIPC_NAMED_MSG);
...
} else { /* TIPC_SOCKET_ADDR */
msg_set_type(hdr, TIPC_DIRECT_MSG);
...
}
So msg_connected(hdr) is false for every SYN, and the new clause is
false too.
Whenever the new clause is true, the unchanged line after it is also
true:
(!sk_conn && msg_connected(hdr))
As a result, the set of rejected messages looks the same as before the
patch. A SOCK_RDM or SOCK_DGRAM server would still add the SYN-flagged
NAMED/DIRECT message to sk_receive_queue. Would the reproducer in the
commit message still show the problem?
There is a second issue with the clause. mtyp is read once, from the
first skb, before the dequeue loop:
int mtyp = msg_type(hdr);
The loop never reads it again for the skb it is checking.
Was the intent to test msg_is_syn(hdr), together with a type check on
the current skb's header? The type check matters because
tipc_mcast_send_sync() in net/tipc/bcast.c also sets the SYN bit, on
TIPC_MCAST_MSG headers that connectionless sockets legitimately receive:
/* Preparing for 'synching' header */
msg_set_syn(hdr, 1);
A plain !sk_conn && msg_is_syn(hdr) test would also reject that
multicast traffic.
> (!grp && msg_in_group(hdr)))
> err = TIPC_ERR_NO_PORT;
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204003240.63452-1-tung.quang.nguyen%40est.tech
Technical Details
Message-ID:
<179643310693.3146.4275269356282190125@kernel.org>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377773-linux-kernel-netdev=dewy.ruReferences:
<20261204003240.63452-3-tung.quang.nguyen@est.tech>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377773-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v2 2/2] tipc: reject SYN sent from a connection-oriented socket to a datagram server Date: Sat, 05 Dec 2026 01:11:46 +0000 Organization: Usenet Network Message-ID: <179643310693.3146.4275269356282190125@kernel.org> References: <20261204003240.63452-3-tung.quang.nguyen@est.tech> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2922262"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:+jQH2KsOrFG5IQ2ZFwQTrsc+99Q= sha256:HdRUNZObFpMiUwo45KNTHz0YELfXVeMRcvOoP8RepgM= sha1:ctidgT/+o0BohiechjghZfRaPKw= sha256:/nF/9KWp+Ff7OT9i9Z3cJxxkAGG0ru0UdW39d/Vxvy4= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 124F3117A6A; Sat, 5 Dec 2026 04:12:04 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.641 X-Spam-Status: No, score=-3.641 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.142, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1PfxtzXJhAkx; Sat, 5 Dec 2026 04:12:01 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-377773-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id B681B117D37; Sat, 5 Dec 2026 04:11:52 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 868142A0B2; Sat, 5 Dec 2026 01:11:49 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796433109; b=FAkkLNMytU6JHh63b+IpdLijmgJDKSrHQGErPamIiq9dDMAjG4N/49FMPDffzg87/wW3 7g/5rRdedQxUxWl4T9SmyqoaKSTCVbnUG95v5q/HaTZEXgwWlysJmTT9j++kSgDYUu+fH 3dFuxB5GQP6DIR00iqLkw2+cTIaMtFEpPjX9Q4ojXrgOVOTNqbYcduk3cGCjiIDhDWD3z vA4DmgNJr7mtZ2TSGIIbB8yxmSl4NNN4ohnb9WGbHmHFsOOj1MXBZcXZqMc4179Of+EHS sZiiTWk/JseS53k3Gn4AqS3GyVrwixgMA5eCDUAUDokPX0UqPAwxR66gAfglmY6PwXg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796433109; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=0j7OKRm1a3hdwUxIDvkKhYLi+YmzwrSgzE+ngJyyW4g=; b=MEmsygt9eaYHKdR3IZxJcVwGNOvloMTrz8mHI/OuPPZmmxVOEK7dm5mgJZPks4/5vY8L kByaye4tLgxPjHruzYkHftI+CBJkLhSz9870LU5ydpiFFJ1WWkkxk/fGbU3g7r++EhdN9 VtdxzQwuaGPK98Y4wpMVo7XJejVtSoLgyO4rWmMbk0XGS5z6Zg/8j5fZob1y0TAxCEUCo UgAhqj8RmRAZiglMjPOIedKuCi/PEDafANFkNU80QVnh7QChaZ6mxbpxlkLfWiV6fBQtY nGGxxYjuQDz5svqtRf2ZVv+BDKI9kq37KLgfXSJ8Kjw1QA39V0kXOB/Hx4DNPytZiUw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IzFm1jgB; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 38DA2606A32F; Sat, 5 Dec 2026 01:11:49 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IzFm1jgB X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796433108; b=ptvZQugVou2TYyogZTsnr/RxyUgU50U0Lm9dBbWkfEoITLliPQ/XWFL4OO9nQ3ZDZp1n E0Nxj5IRkv3oqvP65rE14lXwj6YyTiLsV9LypvN69xGJtaPC6FYHgmVzpZ4vGbTWPH7rl L7li9NpjZZjMAxTetGHkWQkCM8e9Hz1/rczFi4F5XmrBhx1DWD/hjJNeROYVoLF5+rNbI PTIx8zT9wN6ZxDqDlmO+4phgy4xeyJAlMiNRp56GVVEWnhRvwEWhx2OyraEG03io7KTes j10u38uwov6GNgRKB0VZPzm6tmsBSyXZSsZDlNoHi2yqAyLAhqhUM5U9VeRRC4G8buA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796433108; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=0j7OKRm1a3hdwUxIDvkKhYLi+YmzwrSgzE+ngJyyW4g=; b=U1GVjMxEDFh2dQEJGqP3Feqyea0O3/HhpqX754YeCawckabkS2WRTuLBPm7CseSR2sG9 Wkk7lD3cqDmM3JtHGOHoKV9A8GZSxlOkQ7bVny0hq4adKm7mwtFgHVkkVJOBO0eYu0sAC BxmMdIbvRRjcmJZtM27j3WQRQ0h2K4TtYt3CxdHlZ5/G84koPmeji8R97qpG6+ioRFJDt EAO6+IkNKM7T7PSGDc3Baa3drsHvAV/8s6vtO1M1DvbXt5sL70v/dX8yZalnNuQ9I8SzY KXMkLSc19aylSbv3QH5/FlOBsrhPBJp+Z1otxh1NwgxiuQ2quK/a2340/fwkLLw6KFg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IzFm1jgB; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A719606A332 for <netdev@vger.kernel.org>; Sat, 5 Dec 2026 01:11:48 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59F8E1F0092B; Sat, 5 Dec 2026 01:11:47 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796433107; bh=0j7OKRm1a3hdwUxIDvkKhYLi+YmzwrSgzE+ngJyyW4g=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=IzFm1jgBprYMhvF3Z4SMhViv2iOxn4YTcNyYJh977CAbz06ySr+5OqYIThEp5lrBT qZbRMZowNaN7xZBBqNVxo4icD1Oglimi0PkjfPjGVL445FOrnNNWPXIcSUX0c/rwGl PpD6M74/VwifOPpNHhSJTlIRiJafDjwPx36oX/9WnYULtDfDY3U6OTkq8W0TEHnYZ9 kKrszQo9JJ5uKlEvnB00AqnBLhkw1DDAzncVlOmBoNOxcR52tKeWAVTX/WrPX5kucG Wzvth3pBbLk1mlxy+ze+XY72AmJTxNGOVx8AYLK7HYvX0pi42ICsu9d1OyyohXZlQK 48HqMIieeEnoQ== X-Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, edumazet@kernel.org, pabeni@redhat.com, jmaloy@redhat.com, horms@kernel.org, tipc-discussion@lists.sourceforge.net, willemb@google.com, astellman@stellman-greene.com X-In-Reply-To: <20261204003240.63452-3-tung.quang.nguyen@est.tech> X-sashiko-severity: High X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list