Article View: linux.kernel.netdev
Article #2024Re: [PATCH] rds: fix out-of-bounds conn_path access via handshake NPATHS
From: Allison Henderson
Date: Sun, 11 Oct 2026 20:41
Date: Sun, 11 Oct 2026 20:41
78 lines
8207 bytes
8207 bytes
On Fri, 2026-10-09 at 00:38 +0800, Henry Martin wrote:
> Connections on the IB transport (t_mp_capable unset) own exactly one
> rds_conn_path slot, but the peer can still claim eight lanes through
> the NPATHS extension header of a handshake packet, and every
> subsequent fan-out path then treats all eight entries as real: the
> mp-start helper iterates conn->c_path[0..7], dereferencing cp->cp_conn,
> taking cp->cp_lock and queueing delayed work on cp->cp_wq at 504-byte
> strides into whatever comes after the single allocated slot (KASAN:
> "Read of size 8 in rds_conn_path_connect_if_down").
>
> The negotiated lane count is now clamped to the same value the
> transport was allocated with (trans->t_mp_capable ?
> RDS_MPATH_WORKERS : 1), so a peer can never ask us to walk lanes that
> do not exist.
>
> This vulnerability was discovered by Tencent CodeBuddy Security.
Hi Henry,
Thanks for the patches. This patch looked a little familiar, and it turns out this fix and the
companion patch ("fix out-of-bounds conn_path walk in peer gen update") are the same fix Paula
posted in August:
https://lore.kernel.org/netdev/20260825120132.51636-1-pamoutafpro@gmail.com/
The AI review of that version came back with some complaints:
https://lore.kernel.org/netdev/20260828230506.385788-1-kuba@kernel.org/
The good news is, I think the fix is a very simple port of a uek patch:
https://github.com/oracle/linux-uek/commit/2fdeb0513f18
If your willing to step in where this series left off, you'll want to start with the v2 thread,
and pick up the porting task described there:
https://lore.kernel.org/netdev/83915f73efb509328a3d4963b093e2cffcf9af99.camel@kernel.org/
Please send a single v2 that is just that port, against net. The fix tag ba3d1f480c7a doesnt
look like it changes the allocations. The tags you want should be:
Fixes: 840df162b3eb ("rds: reduce memory footprint for RDS when transport is RDMA")
Fixes: 905dd4184e07 ("RDS: TCP: Track peer's connection generation number")
A link to Paula's v2 would also be a nice way to credit her analysis as well.
Thanks!
Allison
>
> Cc: stable@vger.kernel.org
> Fixes: ba3d1f480c7a ("net/rds: size a connection's path set by the transport it ends up with")
> Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com>
> ---
> net/rds/recv.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> --- a/net/rds/recv.c
> +++ b/net/rds/recv.c
> @@ -224,7 +224,8 @@
> /* Process extension header here */
> switch (type) {
> case RDS_EXTHDR_NPATHS:
> - new_npaths = min_t(int, RDS_MPATH_WORKERS,
> + new_npaths = min_t(int, conn->c_trans->t_mp_capable ?
> + RDS_MPATH_WORKERS : 1,
> be16_to_cpu(buffer.rds_npaths));
> break;
> case RDS_EXTHDR_GEN_NUM:
> --
> 2.43.7
Technical Details
Message-ID:
<9cdaa7743cbd1e6e39345647f4ef95ab308ca7ad.camel@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-344610-linux-kernel-netdev=dewy.ruReferences:
<20261008163843.957325-1-bsdhenrymartin@gmail.com>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-344610-linux-kernel-netdev=dewy.ru From: achender@kernel.org (Allison Henderson) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH] rds: fix out-of-bounds conn_path access via handshake NPATHS Date: Sun, 11 Oct 2026 13:41:31 -0700 Organization: Usenet Network Message-ID: <9cdaa7743cbd1e6e39345647f4ef95ab308ca7ad.camel@kernel.org> References: <20261008163843.957325-1-bsdhenrymartin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: usenet.network; logging-data="1615673"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:wQ+Cf4dyAJ5uGA6gy2fPNGQFb7E= sha256:IYh2RY4Iels4EyO/HsQHyvAiK9BxbA0tZY3EGOGy/YU= sha1:3blsmDgdO2oku8IUMzhN67TEb+Y= sha256:aXk6c6jxRWaWOuTsljIGET8H+IQuxmuLpyZyOHdqQW8= 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 E0CD910FA6F; Sun, 11 Oct 2026 23:42:50 +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 rcqevOSzq8qq; Sun, 11 Oct 2026 23:42:46 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-344610-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 68C5310F57F; Sun, 11 Oct 2026 23:42:40 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 644B0261A1; Sun, 11 Oct 2026 20:41:34 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 952C345D930; Sun, 11 Oct 2026 20:41:33 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b10v1nnB" 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 7F4232AD00; Sun, 11 Oct 2026 20:41:32 +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=1791751293; cv=none; b=phyTTTm0T/bRs6tVp5ngRbyUN9qZeq7WlDW40EaBrcIFNaMDZa+Gq6ZxhjGhuqrgh5oAryyWV8TqWz2/JLuBTFsIy4sDnmKwZNuJg0Y8nt7t+T0Im574QZr4XYYd6GA4ipXvm9rvt+rlulqLzgoOLx95ZALZNM6Tr7ZnUuHLYDs= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791751293; c=relaxed/simple; bh=RO9ISlZvPFFXP6l+PwZzFLx38QyGRFkuORHAOV9ntKI=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=B5hu8d/hEiXyyq6WL3w9xcdi0Rfk75mLrz4DeTdlMf52bROplzsLH1a5WxRDz6wolA1KrA9V3zJVlC8k5dFaGdaW/sBvSpHXAzzUTetpVgLi44Hq/Alpa9mSzEhVoh/IR9bXvRQUulvU/6cxBIJKWt/5yld3cK/wiRCZr9Jb4hw= 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=b10v1nnB; arc=none smtp.client-ip=100.103.45.18 X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCB471F0089B; Sun, 11 Oct 2026 20:41:31 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791751292; bh=RfXdrFXcfp1opR3x45dOBQyYz5kPQ9A4aytmThsJMzs=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=b10v1nnBor0aJ+7mOPZ7PlfPUck6RaGHusprk/0cO2RrvqP7qh1tHC64dSh06RjPZ Ms3NNUca0hdC4XWG1CLDKZ88HtkZ7ne7eipytvh6+BBpEBhD+nTvCyHqgyfMVWJb/I dymnSiL0xoMy+u6tZeIPDLt03wp1J1z85ge3StxB1LpTRN0VFNJdutoJ9c17kbezD6 Pw+/XBMnYZoVHdywC3e1RUV+qY7sBj6WURvdSh83bp29+F5vxblG4wldigE2pM+5Tp 91f5guh+WqASznr+N/u2xSxAzRfy9EJ6NhfK1FynkWCbDbjKHKo8eeg3S9XwB9/tey gLYQ1FdU/fcJg== X-Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org X-In-Reply-To: <20261008163843.957325-1-bsdhenrymartin@gmail.com> X-User-Agent: Evolution 3.52.3-0ubuntu1.1 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>