linux/drivers/target
Mike Christie 70d0ea3ee6 iscsi target: fix session creation failure handling
commit 26abc916a8 upstream.

The problem is that iscsi_login_zero_tsih_s1 sets conn->sess early in
iscsi_login_set_conn_values. If the function fails later like when we
alloc the idr it does kfree(sess) and leaves the conn->sess pointer set.
iscsi_login_zero_tsih_s1 then returns -Exyz and we then call
iscsi_target_login_sess_out and access the freed memory.

This patch has iscsi_login_zero_tsih_s1 either completely setup the
session or completely tear it down, so later in
iscsi_target_login_sess_out we can just check for it being set to the
connection.

Fixes: 0957627a99 ("iscsi-target: Fix sess allocation leak in...")
Signed-off-by: Mike Christie <mchristi@redhat.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-12-16 22:08:50 +00:00
..
iscsi iscsi target: fix session creation failure handling 2018-12-16 22:08:50 +00:00
loopback tcm_loop: Fixup tag handling 2015-01-22 16:33:35 +00:00
sbp target: Pass in transport supported PI at session initialization 2014-04-07 01:48:54 -07:00
tcm_fc tcm_fc: missing curly braces in ft_invl_hw_context() 2015-03-30 11:11:42 +01:00
Kconfig target/iblock: Add blk_integrity + BIP passthrough support 2014-01-18 10:14:22 +00:00
Makefile target: Add support for EXTENDED_COPY copy offload emulation 2013-09-10 16:48:43 -07:00
target_core_alua.c Merge branch 'next' (accumulated 3.16 merge window patches) into master 2014-06-08 11:31:16 -07:00
target_core_alua.h target_core_alua: Referrals configfs integration 2014-01-09 21:48:35 -08:00
target_core_configfs.c target: Fix a memory leak in target_dev_lba_map_store() 2016-02-02 19:48:58 +00:00
target_core_device.c target: Fix max_unmap_lba_count calc overflow 2016-11-20 01:16:55 +00:00
target_core_fabric_configfs.c target: Fix sizeof in kmalloc for some default_groups arrays 2013-12-16 12:42:20 -08:00
target_core_fabric_lib.c target: Update copyright ownership/year information to 2013 2013-09-10 20:23:36 -07:00
target_core_file.c target/fileio: Fix zero-length READ and WRITE handling 2017-08-26 02:14:46 +01:00
target_core_file.h Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2014-01-31 15:31:23 -08:00
target_core_hba.c target: Update copyright ownership/year information to 2013 2013-09-10 20:23:36 -07:00
target_core_iblock.c target: Fix max_unmap_lba_count calc overflow 2016-11-20 01:16:55 +00:00
target_core_iblock.h target: kill struct se_subsystem_dev 2012-11-06 20:55:43 -08:00
target_core_internal.h target: Fix kref->refcount underflow in transport_cmd_finish_abort 2017-09-15 18:30:07 +01:00
target_core_pr.c scsi: target: Fix truncated PR-in ReadKeys response 2018-11-20 18:05:18 +00:00
target_core_pr.h target: Fix APTPL metadata handling for dynamic MappedLUNs 2014-11-05 11:43:05 +00:00
target_core_pscsi.c target/pscsi: Fix TYPE_TAPE + TYPE_MEDIMUM_CHANGER export 2017-07-18 18:40:08 +01:00
target_core_pscsi.h target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST 2015-06-03 14:30:06 +01:00
target_core_rd.c target/rd: T10-Dif: RAM disk is allocating more space than required. 2014-04-07 01:48:53 -07:00
target_core_rd.h target/rd: Add support for protection SGL setup + release 2014-01-19 02:22:05 +00:00
target_core_sbc.c target: Fix VERIFY_16 handling in sbc_parse_cdb 2017-07-18 18:40:09 +01:00
target_core_spc.c target: REPORT LUNS should return LUN 0 even for dynamic ACLs 2015-08-31 14:14:07 +01:00
target_core_stat.c target: Convert se_device statistics to atomic_long_t 2013-11-13 18:34:55 -08:00
target_core_tmr.c target: Avoid early CMD_T_PRE_EXECUTE failures during ABORT_TASK 2018-02-13 18:42:18 +00:00
target_core_tpg.c target: Fix APTPL metadata handling for dynamic MappedLUNs 2014-11-05 11:43:05 +00:00
target_core_transport.c target: Avoid early CMD_T_PRE_EXECUTE failures during ABORT_TASK 2018-02-13 18:42:18 +00:00
target_core_ua.c arch: Mass conversion of smp_mb__*() 2014-04-18 14:20:48 +02:00
target_core_ua.h target core: rename (ex,im)plict -> (ex,im)plicit 2013-11-20 11:24:40 -08:00
target_core_xcopy.c target: Use correct SCSI status during EXTENDED_COPY exception 2017-03-16 02:27:11 +00:00
target_core_xcopy.h target: Add support for EXTENDED_COPY copy offload emulation 2013-09-10 16:48:43 -07:00