From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796034309; b=d9SWiiFvDb2NCP9t2rji0W+SS69JIxc4AmeZyqB05poiET//rCbUgudeB4NZP40kRdTF pedirKNJ106eDlWAtEMwoA0UNiqL00Xfy9parP8waaBfhUpfQ260kpmcE110xnTjPOesF yNjXRpAoUhvIDvoKpjifQjAm3NrTTQacKE2Z8181504y+1C7iJ/jcOHIAMuubn9YdELHo fIaYzCUxwTTU+mghzkagxPGSHbhxZAMEFVZuqwQnxQk6B202Bx7g9HDWVZMM/l0ZeaGp+ 93vvITMyv25RWjwGuY7160pROwyzsEN6y43mu9weOjN+e44WhQJjsv3rXgrulPkFVnQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796034309; h=DMARC-Filter:Received:DKIM-Signature:Received:Received:Received: Received:Received:Received:Received:Message-ID:Date:MIME-Version: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-TM-AS-GCONF: X-Proofpoint-Reinject:X-Proofpoint-Spam-Info:X-Proofpoint-ORIG-GUID: X-Proofpoint-GUID:X-Authority-Analysis:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=tehBptJgSjhN6IqqgQrLTsoWypkVnrvjNeB/aRamPYw=; b=HaQV9EHFBToJbHtw1C9Q77eMJEemIFGWd9IyPXNVz+isV2qI7ZpgAFxfpEDVwmWRmwmg jxwWaEHffwoq2Lew6FGborlCISxTgBH4pxBeqtfu0HlSOU4yFJksOo/Cq4eW6GOEQ75KT us0vlZMj2xcKvPf79kTfHoyri5nTti30rVnWwG5Qq5YoxQP6/ItjLK6cWn2Fu/Dg8gGOg eqAkeRtElV45b632THjU4rXBGRIwY2+XwcyVxJEGOvyPgUWuVcvpELMEqV6u80gmBwzOM bYP6evcpKYEqbwy04qqm5j/N0WGf/J/IScB9B4D3awdwTyd71BdYutabTmEhU4/WZyA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=pXHShYCy; arc=none smtp.remote-ip=148.163.156.1 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 8277F606A329; Mon, 30 Nov 2026 10:25:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8277F606A329 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=pXHShYCy Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AU9YYns2931603; Mon, 30 Nov 2026 10:24:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=tehBpt JgSjhN6IqqgQrLTsoWypkVnrvjNeB/aRamPYw=; b=pXHShYCysxvDazUj09udEM BR4+zEa90R4gth713GObC/Xk+xaFyQ7I60T9sLffDAr3h5F0x5N3Qy+NMqt+RV6g eABMm7GM2SnIsv3TnahJvF0rl7GVbAMUySSUzZ/8XMOPfAy6hRfUWpkJQc6MoydR O/HXqYjOEB9301ikQFYNAsZ4YaGSV0FoziIthZHbuRgn4EeuuqoSmHPJcp+j2X9e dpvJs4UUqsgb6hEAjai1wJTENyDzx94xg511c0eS1EhbB+knAZNK5jhvf4C4lx0m 2lII3VNgaCJdh4ZeNqGgUy8eqoKHJ62YyCod1JvGtajT5yoTYY8pzROBSzv2Yc+A == Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4j7pf3qag3-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 30 Nov 2026 10:24:46 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 6AU9YQQl3289256; Mon, 30 Nov 2026 10:24:46 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4j89nvckk3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Nov 2026 10:24:45 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6AUAOgsj49545622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Nov 2026 10:24:42 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0C8532004D; Mon, 30 Nov 2026 10:24:42 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B739C2004B; Mon, 30 Nov 2026 10:24:41 +0000 (GMT) Received: from [9.68.25.8] (unknown [9.68.25.8]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 30 Nov 2026 10:24:41 +0000 (GMT) Message-ID: <25c88570-8cd6-4058-b82e-cde76dd6cac8@linux.ibm.com> Date: Mon, 30 Nov 2026 11:24:41 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v3 2/2] net/smc: do not reuse the DMB of a nocopy device To: hexlabsecurity@proton.me, Jakub Kicinski , "D. Wythe" , Mahanta Jambigi , "David S. Miller" , Sidraya Jayagond , Paolo Abeni , Eric Dumazet , Dust Li Cc: Hidayath Khan , Simon Horman , Julian Ruess , netdev@vger.kernel.org, linux-s390@vger.kernel.org, Wenjia Zhang , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Tony Lu , Wen Gu References: <20261128-b4-disp-2c190c90-v3-0-c566f64196c8@proton.me> <20261128-b4-disp-2c190c90-v3-2-c566f64196c8@proton.me> Content-Language: en-US From: Alexandra Winter In-Reply-To: <20261128-b4-disp-2c190c90-v3-2-c566f64196c8@proton.me> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Info: AW1haW4tMjYxMTMwMDA0MCBTYWx0ZWRfX6/mKzSuEVHOU bYIh+4GF10oPIrxrtkneNGuqGBEhY0IMkfbBYOGJ8K/W76NdxeIanZjv+1D5dBkRBeh1aJNJrf/ fC8OzBnPRWmz3fuBrnNk2eRUdJFd6lA= X-Proofpoint-ORIG-GUID: xNMxhg-zxQcaGi_xyv71W3xUswOla3Iu X-Proofpoint-GUID: 2zbAeDO4SCpAo3nUyNOhMyTq7lg5JERC X-Authority-Analysis: v=2.4 cv=R6eWitRX c=1 sm=1 tr=0 ts=6b0d4eef cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VwQbUJbxAAAA:8 a=LUNE6GlwEK1ry7LBa5AA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTMwMDA0MCBTYWx0ZWRfXxlWep+fm8KVW Rua47r2Vh8UarecsfgUhHc/S4p7ePVGK3MwyJVkBaFd8t5znfvbzG0YjqogZlttXAHY/2eXw5Jz yRVIfGK93UgWJw/mDkK7fC8MO4kQhN14nDFExKX7h7o2oYV+Y35sIN3L1qGtZIu+4bkumjebxVU t/jwnTfXr+gyzE/i1g/ktKFBrvXaaRX8pNGnW0PdvatdJQKV60jPvQvG+sJE5P1QbnZcqHSd+ay Ygiw0PFNxW58HaFU5w6K2kJN5CW36QpSyA9R10dqN7aiahYx9WUw0r2IAqdv9xhEqP/mhHPTROT auh8vd+aIjAusOgQXhJQaslwmCERg939Ck3qTCMVV/jQ2jFu6gWesEbVRmKOMdl0rNDGuRdRlrN 5pXCk4r8bYqzErNiVwnE0Tq96CEvCe6rmeiSNOU9dgnMglBqxmsZjl/xg8GeCIhuJ+JWILs3Ybr mC50aQ3NSXcvWz3CrCA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-30_03,2026-11-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 spamscore=0 bulkscore=0 phishscore=0 suspectscore=0 malwarescore=0 clxscore=1015 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611300040 On 28.11.26 16:05, Bryam Vargas via B4 Relay wrote: > From: Bryam Vargas > > With DMB nocopy (the dibs loopback device) the peer writes into the RMB > through its own attachment, and it can attach late. smc_buf_unuse() puts > the DMB back in the link group's pool with its token still registered > while the old peer can still write to it: the next connection that takes > it gets the old peer's CDCs, and a peer that attaches after the other > end gave up lands in another connection's DMB. > I think the same concept applies when the smcd device does not support nocopy (ISM devices). When the dmb is in link group's unused pool, while it is still registered with the dibs device, the peer can write into the dmb. > Unregister a nocopy DMB when the connection ends instead of pooling it: > the next connection gets a new DMB and token, a peer still attached > keeps the old one until it detaches, and a later attach fails. When the > link group is off its list smc_conn_free() skips smc_buf_unuse() and the > link group's free unregisters the DMB: clear conn->rmb_desc there, or a > retried connect() that cannot allocate its RMB unlinks and frees the > stale descriptor. Devices without nocopy keep their pool. > This idea seems to defeat the whole concept of a reuse pool. If that is necessary, you may as well remove the whole pool concept for SMC-D (not sure about SMC-R). Isn't there some mechanism in SMC that makes sure old date can never be read in a re-used dmb? I don't understand all the observed issues in v3 0/2, but maybe some of them can be solved in __smc_buf_create() instead of smc_buf_unuse() ? Some of the issues (link group fee or link group terminate) may allpy to loopback only. Would it make sense to postpone 2/2 and proceed with 1/2? smc maintainers please chime in, maybe I misunderstood something here. > Fixes: ae2be35cbed2 ("net/smc: {at|de}tach sndbuf to peer DMB if supported") > Cc: stable@vger.kernel.org > Signed-off-by: Bryam Vargas > ---