From: Nicholas Bellinger Date: Wed, 16 Nov 2011 06:13:24 +0000 (-0800) Subject: target: Reject SCSI data overflow for fabrics using transport_generic_map_mem_to_cmd X-Git-Tag: v3.2-rc5~31^2~13 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fef58a6096770ed6ab49103a430cc755254a74d9;p=pandora-kernel.git target: Reject SCSI data overflow for fabrics using transport_generic_map_mem_to_cmd This patch changes transport_generic_map_mem_to_cmd() to reject SCSI data overflow and to send exception status with CHECK_CONDITION + TCM_INVALID_CDB_FIELD for fabrics that are passing a pre-populated struct scatterlist (eg: tcm_loop and iscsi-target) being mapped into se_cmd->t_data_sg and se_cmd->t_data_nents. This addresses an OOPs where transport_allocate_data_tasks() would walk the incorrect post OVERFLOW cmd->data_length value beyond the end of the passed scatterlist. Cc: Christoph Hellwig Cc: Andy Grover Cc: stable@kernel.org Signed-off-by: Nicholas Bellinger --- Reading git-diff-tree failed