From: sashiko-bot@kernel.org
To: "Edward Srouji" <edwards@nvidia.com>
Cc: linux-rdma@vger.kernel.org, dri-devel@lists.freedesktop.org,
media-ci@linuxtv.org
Subject: Re: [PATCH rdma-next 3/3] RDMA/mlx5: Try pinned revocable dmabuf import by default
Date: Sat, 28 Nov 2026 13:59:32 +0000 [thread overview]
Message-ID: <sashiko-outbox-238737@kernel.org> (raw)
In-Reply-To: <20261128-mlx5-pinned-revocable-dmabuf-v1-3-a4cde143a58e@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] RDMA/mlx5: user-triggerable WARN_ON(!page_size) in
alloc_cacheable_mr()
--
commit d5740621fb40d604a240c4d889b540a19d43d88d
Author: Yishai Hadas <yishaih@nvidia.com>
RDMA/mlx5: Try pinned revocable dmabuf import by default
This commit attempts a pinned, revocable dma-buf attachment by default
when registering dma-buf MRs so the mkey can be sized exactly, falling
back to movable ODP dma-buf import when the exporter does not support it.
> diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
> index 4bd911e0596c6..55e6d8656692e 100644
> --- a/drivers/infiniband/hw/mlx5/mr.c
> +++ b/drivers/infiniband/hw/mlx5/mr.c
> @@ -430,7 +430,7 @@ static struct mlx5_ib_mr *alloc_cacheable_mr(struct ib_pd *pd,
> struct mlx5_ib_mr *mr;
> unsigned long page_size;
>
> - if (umem->is_dmabuf)
> + if (umem->is_dmabuf && !to_ib_umem_dmabuf(umem)->pinned)
> page_size = mlx5_umem_dmabuf_default_pgsz(umem, iova);
> else
> page_size = mlx5_umem_mkc_find_best_pgsz(dev, umem, iova,
[Severity: Medium]
Can an unprivileged user trigger the WARN_ON(!page_size) right below this
in alloc_cacheable_mr() when registering a pinned dmabuf MR?
UVERBS_METHOD_REG_DMABUF_MR only checks that offset and iova share the
same sub-page alignment, and ib_umem_dmabuf_get_pinned_revocable_and_lock()
validates offset + size against the dmabuf size without checking iova.
Previously, dmabuf MRs used mlx5_umem_dmabuf_default_pgsz() here and
checked mlx5_umem_dmabuf_find_best_pgsz() later in
mlx5_ib_dmabuf_mr_update_pas(), which returns -EINVAL without warning when
page_size is 0.
With pinned dmabuf MRs now calling mlx5_umem_mkc_find_best_pgsz() ->
ib_umem_find_best_pgsz() in alloc_cacheable_mr(), a user-supplied iova
where iova + length - 1 overflows u64 causes ib_umem_find_best_pgsz() to
return 0 and hit WARN_ON(!page_size) (likewise if KSM alignment constraints
clear the page-size bitmap).
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261128-mlx5-pinned-revocable-dmabuf-v1-0-a4cde143a58e@nvidia.com?part=3
next prev parent reply other threads:[~2026-11-28 13:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 13:36 [PATCH rdma-next 0/3] RDMA/mlx5: Support pinned revocable dma-buf import Edward Srouji
2026-11-28 13:36 ` [PATCH rdma-next 1/3] RDMA/uverbs: Permit dma-buf export to work with pinned importers Edward Srouji
2026-11-28 13:36 ` [PATCH rdma-next 2/3] RDMA/mlx5: Move dma-buf MR init out of ODP-only compilation Edward Srouji
2026-11-28 13:36 ` [PATCH rdma-next 3/3] RDMA/mlx5: Try pinned revocable dmabuf import by default Edward Srouji
2026-11-28 13:59 ` sashiko-bot [this message]
2026-11-29 12:01 ` Edward Srouji
2026-11-28 13:59 ` [PATCH rdma-next 0/3] RDMA/mlx5: Support pinned revocable dma-buf import sashiko-bot
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-238737@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=edwards@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=media-ci@linuxtv.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.