linux_dsm_epyc7002/drivers/misc/cxl
Vaibhav Jain edeb304f65 cxl: Wrap iterations over afu slices inside 'afu_list_lock'
Within cxl module, iteration over array 'adapter->afu' may be racy
at few points as it might be simultaneously read during an EEH and its
contents being set to NULL while driver is being unloaded or unbound
from the adapter. This might result in a NULL pointer to 'struct afu'
being de-referenced during an EEH thereby causing a kernel oops.

This patch fixes this by making sure that all access to the array
'adapter->afu' is wrapped within the context of spin-lock
'adapter->afu_list_lock'.

Fixes: 9e8df8a219 ("cxl: EEH support")
Cc: stable@vger.kernel.org # v4.3+
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Frederic Barrat <fbarrat@linux.ibm.com>
Acked-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2019-01-30 23:36:53 +11:00
..
api.c powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
base.c Revert "cxl: Allow a default context to be associated with an external pci_dev" 2018-07-02 23:54:33 +10:00
context.c cxl: Remove abandonned capi support for the Mellanox CX4, final cleanup 2018-07-02 23:54:33 +10:00
cxl.h Merge branch 'topic/ppc-kvm' into next 2018-07-19 14:37:57 +10:00
cxllib.c powerpc/64s: Remove POWER9 DD1 support 2018-07-16 11:37:21 +10:00
debugfs.c cxl: Remove abandonned capi support for the Mellanox CX4, final cleanup 2018-07-02 23:54:33 +10:00
fault.c Merge branch 'akpm' (patches from Andrew) 2018-08-17 16:49:31 -07:00
file.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
flash.c misc: Convert to using %pOFn instead of device_node.name 2018-09-14 15:25:57 +02:00
guest.c cxl: Wrap iterations over afu slices inside 'afu_list_lock' 2019-01-30 23:36:53 +11:00
hcalls.c cxl: Remove unused values in bare-metal environment. 2017-04-13 23:34:28 +10:00
hcalls.h cxl: Add guest-specific code 2016-03-09 23:36:52 +11:00
irq.c cxl: Add psl9 specific code 2017-04-13 23:34:31 +10:00
Kconfig Revert "cxl: Add cxl_check_and_switch_mode() API to switch bi-modal cards" 2018-07-02 23:54:31 +10:00
main.c cxl: Fix wrong comparison in cxl_adapter_context_get() 2018-07-19 21:58:11 +10:00
Makefile Revert "cxl: Allow a default context to be associated with an external pci_dev" 2018-07-02 23:54:33 +10:00
native.c Revert "cxl: Add kernel API to allow a context to operate with relocate disabled" 2018-07-02 23:54:30 +10:00
of.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
pci.c cxl: Wrap iterations over afu slices inside 'afu_list_lock' 2019-01-30 23:36:53 +11:00
sysfs.c Merge branch 'fixes' into next 2018-06-03 20:32:02 +10:00
trace.c cxl: Add tracepoints 2015-01-22 17:31:51 +11:00
trace.h cxl: Add psl9 specific code 2017-04-13 23:34:31 +10:00
vphb.c cxl: drop the dma_set_mask callback from vphb 2018-12-20 22:21:20 +11:00