Skip to content

Commit 7651e2d

Browse files
Saravanan Vajravelrleon
authored andcommitted
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: bd37922 ("iser-target: Fix pending connections handling in target stack shutdown sequnce") Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Saravanan Vajravel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 691b048 commit 7651e2d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/infiniband/ulp/isert/ib_isert.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,9 +657,13 @@ static int
657657
isert_connect_error(struct rdma_cm_id *cma_id)
658658
{
659659
struct isert_conn *isert_conn = cma_id->qp->qp_context;
660+
struct isert_np *isert_np = cma_id->context;
660661

661662
ib_drain_qp(isert_conn->qp);
663+
664+
mutex_lock(&isert_np->mutex);
662665
list_del_init(&isert_conn->node);
666+
mutex_unlock(&isert_np->mutex);
663667
isert_conn->cm_id = NULL;
664668
isert_put_conn(isert_conn);
665669

0 commit comments

Comments
 (0)