diff options
author | Yann Droneaud <ydroneaud@opteya.com> | 2015-04-13 14:56:23 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-04-15 16:05:02 -0400 |
commit | 66578b0b2f69659f00b6169e6fe7377c4b100d18 (patch) | |
tree | 9db2496b1482ae041739cad2eddda890038be7cd /drivers/infiniband/hw/mlx4/alias_GUID.c | |
parent | 8abaae62f3fdead8f4ce0ab46b4ab93dee39bab2 (diff) | |
download | linux-66578b0b2f69659f00b6169e6fe7377c4b100d18.tar.bz2 |
IB/core: don't disallow registering region starting at 0x0
In a call to ib_umem_get(), if address is 0x0 and size is
already page aligned, check added in commit 8494057ab5e4
("IB/uverbs: Prevent integer overflow in ib_umem_get address
arithmetic") will refuse to register a memory region that
could otherwise be valid (provided vm.mmap_min_addr sysctl
and mmap_low_allowed SELinux knobs allow userspace to map
something at address 0x0).
This patch allows back such registration: ib_umem_get()
should probably don't care of the base address provided it
can be pinned with get_user_pages().
There's two possible overflows, in (addr + size) and in
PAGE_ALIGN(addr + size), this patch keep ensuring none
of them happen while allowing to pin memory at address
0x0. Anyway, the case of size equal 0 is no more (partially)
handled as 0-length memory region are disallowed by an
earlier check.
Link: http://mid.gmane.org/cover.1428929103.git.ydroneaud@opteya.com
Cc: <stable@vger.kernel.org> # 8494057ab5e4 ("IB/uverbs: Prevent integer overflow in ib_umem_get address arithmetic")
Cc: Shachar Raindel <raindel@mellanox.com>
Cc: Jack Morgenstein <jackm@mellanox.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/alias_GUID.c')
0 files changed, 0 insertions, 0 deletions