]> git.karo-electronics.de Git - karo-tx-linux.git/commit
sg_start_req(): make sure that there's not too many elements in iovec
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 22 Mar 2015 00:08:18 +0000 (20:08 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 30 Mar 2015 15:23:44 +0000 (11:23 -0400)
commitaa0b5c58d48773cdfc6f1d6317c9de75897e9fc4
tree5f18882f130052e323741b636967538592397be7
parent7f079db804354db6de8057fef8968a9238ba8dc1
sg_start_req(): make sure that there's not too many elements in iovec

unfortunately, allowing an arbitrary 16bit value means a possibility of
overflow in the calculation of total number of pages in bio_map_user_iov() -
we rely on there being no more than PAGE_SIZE members of sum in the
first loop there.  If that sum wraps around, we end up allocating
too small array of pointers to pages and it's easy to overflow it in
the second loop.

X-Coverup: TINC (and there's no lumber cartel either)
Cc: stable@vger.kernel.org # way, way back
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/scsi/sg.c