Netdev List
 help / color / mirror / Atom feed
From: Bryam Vargas <hexlabsecurity@proton.me>
To: netdev-bot+sashiko@kernel.org,
	"D . Wythe" <alibuda@linux.alibaba.com>,
	Dust Li <dust.li@linux.alibaba.com>,
	Sidraya Jayagond <sidraya@linux.ibm.com>,
	Mahanta Jambigi <mjambigi@linux.ibm.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@kernel.org>,
	"David S . Miller" <davem@davemloft.net>
Cc: Simon Horman <horms@kernel.org>,
	Tony Lu <tonylu@linux.alibaba.com>,
	Wen Gu <guwen@linux.alibaba.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>,
	Hidayath Khan <hidayath@linux.ibm.com>,
	Guangguan Wang <guangguan.wang@linux.alibaba.com>,
	Ursula Braun <ubraun@linux.ibm.com>,
	Stefan Raspl <raspl@linux.ibm.com>,
	linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v7 3/4] net/smc: bound the send length to the send buffer in smc_tx_sendmsg()
Date: Thu, 29 Oct 2026 18:33:53 +0000	[thread overview]
Message-ID: <20261029183345.1744839-1-hexlabsecurity@proton.me> (raw)
In-Reply-To: <179209532279.434549.3831566859438447501@kernel.org>

On Thu, 15 Oct 2026 20:15:22 +0000, netdev-bot+sashiko@kernel.org wrote:
> [Severity: High]
> Mapping a negative writespace to sndbuf_desc->len is new behaviour from
> this patch. It turns a negative sndbuf_space into a full-ring copy on
> every pass of the loop. Is that intended?

It is, for what can reach it. With 4/4 in, sndbuf_space goes negative
only through the DMB-merge credit, which runs on the loopback device
alone, IOW only the local kernel can forge it, and it takes 2^31/len
forged CDCs (measured); without 4/4 a forged cursor at failover does it
in one step, which is 4/4's case. The SMC-R over-credit after a failover
is positive (3x the buffer in the measured case), a "<= 0" gate wouldn't
see it, and the clamp is what keeps that copy inside the buffer. A gate
that blocks the sender at <= 0 is a fair alternative for the loopback
case, but it is four sites and its own change, so v8 keeps the code. The
comment in smc_tx_sendmsg() that claims 0 <= sndbuf_space <= len is
corrected in v8; the three "guarantee" comments in the credit paths from
your Low item describe the conforming case and stay.

> [Severity: High]
> This is a pre-existing issue, and this patch didn't introduce it. The
> clamp limits the size of each copy but doesn't fix the flow control.

Right: after the over-credit the copy stays in the buffer but can
overwrite data the peer has not received yet. Fixing the credit needs a
cursor compare that survives the u16 wrap rollover, which
smc_curs_comp() doesn't give; not in this series.

> [Severity: High]
> This is also a pre-existing issue. What serializes smc_switch_cursor()
> against smc_cdc_tx_handler()?

Nothing beyond what you list, send_lock on one side and bh_lock_sock()
on the other. The interleaving you give credits the handler's bytes a
second time and leaves tx_curs_fin ahead of tx_curs_sent, and a later
completion moves tx_curs_fin back and credits again. Pre-existing,
conforming peer, failover with CDC sends in flight.


  reply	other threads:[~2026-10-29 18:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 20:12 [PATCH net v7 0/4] net/smc: bound wire-controlled CDC cursors against the local buffers Bryam Vargas via B4 Relay
2026-10-13 20:12 ` [PATCH net v7 1/4] net/smc: bound the wire-controlled producer cursor to the RMB Bryam Vargas via B4 Relay
2026-10-13 20:12 ` [PATCH net v7 2/4] net/smc: bound the receive length " Bryam Vargas via B4 Relay
2026-10-15 20:15   ` netdev-bot+sashiko
2026-10-29 18:25     ` Bryam Vargas
2026-10-13 20:12 ` [PATCH net v7 3/4] net/smc: bound the send length to the send buffer in smc_tx_sendmsg() Bryam Vargas via B4 Relay
2026-10-15 20:15   ` netdev-bot+sashiko
2026-10-29 18:33     ` Bryam Vargas [this message]
2026-10-13 20:12 ` [PATCH net v7 4/4] net/smc: bound the link failover cursor advance to the send buffer Bryam Vargas via B4 Relay
2026-10-15 20:15   ` netdev-bot+sashiko
2026-10-29 18:38     ` Bryam Vargas
2026-10-13 20:16 ` [PATCH net v7 0/4] net/smc: bound wire-controlled CDC cursors against the local buffers netdev-bot+sinfo
2026-10-20 19:28   ` Jakub Kicinski

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=20261029183345.1744839-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=guangguan.wang@linux.alibaba.com \
    --cc=guwen@linux.alibaba.com \
    --cc=hidayath@linux.ibm.com \
    --cc=horms@kernel.org \
    --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=raspl@linux.ibm.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