Commit ed65a4dc authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Jason Gunthorpe
Browse files

RDMA/ucma: Fix use-after-free access in ucma_close

The error in ucma_create_id() left ctx in the list of contexts belong
to ucma file descriptor. The attempt to close this file descriptor causes
to use-after-free accesses while iterating over such list.

Fixes: 75216638

 ("RDMA/cma: Export rdma cm interface to userspace")
Reported-by: <>
Signed-off-by: default avatarLeon Romanovsky <>
Reviewed-by: default avatarSean Hefty <>
Signed-off-by: default avatarJason Gunthorpe <>
parent 2975d5de
......@@ -497,6 +497,9 @@ static ssize_t ucma_create_id(struct ucma_file *file, const char __user *inbuf,
idr_remove(&ctx_idr, ctx->id);
return ret;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment