]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
IB/core: Avoid unsigned int overflow in sg_alloc_table
authorMark Bloch <markb@mellanox.com>
Thu, 27 Oct 2016 13:36:31 +0000 (16:36 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 23 Feb 2017 03:54:35 +0000 (03:54 +0000)
commitd05da7e292580d7cbe66a9b00895be74c7a64e46
tree766961c95564bd508f67f5753a398a31237d49cb
parent8ad2c099493e4d38318b80e430e5b9772fe6efea
IB/core: Avoid unsigned int overflow in sg_alloc_table

commit 3c7ba5760ab8eedec01159b267bb9bfcffe522ac upstream.

sg_alloc_table gets unsigned int as parameter while the driver
returns it as size_t. Check npages isn't greater than maximum
unsigned int.

Fixes: eeb8461e36c9 ("IB: Refactor umem to use linear SG table")
Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/infiniband/core/umem.c