From: Dust Li <dust.li@linux.alibaba.com>
To: hexlabsecurity@proton.me, Tony Lu <tonylu@linux.alibaba.com>,
Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
"David S. Miller" <davem@davemloft.net>,
"D. Wythe" <alibuda@linux.alibaba.com>,
Wen Gu <guwen@linux.alibaba.com>,
Sidraya Jayagond <sidraya@linux.ibm.com>,
Jakub Kicinski <kuba@kernel.org>,
Mahanta Jambigi <mjambigi@linux.ibm.com>
Cc: Hans Wippel <hwippel@linux.ibm.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-s390@vger.kernel.org, Wenjia Zhang <wenjia@linux.ibm.com>,
linux-rdma@vger.kernel.org, Ursula Braun <ubraun@linux.ibm.com>,
Simon Horman <horms@kernel.org>
Subject: Re: [PATCH net v4] net/smc: order the CDC receive path against buffer publication
Date: Wed, 29 Jul 2026 11:58:38 +0800 [thread overview]
Message-ID: <aml6bmRRgDVznjIs@linux.alibaba.com> (raw)
In-Reply-To: <20260728-b4-disp-52ee4e7d-v4-1-0dda94b0f397@proton.me>
On 2026-07-28 11:52:53, Bryam Vargas via B4 Relay wrote:
>From: Bryam Vargas <hexlabsecurity@proton.me>
>
>The SMC CDC receive handlers dereference conn->rmb_desc, and on the
>SMC-D DMB-nocopy path conn->sndbuf_desc, but both are published after the
>connection is already reachable to a peer: rmb_desc once the connection
>is in the link group's token tree, the nocopy ghost sndbuf_desc later
>still, in smcd_buf_attach() after the ISM receive tasklet is armed. A CDC
>in that window hits a handler with the buffer unset -- a NULL dereference
>and host DoS -- or, on a weakly ordered CPU, non-NULL but not yet
>initialised. Both are also published before the receive state
>(bytes_to_rcv, sndbuf_space), so an early CDC's accounting can be
>overwritten by setup.
>
>Initialise the receive state first and publish both buffers last with
>smp_store_release(), consuming them with smp_load_acquire() and bailing
>while unset, as the handlers already do for a killed connection. Gate the
>whole sndbuf consumer trigger on the send buffer, not just the nocopy
>accounting: smc_tx_prepared_sends() and smc_tx_pending() dereference it
>too. Conforming peers are unaffected.
>
>Fixes: 69cb7dc0218b ("net/smc: add common buffer size in send and receive buffer descriptors")
>Closes: https://sashiko.dev/#/patchset/20260714-b4-disp-835288a6-v2-1-581555ef2145@proton.me?part=1
>Cc: stable@vger.kernel.org
>Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
Hi Bryam,
Thanks for finding this corner case !
Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
Best regards,
Dust
next prev parent reply other threads:[~2026-07-29 3:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 16:52 [PATCH net v4] net/smc: order the CDC receive path against buffer publication Bryam Vargas via B4 Relay
2026-07-28 16:52 ` Bryam Vargas
2026-07-29 3:58 ` Dust Li [this message]
2026-07-29 16:53 ` sashiko-bot
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=aml6bmRRgDVznjIs@linux.alibaba.com \
--to=dust.li@linux.alibaba.com \
--cc=alibuda@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=guwen@linux.alibaba.com \
--cc=hexlabsecurity@proton.me \
--cc=horms@kernel.org \
--cc=hwippel@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=ubraun@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.