๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27196

Re: [PATCH net v2 1/2] tipc: reject service-range SYN sent from connection-oriented socket

#27196
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 01:11
131 lines
12434 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message's reproducer and problem statement don't match
  the code.
- [Low] tipc: Fixes trailer cites initial merge instead of 0abd8ff21f19

--

tipc: reject service-range SYN sent from connection-oriented socket

This commit makes __tipc_sendmsg() return -EINVAL when a
connection-oriented socket tries to set up a connection to a
TIPC_SERVICE_RANGE destination. Before this change, such a send fell
through to tipc_sendmcast().

Closes: https://lore.kernel.org/netdev/20261129144901.90934-1-bugs@stellman-greene.com/

> The issue can be reproduced as follows:
> 1. Run a connection-oriented server that binds to a service range.
> 2. Run a connection-oriented client that binds to a service range, then sends an
>    implicit connection message to the server using sendto().
> 3. Read from the server socket. The server still receives the connection
>    message, which is unexpected behavior.

[Severity: Low]
Can step 2 of this reproducer trigger the bug?

On a connection-oriented socket, bind goes through
tipc_bind()->tipc_sk_bind()->__tipc_bind()->tipc_sk_publish(), which
does this:

net/tipc/socket.c:tipc_sk_publish() {
    ...
	tsk->published = true;
	return 0;
}

In __tipc_sendmsg(), the syn branch checks published before it gets to
the new service range check:

		if (tsk->published)
			return -EOPNOTSUPP;
		if (atype == TIPC_SERVICE_RANGE)
			return -EINVAL;

So a client that binds first gets -EOPNOTSUPP from sendto() whether or
not this patch is applied, and the server never receives anything.

The path this patch closes seems to be an unbound SOCK_STREAM or
SOCK_SEQPACKET client that calls sendto() or sendmsg() with a
TIPC_SERVICE_RANGE destination. The code change looks correct for that
case.

Should step 2 say that the client sends to a service range, rather than
binds to one?

> However, the current implementation allows a client to send a SYN or an implicit
> connection message using a service range.

Is the explicit SYN part of this sentence accurate? tipc_connect()
already rejects service ranges on connection-oriented sockets:

net/tipc/socket.c:tipc_connect() {
    ...
	} else if (dst->addrtype == TIPC_SERVICE_RANGE) {
		res = -EINVAL;
		goto exit;
	}
    ...
}

It looks like only the implicit connect through sendmsg() was open.

The second patch in the series, "tipc: reject SYN sent from a
connection-oriented socket to a datagram server", only changes
tipc_sk_filter_rcv(), so it does not affect this.

[ ... ]

> diff --git a/net/tipc/socket.c b/net/tipc/socket.c
> --- a/net/tipc/socket.c
> +++ b/net/tipc/socket.c
> @@ -1458,6 +1458,8 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen)
>  			return -EISCONN;
>  		if (tsk->published)
>  			return -EOPNOTSUPP;
> +		if (atype == TIPC_SERVICE_RANGE)
> +			return -EINVAL;
>  		if (atype == TIPC_SERVICE_ADDR)
>  			tsk->conn_addrtype = atype;
>  		msg_set_syn(hdr, 1);

[Severity: Low]
Is b97bf3fd8f6a the right commit for the Fixes tag?

In the initial merge, send_msg() already refused TIPC_ADDR_MCAST (the
old name for TIPC_SERVICE_RANGE) on connection-oriented sockets:

    if (needs_conn) {
        res = -EOPNOTSUPP;
        goto exit;
    }

