From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Russell Currey <ruscur@russell.cc>, linuxppc-dev@lists.ozlabs.org
Cc: aik@ozlabs.ru, Russell Currey <ruscur@russell.cc>
Subject: Re: [v3, 1/2] powerpc/eeh: Avoid use after free in eeh_handle_special_event()
Date: Thu, 4 May 2017 08:18:57 +1000 (AEST) [thread overview]
Message-ID: <3wJCHP3ZByz9s0g@ozlabs.org> (raw)
In-Reply-To: <20170419073927.29224-1-ruscur@russell.cc>
On Wed, 2017-04-19 at 07:39:26 UTC, Russell Currey wrote:
> eeh_handle_special_event() is called when an EEH event is detected but
> can't be narrowed down to a specific PE. This function looks through
> every PE to find one in an erroneous state, then calls the regular event
> handler eeh_handle_normal_event() once it knows which PE has an error.
>
> However, if eeh_handle_normal_event() found that the PE cannot possibly
> be recovered, it will free it, rendering the passed PE stale.
> This leads to a use after free in eeh_handle_special_event() as it attempts to
> clear the "recovering" state on the PE after eeh_handle_normal_event() returns.
>
> Thus, make sure the PE is valid when attempting to clear state in
> eeh_handle_special_event().
>
> Cc: <stable@vger.kernel.org> #3.10+
> Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Signed-off-by: Russell Currey <ruscur@russell.cc>
> Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/daeba2956f32f91f3493788ff6ee02
cheers
prev parent reply other threads:[~2017-05-03 22:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-19 7:39 [PATCH v3 1/2] powerpc/eeh: Avoid use after free in eeh_handle_special_event() Russell Currey
2017-04-19 7:39 ` [PATCH v3 2/2] powerpc/eeh: Clean up and document event handling functions Russell Currey
2017-04-19 23:48 ` Gavin Shan
2017-04-20 1:03 ` Russell Currey
2017-04-20 1:26 ` Gavin Shan
2017-04-20 0:36 ` Andrew Donnellan
2017-04-20 1:24 ` Gavin Shan
2017-05-03 22:18 ` [v3, " Michael Ellerman
2017-04-19 23:49 ` [PATCH v3 1/2] powerpc/eeh: Avoid use after free in eeh_handle_special_event() Gavin Shan
2017-05-03 22:18 ` Michael Ellerman [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=3wJCHP3ZByz9s0g@ozlabs.org \
--to=patch-notifications@ellerman.id.au \
--cc=aik@ozlabs.ru \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=ruscur@russell.cc \
/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).