lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Tue, 25 Jul 2023 11:33:35 +0000
From:   "jirong.feng" <jirong.feng@...ystack.cn>
To:     martin.petersen@...cle.com, michael.christie@...cle.com,
        mlombard@...hat.com, d.bogdanov@...ro.com
Cc:     dongsheng.yang@...ystack.cn, linux-scsi@...r.kernel.org,
        target-devel@...r.kernel.org, linux-kernel@...r.kernel.org,
        "jirong.feng" <jirong.feng@...ystack.cn>
Subject: [PATCH RFC] scsi: target: iscsi: Handle abort for ICF_OOO_CMDSN cmds

If a connection closes with an ICF_OOO_CMDSN cmd being aborted, then
rx thread will wait for the abort cmd to complete. At the same time,
the abort kworker is waiting for the ooo cmd's completion. Since rx
thread is waiting too, that ooo cmd can never reach to completion, so
is the abort cmd, causing both rx thread and abort kworker hanging
indefinitely.

Add handling in TCM of the abort for the ICF_OOO_CMDSN cmds at
connection closing moment to make it possible to release them.
---
 drivers/target/iscsi/iscsi_target.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index b516c2893420..27edc5eb9e6e 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -4236,7 +4236,8 @@ static void iscsit_release_commands_from_conn(struct iscsit_conn *conn)
 			se_cmd->transport_state |= CMD_T_FABRIC_STOP;
 		}
 
-		if (cmd->se_cmd.t_state == TRANSPORT_WRITE_PENDING) {
+		if (cmd->se_cmd.t_state == TRANSPORT_WRITE_PENDING ||
+		    cmd->cmd_flags & ICF_OOO_CMDSN) {
 			/*
 			 * We never submitted the cmd to LIO core, so we have
 			 * to tell LIO to perform the completion process.
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