linux/drivers/infiniband/hw/hfi1
Michael J. Ruhl dbc2970cae IB/hfi1: Incorrect sizing of sge for PIO will OOPs
An incorrect sge sizing in the HFI PIO path will cause an OOPs similar to
this:

BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [] hfi1_verbs_send_pio+0x3d8/0x530 [hfi1]
PGD 0
Oops: 0000 1 SMP
 Call Trace:
 ? hfi1_verbs_send_dma+0xad0/0xad0 [hfi1]
 hfi1_verbs_send+0xdf/0x250 [hfi1]
 ? make_rc_ack+0xa80/0xa80 [hfi1]
 hfi1_do_send+0x192/0x430 [hfi1]
 hfi1_do_send_from_rvt+0x10/0x20 [hfi1]
 rvt_post_send+0x369/0x820 [rdmavt]
 ib_uverbs_post_send+0x317/0x570 [ib_uverbs]
 ib_uverbs_write+0x26f/0x420 [ib_uverbs]
 ? security_file_permission+0x21/0xa0
 vfs_write+0xbd/0x1e0
 ? mntput+0x24/0x40
 SyS_write+0x7f/0xe0
 system_call_fastpath+0x16/0x1b

Fix by adding the missing sizing check to correctly determine the sge
length.

Fixes: 7724105686 ("IB/hfi1: add driver files")
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2018-12-06 19:50:08 -07:00
..
affinity.c IB/hfi1: Make the MSIx resource allocation a bit more flexible 2018-09-01 08:13:38 -04:00
affinity.h IB/{hfi1, rdmavt, qib}: Implement CQ completion vector support 2018-05-09 15:53:30 -04:00
aspm.h IB/hfi1: Convert timers to use timer_setup() 2017-10-18 11:48:19 -04:00
chip_registers.h IB/hfi1: Dump pio info for non-user send contexts 2018-12-06 19:49:47 -07:00
chip.c IB/hfi1: Ignore LNI errors before DC8051 transitions to Polling state 2018-12-06 19:50:08 -07:00
chip.h IB/hfi1: Rework the IRQ API to be more flexible 2018-09-01 08:13:38 -04:00
common.h IB/hfi1: Eliminate allocation while atomic 2017-10-18 10:12:59 -04:00
debugfs.c IB/hfi1: Dump pio info for non-user send contexts 2018-12-06 19:49:47 -07:00
debugfs.h RDMA/hfi1: Fix build error with debugfs disabled 2018-05-15 14:24:18 -04:00
device.c
device.h
driver.c IB/hfi1: Correctly process FECN and BECN in packets 2018-12-06 19:50:08 -07:00
efivar.c
efivar.h
eprom.c IB/hfi1: Check eeprom config partition validity 2017-09-27 11:10:36 -04:00
eprom.h
exp_rcv.c IB/hfi1: Cleanup of exp_rcv 2018-05-24 09:39:25 -06:00
exp_rcv.h IB/hfi1: Cleanup of exp_rcv 2018-05-24 09:39:25 -06:00
fault.c IB/hfi1: Rework fault injection machinery 2018-05-09 15:53:30 -04:00
fault.h IB/hfi1: Rework fault injection machinery 2018-05-09 15:53:30 -04:00
file_ops.c IB/hfi1: Move URGENT IRQ enable to hfi1_rcvctrl() 2018-09-01 08:13:38 -04:00
firmware.c IB/hfi1: Fix infinite loop in 8051 command error path 2018-01-05 13:34:55 -05:00
hfi.h IB/hfi1: Correctly process FECN and BECN in packets 2018-12-06 19:50:08 -07:00
init.c IB/{hfi1, qib, rdmavt}: Move copy SGE logic into rdmavt 2018-10-03 16:38:28 -06:00
intr.c IB/hfi1: Allow MgmtAllowed on B2B setups 2017-11-13 15:53:56 -05:00
iowait.c IB/hfi1: Add static trace for iowait 2018-09-30 19:21:12 -06:00
iowait.h IB/hfi1: Prepare resource waits for dual leg 2018-09-30 19:21:12 -06:00
Kconfig
mad.c IB/hfi1: Error path MAD response size is incorrect 2018-09-30 19:21:11 -06:00
mad.h IB/hfi1: Convert PortXmitWait/PortVLXmitWait counters to flit times 2018-02-01 15:43:30 -07:00
Makefile IB/hfi1: Prepare resource waits for dual leg 2018-09-30 19:21:12 -06:00
mmu_rb.c Revert "mm, mmu_notifier: annotate mmu notifiers with blockable invalidate callbacks" 2018-10-26 16:25:19 -07:00
mmu_rb.h
msix.c IB/hfi1: Rework the IRQ API to be more flexible 2018-09-01 08:13:38 -04:00
msix.h IB/hfi1: Make the MSIx resource allocation a bit more flexible 2018-09-01 08:13:38 -04:00
opa_compat.h
pcie.c First merge window pull request 2018-10-26 07:38:19 -07:00
pio_copy.c
pio.c IB/hfi1: Dump pio info for non-user send contexts 2018-12-06 19:49:47 -07:00
pio.h IB/hfi1: Dump pio info for non-user send contexts 2018-12-06 19:49:47 -07:00
platform.c IB/{hfi1, rdmavt}: Fix memory leak in hfi1_alloc_devdata() upon failure 2018-05-03 15:24:48 -04:00
platform.h
qp.c IB/hfi1: Use VL15 for SM packets 2018-09-30 19:21:12 -06:00
qp.h IB/hfi1: Prepare resource waits for dual leg 2018-09-30 19:21:12 -06:00
qsfp.c IB/{hfi1, rdmavt}: Fix memory leak in hfi1_alloc_devdata() upon failure 2018-05-03 15:24:48 -04:00
qsfp.h
rc.c IB/hfi1: Correctly process FECN and BECN in packets 2018-12-06 19:50:08 -07:00
ruc.c IB/{hfi1, qib, rdmavt}: Move ruc_loopback to rdmavt 2018-10-03 16:38:28 -06:00
sdma_txreq.h
sdma.c IB/hfi1: Prepare resource waits for dual leg 2018-09-30 19:21:12 -06:00
sdma.h IB/hfi1: Prepare resource waits for dual leg 2018-09-30 19:21:12 -06:00
sysfs.c RDMA/drivers: Use core provided API for registering device attributes 2018-10-17 03:45:01 -06:00
trace_ctxts.h treewide: remove large struct-pass-by-value from tracepoint arguments 2018-03-28 22:55:18 +02:00
trace_dbg.h IB/{hfi1, rdmavt, qib}: Implement CQ completion vector support 2018-05-09 15:53:30 -04:00
trace_ibhdrs.h IB/hfi1: Add 16B Management Packet trace support 2018-05-24 09:39:25 -06:00
trace_iowait.h IB/hfi1: Add static trace for iowait 2018-09-30 19:21:12 -06:00
trace_misc.h
trace_mmu.h
trace_rc.h
trace_rx.h IB/hfi1: Add 16B rcvhdr trace support 2018-02-01 15:43:32 -07:00
trace_tx.h
trace.c IB/hfi1: Add 16B Management Packet trace support 2018-05-24 09:39:25 -06:00
trace.h IB/hfi1: Add static trace for iowait 2018-09-30 19:21:12 -06:00
uc.c IB/hfi1: Correctly process FECN and BECN in packets 2018-12-06 19:50:08 -07:00
ud.c IB/hfi1: Correctly process FECN and BECN in packets 2018-12-06 19:50:08 -07:00
user_exp_rcv.c IB/hfi1: Rename exp_lock to exp_mutex 2018-06-04 15:25:27 -06:00
user_exp_rcv.h
user_pages.c
user_sdma.c Merge branch 'for-rc' into rdma.git for-next 2018-10-16 00:01:02 -06:00
user_sdma.h IB/hfi1: Right size user_sdma sequence numbers and related variables 2018-09-11 10:05:17 -06:00
verbs_txreq.c IB/hfi1: Fix incorrect mixing of ERR_PTR and NULL return values 2018-06-26 14:35:55 -06:00
verbs_txreq.h IB/hfi1: Prepare resource waits for dual leg 2018-09-30 19:21:12 -06:00
verbs.c IB/hfi1: Incorrect sizing of sge for PIO will OOPs 2018-12-06 19:50:08 -07:00
verbs.h IB/{hfi1, qib, rdmavt}: Move send completion logic to rdmavt 2018-10-03 16:38:28 -06:00
vnic_main.c IB/hfi1: Limit VNIC use of SDMA engines to the available count 2018-12-06 19:50:08 -07:00
vnic_sdma.c IB/hfi1: Prepare resource waits for dual leg 2018-09-30 19:21:12 -06:00
vnic.h