IB/mlx5: Serialize access to the VMA list
authorMajd Dibbiny <majd@mellanox.com>
Sun, 24 Dec 2017 11:54:56 +0000 (13:54 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 27 Dec 2017 22:24:40 +0000 (15:24 -0700)
commitad9a3668a434faca1339789ed2f043d679199309
tree6ae4f8fc84efe4a0db5750a696c24bc06dddbb09
parent4c009af473b2026caaa26107e34d7cc68dad7756
IB/mlx5: Serialize access to the VMA list

User-space applications can do mmap and munmap directly at
any time.

Since the VMA list is not protected with a mutex, concurrent
accesses to the VMA list from the mmap and munmap can cause
data corruption. Add a mutex around the list.

Cc: <stable@vger.kernel.org> # v4.7
Fixes: 7c2344c3bbf9 ("IB/mlx5: Implements disassociate_ucontext API")
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/main.c
drivers/infiniband/hw/mlx5/mlx5_ib.h