Netdev List
 help / color / mirror / Atom feed
From: Bryam Vargas <hexlabsecurity@proton.me>
To: netdev-bot+sashiko@kernel.org
Cc: Mahanta Jambigi <mjambigi@linux.ibm.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Dust Li <dust.li@linux.alibaba.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Sidraya Jayagond <sidraya@linux.ibm.com>,
	Paolo Abeni <pabeni@redhat.com>,
	"D . Wythe" <alibuda@linux.alibaba.com>,
	Hans Wippel <hwippel@linux.ibm.com>,
	linux-kernel@vger.kernel.org, Wenjia Zhang <wenjia@linux.ibm.com>,
	netdev@vger.kernel.org, Hidayath Khan <hidayath@linux.ibm.com>,
	Ursula Braun <ubraun@linux.ibm.com>,
	Tony Lu <tonylu@linux.alibaba.com>,
	linux-rdma@vger.kernel.org, Wen Gu <guwen@linux.alibaba.com>,
	linux-s390@vger.kernel.org, Simon Horman <horms@kernel.org>
Subject: Re: [PATCH net v6 3/3] net/smc: skip the DMB nocopy accounting until the send buffer is set
Date: Sat, 28 Nov 2026 15:54:10 +0000	[thread overview]
Message-ID: <20261128155407.1427708-1-hexlabsecurity@proton.me> (raw)
In-Reply-To: <179487758596.3136.12928828467382443502@kernel.org>

On Tue, 17 Nov 2026 01:06:25 +0000, netdev-bot+sashiko@kernel.org wrote:
> - [High] The new NULL check only covers the time before
>   smcd_buf_attach().

Yes. 3/3 removes the NULL deref and nothing else. The cover has the
rest as the second item under "Not fixed here": the old peer's CDCs are
still applied to the new connection, and once the sndbuf is attached
they add to its sndbuf_space. They can also close it during its
handshake, as the cover says. The MSG_OOB wait you describe follows
from the consumer cursor they leave in the connection; by inspection,
not run. 3/6 of the cursor series [1] keeps the send() copy inside the
send buffer; it doesn't correct sndbuf_space.

> - [Medium] The patch stops the NULL dereference, but it keeps processing
>   a CDC that, by the patch's own new comment, can come from the old peer...
[...]
> Is that comparison accurate? A CDC that leaves the consumer cursor alone
> does not create a cons/tx_curs_fin mismatch.

Right, it isn't the same. A consumer cursor that moved stays in
local_rx_ctrl.cons, and the new peer's updates are then measured
against it. The comparison holds only for the flags and the producer
cursor; the code does not depend on it.

> A CDC that moves the consumer cursor before smcd_buf_attach() cannot come
> from the real peer. That is the reasoning behind "Nothing of ours can have
> been consumed before the attach".
>
> Would it be better to drop such a CDC, or to stop reusing a DMB that a
> previous peer can still signal, instead of applying part of it?

Stop reusing it. That is a series of its own [2]: it stops pooling
DMBs on nocopy devices, so the next connection gets a new DMB and
token. Measured on the loopback device, 8 reuse rounds: on net, the
old peer's CDCs reach the new connection every time; with v3 of [2],
none does. With it on top of this series, no test reached 3/3's skip.

Dropping covers less. Before the attach, a CDC that moves the consumer
cursor is known not to be the new peer's, and could be dropped whole
(by inspection, not tried). The rest looks like the new peer's: the old
peer's CDCs that leave that cursor alone, with its flags and its
producer cursor, and all it sends after the attach. An SMC-D CDC has no
token and no sequence number, and smcd_handle_irq() finds the
connection by the DMB alone.

[1] https://lore.kernel.org/all/20261112-b4-disp-0287c16e-v9-0-e5e8fa688177@proton.me/
[2] https://lore.kernel.org/all/20261128-b4-disp-2c190c90-v3-0-c566f64196c8@proton.me/

Thanks,
Bryam


      reply	other threads:[~2026-11-28 15:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13  0:32 [PATCH net v6 0/3] net/smc: order the CDC receive path against buffer publication Bryam Vargas via B4 Relay
2026-11-13  0:32 ` [PATCH net v6 1/3] net/smc: order the CDC receive path against RMB publication Bryam Vargas via B4 Relay
2026-11-13  0:32 ` [PATCH net v6 2/3] net/smc: clear the buffer pointers before registering a connection Bryam Vargas via B4 Relay
2026-11-17  1:06   ` netdev-bot+sashiko
2026-11-28 15:53     ` Bryam Vargas
2026-11-13  0:32 ` [PATCH net v6 3/3] net/smc: skip the DMB nocopy accounting until the send buffer is set Bryam Vargas via B4 Relay
2026-11-17  1:06   ` netdev-bot+sashiko
2026-11-28 15:54     ` Bryam Vargas [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=20261128155407.1427708-1-hexlabsecurity@proton.me \
    --to=hexlabsecurity@proton.me \
    --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=hidayath@linux.ibm.com \
    --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-bot+sashiko@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox