]> git.ipfire.org Git - thirdparty/kernel/stable.git/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2015 13:10:57 +0000 (14:10 +0100)
commit1a36e39ae78ce0aabbe4932d152d83b9352d97ae
treee8c859fcbee1aee454d932073789c70b4de081ec
parent12c5ac27e69ca3d652a95d3f99423e5fadb274a1
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/target_core_sbc.c