Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Bryam Vargas <hexlabsecurity@proton.me>
To: netdev-bot+sashiko@kernel.org
Cc: Mahanta Jambigi <mjambigi@linux.ibm.com>,
	Dust Li <dust.li@linux.alibaba.com>,
	Eric Dumazet <edumazet@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	"D . Wythe" <alibuda@linux.alibaba.com>,
	Sidraya Jayagond <sidraya@linux.ibm.com>,
	Ursula Braun <ubraun@linux.ibm.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>,
	Stefan Raspl <raspl@linux.ibm.com>,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	Wen Gu <guwen@linux.alibaba.com>,
	Tony Lu <tonylu@linux.alibaba.com>,
	Simon Horman <horms@kernel.org>,
	Guangguan Wang <guangguan.wang@linux.alibaba.com>,
	linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
	Hidayath Khan <hidayath@linux.ibm.com>
Subject: Re: [PATCH net v9 2/6] net/smc: bound the receive length to the RMB
Date: Sat, 28 Nov 2026 14:48:50 +0000	[thread overview]
Message-ID: <20261128144844.1385070-1-hexlabsecurity@proton.me> (raw)
In-Reply-To: <179483403531.3136.8089060655556532664@kernel.org>

On Mon, 16 Nov 2026 13:00:35 +0000, netdev-bot+sashiko@kernel.org wrote:
> - [High] The patch relies on spliced bytes being counted exactly once: in
>   bytes_to_rcv until they are handed to the pipe, then in splice_pending...

Both cases hold by inspection and neither is new: the review of v8 [1]
described both. They are the error exit of the chunk loop in
smc_rx_recvmsg() and the debit after the loop; 2/6 changes only the
comment on that debit. The failed second chunk dates from 9014db202cb7;
the short count needs a vmalloc'ed RMB, so b8d199451c99.

The bound doesn't rely on the single count: min(bytes_to_rcv, rmb_len -
splice_pending) keeps the read that follows either case inside the RMB,
double count included (by inspection). The commit message says the
splice_pending change is only for a reader that runs between the cursor
update and the drop in smc_rx_pipe_buf_release(), and the changelog in
the cover says the failed second chunk is a different bug, not fixed
here.

What goes wrong after that is the same as on unpatched. After case 1
the read returns stale bytes from past the producer cursor and cons
ends past it; I haven't worked out what the peer's writes do then.
After case 2 splice() has reported bytes the pipe never got, and the rx
window the peer sees stays short by that many.

Hidayath Khan's "net/smc: do not credit bytes that splice() did not
take" [2] covers this accounting: the patch handles the short count,
your case 2, and its review raised the failed second chunk, case 1,
which Hidayath agreed to fix in v2. The same review raised the
splice_pending drop that 2/6 moves; his reply announced a separate
patch for it.

> Pre-existing issues:
> - [High] This problem wasn't introduced by this patch, but spliced pipe
>   buffers keep pointing into an RMB that has already been handed back...

By inspection, yes: nothing holds the RMB slot while a pipe buffer
points into it, and smc_conn_free() doesn't look at splice_pending.
The conn->freed test isn't from this series, and 2/6 only moves the
splice_pending drop that follows it.

[1] https://lore.kernel.org/all/179364387064.3131.5492897013975868107@kernel.org/
[2] https://lore.kernel.org/all/20260820085543.967490-1-hidayath@linux.ibm.com/

Thanks,
Bryam


  reply	other threads:[~2026-11-28 14:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 12:59 [PATCH net v9 0/6] net/smc: bound wire-controlled CDC cursors against the local buffers Bryam Vargas via B4 Relay
2026-11-12 12:59 ` [PATCH net v9 1/6] net/smc: bound the wire-controlled producer cursor to the RMB Bryam Vargas via B4 Relay
2026-11-12 13:30   ` sashiko-bot
2026-11-12 12:59 ` [PATCH net v9 2/6] net/smc: bound the receive length " Bryam Vargas via B4 Relay
2026-11-12 13:30   ` sashiko-bot
2026-11-16 13:00   ` netdev-bot+sashiko
2026-11-28 14:48     ` Bryam Vargas [this message]
2026-11-12 12:59 ` [PATCH net v9 3/6] net/smc: bound the send length to the send buffer in smc_tx_sendmsg() Bryam Vargas via B4 Relay
2026-11-12 13:30   ` sashiko-bot
2026-11-16 13:00   ` netdev-bot+sashiko
2026-11-12 12:59 ` [PATCH net v9 4/6] net/smc: keep the source of an RDMA write inside the send buffer Bryam Vargas via B4 Relay
2026-11-12 13:30   ` sashiko-bot
2026-11-12 12:59 ` [PATCH net v9 5/6] net/smc: keep an RDMA write inside the peer's RMBE Bryam Vargas via B4 Relay
2026-11-12 13:30   ` sashiko-bot
2026-11-16 13:00   ` netdev-bot+sashiko
2026-11-12 12:59 ` [PATCH net v9 6/6] net/smc: bound the link failover cursor advance to the send buffer Bryam Vargas via B4 Relay
2026-11-12 13:30   ` sashiko-bot
2026-11-16 13:00   ` netdev-bot+sashiko
2026-11-28 14:49     ` Bryam Vargas
2026-11-18 23:54 ` [PATCH net v9 0/6] net/smc: bound wire-controlled CDC cursors against the local buffers 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=20261128144844.1385070-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