Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Youngsung Ahn" <ays511.kr@gmail.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH v2] RDMA/rxe: reject IB_WR_REG_MR from user QPs in rxe_reg_fast_mr()
Date: Thu, 01 Oct 2026 15:39:58 +0000	[thread overview]
Message-ID: <20261001153958.8E29D1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261001152426.3259522-1-ays511.kr@gmail.com>

> IB_WR_REG_MR is documented as kernel-only ("can not be issued by
> userspace"), but nothing enforces it.
> rxe_wr_opcode_info[IB_WR_REG_MR] sets WR_LOCAL_OP_MASK for IB_QPT_RC,
> a QP type userspace can create, so a user QP that writes
> opcode = IB_WR_REG_MR into its mmap'd SQ ring reaches
> rxe_do_local_ops() -> rxe_reg_fast_mr(). That function then trusts
> the ring-supplied fields:
> 
> 	struct rxe_mr *mr = to_rmr(wqe->wr.wr.reg.mr);
> 	...
> 	if (unlikely(mr->state != RXE_MR_STATE_FREE))    /* deref */
> 	...
> 	mr->access = access;                             /* write */
> 
> For a user QP wqe->wr.wr.reg.mr is a fully attacker-chosen pointer,
> so this is an arbitrary-kernel-address dereference (arbitrary read
> confirmed, oops). No existing check distinguishes a user QP on this
> path.
> 
> Reject IB_WR_REG_MR for user QPs before dereferencing the supplied
> pointer.
> 
> Fixes: 8700e3e7c485 ("Soft RoCE driver")
> Cc: stable@vger.kernel.org
> 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/20261001152426.3259522-1-ays511.kr@gmail.com?part=1


      reply	other threads:[~2026-10-01 15:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 18:21 [PATCH] RDMA/rxe: reject IB_WR_REG_MR from user QPs in rxe_reg_fast_mr() Youngsung Ahn
2026-09-30 18:34 ` sashiko-bot
2026-10-01 15:24 ` [PATCH v2] " Youngsung Ahn
2026-10-01 15:39   ` 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=20261001153958.8E29D1F000FF@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox