[PATCH] cxl: prevent read/write to AFU config space while AFU not configured

Frederic Barrat fbarrat at linux.vnet.ibm.com
Wed Dec 7 01:33:08 AEDT 2016



Le 05/12/2016 à 14:22, Andrew Donnellan a écrit :
> 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 at in.ibm.com>
> Suggested-by: Frederic Barrat <fbarrat at linux.vnet.ibm.com>
> Cc: stable at vger.kernel.org # 4.4+
> Signed-off-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>


Thanks for adding the comments!

Acked-by: Frederic Barrat <fbarrat at linux.vnet.ibm.com>



More information about the Linuxppc-dev mailing list