iscsi-target: Fix non-immediate TMR reference leak
authorNicholas Bellinger <nab@linux-iscsi.org>
Sat, 28 Oct 2017 03:52:56 +0000 (20:52 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Nov 2017 08:40:51 +0000 (08:40 +0000)
commit8009209a65167c899729e9a9d40fd3b809474c9d
treed037a4ba5e29db8ad1bdc53a9138658dcbd6d52d
parent84ab17cf4f30740eff6247d2bf657f8ee527b034
iscsi-target: Fix non-immediate TMR reference leak

commit 3fc9fb13a4b2576aeab86c62fd64eb29ab68659c upstream.

This patch fixes a se_cmd->cmd_kref reference leak that can
occur when a non immediate TMR is proceeded our of command
sequence number order, and CMDSN_LOWER_THAN_EXP is returned
by iscsit_sequence_cmd().

To address this bug, call target_put_sess_cmd() during this
special case following what iscsit_process_scsi_cmd() does
upon CMDSN_LOWER_THAN_EXP.

Cc: Mike Christie <mchristi@redhat.com>
Cc: Hannes Reinecke <hare@suse.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/iscsi/iscsi_target.c