From: sashiko-bot@kernel.org
To: "Youngsung Ahn" <ays511.kr@gmail.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH v3] RDMA/rxe: validate cur_sge on the receive path before indexing dma->sge[]
Date: Sun, 04 Oct 2026 15:40:51 +0000 [thread overview]
Message-ID: <20261004154052.65D1B1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261004153325.2952372-1-ays511.kr@gmail.com>
> A user QP's receive queue is an mmap'd ring. The user provider writes
> the WQEs into it and post_recv never touches them, so every field of
> struct rxe_recv_wqe comes from user space. When the responder picks up a
> WQE it only checks dma.num_sge (in rxe_get_recv_wqe() and
> get_srq_wqe()). dma.cur_sge, dma.sge_offset and dma.resid are copied
> into qp->resp.srq_wqe without any check.
>
> copy_data() then uses cur_sge as an index right away:
>
> struct rxe_sge *sge = &dma->sge[dma->cur_sge];
>
> It dereferences that pointer (sge->length) before the in-loop
> "dma->cur_sge >= dma->num_sge" test, which only runs after the first
> sge++. cur_sge is a u32, so the pointer can land far outside
> dma->sge[], which has RXE_MAX_SGE entries and sits inside the
> [ ... ]
> retransmit path reaches dma->sge[] through advance_dma_data(), which
> still has the same unchecked index. I will send those separately.
>
> Fixes: 8700e3e7c485 ("Soft RoCE driver")
> Signed-off-by: Youngsung Ahn <ays511.kr@gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261004153325.2952372-1-ays511.kr@gmail.com?part=1
prev parent reply other threads:[~2026-10-04 15:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-04 15:33 [PATCH v3] RDMA/rxe: validate cur_sge on the receive path before indexing dma->sge[] Youngsung Ahn
2026-10-04 15:40 ` sashiko-bot [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=20261004154052.65D1B1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ays511.kr@gmail.com \
--cc=linux-rdma@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.