android_kernel_google_msm/drivers/target
Alexei Potashnik 874fc85921 target/iscsi: Fix double free of a TUR followed by a solicited NOPOUT
commit 9547308bda296b6f69876c840a0291fcfbeddbb8 upstream.

Make sure all non-READ SCSI commands get targ_xfer_tag initialized
to 0xffffffff, not just WRITEs.

Double-free of a TUR cmd object occurs under the following scenario:

1. TUR received (targ_xfer_tag is uninitialized and left at 0)
2. TUR status sent
3. First unsolicited NOPIN is sent to initiator (gets targ_xfer_tag of 0)
4. NOPOUT for NOPIN (with TTT=0) arrives
 - its ExpStatSN acks TUR status, TUR is queued for removal
 - LIO tries to find NOPIN with TTT=0, but finds the same TUR instead,
   TUR is queued for removal for the 2nd time

(Drop unbalanced conditional bracket usage - nab)

Signed-off-by: Alexei Potashnik <alexei@purestorage.com>
Signed-off-by: Spencer Baugh <sbaugh@catern.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
[lizf: Backported to 3.4:
 - adjust context
 - leave the braces as it is]
Signed-off-by: Zefan Li <lizefan@huawei.com>
2016-03-21 09:17:49 +08:00
..
iscsi target/iscsi: Fix double free of a TUR followed by a solicited NOPOUT 2016-03-21 09:17:49 +08:00
loopback
tcm_fc tcm_fc: missing curly braces in ft_invl_hw_context() 2015-06-19 11:40:28 +08:00
Kconfig
Makefile
target_core_alua.c target: Fix MAINTENANCE_IN service action CDB checks to use lower 5 bits 2014-06-11 12:04:20 -07:00
target_core_alua.h
target_core_cdb.c
target_core_configfs.c
target_core_device.c
target_core_fabric_configfs.c
target_core_fabric_lib.c
target_core_file.c target/file: Fix 32-bit highmem breakage for SGL -> iovec mapping 2014-06-11 12:04:21 -07:00
target_core_file.h
target_core_hba.c
target_core_iblock.c
target_core_iblock.h
target_core_internal.h
target_core_pr.c
target_core_pr.h
target_core_pscsi.c target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST 2015-09-18 09:20:43 +08:00
target_core_pscsi.h target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST 2015-09-18 09:20:43 +08:00
target_core_rd.c target: Explicitly clear ramdisk_mcp backend pages 2014-06-30 20:01:33 -07:00
target_core_rd.h
target_core_stat.c
target_core_tmr.c
target_core_tpg.c
target_core_transport.c target: Fix queue full status NULL pointer for SCF_TRANSPORT_TASK_SENSE 2015-02-02 17:04:52 +08:00
target_core_ua.c
target_core_ua.h