linux-stable/drivers/infiniband/hw
Douglas Miller 2bbac98d09 RDMA/hfi1: Fix use-after-free bug for mm struct
Under certain conditions, such as MPI_Abort, the hfi1 cleanup code may
represent the last reference held on the task mm.
hfi1_mmu_rb_unregister() then drops the last reference and the mm is freed
before the final use in hfi1_release_user_pages().  A new task may
allocate the mm structure while it is still being used, resulting in
problems. One manifestation is corruption of the mmap_sem counter leading
to a hang in down_write().  Another is corruption of an mm struct that is
in use by another task.

Fixes: 3d2a9d6425 ("IB/hfi1: Ensure correct mm is used at all times")
Link: https://lore.kernel.org/r/20220408133523.122165.72975.stgit@awfm-01.cornelisnetworks.com
Cc: <stable@vger.kernel.org>
Signed-off-by: Douglas Miller <doug.miller@cornelisnetworks.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2022-04-08 15:40:06 -03:00
..
bnxt_re RDMA/bnxt_re: Fix endianness warning for req.pkey 2021-12-06 19:56:30 -04:00
cxgb4 RDMA/cxgb4: Set queue pair state when being queried 2022-01-05 15:51:51 -04:00
efa RDMA/efa: Add support for dmabuf memory regions 2021-10-28 08:58:26 -03:00
hfi1 RDMA/hfi1: Fix use-after-free bug for mm struct 2022-04-08 15:40:06 -03:00
hns RDMA/hns: Use the reserved loopback QPs to free MR before destroying MPT 2022-03-15 20:19:00 -03:00
irdma RDMA/irdma: Add support for address handle re-use 2022-03-15 16:22:55 -03:00
mlx4 v5.18 merge window pull request 2022-03-24 19:17:39 -07:00
mlx5 RDMA/mlx5: Add a missing update of cache->last_add 2022-04-04 10:32:02 -03:00
mthca RDMA/mthca: Delete useless module.h include 2022-01-28 13:03:12 -04:00
ocrdma RDMA/ocrdma: Remove unneeded variable 2022-01-05 13:47:43 -04:00
qedr RDMA/qedr: Fix reporting max_{send/recv}_wr attrs 2021-12-07 14:59:26 -04:00
qib v5.18 merge window pull request 2022-03-24 19:17:39 -07:00
usnic RDMA/usnic: Delete useless module.h include 2022-01-28 13:03:13 -04:00
vmw_pvrdma RDMA/pvrdma: Remove useless DMA-32 fallback configuration 2022-01-28 10:49:04 -04:00
Makefile RDMA/irdma: Add irdma Kconfig/Makefile and remove i40iw 2021-06-02 20:06:36 -03:00