That guard survived e2dafe87d328 ("tipc: RDM/DGRAM transport uses new
fragmenting and sending functions"). That commit split the multicast
path out into tipc_sendmcast() and kept a sock->state != SS_READY test
there that returned -EOPNOTSUPP.

The protection appears to have been lost in 0abd8ff21f19 ("tipc: start
using the new multicast functions"). That commit rewrote
tipc_sendmcast() and dropped the SS_READY check without adding an
equivalent one in tipc_sendmsg(). That seems to be the first point
where an unconnected SOCK_STREAM or SOCK_SEQPACKET socket could reach
tipc_sendmcast() with a service range destination.

If that history is right, should the tag be:

Fixes: 0abd8ff21f19 ("tipc: start using the new multicast functions")

There is no runtime impact either way. However, blaming the initial
merge misleads anyone tracing where the regression came from. It also
misleads the tooling that uses the Fixes tag to decide which trees
need the backport.

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204003240.63452-1-tung.quang.nguyen%40est.tech
Technical Details
Message-ID: <179643310566.3146.7461447303310470606@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!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377772-linux-kernel-netdev=dewy.ru
References: <20261204003240.63452-2-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!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377772-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2 1/2] tipc: reject service-range SYN sent from connection-oriented socket
Date: Sat, 05 Dec 2026 01:11:45 +0000
Organization: Usenet Network
Message-ID: <179643310566.3146.7461447303310470606@kernel.org>
References: <20261204003240.63452-2-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="2922312"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:CUc/J+M9cZolY3B8i7x4r0IsHTc= sha256:A4+DklYP2NCYQzF1DAZCrhkvlSaKyW+v6VsTXwo1m50= sha1:TqD9yOJ4KANIgXuvz2UN9WxjSqs= sha256:W/oXtpIjYUozmY4BKSQaZMb/L/5ug0bZRAW3OARq0z4=
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 B4F9E117A6A; 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 xoPZOc2G1lwX; Sat,  5 Dec 2026 04:12:00 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-377772-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 6BAC2117D35; Sat,  5 Dec 2026 04:11:51 +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 0602D2A013; Sat,  5 Dec 2026 01:11:48 +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=1796433107; b=ItUTwbysPbMqnZNr0bOMfW+9UosUBQwY7Zm6TSmEB/QSeJTpzSWJzXabFY1aCqTx6Sfz 8RBznmVJrk0VCCQetI2mgpAg8Uzeh3Z0iJFCx/d+GSRP0rryZJv+Z66eCg3i7oNqvgIyB awBy1JZxBT7cnVZHadJ0ZwJCd5POWyN1VKZrK5XDAK5DCsatmLdQG8egl+VbKoKn+r/nZ vCXLhfzSBXL0E72ggn/f3o/MKqA2ZJpMX3yVQWhRGDHPNjcqa+05Z4rWWm5kFmresXrnt ASWTtRuIvW8UGjipEPQupW76g4nSr/ZnDn8Pft7bPhloB8UcggCv9YqnCQFSgR7Ek3A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796433107; 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=CfAKQRHSmvcRufNycAr0Dvy80xN7XALmY2wnY6gOhV4=; b=zjSmCq4W/fseGiuPvQZnW5KfHN79EPSrtRPHxS2Ul34gyLJMMWddleFh4dUseLQQOtCf bZtOm3pBMWeYtkvr56htchVxX2YR95j33axt9ES2i2qmCTDdnI7B3Uvlj+R67kchqN/B4 UG6Jb6BCyqNJsYRm1b6lE9deNBReOoFqdSxSzhzaNlfTaDArIxK+VK6wzxQCIHeQGWDlq WaEmn/IZS1nMT3sVeweVK2VKAMc+JkViEagOGJl8LhgXn8Np7Cs4BNRm1LWRNhA6KAzIz xMxxMI/h/mfSmQ+P/C7zUjQMSW/z6ISesCnxllYjTSPbyuCny8z/zpyMxSgaAcYFBXA==
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=Xjv2NMHF; 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 C0A9A606A32C; Sat,  5 Dec 2026 01:11:47 +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=Xjv2NMHF
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=1796433106; b=DtTtJNuZo1Orj7hzrvdwGHev9QJ2RGvX8YsA+fl9sc/9NwmNyj7pnwZlU/yvbAs6TryP 2tX41NItadbOsireReSau9qnK3JdkNwJo1wdS0G16kEvX8D91VD2s20STr9w2LGz4l0O4 AtPN+h0PistdjETTb1V5BfMBwbPkoCCaMrX05HV4cFyJnCM7lvaZfWdyFvtarV+EzQS2D d8kaMRZK63V7BdJEyFC95CUydijZJV+ct1V50lE+ZF+XimbCdHTRCKqHKUgEiBBchnUA0 iAVwtryEb4MqFT5lgz/gT7FO+CKsw8Ka8p/JXf10dZmNV8Yd6LTRfuF92aWQBGETmrw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796433106; 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=CfAKQRHSmvcRufNycAr0Dvy80xN7XALmY2wnY6gOhV4=; b=YiQyfKGC84mDM80bA1ntCcqdFLO6fxwoiAdEe0pC50CwmbiMXoA4tcfzX1Z0y+RlwX92 uW11dnTGBlN4njFpz4JiWAIbGWXJKe5YuV+oF/ca+56LDspOOoIBKMoS1XXNaGY4kdOBb A0dqs9JXc/Cyd1CwUna9ba2U46AHAcu33abD1J8h7MNc/tFG+qGWA/GZnQl7WeW2R8Km6 Zko5E9BBqbi/aHtVflmWAI9p9mjFPP3ukZ1cG6gi2eqCnyZm1OM6/5q5waAYZK5sKt6Yz 34kFWUKfRcVczxaR7unYdnHpH4GpZWjmwlY3GbVmGGgzIx8zR6ydiQoVJNp7mTAmn8A==
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=Xjv2NMHF; 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 DE1C4606A322 for <netdev@vger.kernel.org>; Sat,  5 Dec 2026 01:11:46 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26C831F0092B; Sat,  5 Dec 2026 01:11:46 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796433106; bh=CfAKQRHSmvcRufNycAr0Dvy80xN7XALmY2wnY6gOhV4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Xjv2NMHFKxXLo1RMuJM5iATWKJzUXzGZYypgDiablri8gm3t3NLonbxScopOJXe+t oZqhLMhRCLTfHk5VBJXQyJrZQCgIq2iXGVUt7mLNUT8zD30rJClFgSoHO8+lD3tsXy VDNvAXP0cvFuJbrDTnVVEoTHnk8hpkNBo6nAcIZPI+doofYiA7Z6znrsOIk+WMDo+b zeZ0vY9jLGBabToFkbEvepaKKtABuyObz8tf/SxqGPoR7ng2Fg8ms2nKxQgKmCqjyL kNAe3+eoyXJTpSYaShUGBo5Y+8BO5RduYbIFCPDFdsmu8y7jrco53aySRRQPiC72Ek imjM9Dm7Ci6DA==
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-2-tung.quang.nguyen@est.tech>
X-sashiko-severity: Low
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