RDMA/odp: Check for overflow when computing the umem_odp end
authorJason Gunthorpe <jgg@mellanox.com>
Mon, 19 Aug 2019 11:17:06 +0000 (14:17 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 21 Aug 2019 17:08:43 +0000 (14:08 -0300)
commit204e3e5630c5d41948fc11d8419c07da8f3e5a4d
treebeff53d4d2ef58f612caaebddec78eda7819a554
parent0446cad9ca385c3b8d6e5a1184e59650fa7a7a6d
RDMA/odp: Check for overflow when computing the umem_odp end

Since the page size can be extended in the ODP case by IB_ACCESS_HUGETLB
the existing overflow checks done by ib_umem_get() are not
sufficient. Check for overflow again.

Further, remove the unchecked math from the inlines and just use the
precomputed value stored in the interval_tree_node.

Link: https://lore.kernel.org/r/20190819111710.18440-9-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/umem_odp.c
include/rdma/ib_umem_odp.h