]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA: During rereg_mr ensure that REREG_ACCESS is compatible
authorJason Gunthorpe <jgg@nvidia.com>
Mon, 15 Jun 2026 21:29:10 +0000 (17:29 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Jun 2026 11:42:37 +0000 (13:42 +0200)
commiteba5df21eda0fe7418efbea2f799f8ea1b8ca94c
treea2fd61fe0ffb2c2237ce83e5a4b7aa25b0a0f60f
parent171559364937bf5bff84c637f802151a4075bfea
RDMA: During rereg_mr ensure that REREG_ACCESS is compatible

[ Upstream commit badad6fad60def1b9805559dd81dbab3d97b82aa ]

If IB_MR_REREG_ACCESS changes from RO to RW then the umem has to be
re-evaluated to ensure it is properly pinned as RW. Since the umem is
hidden inside each driver's mr struct add a ib_umem_check_rereg() function
that each driver has to call before processing IB_MR_REREG_ACCESS.

mlx4 has to retain its duplicate ib_access_writable check because it
implements IB_MR_REREG_ACCESS | IB_MR_REREG_TRANS by changing both items
in place sequentially while the MR is live, so it will continue to not
support this combination.

Cc: stable@vger.kernel.org
Fixes: b40656aa7d55 ("RDMA/umem: remove FOLL_FORCE usage")
Link: https://patch.msgid.link/r/0-v1-06fb1a2d6cf5+107-rereg_access_jgg@nvidia.com
Reported-by: Philip Tsukerman <philiptsukerman@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/core/umem.c
drivers/infiniband/hw/hns/hns_roce_mr.c
drivers/infiniband/hw/irdma/verbs.c
drivers/infiniband/hw/mlx4/mr.c
drivers/infiniband/hw/mlx5/mr.c
drivers/infiniband/sw/rxe/rxe_verbs.c
include/rdma/ib_umem.h