OrangePi_CM5/drivers/infiniband/hw/hfi1
Douglas Miller 5f54364ff6 RDMA/hfi1: Fix use-after-free bug for mm struct
commit 2bbac98d0930e8161b1957dc0ec99de39ade1b3c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-13 21:01:08 +02:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile IB/hfi1: Add functions to receive accelerated ipoib packets 2020-05-21 11:23:56 -03:00
affinity.c IB/hfi1: Fix probe time panic when AIP is enabled with a buggy BIOS 2021-04-14 08:41:58 +02:00
affinity.h IB/hfi1: Add interrupt handler functions for accelerated ipoib 2020-05-21 11:23:56 -03:00
aspm.c
…
aspm.h
…
chip.c IB/hfi1: Fix early init panic 2021-12-14 11:32:34 +01:00
chip.h IB/hfi1: Add interrupt handler functions for accelerated ipoib 2020-05-21 11:23:56 -03:00
chip_registers.h IB/hfi1: Add RcvShortLengthErrCnt to hfi1stats 2020-01-10 10:57:17 -04:00
common.h IB/hfi1: Enable the transmit side of the datagram ipoib netdev 2020-05-21 11:23:58 -03:00
debugfs.c IB/hfi1: Fix module use count flaw due to leftover module put calls 2020-06-24 15:54:08 -03:00
debugfs.h
…
device.c
…
device.h
…
driver.c IB/hfi1: Fix early init panic 2021-12-14 11:32:34 +01:00
efivar.c infiniband: hfi1: Use EFI GetVariable only when available 2020-02-23 21:59:42 +01:00
efivar.h
…
eprom.c
…
eprom.h
…
exp_rcv.c
…
exp_rcv.h
…
fault.c IB/hfi1: Use scnprintf() for avoiding potential buffer overflow 2020-03-26 15:06:14 -03:00
fault.h
…
file_ops.c IB/hfi1: Ensure correct mm is used at all times 2020-11-25 20:30:46 -04:00
firmware.c IB/hfi1: Fix error return code in parse_platform_config() 2021-05-14 09:50:36 +02:00
hfi.h IB/hfi1: Fix probe time panic when AIP is enabled with a buggy BIOS 2021-04-14 08:41:58 +02:00
init.c IB/hfi1: Correct guard on eager buffer deallocation 2021-12-14 11:32:37 +01:00
intr.c
…
iowait.c IB/hfi1: Don't cancel unused work item 2020-01-03 16:41:51 -04:00
iowait.h RDMA/hfi1: Fix trivial mis-spelling of 'descriptor' 2020-06-15 15:56:54 -03:00
ipoib.h IB/hfi1: Correct oversized ring allocation 2021-05-19 10:12:55 +02:00
ipoib_main.c IB/hfi1: Fix AIP early init panic 2022-02-08 18:30:36 +01:00
ipoib_rx.c IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
ipoib_tx.c IB/hfi1: Correct oversized ring allocation 2021-05-19 10:12:55 +02:00
mad.c IB/hfi1: Use fallthrough pseudo-keyword 2020-07-24 16:59:55 -03:00
mad.h RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
mmu_rb.c RDMA/hfi1: Fix use-after-free bug for mm struct 2022-04-13 21:01:08 +02:00
mmu_rb.h IB/hfi1: Ensure correct mm is used at all times 2020-11-25 20:30:46 -04:00
msix.c IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
msix.h IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
netdev.h IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
netdev_rx.c IB/hfi1: Fix probe time panic when AIP is enabled with a buggy BIOS 2021-04-14 08:41:58 +02:00
opa_compat.h
…
opfn.c
…
opfn.h
…
pcie.c IB/hfi1: Convert PCIBIOS_* errors to generic -E* errors 2020-06-30 13:27:14 -03:00
pio.c IB/hfi1: Fix abba locking issue with sc_disable() 2021-11-02 19:48:21 +01:00
pio.h RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
pio_copy.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
platform.c IB/hfi1: Use fallthrough pseudo-keyword 2020-07-24 16:59:55 -03:00
platform.h
…
qp.c RDMA 5.9 merge window pull request 2020-08-06 16:43:36 -07:00
qp.h RDMA/hfi1: Remove hfi1_create_qp declaration 2020-06-22 14:49:27 -03:00
qsfp.c IB/hfi1: Use fallthrough pseudo-keyword 2020-07-24 16:59:55 -03:00
qsfp.h
…
rc.c IB/hfi1: Use fallthrough pseudo-keyword 2020-07-24 16:59:55 -03:00
rc.h
…
ruc.c
…
sdma.c IB/hfi1: Insure use of smp_processor_id() is preempt disabled 2021-12-14 11:32:34 +01:00
sdma.h RDMA: Replace zero-length array with flexible-array member 2020-02-20 13:33:51 -04:00
sdma_txreq.h
…
sysfs.c IB/hfi1: Call kobject_put() when kobject_init_and_add() fails 2020-03-27 13:13:36 -03:00
tid_rdma.c RDMA/hfi1: Correct an interlock issue for TID RDMA WRITE request 2020-08-20 08:31:41 -03:00
tid_rdma.h IB/hfi1: Calculate flow weight based on QP MTU for TID RDMA 2019-11-06 13:15:36 -04:00
trace.c IB/hfi1: Add packet histogram trace event 2020-05-21 11:23:57 -03:00
trace.h
…
trace_ctxts.h IB/hfi1: Add packet histogram trace event 2020-05-21 11:23:57 -03:00
trace_dbg.h
…
trace_ibhdrs.h
…
trace_iowait.h
…
trace_misc.h
…
trace_mmu.h
…
trace_rc.h
…
trace_rx.h IB/hfi1: Add fast and slow handlers for receive context 2020-01-10 10:57:16 -04:00
trace_tid.h ftrace: Rework event_create_dir() 2019-11-27 07:44:25 +01:00
trace_tx.h ftrace: Rework event_create_dir() 2019-11-27 07:44:25 +01:00
uc.c IB/hfi1: Use fallthrough pseudo-keyword 2020-07-24 16:59:55 -03:00
ud.c
…
user_exp_rcv.c IB/hfi1: Ensure correct mm is used at all times 2020-11-25 20:30:46 -04:00
user_exp_rcv.h IB/hfi1: Ensure correct mm is used at all times 2020-11-25 20:30:46 -04:00
user_pages.c mm, tree-wide: rename put_user_page*() to unpin_user_page*() 2020-01-31 10:30:38 -08:00
user_sdma.c IB/hfi1: Ensure correct mm is used at all times 2020-11-25 20:30:46 -04:00
user_sdma.h IB/hfi1: Ensure correct mm is used at all times 2020-11-25 20:30:46 -04:00
verbs.c IB/hfi1: Allow larger MTU without AIP 2022-04-08 14:40:19 +02:00
verbs.h treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
verbs_txreq.c
…
verbs_txreq.h RDMA/hfi1: Fix trivial mis-spelling of 'descriptor' 2020-06-15 15:56:54 -03:00
vnic.h IB/hfi1: Activate the dummy netdev 2020-05-21 11:23:56 -03:00
vnic_main.c IB/hfi1: Fix hfi1_netdev_rx_init() error handling 2020-06-02 20:32:54 -03:00
vnic_sdma.c
…