linux-stable/drivers/infiniband/hw
Douglas Miller 33794e8e9b 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-14 16:53:47 +02:00
..
bnxt_re RDMA/bnxt_re: Set queue pair state when being queried 2020-12-29 13:46:50 +01:00
cxgb3 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cxgb4 RDMA/cxgb4: Set queue pair state when being queried 2022-01-27 09:00:53 +01:00
hfi1 RDMA/hfi1: Prevent panic when SDMA is disabled 2022-06-14 16:53:47 +02:00
hns RDMA/hns: Modify the mapping attribute of doorbell to device 2022-01-27 09:01:00 +01:00
i40iw RDMA/i40iw: Avoid panic when reading back the IRQ affinity hint 2021-05-22 10:57:41 +02:00
mlx4 RDMA/mlx4: Don't continue event handler after memory allocation failure 2022-02-08 18:16:28 +01:00
mlx5 RDMA/mlx5: Set GRH fields in query QP on RoCE 2020-05-05 19:15:51 +02:00
mthca RDMa/mthca: Work around -Wenum-conversion warning 2020-12-29 13:46:53 +01:00
nes IB: Correct MR length field to be 64-bit 2017-09-25 11:47:23 -04:00
ocrdma RDMA/ocrdma: Fix out of bounds index check in query pkey 2020-01-27 14:46:12 +01:00
qedr RDMA/qedr: Fix NULL deref for query_qp on the GSI QP 2021-11-26 11:40:24 +01:00
qib IB/qib: Fix memory leak in qib_user_sdma_queue_pkts() 2021-12-29 12:17:33 +01:00
usnic RDMA/usnic: Fix memleak in find_free_vf_and_create_qp_grp 2021-01-23 15:48:44 +01:00
vmw_pvrdma RDMA/pvrdma: Fix missing pci disable in pvrdma_pci_probe() 2020-06-03 08:18:00 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00