]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/umem: Fix potential addition overflow
authorDoug Ledford <dledford@redhat.com>
Fri, 21 Sep 2018 15:30:13 +0000 (11:30 -0400)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 25 Sep 2018 21:19:06 +0000 (15:19 -0600)
commit5b6c5b56a11c1bf7c84902aacc24fdbefd8a3176
treecfec93bc6ebd1580a7498589c05db2d516078b19
parente721d59bf109a402613c7db9498dc633ef53ef33
RDMA/umem: Fix potential addition overflow

Given a large enough memory allocation, it is possible to wrap the
pinned_vm counter.  Check for addition overflow to prevent such
eventualities.

Fixes: 12143ca5ca37 ("RDMA/umem: Don't hold mmap_sem for too long")
Reported-by: Jason Gunthorpe <jgg@ziepe.ca>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/umem.c