Article View: linux.kernel.netdev
Article #3458Re: [PATCH net v2] rds: fix out-of-bounds conn_path walks via handshake exthdrs
From: Allison Henderson
Date: Thu, 15 Oct 2026 05:29
Date: Thu, 15 Oct 2026 05:29
77 lines
8467 bytes
8467 bytes
On Mon, 2026-10-12 at 10:53 +0800, Henry Martin wrote:
> Both the lane and the connection-generation negotiation are driven by
> extension headers in handshake packets, and both are processed
> unconditionally, even on transports that are not multipath capable.
> A non-MP connection (t_mp_capable unset) owns exactly one
> rds_conn_path slot, so a peer claiming up to RDS_MPATH_WORKERS lanes
> makes every subsequent fan-out walk conn->c_path[0..7] at 504-byte
> strides past the single allocated slot (KASAN: "Read of size 8 in
> rds_conn_path_connect_if_down"); the generation negotiation opens a
> similar out-of-bounds walk on the same array.
>
> Only process handshake extension headers when the connection's
> transport is multipath capable, so a peer can never make us walk
> lanes that do not exist. Both call sites in rds_recv_incoming() are
> gated.
>
> This is a port of the Oracle UEK fix for the same issue, picked up
> where Paula's series of the same change left off.
>
> This issue was discovered by Tencent CodeBuddy Security.
>
> Cc: stable@vger.kernel.org
> Link: https://lore.kernel.org/netdev/20260825120132.51636-1-pamoutafpro@gmail.com/
> Link: https://github.com/oracle/linux-uek/commit/2fdeb0513f18
> Fixes: 840df162b3eb ("rds: reduce memory footprint for RDS when transport is RDMA")
> Fixes: 905dd4184e07 ("RDS: TCP: Track peer's connection generation number")
> Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com>
Hi Henry,
Looks like a straight forward port. Thank you!
Reviewed-by: Allison Henderson <achender@kernel.org>
Tested-by: Allison Henderson <achender@kernel.org>
Thank you!
Allison
> ---
>
> v2: Replace the two allocation-bound clamps with a port of the UEK
> t_mp_capable handshake gating (suggested by Allison Henderson),
> correct the Fixes tags and link Paula's series.
>
> net/rds/recv.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/net/rds/recv.c b/net/rds/recv.c
> index 6204e577a90ae..93ee4546ae362 100644
> --- a/net/rds/recv.c
> +++ b/net/rds/recv.c
> @@ -379,7 +379,8 @@ void rds_recv_incoming(struct rds_connection *conn, struct in6_addr *saddr,
> rds_stats_inc(s_recv_ping);
> rds_send_pong(cp, inc->i_hdr.h_sport);
> /* if this is a handshake ping, start multipath if necessary */
> - if (RDS_HS_PROBE(be16_to_cpu(inc->i_hdr.h_sport),
> + if (conn->c_trans->t_mp_capable &&
> + RDS_HS_PROBE(be16_to_cpu(inc->i_hdr.h_sport),
> be16_to_cpu(inc->i_hdr.h_dport))) {
> rds_recv_hs_exthdrs(&inc->i_hdr, cp->cp_conn);
> rds_start_mprds(cp->cp_conn);
> @@ -387,7 +388,8 @@ void rds_recv_incoming(struct rds_connection *conn, struct in6_addr *saddr,
> goto out;
> }
>
> - if (be16_to_cpu(inc->i_hdr.h_dport) == RDS_FLAG_PROBE_PORT &&
> + if (conn->c_trans->t_mp_capable &&
> + be16_to_cpu(inc->i_hdr.h_dport) == RDS_FLAG_PROBE_PORT &&
> inc->i_hdr.h_sport == 0) {
> rds_recv_hs_exthdrs(&inc->i_hdr, cp->cp_conn);
> /* if this is a handshake pong, start multipath if necessary */
Technical Details
Message-ID:
<220faca993d7a88c356b1e146f4a4397eedfe5de.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-346544-linux-kernel-netdev=dewy.ruReferences:
<20261012025336.54756-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-346544-linux-kernel-netdev=dewy.ru From: achender@kernel.org (Allison Henderson) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v2] rds: fix out-of-bounds conn_path walks via handshake exthdrs Date: Wed, 14 Oct 2026 22:29:37 -0700 Organization: Usenet Network Message-ID: <220faca993d7a88c356b1e146f4a4397eedfe5de.camel@kernel.org> References: <20261012025336.54756-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="2456239"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:CWSIR5ZZ4axxV2eAnBl7zVDHGmQ= sha256:xyrqwMB3FcYdEg5TXwxNLa4oKkySC/6AVzVCbeDF6Vs= sha1:kgjDmY3comxqRa5RVcVudlE6oi4= sha256:ofkEVKHohoo2mcJnsZwM8WRgyvFXidfdQUTCNHyqkDI= 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 6844611024C; Thu, 15 Oct 2026 08:30:55 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.34 X-Spam-Status: No, score=-1.34 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, 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 TOZSrta7sr7o; Thu, 15 Oct 2026 08:30:47 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-346544-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 9F1AD1101E6; Thu, 15 Oct 2026 08:30:39 +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 F14093B243; Thu, 15 Oct 2026 05:29:40 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 15DBC3EAC75; Thu, 15 Oct 2026 05:29:40 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cfxzQI/B" 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 CDA203C09F2; Thu, 15 Oct 2026 05:29:38 +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=1792042180; cv=none; b=hwRri1Ks4UqrZTSROTbIRehamn76ZtHwCVqRKgYqUZipebzXvsIQ1n3IE2DFAgnaz7nTHav7X7rSRol4XnGYYJdEWNhNAU94Ssakt5T554MoCZR8l7xRvcPRQzvnRnQhteFwV3SFY+d2MhH+uqa8V6bawbtNBuH4xkKfhzPM9GY= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792042180; c=relaxed/simple; bh=J96CPq9KNfSGwmFfSwnow8d1VRCNy1lykVWEa4BRv5s=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=mJAVUg6pRtsRrx/P0bLfdFtcjWi1doRR0+bGlk62iMqaIIlNvHKktPsmPkOleukuwrVeaLJy7eo0RT6X69d8NgEkGMs/j2gibffqd1e37Xiy/MVKs17NHHi5N2Ma6h4HVzba+hYipwXSPVFf/zTvZpZR5G42wZ1diGDsWi1hxMs= 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=cfxzQI/B; arc=none smtp.client-ip=100.103.45.18 X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E20881F000C4; Thu, 15 Oct 2026 05:29:37 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792042178; bh=mosaqDMrnIIYI76F1/ztKvBh4xcaQ41OBgNMnDxgPXw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=cfxzQI/BmSlZ6JiSpe4YMKvEFO7zN9jq3yeuCt97nRbyY5SVTgfc64ygdLL1csrYS N43cXgV0/a0Du+vj3dRxNX/NSsLk/35Cn7Qydzb6gsE+YGCCatdxuGosXeeOmvcHVC nqQXtsIscv0Cs+svQ7wpdhSWddqSJRY+lsxoCxn2zDPr3R3x8mrjrT+p+qXv/BI39r F140vlp5VRuLSsYTPFwWoTR/bOucpT+BF5J5SXwdVJJZ0OcQrLftaaePT4XkReUPJz 1UlbckKwHzsF+BZAg2Qpj20euGWUAAa77BKb1gx5wtVkOtY0U8Jy8mlU2Yhr2qo5lG fwYYPqoMv5nxg== X-Cc: linux-rdma@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org X-In-Reply-To: <20261012025336.54756-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>