From: Akinobu Mita Date: Sun, 25 May 2014 12:43:34 +0000 (+0900) Subject: block: fix SG_[GS]ET_RESERVED_SIZE ioctl when max_sectors is huge X-Git-Tag: omap-for-v3.17/fixes-against-rc2~75^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b4231bf995996d6459c57959ead5a1829ff2c57;p=pandora-kernel.git block: fix SG_[GS]ET_RESERVED_SIZE ioctl when max_sectors is huge SG_GET_RESERVED_SIZE and SG_SET_RESERVED_SIZE ioctls access a reserved buffer in bytes as int type. The value needs to be capped at the request queue's max_sectors. But integer overflow is not correctly handled in the calculation when converting max_sectors from sectors to bytes. Signed-off-by: Akinobu Mita Cc: Jens Axboe Cc: "James E.J. Bottomley" Cc: Douglas Gilbert Cc: linux-scsi@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe --- Reading git-diff-tree failed