Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b37bc27 authored by Feng Li's avatar Feng Li Committed by Sasha Levin
Browse files

iscsi-target: Fix panic when adding second TCP connection to iSCSI session



[ Upstream commit 8abc718de6e9e52d8a6bfdb735060554aeae25e4 ]

In MC/S scenario, the conn->sess has been set NULL in
iscsi_login_non_zero_tsih_s1 when the second connection comes here,
then kernel panic.

The conn->sess will be assigned in iscsi_login_non_zero_tsih_s2. So
we should check whether it's NULL before calling.

Signed-off-by: default avatarFeng Li <lifeng1519@gmail.com>
Tested-by: default avatarSumit Rai <sumit.rai@calsoftinc.com>
Cc: stable@vger.kernel.org # 3.14+
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent 3f4976f0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1414,6 +1414,7 @@ static int __iscsi_target_login_thread(struct iscsi_np *np)
	}
	login->zero_tsih = zero_tsih;

	if (conn->sess)
		conn->sess->se_sess->sup_prot_ops =
			conn->conn_transport->iscsit_get_sup_prot_ops(conn);