From: Bart Van Assche <bvanassche@acm.org>
To: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Cc: Leon Romanovsky <leon@kernel.org>, Jason Gunthorpe <jgg@ziepe.ca>,
linux-rdma@vger.kernel.org, target-devel@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] RDMA/srpt: bound the indirect descriptor table and widen the counters
Date: Wed, 21 Oct 2026 09:58:04 -0700 [thread overview]
Message-ID: <266b742e-5568-421f-a861-945e6dd54eed@acm.org> (raw)
In-Reply-To: <20261021001854.2343027-1-yhlee@isslab.korea.ac.kr>
On 10/20/26 5:18 PM, Yehyeong Lee wrote:
> BUG: KASAN: slab-out-of-bounds in srpt_alloc_rw_ctxs+0x6ee/0x950
> Read of size 4 at addr 000000006318205c by task kunit_try_catch/33
Some feedback about this patch:
* Since this patch fixes two separate bugs, should it perhaps be split
into two patches? The fixed issues are:
- The missing bound on the descriptor table goes back to
commit a42d985bd5b2. The original code did `memcpy(ioctx->rbufs,
db, n_rbuf * sizeof *db)` with the same missing check.
- The `u8` `n_rw_ctx`/`n_rdma` counters came in with commit
b99f8e4d7bcd ("IB/srpt: convert to the generic RDMA READ/WRITE
API").
* n_rdma can overflow without many descriptors. It is the sum of
rdma_rw_ctx_init() return values (work requests per context), and that
can exceed 255 even for a few large descriptors. Widening it fixes
more than the commit message says; please mention that.
* The `idb` header ends at most at offset 320, and `MIN_MAX_REQ_SIZE` is
996, so reading it is never out of bounds; at worst it reads stale
data. The extra check is fine, but both checks could be folded into
one, placed after the existing descriptor-count check.
Thanks,
Bart.
prev parent reply other threads:[~2026-10-21 16:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 0:18 [PATCH v2] RDMA/srpt: bound the indirect descriptor table and widen the counters Yehyeong Lee
2026-10-21 0:23 ` sashiko-bot
2026-10-21 16:58 ` Bart Van Assche [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=266b742e-5568-421f-a861-945e6dd54eed@acm.org \
--to=bvanassche@acm.org \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=target-devel@vger.kernel.org \
--cc=yhlee@isslab.korea.ac.kr \
/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