2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 04:34:11 +08:00
linux-next/drivers/misc/cxl
Andrew Donnellan 14a3ae34bf cxl: Prevent read/write to AFU config space while AFU not configured
During EEH recovery, we deconfigure all AFUs whilst leaving the
corresponding vPHB and virtual PCI device in place.

If something attempts to interact with the AFU's PCI config space (e.g.
running lspci) after the AFU has been deconfigured and before it's
reconfigured, cxl_pcie_{read,write}_config() will read invalid values from
the deconfigured struct cxl_afu and proceed to Oops when they try to
dereference pointers that have been set to NULL during deconfiguration.

Add a rwsem to struct cxl_afu so we can prevent interaction with config
space while the AFU is deconfigured.

Reported-by: Pradipta Ghosh <pradghos@in.ibm.com>
Suggested-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org # v4.9+
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-01-25 13:34:24 +11:00
..
api.c cxl: Drop unused header asm/pnv-pci.h 2017-01-25 13:34:23 +11:00
base.c cxl: Add support for interrupts on the Mellanox CX4 2016-07-14 20:27:08 +10:00
context.c powerpc updates for 4.10 2016-12-16 09:26:42 -08:00
cxl.h cxl: Prevent read/write to AFU config space while AFU not configured 2017-01-25 13:34:24 +11:00
debugfs.c cxl: Fix coccinelle warnings 2016-11-23 22:57:49 +11:00
fault.c powerpc/mm: Replace _PAGE_USER with _PAGE_PRIVILEGED 2016-05-01 18:32:26 +10:00
file.c cxl: Fix coredump generation when cxl_get_fd() is used 2016-11-18 23:02:17 +11:00
flash.c cxl: static-ify variables to fix sparse warnings 2016-06-16 22:49:27 +10:00
guest.c cxl: Fix coccinelle warnings 2016-11-23 22:57:49 +11:00
hcalls.c cxl: Add tracepoints around the cxl hcall 2016-03-09 23:40:01 +11:00
hcalls.h cxl: Add guest-specific code 2016-03-09 23:36:52 +11:00
irq.c cxl: Fix coccinelle warnings 2016-11-23 22:57:49 +11:00
Kconfig cxl: remove dead Kconfig options 2016-07-19 20:12:29 +10:00
main.c cxl: Prevent read/write to AFU config space while AFU not configured 2017-01-25 13:34:24 +11:00
Makefile cxl: Allow a default context to be associated with an external pci_dev 2016-07-14 20:26:52 +10:00
native.c cxl: drop duplicate header sched.h 2016-11-25 14:07:50 +11:00
of.c cxl: replace loop with for_each_child_of_node(), remove unneeded of_node_put() 2016-10-04 16:19:23 +11:00
pci.c cxl: Prevent read/write to AFU config space while AFU not configured 2017-01-25 13:34:24 +11:00
phb.c cxl: Fix error handling in _cxl_pci_associate_default_context() 2016-11-18 22:41:08 +11:00
sysfs.c cxl: Prevent adapter reset if an active context exists 2016-10-19 20:35:39 +11:00
trace.c cxl: Add tracepoints 2015-01-22 17:31:51 +11:00
trace.h cxl: Add tracepoints around the cxl hcall 2016-03-09 23:40:01 +11:00
vphb.c cxl: Prevent read/write to AFU config space while AFU not configured 2017-01-25 13:34:24 +11:00