From d2092581044807f69e54c60560b096bacf730f9c Mon Sep 17 00:00:00 2001 From: Vladimir Sokolovsky Date: Wed, 8 Aug 2012 18:32:44 +0300 Subject: [PATCH] linux-next-cherry-picks: RDMA/ucma.c: Different fix for ucma context uid=0, causing iWarp RDMA applications to fail in connection establishment Fix for ucma context uid=0, causing iWarp RDMA applications to fail in connection establishment. This is a new patch addressing the librdmacm segfault when RDMA_CM_EVENT_ESTABLISHED event shows up with evt->id_priv = NULL In the ucma_event_handler(), ctx->file->mut is moved up to prevent race conditions and protect from assigning zero ucma ctx->uid to asynchronously generated events. Signed-off-by: Tatyana Nikolova Signed-off-by: Sean Hefty Signed-off-by: Vladimir Sokolovsky --- ...erent-fix-for-ucma-context-uid-0-cau.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 linux-next-cherry-picks/0001-RDMA-ucma.c-Different-fix-for-ucma-context-uid-0-cau.patch diff --git a/linux-next-cherry-picks/0001-RDMA-ucma.c-Different-fix-for-ucma-context-uid-0-cau.patch b/linux-next-cherry-picks/0001-RDMA-ucma.c-Different-fix-for-ucma-context-uid-0-cau.patch new file mode 100644 index 0000000..965b48c --- /dev/null +++ b/linux-next-cherry-picks/0001-RDMA-ucma.c-Different-fix-for-ucma-context-uid-0-cau.patch @@ -0,0 +1,39 @@ +From 63e0d2fdb051ee6beb0990cb4722c9cf6816d80b Mon Sep 17 00:00:00 2001 +From: Tatyana Nikolova +Date: Tue, 7 Aug 2012 17:46:42 -0500 +Subject: [PATCH] RDMA/ucma.c: Different fix for ucma context uid=0, causing iWarp RDMA applications to fail in connection establishment + +Fix for ucma context uid=0, causing iWarp RDMA applications to fail in connection establishment. + +This is a new patch addressing the librdmacm segfault when RDMA_CM_EVENT_ESTABLISHED event shows up with evt->id_priv = NULL +In the ucma_event_handler(), ctx->file->mut is moved up to prevent race conditions and protect from assigning zero ucma ctx->uid to asynchronously generated events. + +Signed-off-by: Tatyana Nikolova +Signed-off-by: Sean Hefty +--- + drivers/infiniband/core/ucma.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c +index 5861cdb..28bf514 100644 +--- a/drivers/infiniband/core/ucma.c ++++ b/drivers/infiniband/core/ucma.c +@@ -273,6 +273,7 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id, + if (!uevent) + return event->event == RDMA_CM_EVENT_CONNECT_REQUEST; + ++ mutex_lock(&ctx->file->mut); + uevent->cm_id = cm_id; + ucma_set_event_context(ctx, event, uevent); + uevent->resp.event = event->event; +@@ -283,7 +284,6 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id, + ucma_copy_conn_event(&uevent->resp.param.conn, + &event->param.conn); + +- mutex_lock(&ctx->file->mut); + if (event->event == RDMA_CM_EVENT_CONNECT_REQUEST) { + if (!ctx->backlog) { + ret = -ENOMEM; +-- +1.7.0.4 + -- 2.41.0