android_kernel_google_msm/drivers/target
Nicholas Bellinger 32ba51997e iscsi-target: Fail connection on short sendmsg writes
commit 6bf6ca7515c1df06f5c03737537f5e0eb191e29e upstream.

This patch changes iscsit_do_tx_data() to fail on short writes
when kernel_sendmsg() returns a value different than requested
transfer length, returning -EPIPE and thus causing a connection
reset to occur.

This avoids a potential bug in the original code where a short
write would result in kernel_sendmsg() being called again with
the original iovec base + length.

In practice this has not been an issue because iscsit_do_tx_data()
is only used for transferring 48 byte headers + 4 byte digests,
along with seldom used control payloads from NOPIN + TEXT_RSP +
REJECT with less than 32k of data.

So following Al's audit of iovec consumers, go ahead and fail
the connection on short writes for now, and remove the bogus
logic ahead of his proper upstream fix.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-04-14 17:33:47 +08:00
..
iscsi iscsi-target: Fail connection on short sendmsg writes 2015-04-14 17:33:47 +08:00
loopback
tcm_fc target/tcm_fc: Fix use-after-free of ft_tpg 2014-05-06 07:51:44 -07: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: Fix trailing ASCII space usage in INQUIRY vendor+model 2013-09-07 21:58:16 -07:00
target_core_configfs.c
target_core_device.c target: Fix lookup of dynamic NodeACLs during cached demo-mode operation 2013-03-04 06:06:39 +08:00
target_core_fabric_configfs.c target: Add missing mapped_lun bounds checking during make_mappedlun setup 2013-03-04 06:06:39 +08:00
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/file: Re-enable optional fd_buffered_io=1 operation 2014-02-20 10:45:33 -08:00
target_core_hba.c
target_core_iblock.c
target_core_iblock.h
target_core_internal.h target: Fix lookup of dynamic NodeACLs during cached demo-mode operation 2013-03-04 06:06:39 +08:00
target_core_pr.c
target_core_pr.h
target_core_pscsi.c target/pscsi: fix return value check 2014-06-11 12:04:20 -07:00
target_core_pscsi.h
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: Fix lookup of dynamic NodeACLs during cached demo-mode operation 2013-03-04 06:06:39 +08:00
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