From: Leon Romanovsky <leon@kernel.org>
To: Jacob Moroni <jmoroni@google.com>
Cc: tatyana.e.nikolova@intel.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org
Subject: Re: [PATCH] RDMA/irdma: Check for null udata during reg_user_mr
Date: Sun, 5 Jul 2026 17:09:40 +0300 [thread overview]
Message-ID: <20260705140940.GG15188@unreal> (raw)
In-Reply-To: <20260630154720.1647530-1-jmoroni@google.com>
On Tue, Jun 30, 2026 at 03:47:19PM +0000, Jacob Moroni wrote:
> The irdma driver requires udata for reg_user_mr. Previously,
> it was assuming that it was always non-null, but it can actually
> be null if the user intentionally triggers the UVERBS_METHOD_REG_MR
> ioctl.
>
> Signed-off-by: Jacob Moroni <jmoroni@google.com>
> ---
> drivers/infiniband/hw/irdma/verbs.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
> index cb54c7c8fcd..3bcac68a612 100644
> --- a/drivers/infiniband/hw/irdma/verbs.c
> +++ b/drivers/infiniband/hw/irdma/verbs.c
> @@ -3519,6 +3519,9 @@ static struct ib_mr *irdma_reg_user_mr(struct ib_pd *pd, u64 start, u64 len,
> if (dmah)
> return ERR_PTR(-EOPNOTSUPP);
>
> + if (!udata)
> + return ERR_PTR(-EINVAL);
Is this check specific to iRDMA?
Thanks
> +
> if (len > iwdev->rf->sc_dev.hw_attrs.max_mr_size)
> return ERR_PTR(-EINVAL);
>
> --
> 2.55.0.rc0.799.gd6f94ed593-goog
>
next prev parent reply other threads:[~2026-07-05 14:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 15:47 [PATCH] RDMA/irdma: Check for null udata during reg_user_mr Jacob Moroni
2026-07-05 14:09 ` Leon Romanovsky [this message]
2026-07-05 14:22 ` Leon Romanovsky
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=20260705140940.GG15188@unreal \
--to=leon@kernel.org \
--cc=jgg@ziepe.ca \
--cc=jmoroni@google.com \
--cc=linux-rdma@vger.kernel.org \
--cc=tatyana.e.nikolova@intel.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 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.