* [PATCH] RDMA/ucma: Lock the handler in ucma_set_ib_path()
@ 2026-08-11 17:37 Jason Gunthorpe
0 siblings, 0 replies; only message in thread
From: Jason Gunthorpe @ 2026-08-11 17:37 UTC (permalink / raw)
To: Leon Romanovsky, linux-rdma; +Cc: Leon Romanovsky, patches, stable
ctx->file may only be changed under the handler lock and the xa_lock, which
is what stops uevents being queued for a ctx while ucma_migrate_id() moves
it to another file.
ucma_set_ib_path() was missing this locking prior to calling
ucma_event_handler(). Normally ucma_event_handler() would be called from
the CM framework with the handler lock already held.
Add the missing locking.
Cc: stable@vger.kernel.org
Fixes: 09e328e47a69 ("RDMA/ucma: Fix the locking of ctx->file")
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
drivers/infiniband/core/ucma.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index a29f2d4b8d143d..ac29dfa69bb3a6 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -1404,7 +1404,10 @@ static int ucma_set_ib_path(struct ucma_context *ctx,
memset(&event, 0, sizeof event);
event.event = RDMA_CM_EVENT_ROUTE_RESOLVED;
- return ucma_event_handler(ctx->cm_id, &event);
+ rdma_lock_handler(ctx->cm_id);
+ ret = ucma_event_handler(ctx->cm_id, &event);
+ rdma_unlock_handler(ctx->cm_id);
+ return ret;
}
static int ucma_set_option_ib(struct ucma_context *ctx, int optname,
base-commit: f4cc21c6a8e9d392871477f9fd98d68e5ad80272
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-11 17:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-11 17:37 [PATCH] RDMA/ucma: Lock the handler in ucma_set_ib_path() Jason Gunthorpe
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.