]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mlx5: Skip non-ODP MR when handling a page fault
authorArtemy Kovalyov <artemyko@mellanox.com>
Sun, 25 Nov 2018 18:34:23 +0000 (20:34 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 26 Nov 2018 23:27:29 +0000 (16:27 -0700)
commit9261aecbc4ebc5ac35e6e58adad6ac30a84387af
tree8d7d9a9fd6f0afe595d638ce3f37f32c3eeca8ca
parent4c1394d23d0be7e18a2622496abfef0420ba63a7
IB/mlx5: Skip non-ODP MR when handling a page fault

It is possible that we call pagefault_single_data_segment() with a MKey
that belongs to a memory region which is not on demand (i.e. pinned
pages). This can happen if, for instance, a WQE that points to multiple
MRs where some of them are ODP MRs and some are not.  In this case we
don't need to handle this MR in the ODP context besides reporting success.

Otherwise the code will call pagefault_mr() which will do to_ib_umem_odp()
on a non-ODP MR and thus access out of bounds.

Fixes: e37165785216 ("IB/mlx5: Handle page faults")
Signed-off-by: Artemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/odp.c