Commit 7651e2d6 authored by Saravanan Vajravel's avatar Saravanan Vajravel Committed by Leon Romanovsky

IB/isert: Fix possible list corruption in CMA handler

When ib_isert module receives connection error event, it is
releasing the isert session and removes corresponding list
node but it doesn't take appropriate mutex lock to remove
the list node.  This can lead to linked  list corruption

Fixes: bd379220 ("iser-target: Fix pending connections handling in target stack shutdown sequnce")
Signed-off-by: default avatarSelvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: default avatarSaravanan Vajravel <saravanan.vajravel@broadcom.com>
Link: https://lore.kernel.org/r/20230606102531.162967-3-saravanan.vajravel@broadcom.comSigned-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent 691b0480
...@@ -657,9 +657,13 @@ static int ...@@ -657,9 +657,13 @@ static int
isert_connect_error(struct rdma_cm_id *cma_id) isert_connect_error(struct rdma_cm_id *cma_id)
{ {
struct isert_conn *isert_conn = cma_id->qp->qp_context; struct isert_conn *isert_conn = cma_id->qp->qp_context;
struct isert_np *isert_np = cma_id->context;
ib_drain_qp(isert_conn->qp); ib_drain_qp(isert_conn->qp);
mutex_lock(&isert_np->mutex);
list_del_init(&isert_conn->node); list_del_init(&isert_conn->node);
mutex_unlock(&isert_np->mutex);
isert_conn->cm_id = NULL; isert_conn->cm_id = NULL;
isert_put_conn(isert_conn); isert_put_conn(isert_conn);
......
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