linux-stable/drivers/infiniband
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
..
core RDMA/core: Let ib_find_gid() continue search even after empty entry 2022-01-27 09:00:52 +01:00
hw RDMA/hfi1: Prevent panic when SDMA is disabled 2022-06-14 16:53:47 +02:00
sw RDMA/rxe: Fix a typo in opcode name 2022-01-27 09:01:00 +01:00
ulp RDMA/ib_srp: Fix a deadlock 2022-03-02 11:33:56 +01:00
Kconfig RDMA/ucm: Mark UCM interface as BROKEN 2018-07-17 11:39:33 +02:00
Makefile