From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=109.224.244.16 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796278001; b=zZp9Ml6l+Y3xUr3nRGDqGwZXQooGvUcvq6zA6rsLkVoipKO5tPeZ+SPjD1rYCbqNIuzf OBxo58a+7aBfduaspNq+/PfOWnE1xcshXKoMbKoupMCU1ZV4XAFwFomvGia0WyOLhfhJM D/tkjXVMuCbQTDWWBcEGlnV61LP35viPi0ih41NtuelyMatZGGbNE5GQN4lWK+Nxnmpta n9tZooSYPF2k02lEO9LtFSD6vUVVqSYzZ37k5cWzgdF1QtwkWCVU5LEpo9LQkpMwROeUY POZliCCU2Ma5g0jSoVOXs+xYcrvqNtUQpLaZvbxv4ztDxHls0t3MjQ6B1zkDDi0vAPQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796278001; h=DMARC-Filter:DKIM-Signature:Date:To:From:Cc:Subject:Message-ID: In-Reply-To:References:Feedback-ID:X-Pm-Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding; bh=nE5ynD3OStYeqBBH4mf4uI0Gdjek7K0vlkCsumgE5io=; b=dewIun8mGUth1p35V7PKgA4buJoiGJyHR6dPp6kywtWg/HVgdxWmO9Y4Ag43W+WlGqjU KkcWZPY7onGBpB9pCyP61ex4bEOe5DPFKu4DEXklUBiZlVIXMLYGLWraAX4jwbXu2A+/G uZBlIec9RykWobJY5U1E2j0l/nLsCFj+2f7KvaHb7FvU6qbxwInytEYwTNenNgWWPxAqC AkUo88DeZr34YUXpG7X3yvNmvxMp6pdNGxLIEsRpjJXXEg7Q7HQmz7GuWI3PEdR7LLPaL 92a5iXDY/jQyDm3gci3ko+osjz79oDzzH3csovqlkiA4hQZtybu1/zWYuT6E/Bc9mfQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass header.d=proton.me header.i=@proton.me header.a=rsa-sha256 header.s=76ghnny5evc27mguyi5medast4.protonmail2 header.b=KTqsh1in; arc=none smtp.remote-ip=109.224.244.16 Received: from mail-24416.protonmail.ch (mail-24416.protonmail.ch [109.224.244.16]) (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 433D4606A32C; Thu, 3 Dec 2026 06:06:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 433D4606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=proton.me header.i=@proton.me header.a=rsa-sha256 header.s=76ghnny5evc27mguyi5medast4.protonmail2 header.b=KTqsh1in DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=76ghnny5evc27mguyi5medast4.protonmail2; t=1796277998; x=1796537198; bh=nE5ynD3OStYeqBBH4mf4uI0Gdjek7K0vlkCsumgE5io=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=KTqsh1incTwmqRPJXDkttpJ8u2+miJdYVqfZhLZEaGAmVagz8RQCiLhXpIw18gUE2 k3SVZi0IxMr4+8qfZw6fgqysQAMYdQk0MiomlU+UjfxL+8ym7/lnSar99v7lGwFz7B CEgTkqr7fc/NL7ZONOT4JEvOWtyOO2sUzwP4Gbzr4J8cjIxE2PCx9qxtTuOYDS4Gsn UcFgnvyxdm4HEaXeIBo+Y9rqvzhb6AKnGaogkNMQlSKNglw3wl4STYQTt86/cK7cX1 o653ixdbcJ5t6SUWS8hdEjhI+uBcRuXZqy9dcDcXXm6yKQ9PCOe03CC+YrAmsfzNeC EPGYRGfq+iJSA== Date: Thu, 03 Dec 2026 06:06:30 +0000 To: Alexandra Winter From: Bryam Vargas Cc: Jakub Kicinski , "D . Wythe" , Mahanta Jambigi , "David S . Miller" , Sidraya Jayagond , Paolo Abeni , Eric Dumazet , Dust Li , 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 Subject: Re: [PATCH net v3 2/2] net/smc: do not reuse the DMB of a nocopy device Message-ID: <20261203060619.416707-1-hexlabsecurity@proton.me> In-Reply-To: <25c88570-8cd6-4058-b82e-cde76dd6cac8@linux.ibm.com> References: <20261128-b4-disp-2c190c90-v3-0-c566f64196c8@proton.me> <20261128-b4-disp-2c190c90-v3-2-c566f64196c8@proton.me> <25c88570-8cd6-4058-b82e-cde76dd6cac8@linux.ibm.com> Feedback-ID: 199661219:user:proton X-Pm-Message-ID: 1571acbc39bebc88fe2702899bd24e1e08c63694 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 30.11.26 11:24, Alexandra Winter wrote: > 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. Agreed, by reading: the pooled DMB keeps its token, and a peer that still has the token can write to the DMB. I only measured loopback; I have no ISM. > Isn't there some mechanism in SMC that makes sure old date can never be > read in a re-used dmb? smc_buf_unuse() zeroes the DMB when the connection ends. That is all I found, and it does not cover a write that comes later. On loopback the old peer's CDC lands in the DMB after the next connection has taken it, and that connection reads EOF while its own client is open. > 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() ? Maybe, with two limits. On loopback the old peer is attached to the DMB and writes its data straight into that memory, so a DMB it still holds cannot go to another connection, in either function. And a late attach finds the DMB by its token, so a pooled DMB would need a new token before it is taken again. I have not tried that. > Would it make sense to postpone 2/2 and proceed with 1/2? Yes. v4 is 1/2 alone: https://lore.kernel.org/all/20261203-b4-disp-b330a4df-v4-1-bafca73822d0@pro= ton.me/ 2/2 is not ready as it is anyway: Sashiko flagged a stale descriptor in it on v3. Thanks, Bryam pw-bot: cr