Re: [PATCH 2/4] block: fix SG_[GS]ET_RESERVED_SIZE ioctl when max_sectors is huge

2014-05-28 Thread Christoph Hellwig
On Sun, May 25, 2014 at 09:43:34PM +0900, Akinobu Mita wrote: > 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 calculati

[PATCH 2/4] block: fix SG_[GS]ET_RESERVED_SIZE ioctl when max_sectors is huge

2014-05-25 Thread Akinobu Mita
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: