Article View: linux.kernel.netdev
Article #1202Re: [PATCH net v4 2/2] net/rds: include the scope id in the sendmsg connection cache check
From: Simon Horman
Date: Fri, 09 Oct 2026 11:57
Date: Fri, 09 Oct 2026 11:57
31 lines
6975 bytes
6975 bytes
On Wed, Oct 07, 2026 at 08:14:26PM -0700, Allison Henderson wrote:
> rds_sendmsg() reuses the connection cached in rs->rs_conn when its
> peer address and ToS match the request. The interface index is part
> of a connection's identity as well: rds_conn_create_outgoing() passes
> the request's scope_id down as dev_if, and rds_conn_lookup() compares
> c_dev_if, so sends to the same link-local address through two
> interfaces are two different connections. The cache-hit test never
> looked at it.
>
> A socket bound to a non-link-local address has rs_bound_scope_id 0,
> and the scope check at the top of rds_sendmsg() accepts any non-zero
> destination scope for such a socket. So after a send to fe80::x%ifA,
> a send to fe80::x%ifB hits the cached ifA connection and the datagram
> leaves through ifA, to whichever peer answers to that address there.
>
> Compare c_dev_if with the request's scope_id in the cache test, so
> that such a send takes the lookup path and finds, or creates, the ifB
> connection - the same key the lookup uses. With the previous patch a
> send without a destination carries the connected peer's scope, or the
> bound scope for a non-link-local peer, which is what an explicit send
> to that peer computes, so the comparison is exact for it too.
>
> Found by inspection while reworking this cache for the connection
> lifetime series on net-next; not observed in the field.
>
> Fixes: 1e2b44e78eea ("rds: Enable RDS IPv6 support")
> Assisted-by: Claude-Code:claude-fable-5
> Signed-off-by: Allison Henderson <achender@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Technical Details
Message-ID:
<20261009115724.GA83879@horms.kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343613-linux-kernel-netdev=dewy.ruReferences:
<20261008031426.1142344-1-achender@kernel.org> <20261008031426.1142344-3-achender@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343613-linux-kernel-netdev=dewy.ru From: horms@kernel.org (Simon Horman) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v4 2/2] net/rds: include the scope id in the sendmsg connection cache check Date: Fri, 9 Oct 2026 12:57:24 +0100 Organization: Usenet Network Message-ID: <20261009115724.GA83879@horms.kernel.org> References: <20261008031426.1142344-1-achender@kernel.org> <20261008031426.1142344-3-achender@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1099240"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:EQVnSnOd2DdE8Z0uYLMUCWJqx2s= sha256:Bytqm0m6vuZEV32phGPhHWti2qP3TLEmy14PMOG3v+8= sha1:/mMVsTQ2WdbO6v3HJt+ranT+fw8= sha256:FzOBY3/aIAo8LOrVFSIvs8Jwx6yO7iKN+TQHXPBcV/w= Content-Disposition: inline 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 2B80710F66F; Fri, 9 Oct 2026 15:14:23 +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=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.241, 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] 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 H6R1TjgNOx47; Fri, 9 Oct 2026 15:14:20 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-343613-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 127AB10F665; Fri, 9 Oct 2026 15:14:17 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 6F7CE61360; Fri, 9 Oct 2026 12:03:26 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD6894DD6C8; Fri, 9 Oct 2026 11:57:31 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KGH4/92a" X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 688D14D0CE7; Fri, 9 Oct 2026 11:57:28 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791547051; cv=none; b=mEqHoK7uYnXr6s5cx0W+rTJANMNNU9U4XyXjaxvtjsxatuHQ5qxGuEVZRJw+f27myA+5mnkXZPqKDU/FRB8Ga2lFUxAwYq7Fxnj0uzQl5Ls4qljODldyWNXIwXbD0sVyx5e53qWjZJzUifEa48Bc6b6CjUUHxOkgOK8UF0STm/c= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791547051; c=relaxed/simple; bh=eooPg2n9iPNRFhAxuYdKaVw7vSM3NMRtcUG2y2oMiSs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CsIxes52ZNmjp3QbuBUD8zHOqQZY/3gItZvmclQwu8BA8cNINGjSzX4zzN8FqM3KzvpxJLgq3JKU5AEF7NeFWolCNYuNZOMT24E4pwsYPbYmpQL2NZV+kqgz7dhJcZeqUqmAK4ylXtfUFOHi5kC3Qz4kA2Yzu1XzisXLgoc+anM= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KGH4/92a; arc=none smtp.client-ip=100.103.45.18 X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id F19CD1F000FF; Fri, 9 Oct 2026 11:57:26 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791547048; bh=etuxrB8opkdzHU19eF0XxZGDl52Q6+ijG3fwOHg1lvc=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=KGH4/92akH+Y3jBUkiae09npPb6Z4SCqt6OREllfcMj/5x0xHMGCDjv/dzolIoC+s VWojNvFh0taJ3SO9ZMNFpFt9rSyy3bTb7tJ6V7d13n6f58NhT59Ot27XpUTxDCzoa1 rQvKvs5XZR7LNa09St5mD0m+B3+7dvINuHQfNL+hg2b9zj9b2f0yDzrp8OIjrI1I5U 0cGqFxnRtpHXYmLL85+FysyPf3Kgjzh8lOAopXyjfL2kY6vOx2SrVhbRBnQn+aKPdo PiivoPK3gVaBJJypTDH77TrT2yKBkcoVo0Mk6mrb+Tj0puvFEj2Ba+YL84gsPSZoUm lVfcNYmbCI7Ig== X-Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, pabeni@redhat.com, edumazet@google.com, kuba@kernel.org X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-In-Reply-To: <20261008031426.1142344-3-achender@kernel.org>