From: Alexandra Winter <wintera@linux.ibm.com>
To: hexlabsecurity@proton.me, Jakub Kicinski <kuba@kernel.org>,
"D. Wythe" <alibuda@linux.alibaba.com>,
Mahanta Jambigi <mjambigi@linux.ibm.com>,
"David S. Miller" <davem@davemloft.net>,
Sidraya Jayagond <sidraya@linux.ibm.com>,
Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@kernel.org>,
Dust Li <dust.li@linux.alibaba.com>
Cc: Hidayath Khan <hidayath@linux.ibm.com>,
Simon Horman <horms@kernel.org>,
Julian Ruess <julianr@linux.ibm.com>,
netdev@vger.kernel.org, linux-s390@vger.kernel.org,
Wenjia Zhang <wenjia@linux.ibm.com>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
Tony Lu <tonylu@linux.alibaba.com>,
Wen Gu <guwen@linux.alibaba.com>
Subject: Re: [PATCH net v3 2/2] net/smc: do not reuse the DMB of a nocopy device
Date: Mon, 30 Nov 2026 11:24:41 +0100 [thread overview]
Message-ID: <25c88570-8cd6-4058-b82e-cde76dd6cac8@linux.ibm.com> (raw)
In-Reply-To: <20261128-b4-disp-2c190c90-v3-2-c566f64196c8@proton.me>
On 28.11.26 16:05, Bryam Vargas via B4 Relay wrote:
> From: Bryam Vargas <hexlabsecurity@proton.me>
>
> 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 <hexlabsecurity@proton.me>
> ---
prev parent reply other threads:[~2026-11-30 10:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 15:05 [PATCH net v3 0/2] " Bryam Vargas via B4 Relay
2026-11-28 15:05 ` [PATCH net v3 1/2] dibs: loopback: reset the client id when the owner unregisters a DMB Bryam Vargas via B4 Relay
2026-11-28 15:05 ` [PATCH net v3 2/2] net/smc: do not reuse the DMB of a nocopy device Bryam Vargas via B4 Relay
2026-11-30 10:24 ` Alexandra Winter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25c88570-8cd6-4058-b82e-cde76dd6cac8@linux.ibm.com \
--to=wintera@linux.ibm.com \
--cc=alibuda@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=dust.li@linux.alibaba.com \
--cc=edumazet@kernel.org \
--cc=guwen@linux.alibaba.com \
--cc=hexlabsecurity@proton.me \
--cc=hidayath@linux.ibm.com \
--cc=horms@kernel.org \
--cc=julianr@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mjambigi@linux.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sidraya@linux.ibm.com \
--cc=tonylu@linux.alibaba.com \
--cc=wenjia@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®