WSL2-Linux-Kernel/drivers/target/iscsi
Nicholas Bellinger 9d86a2befc iscsi-target: Fix ImmediateData=Yes failure regression in >= v3.10
This patch addresses a regression bug within ImmediateData=Yes failure
handling that ends up triggering an OOPs within >= v3.10 iscsi-target
code.

The problem occurs when iscsit_process_scsi_cmd() does the call to
target_put_sess_cmd(), and once again in iscsit_get_immediate_data()
that is triggered during two different cases:

 - When iscsit_sequence_cmd() returns CMDSN_LOWER_THAN_EXP, for which
   the descriptor state will already have been set to ISTATE_REMOVE
   by iscsit_sequence_cmd(), and
 - When iscsi_cmd->sense_reason is set, for which iscsit_execute_cmd()
   will have already called transport_send_check_condition_and_sense()
   to queue the exception response.

It changes iscsit_process_scsi_cmd() to drop the early call, and makes
iscsit_get_immediate_data() call target_put_sess_cmd() from a single
location after dumping the immediate data for the failed command.

The regression was initially introduced in commit:

commit 561bf15892
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Wed Jul 3 03:58:58 2013 -0700

    iscsi-target: Fix iscsit_sequence_cmd reject handling for iser

Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2013-08-22 00:45:51 -07:00
..
Kconfig target: iscsi_target depends on NET 2011-07-28 20:16:18 +00:00
Makefile iscsi-target: Add iscsit_transport API template 2013-04-25 01:05:26 -07:00
iscsi_target.c iscsi-target: Fix ImmediateData=Yes failure regression in >= v3.10 2013-08-22 00:45:51 -07:00
iscsi_target.h iscsi-target: Fix iscsit_add_reject* usage for iser 2013-07-06 21:59:53 -07:00
iscsi_target_auth.c target/iscsi: Remove chap_set_random() 2013-04-25 01:05:22 -07:00
iscsi_target_auth.h iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
iscsi_target_configfs.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2013-07-11 12:57:19 -07:00
iscsi_target_configfs.h iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
iscsi_target_core.h iscsi-target: Fix iscsit_add_reject* usage for iser 2013-07-06 21:59:53 -07:00
iscsi_target_datain_values.c target/iscsi: Eliminate iscsi_cmd.data_length 2012-04-14 17:40:38 -07:00
iscsi_target_datain_values.h iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
iscsi_target_device.c iscsi-target: Refactor TX queue logic + export response PDU creation 2013-04-25 01:05:27 -07:00
iscsi_target_device.h target/iscsi: Remove unneeded wrapper functions 2012-02-25 14:37:47 -08:00
iscsi_target_erl0.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2013-07-11 12:57:19 -07:00
iscsi_target_erl0.h iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
iscsi_target_erl1.c iscsi-target: Fix iscsit_sequence_cmd reject handling for iser 2013-07-06 21:59:54 -07:00
iscsi_target_erl1.h iscsit: use the itt_t abstract type 2012-10-03 14:21:50 -07:00
iscsi_target_erl2.c iscsi-target: Fix iscsit_free_cmd() se_cmd->cmd_kref shutdown handling 2013-05-31 01:21:28 -07:00
iscsi_target_erl2.h iscsit: proper endianess conversions 2012-10-03 14:39:22 -07:00
iscsi_target_login.c iscsi-target: Remove left over v3.10-rc debug printks 2013-06-20 16:47:41 -07:00
iscsi_target_login.h iscsi-target: Initial traditional TCP conversion to iscsit_transport 2013-04-25 01:05:26 -07:00
iscsi_target_nego.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2013-07-11 12:57:19 -07:00
iscsi_target_nego.h iscsi-target: Initial traditional TCP conversion to iscsit_transport 2013-04-25 01:05:26 -07:00
iscsi_target_nodeattrib.c iscsi-target: remove improper externs 2012-03-17 18:07:04 -07:00
iscsi_target_nodeattrib.h iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
iscsi_target_parameters.c iscsi-target: Allow ->MaxXmitDataSegmentLength assignment for iser discovery 2013-07-03 19:43:22 -07:00
iscsi_target_parameters.h iscsi-target: fix heap buffer overflow on error 2013-05-30 18:07:54 -07:00
iscsi_target_seq_pdu_list.c iscsi-target: Change iscsi_target_seq_pdu_list.c to honor MaxXmitDataSegmentLength 2012-10-02 13:17:33 -07:00
iscsi_target_seq_pdu_list.h target/iscsi: Fold _decide_list_to_build into _build_pdu_and_seq_lists 2012-04-14 17:40:38 -07:00
iscsi_target_stat.c target: don't truncate the fail intr address 2013-02-13 11:27:58 -08:00
iscsi_target_stat.h iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
iscsi_target_tmr.c iscsi-target: Refactor TX queue logic + export response PDU creation 2013-04-25 01:05:27 -07:00
iscsi_target_tmr.h iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
iscsi_target_tpg.c iscsi-target: Initial traditional TCP conversion to iscsit_transport 2013-04-25 01:05:26 -07:00
iscsi_target_tpg.h iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
iscsi_target_tq.c iscsi-target: Use list_first_entry() where appropriate 2012-11-06 20:55:45 -08:00
iscsi_target_tq.h iscsit: mark various functions static 2012-10-02 14:41:59 -07:00
iscsi_target_transport.c iscsi-target: Add iscsit_transport API template 2013-04-25 01:05:26 -07:00
iscsi_target_util.c iscsi-target: Fix iscsit_sequence_cmd reject handling for iser 2013-07-06 21:59:54 -07:00
iscsi_target_util.h iscsi-target: Fix iscsit_sequence_cmd reject handling for iser 2013-07-06 21:59:54 -07:00