]> git.itanic.dy.fi Git - linux-stable/commit
target: Add missing WRITE_SAME end-of-device sanity check
authorNicholas Bellinger <nab@linux-iscsi.org>
Fri, 13 Feb 2015 22:09:47 +0000 (22:09 +0000)
committerJiri Slaby <jslaby@suse.cz>
Thu, 12 Mar 2015 10:10:04 +0000 (11:10 +0100)
commitdffc0bca5ea9b1ae646fb8fc7c82ca179a866b09
treed8290c55562cfd80322e5a62d9ece27dc865182f
parentb18b42fe0a23ff7607cfec88ede23a57e53bec66
target: Add missing WRITE_SAME end-of-device sanity check

commit 8e575c50a171f2579e367a7f778f86477dfdaf49 upstream.

This patch adds a check to sbc_setup_write_same() to verify
the incoming WRITE_SAME LBA + number of blocks does not exceed
past the end-of-device.

Also check for potential LBA wrap-around as well.

Reported-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Martin Petersen <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/target/target_core_sbc.c