]> git.baikalelectronics.ru Git - kernel.git/commit
target: Add missing DATA_SG_IO transport_cmd_get_valid_sectors check
authorNicholas Bellinger <nab@linux-iscsi.org>
Wed, 10 Aug 2011 07:59:58 +0000 (00:59 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 22 Aug 2011 19:26:26 +0000 (19:26 +0000)
commit4b70b0aef2f7e4c074c548cdba65da32dfef5306
treeec692d6516775c8362cacd0788f4374c62e9d56f
parentbbe48f8e23a5d03d8ea1304c5598234518ea229f
target: Add missing DATA_SG_IO transport_cmd_get_valid_sectors check

This patch adds the missing transport_cmd_get_valid_sectors() check for
SCF_SCSI_DATA_SG_IO_CDB type payloads to ensure that a received LBA + range
does not exeed past the end of associated backend struct se_device.

This patch also fixes a bug in the failure path of transport_new_cmd_obj()
where this check can fail, so change to use a signed 'rc' and return '-EINVAL'
to signal proper transport_generic_request_failure() handling.

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c