]> 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)
committerSasha Levin <sasha.levin@oracle.com>
Sat, 14 Mar 2015 19:37:19 +0000 (15:37 -0400)
commitf38a130bffe1b699bd9ac9ce89f19ccff31d97b5
tree62a20a80fbc7180b6aff1fc0399170db45d8cefd
parentaff40baf1dc0c562918b866e66274c94b0f87c23
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: Sasha Levin <sasha.levin@oracle.com>
drivers/target/target_core_sbc.c