linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: christophe lombard <clombard@linux.vnet.ibm.com>
To: Vaibhav Jain <vaibhav@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org,
	Frederic Barrat <fbarrat@linux.ibm.com>
Cc: Philippe Bergheaud <philippe.bergheaud@fr.ibm.com>,
	Alastair D'Silva <alastair@linux.ibm.com>,
	Christophe Lombard <christophe_lombard@fr.ibm.com>,
	Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Subject: Re: [PATCH v3] cxl: Wrap iterations over afu slices inside 'afu_list_lock'
Date: Tue, 29 Jan 2019 11:08:33 +0100	[thread overview]
Message-ID: <81f361bd-3f51-7e63-f967-1f8625c0812d@linux.vnet.ibm.com> (raw)
In-Reply-To: <20190129061558.2122-1-vaibhav@linux.ibm.com>

On 29/01/2019 07:15, Vaibhav Jain wrote:
> Within cxl module, iteration over array 'adapter->slices' 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->slices' is wrapped within the context of spin-lock
> 'adapter->afu_list_lock'.
> 
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
> ---
> Changelog:
> 
> v3:
> * Updated a slice loop in cxl_pci_error_detectected() to ignore NULL
>    slices [Fred]
> * Added a NULL AFU check in cxl_pci_slot_reset() [Fred]
> 
> v2:
> * Fixed a wrong comparison of non-null pointer [Fred]
> * Moved a call to cxl_vphb_error_detected() within a branch that
>    checks for not null AFU pointer in 'adapter->slices' [Fred]
> * Removed a misleading comment in code.
> ---

Thanks

Acked-by: Christophe Lombard<clombard@linux.vnet.ibm.com>


      parent reply	other threads:[~2019-01-29 10:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29  6:15 [PATCH v3] cxl: Wrap iterations over afu slices inside 'afu_list_lock' Vaibhav Jain
2019-01-29  6:37 ` Andrew Donnellan
2019-01-29 11:08   ` Vaibhav Jain
2019-01-29  8:29 ` Frederic Barrat
2019-01-29 10:08 ` christophe lombard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81f361bd-3f51-7e63-f967-1f8625c0812d@linux.vnet.ibm.com \
    --to=clombard@linux.vnet.ibm.com \
    --cc=alastair@linux.ibm.com \
    --cc=andrew.donnellan@au1.ibm.com \
    --cc=christophe_lombard@fr.ibm.com \
    --cc=fbarrat@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=philippe.bergheaud@fr.ibm.com \
    --cc=vaibhav@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).