Article View: linux.kernel.netdev
Article #21504Re: [PATCH net] net/smc: validate peer CDC cursors against buffer bounds and window
From: Dust Li
Date: Tue, 24 Nov 2026 04:16
Date: Tue, 24 Nov 2026 04:16
40 lines
10183 bytes
10183 bytes
On 2026-11-23 19:21:01, Qican Ma wrote: >smc_cdc_cursor_to_host() only checks cursor monotonicity and >smcd_cdc_msg_to_host() copies peer cursors without any validation. Neither >verifies that prod.count < conn->rmb_desc->len or >cons.count < conn->peer_rmbe_size, nor that the resulting cursor deltas >stay within available buffer capacity. A malformed or malicious peer CDC >message can therefore: > >1. Drive conn->urg_curs.count past conn->rmb_desc->len in > smc_cdc_handle_urg_data_arrival(), causing an out-of-bounds read from > conn->rmb_desc->cpu_addr exposed via recvmsg(MSG_OOB). >2. Inflate conn->bytes_to_rcv past conn->rmb_desc->len (either via an > out-of-range prod.count or repeated wrap increments), causing the > second chunk iteration in smc_rx_recvmsg() to copy past the end of > rcvbuf_base. >3. On SMC-D dmb_nocopy links, inflate conn->sndbuf_space past > conn->sndbuf_desc->len, causing the second chunk iteration in > smc_tx_sendmsg() to write past the end of sndbuf_base. > >Decode incoming CDC messages into a temporary smc_host_cdc_msg and verify >both cursor offsets and their deltas against rmb_desc->len, >peer_rmbe_size, and (for dmb_nocopy) sndbuf_desc->len before committing >the update to conn->local_rx_ctrl. Have you checked this patch ? https://lore.kernel.org/netdev/20261112-b4-disp-0287c16e-v9-0-e5e8fa688177@proton.me Best regards, Dust > >Found with an LLM-assisted code review tool and verified by inspection on >v7.4-rc4 (b6a9fa34ce4). Build-tested only; not runtime-tested due to lack >of an SMC-R/SMC-D setup. You can test using SMC-R & rxe + veth Best regards, Dust
Technical Details
Message-ID:
<awUPgw3EGv7ATYRS@linux.alibaba.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369993-linux-kernel-netdev=dewy.ruReferences:
<CA+OT+ON4Lt9mLvWPK8rUaHKZ01_p0fGCiCsWHwXWzT1sGaTtLA@mail.gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369993-linux-kernel-netdev=dewy.ru
From: dust.li@linux.alibaba.com (Dust Li)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] net/smc: validate peer CDC cursors against buffer
bounds and window
Date: Tue, 24 Nov 2026 12:16:03 +0800
Organization: Usenet Network
Message-ID: <awUPgw3EGv7ATYRS@linux.alibaba.com>
References: <CA+OT+ON4Lt9mLvWPK8rUaHKZ01_p0fGCiCsWHwXWzT1sGaTtLA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
logging-data="4049249"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:9kc/4OgHPVd4dR9R6/Fwjgq055s= sha256:ZfODxwvJInDgPQLycys4FdaWu0Pb546TgUMq/zkALJM=
sha1:82QLrrOigcYcx5SKn8f0u8Y7360= sha256:4oSVGUgnvnfB4D9naJ1aXaMcYM68H/dL0n+KoCIDRTQ=
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 7494B125DCD; Tue, 24 Nov 2026 07:16:40 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -10.65
X-Spam-Status: No, score=-10.65 tagged_above=-9999 required=6.31
tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
UNPARSEABLE_RELAY=0.001, USER_IN_DEF_DKIM_WL=-7.5]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
header.d=linux.alibaba.com
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 6gJXPlrqus9T;
Tue, 24 Nov 2026 07:16:36 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-369993-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id C27DC125DC9; Tue, 24 Nov 2026 07:16:27 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sto.lore.kernel.org (Postfix) with ESMTP id E14B9604ACE; Tue, 24 Nov 2026 04:16:26 +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=1795493784;
b=31FDNy5B03joUfIBEfQiWeguipaTxI7QQOQ75pncrwK56qMpwb/sT55K2VcQiOGw7h+Y
JQKMqtFqKcCHYGhU1+XiRzRG5BVxCm0af8mn+vXl7ba3ZYl5bKDZYqjsQbeX2+03dnRJ/
ekm/nrE0m69YTb+Opx07HMLKCQZT2HMfIsPdwAGfVbDljbyGbIe3n4BC0qHS4425BEpiT
l8RLuATTsLvUIKmbW6d/DC6O1J1YHlzfv2PuaeFJcd7xvXr024R4G8+pai9qT6oo7NEvv
4xFV86Zz6FCKQGm0eVPM/EM0KclVbuimaWepoV9gIxVoAP7ejYLuGnnyRtsijzFceqg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795493784;
h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:
X-Alimail-AntiSpam:Received:Date:From:To:Cc:Subject:Message-ID:
Reply-To:References:X-Mailing-List:List-Id:List-Post:List-Help:
List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To;
bh=lzo3DG5jQeTIv4tq9t9/JrbENZSwl8CcGGmhioRYcrU=;
b=2BAr1pZ2mD2FL5ni4vaUOY84Z3JLkCGA0soY+suXEfHr4j0d94B3ddpR1J4+7dDVH1tY
DdxgB0nXKmaLwR37gepu85a3Ve7l4O7jjyTGN7XVkOi4wkmkijPuJK+15XuAkoGrACT+d
Fz7mXEZfMRzq2kcE0MC+0L8mLp18rGcV0IFA9MrXk5NMj5aVFKQ1xm0hprYY5O47WRflP
inIvwehVCGts0BW86YIkqLJ8rfs3TRRg3G88P6a550wqpiGpqrNeAduEUTjwT/fX/m63H
Y+DvuewMnUSp8wt3D1+1VR3N2XOtsuZ8lu9XrHvJ0UWUZHFuaK9uxcDT8ao1bR/DXfw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=hCG1Iuvl;
dmarc=pass header.from=linux.alibaba.com;
spf=pass smtp.mailfrom=linux.alibaba.com;
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 8776B606A32D;
Tue, 24 Nov 2026 04:16:24 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=hCG1Iuvl
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.99
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795493778;
b=ddJbAKN8hGHuXJYQTaPw+G41OJHb/WUvuVJ2k8k5QwbdihjfM8+JJStzL2owpgQy69Dg
gY1l+68dVGIyR184bvKBX2k9sHIhn+/1cB67KFfKBbH/i+QNh86Tr2g6Gi96L/9jSACTn
Ww6jbzNHX+G3OyHmiGxfglpIgw8/FRbyQirz97TsK7ZPRio2OYa18WoxTHIjygAjfzgwk
Ucf7Hc/PVMWuZ2aMXMQ+ZO3aHxqqZ1/zViOUSeP5nP9keP83sQA/WvMnXHJbANjtOAXvo
tXho7852Rq99KLfzklnlvSG4NC2TJQjOiYfnoNEeyEluft/4tPh8lQ1KvC7tVfzpgSA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795493778;
h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:Date:From:To:
Cc:Subject:Message-ID:Reply-To:References:MIME-Version:Content-Type:
Content-Disposition:In-Reply-To;
bh=lzo3DG5jQeTIv4tq9t9/JrbENZSwl8CcGGmhioRYcrU=;
b=eYRcCdCMweZclPyMDxcBbY11j//87vlEG5l4s1ZlpG5wP62DW6LpAVgs1UMXNSSWHLXQ
Vb7AZE/OcCLczyBcqTF8FutNsC9q3hgmnXcYr+EXIhZ6Ng5AG5e3K/92pimI0zuMtbZQo
LP/oLKfo+hVJCJuv+3Y99q0e6RIamkza4H2s7zt6G87hs5IATwdjcRo+elXqF00qxexA3
buInI/sQv1uK8u1r9o2uCSDOBxXyfyNFXj2zI/Wgg/F6C6FGrD8gi8I5Vx3LINMZIl3Zo
BOu+5cWloeSewfTiGdVF0wGmL9a+CimJKGMLCfKISVz8ro+Y2qjjprDQx4EORuLZkZg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=linux.alibaba.com;
spf=pass smtp.mailfrom=linux.alibaba.com;
dkim=pass header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=hCG1Iuvl;
arc=none smtp.remote-ip=115.124.30.99
X-Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A31CB606A31E;
Tue, 24 Nov 2026 04:16:16 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A31CB606A31E
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=linux.alibaba.com; s=default;
t=1795493765; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type;
bh=lzo3DG5jQeTIv4tq9t9/JrbENZSwl8CcGGmhioRYcrU=;
b=hCG1IuvlAO6dqN5GWiermX8FEFidFsScHIwp8f+axgVckTMACxeofD4a7IcGSSEU5iCFgekwB4CZE8iPuuMFOBw7+dlQ+s62Kw7x+W8IiJ1FcH/Gh0Kt7mVpK5PaQ2+sssz/Hr451NihhicLgZiT89HHDWxw2BE/Q5jMOTvV1hA=
X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R621e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037026112;MF=dust.li@linux.alibaba.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---0XFNAltz_1795493764;
X-Received: from localhost(mailfrom:dust.li@linux.alibaba.com fp:SMTPD_---0XFNAltz_1795493764 cluster:ay36)
by smtp.aliyun-inc.com;
Tue, 24 Nov 2026 12:16:04 +0800
X-Cc: tonylu@linux.alibaba.com, guwen@linux.alibaba.com, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, linux-rdma@vger.kernel.org,
linux-s390@vger.kernel.org, netdev@vger.kernel.org
X-Reply-To: dust.li@linux.alibaba.com
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
X-In-Reply-To: <CA+OT+ON4Lt9mLvWPK8rUaHKZ01_p0fGCiCsWHwXWzT1sGaTtLA@mail.gmail.com>