Skip to content

BAR mappings fixes in RDMA

Leon Romanovsky linux-rdma netdev 1 version Applied

Status from this message: Applied to for-rc

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 7 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/6RDMA/mlx5: Do not allow the user to write to the clock pagedrivers/infiniband/hw/mlx5/main.c+2 -00 replies
2/6RDMA/mlx5: Use rdma_user_map_io for mapping BAR pagesdrivers/infiniband/hw/mlx5/main.c+3 -50 replies
3/6RDMA/ucontext: Do not allow BAR mappings to be executabledrivers/infiniband/core/uverbs_main.c+4 -06 replies
4/6RDMA/ucontext: Fix regression with disassociatedrivers/infiniband/core/uverbs.h drivers/infiniband/core/uverbs_main.c+49 -30 replies
5/6RDMA/mlx5: Use get_zeroed_page() for clock_infodrivers/infiniband/hw/mlx5/main.c drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c include/linux/mlx5/driver.h+14 -220 replies
6/6RDMA: Remove rdma_user_mmap_pagedrivers/infiniband/core/uverbs_main.c drivers/infiniband/hw/mlx5/main.c include/rdma/ib_verbs.h+18 -670 replies

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by.

PatchHaggai Eran
1/6R-b
2/6R-b
3/6
4/6
5/6R-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH rdma-next 0/6] BAR mappings fixes in RDMA

From: Leon Romanovsky <[email protected]>

Quoted 1 line

From Jason,

Upon review it turns out there are some long standing problems in BAR mapping area:
* BAR pages are being allowed to be executable.
* BAR pages intended for read-only can be switched to writable via mprotect.
* Missing use of rdma_user_mmap_io for the mlx5 clock BAR page.
* Disassociate causes SIGBUS when touching the pages.
* CPU pages are being mapped through to the process via remap_pfn_range instead of the more appropriate vm_insert_page, causing weird behaviors during disassociation.

This series adds the missing VM_* flag manipulation, adds faulting a zero page for disassociation and revises the CPU page mappings to use vm_insert_page.

Thanks

Jason Gunthorpe (6):
RDMA/mlx5: Do not allow the user to write to the clock page RDMA/mlx5: Use rdma_user_map_io for mapping BAR pages RDMA/ucontext: Do not allow BAR mappings to be executable RDMA/ucontext: Fix regression with disassociate RDMA/mlx5: Use get_zeroed_page() for clock_info
RDMA: Remove rdma_user_mmap_page

 drivers/infiniband/core/uverbs.h              |   1 +
 drivers/infiniband/core/uverbs_main.c         | 115 ++++++++++--------
 drivers/infiniband/hw/mlx5/main.c             |  21 ++--
 .../ethernet/mellanox/mlx5/core/lib/clock.c   |  30 ++---
 include/linux/mlx5/driver.h                   |   1 -
 include/rdma/ib_verbs.h                       |   9 --
 6 files changed, 85 insertions(+), 92 deletions(-)