Commit 699826f4 authored by Saravanan Vajravel's avatar Saravanan Vajravel Committed by Leon Romanovsky

IB/isert: Fix incorrect release of isert connection

The ib_isert module is releasing the isert connection both in
isert_wait_conn() handler as well as isert_free_conn() handler.
In isert_wait_conn() handler, it is expected to wait for iSCSI
session logout operation to complete. It should free the isert
connection only in isert_free_conn() handler.

When a bunch of iSER target is cleared, this issue can lead to
use-after-free memory issue as isert conn is twice released

Fixes: b02efbfc ("iser-target: Fix implicit termination of connections")
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarSaravanan Vajravel <saravanan.vajravel@broadcom.com>
Signed-off-by: default avatarSelvin Xavier <selvin.xavier@broadcom.com>
Link: https://lore.kernel.org/r/20230606102531.162967-4-saravanan.vajravel@broadcom.comSigned-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent 7651e2d6
...@@ -2570,8 +2570,6 @@ static void isert_wait_conn(struct iscsit_conn *conn) ...@@ -2570,8 +2570,6 @@ static void isert_wait_conn(struct iscsit_conn *conn)
isert_put_unsol_pending_cmds(conn); isert_put_unsol_pending_cmds(conn);
isert_wait4cmds(conn); isert_wait4cmds(conn);
isert_wait4logout(isert_conn); isert_wait4logout(isert_conn);
queue_work(isert_release_wq, &isert_conn->release_work);
} }
static void isert_free_conn(struct iscsit_conn *conn) static void isert_free_conn(struct iscsit_conn *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