linux-stable/drivers/infiniband/hw
Douglas Miller 29952ab85d RDMA/hfi1: Prevent panic when SDMA is disabled
[ Upstream commit 629e052d0c ]

If the hfi1 module is loaded with HFI1_CAP_SDMA off, a call to
hfi1_write_iter() will dereference a NULL pointer and panic. A typical
stack frame is:

  sdma_select_user_engine [hfi1]
  hfi1_user_sdma_process_request [hfi1]
  hfi1_write_iter [hfi1]
  do_iter_readv_writev
  do_iter_write
  vfs_writev
  do_writev
  do_syscall_64

The fix is to test for SDMA in hfi1_write_iter() and fail the I/O with
EINVAL.

Link: https://lore.kernel.org/r/20220520183706.48973.79803.stgit@awfm-01.cornelisnetworks.com
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:25:35 +02: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: Prevent panic when SDMA is disabled 2022-06-09 10:25:35 +02:00
hns Linux 5.16 2022-01-13 13:21:03 -04:00
irdma RDMA/irdma: Fix deadlock in irdma_cleanup_cm_core() 2022-05-18 10:28:16 +02:00
mlx4 RDMA/mlx4: Don't continue event handler after memory allocation failure 2022-02-01 10:12:26 -04:00
mlx5 RDMA/mlx5: Add a missing update of cache->last_add 2022-04-13 19:27:30 +02:00
mthca RDMA/mad: Delete duplicated init_query_mad functions 2022-01-05 15:18:36 -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 IB/qib: Fix duplicate sysfs directory name 2022-02-17 11:54:08 -04:00
usnic RDMA: Use default_groups in kobj_type 2022-01-05 15:15:15 -04:00
vmw_pvrdma RDMA/pvrdma: Use non-atomic bitmap functions when possible 2021-11-29 14:33:56 -04:00
Makefile RDMA/irdma: Add irdma Kconfig/Makefile and remove i40iw 2021-06-02 20:06:36 -03:00