]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
IB/mlx5: Don't take the rereg_mr fallback without a new translation
authorJason Gunthorpe <jgg@nvidia.com>
Thu, 4 Jun 2026 01:27:40 +0000 (22:27 -0300)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 8 Jun 2026 17:32:42 +0000 (14:32 -0300)
Jumping to mlx5_ib_reg_user_mr() without IB_MR_REREG_TRANS set will use
garbage values for start, length, and iova. Recovering the original mr
parameters for ODP and DMABUF to properly recreate it is too hard in this
flow, so just fail it.

Fixes: ef3642c4f54d ("RDMA/mlx5: Fix error unwinds for rereg_mr")
Link: https://patch.msgid.link/r/1-v1-29ebd2c229b5+fd5-ib_mr_pd_jgg@nvidia.com
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/mr.c

index 254e6aa4ccafb2d6a545ceeff64fc241023e567a..0fa0a57240c01d85650c0c5b21fa9038cdb92f85 100644 (file)
@@ -1198,7 +1198,7 @@ struct ib_mr *mlx5_ib_rereg_user_mr(struct ib_mr *ib_mr, int flags, u64 start,
                }
                /* DM or ODP MR's don't have a normal umem so we can't re-use it */
                if (!mr->umem || is_odp_mr(mr) || is_dmabuf_mr(mr))
-                       goto recreate;
+                       return ERR_PTR(-EOPNOTSUPP);
 
                /*
                 * Only one active MR can refer to a umem at one time, revoke