Skip to content

Commit 7067eac

Browse files
author
CIQ Kernel Automation
committed
scsi: target: iscsi: Fix use-after-free in iscsit_dec_conn_usage_count()
jira VULN-176436 cve CVE-2026-23216 commit-author Maurizio Lombardi <mlombard@redhat.com> commit 9411a89 In iscsit_dec_conn_usage_count(), the function calls complete() while holding the conn->conn_usage_lock. As soon as complete() is invoked, the waiter (such as iscsit_close_connection()) may wake up and proceed to free the iscsit_conn structure. If the waiter frees the memory before the current thread reaches spin_unlock_bh(), it results in a KASAN slab-use-after-free as the function attempts to release a lock within the already-freed connection structure. Fix this by releasing the spinlock before calling complete(). Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Reported-by: Zhaojuan Guo <zguo@redhat.com> Reviewed-by: Mike Christie <michael.christie@oracle.com> Link: https://patch.msgid.link/20260112165352.138606-2-mlombard@redhat.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> (cherry picked from commit 9411a89) Signed-off-by: CIQ Kernel Automation <ciq_kernel_automation@ciq.com>
1 parent 375eea0 commit 7067eac

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/target/iscsi/iscsi_target_util.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,8 +857,11 @@ void iscsit_dec_conn_usage_count(struct iscsit_conn *conn)
857857
spin_lock_bh(&conn->conn_usage_lock);
858858
conn->conn_usage_count--;
859859

860-
if (!conn->conn_usage_count && conn->conn_waiting_on_uc)
860+
if (!conn->conn_usage_count && conn->conn_waiting_on_uc) {
861+
spin_unlock_bh(&conn->conn_usage_lock);
861862
complete(&conn->conn_waiting_on_uc_comp);
863+
return;
864+
}
862865

863866
spin_unlock_bh(&conn->conn_usage_lock);
864867
}

0 commit comments

Comments
 (0)