🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #2025

Re: [PATCH] rds: fix out-of-bounds conn_path walk in peer gen update

#2025
From: Allison Henderson
Date: Sun, 11 Oct 2026 20:44
57 lines
7348 bytes
On Fri, 2026-10-09 at 00:40 +0800, Henry Martin wrote:
> A connection on the IB transport (t_mp_capable unset) is allocated
> with exactly one rds_conn_path slot, yet the peer's genetic number
> update routine is hardcoded to walk RDS_MPATH_WORKERS entries whenever
> the peer announces a non-zero gen number that differs from the one we
> cached.  Everything past the first entry lands on whatever happens to
> follow the single-slot array in the same slab slot group, and the loop
> then reads and modifies struct fields there (lock acquired,
> cp_next_tx_seq cleared, retransmit list inspected).  A malicious peer
> can therefore force consecutive out-of-bounds writes into neighbouring
> kmalloc-512 objects (KASAN: "Write of size 4 in
> _raw_spin_lock_irqsave").
> 
> The allocation and the walk now agree on the same expression
> (trans->t_mp_capable ? RDS_MPATH_WORKERS : 1), so the loop can never
> outlive the array regardless of what the peer reports.
> 
> This vulnerability was discovered by Tencent CodeBuddy Security.

Hi Henry,

Please see my reply to the NPATHS patch:
https://lore.kernel.org/netdev/20261008163843.957325-1-bsdhenrymartin@gmail.com/

We should fold this patch into a single v2 from that thread.

Thank you!
Allison

pw-bot: cr


> 
> 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
> @@ -144,7 +144,8 @@
>  	if (peer_gen_num != 0) {
>  		if (conn->c_peer_gen_num != 0 &&
>  		    peer_gen_num != conn->c_peer_gen_num) {
> -			for (i = 0; i < RDS_MPATH_WORKERS; i++) {
> +			for (i = 0; i < (conn->c_trans->t_mp_capable ?
> +			     RDS_MPATH_WORKERS : 1); i++) {
>  				struct rds_conn_path *cp;
> 
>  				cp = &conn->c_path[i];
> --
> 2.43.7
Technical Details
Message-ID: <b33f6c72f102b1181e2f6ef605c8958800be4784.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-344611-linux-kernel-netdev=dewy.ru
References: <20261008164041.961961-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-344611-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 walk in peer gen update
Date: Sun, 11 Oct 2026 13:44:07 -0700
Organization: Usenet Network
Message-ID: <b33f6c72f102b1181e2f6ef605c8958800be4784.camel@kernel.org>
References: <20261008164041.961961-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="1615934"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ZXJZ53Kmq5piQZH9LWEssgcRaF4= sha256:OvHCXvwjTMv3y9LFfaU7iwvnMTufUnhLgoQV+yvBIKk=
	sha1:4FeQWpiM+8HHFmwSi2OiHzzhjkc= sha256:fl2aQbdt8MprxaG0dZmIHKDc23VZGxa3wYfsrBl4llw=
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 AA0CC10FA70; Sun, 11 Oct 2026 23:44:21 +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 N9CB8D6trNVK;
	Sun, 11 Oct 2026 23:44:17 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-344611-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 379C610FA0A; Sun, 11 Oct 2026 23:44:12 +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 DA26F27004; Sun, 11 Oct 2026 20:44:10 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 26078443AB4;
	Sun, 11 Oct 2026 20:44:10 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PFCW3XMn"
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 1C1FA23817E;
	Sun, 11 Oct 2026 20:44:08 +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=1791751450; cv=none; b=Xte5PIRQ+Ek55gqFxJnMsG3mVaGpkL7axyVM/aQLNgz18iFDkdIHW0N4CizQwh5jfL4j9o6pG7mTOycYg8vakeoCXooSdVyTRQ+Pt2uG/arWs4u5w+2K1fqhFJlGeiduSAIhtGNgCIgfQ47Bzk/u+ojDw8yPyF2+suIWd635MA4=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791751450; c=relaxed/simple;
	bh=qFwGJErAOF1xJhe3RYW0olYnPq0313Jj84maBd/9NRE=;
	h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References:
	 Content-Type:MIME-Version; b=gNLeBDmISeQxRkqVKjkDPjtZwaVCunU/OdolNpeU9QiI8luqxsPNGZpo+OmsmeMCU6lfIFvQjujp0Lvbc9un4Y6uFDMUbEH2ElKJ9P+P+rDaeyEg4wyH/I19sdcOX2IoaMF3F+W9axVUjs6muo9425Jb3j/jhY8fO/Vc1ldNBKU=
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=PFCW3XMn; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 480121F0089B;
	Sun, 11 Oct 2026 20:44:08 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1791751448;
	bh=jwsaWPFL5lSwMPYPKntzvuLOFwYaczrmDVzo/Dx8PRU=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=PFCW3XMnfU6kH3gRH6dy9KV8ldB4nP1e8vhhv1NMTNMx6U4g670H3uiDL3bPgqujr
	 +grhzBWVN1agI5VrOxN9TtjkpWUBXUAYudMOKS1NnjTdD9udHetuQ9jEMgRNydnpVF
	 0ixyg22xSTAJ2tWuxmbNPmIBWgpX7oOUNCBHR+sukMNSdSh8RuGs9qet2hE3g5CLdH
	 Tqc3LP7mMlPTt5aDB+Pp8lHrgJ/ZQIDb2/I5uNHoIhSb3grNFZxRXCaJ+hovYecilU
	 ZRcDV8fe+U//rdMiY3F8hfh6yibgFmNpaKvQofch421mUSzTT9NFqjVpgPfjU7bXoL
	 qYW4YZVVrnbrw==
X-Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, 
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
X-In-Reply-To: <20261008164041.961961-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>