Re: [PATCH net v6 3/3] net/smc: skip the DMB nocopy accounting until the send buffer is set
From: Bryam Vargas
Date: Sat Nov 28 2026 - 10:54:24 EST
On Tue, 17 Nov 2026 01:06:25 +0000, netdev-bot+sashiko@xxxxxxxxxx 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@xxxxxxxxx/
[2] https://lore.kernel.org/all/20261128-b4-disp-2c190c90-v3-0-c566f64196c8@xxxxxxxxx/
Thanks,
Bryam