Subject: Re: [RESEND, v3] cxl: Wrap iterations over afu slices inside 'afu_list_lock'

From: Michael Ellerman <[email-masked]>
Date: Sat, 9 Feb 2019 00:02:37 +1100 (AEDT)

On Tue, 2019-01-29 at 11:06:18 UTC, Vaibhav Jain wrote:
> 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'.
> 
> Cc: [email-masked]
> Fixes: 9e8df8a2196("cxl: EEH support")
> Acked-by: Andrew Donnellan <[email-masked]>
> Acked-by: Frederic Barrat <[email-masked]>
> Acked-by: Christophe Lombard <[email-masked]>
> Signed-off-by: Vaibhav Jain <[email-masked]>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/edeb304f659792fb5bab90d7d6f3408b

cheers