]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mlx5: Lock QP during page fault handling
authorMoni Shoua <monis@mellanox.com>
Thu, 8 Nov 2018 19:10:12 +0000 (21:10 +0200)
committerLeon Romanovsky <leonro@mellanox.com>
Mon, 12 Nov 2018 20:21:01 +0000 (22:21 +0200)
commitc54c53631fb611c8869443e32f2acd503636ee46
treee12a406c1e3a26fccc8f07f0a611865b728d87fb
parente3833fdf644c9677bee16ee0b711ea6adb99f657
IB/mlx5: Lock QP during page fault handling

When page fault event for a WQE arrives, the event data contains the
resource (e.g. QP) number which will later be used by the page fault
handler to retrieve the resource. Meanwhile, another context can destroy
the resource and cause use-after-free. To avoid that, take a reference on the
resource when handler starts and release it when it ends.

Page fault events for RDMA operations don't need to be protected because
the driver doesn't need to access the QP in the page fault handler.

Fixes: 448b73a16a65 ("{net,IB}/mlx5: Refactor page fault handling")
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
drivers/infiniband/hw/mlx5/odp.c