Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yehyeong Lee" <yhlee@isslab.korea.ac.kr>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH v5 2/3] RDMA/srpt: reject zero-length buffer descriptors
Date: Sun, 25 Oct 2026 01:58:57 +0000	[thread overview]
Message-ID: <sashiko-outbox-183973@kernel.org> (raw)
In-Reply-To: <20261025013748.3755639-3-yhlee@isslab.korea.ac.kr>

> srpt_alloc_rw_ctxs() takes each buffer descriptor length straight from the
> wire and hands it to target_alloc_sgl(), which has no length check of its
> own.
> 
> For the single descriptor of a DIRECT request, and for the last descriptor
> of an INDIRECT table, chainable is false, so a zero length makes
> sgl_alloc_order() compute nalloc zero. kmalloc_objs() answers that with
> ZERO_SIZE_PTR, which is not NULL, so the allocation looks like it
> succeeded and sg_init_table(sgl, 0) runs. That reaches sg_init_marker(),
> which does sg_mark_end(&sgl[nents - 1]) with nents unsigned, so the index
> is 4294967295 rather than minus one and the read modify write of page_link
> lands far outside any allocation.
> 
>   Oops: general protection fault, probably for non-canonical address 0xdffffc03fffffffe: 0000 [#1] KASAN PTI
>   KASAN: probably user-memory-access in range [0x0000001ffffffff0-0x0000001ffffffff7]
> [ ... ]
> been allocated yet.
> 
> Fixes: b99f8e4d7bcd ("IB/srpt: convert to the generic RDMA READ/WRITE API")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261025013748.3755639-1-yhlee@isslab.korea.ac.kr?part=2


  reply	other threads:[~2026-10-25  1:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-25  1:37 [PATCH v5 0/3] RDMA/srpt: fix the descriptor table checks and the context counters Yehyeong Lee
2026-10-25  1:37 ` [PATCH v5 1/3] RDMA/srpt: bound the indirect descriptor table to the IU Yehyeong Lee
2026-10-25  2:04   ` sashiko-bot
2026-10-25  1:37 ` [PATCH v5 2/3] RDMA/srpt: reject zero-length buffer descriptors Yehyeong Lee
2026-10-25  1:58   ` sashiko-bot [this message]
2026-10-25  1:37 ` [PATCH v5 3/3] RDMA/srpt: widen the indirect RDMA context counters Yehyeong Lee
2026-10-25  1:58   ` sashiko-bot
2026-10-25 14:25 ` [PATCH v5 0/3] RDMA/srpt: fix the descriptor table checks and the " Bart Van Assche

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=sashiko-outbox-183973@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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