From: Greg KH <gregkh@linuxfoundation.org>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: stable@vger.kernel.org, huhai <huhai@kylinos.cn>,
Jackie Liu <liuyun01@kylinos.cn>
Subject: Re: [BACKPORT][PATCH -stable v4.19] firmware: arm_scpi: Ensure scpi_info is not assigned if the probe fails
Date: Fri, 19 Aug 2022 13:12:53 +0200 [thread overview]
Message-ID: <Yv9wNRC/K2ojLDHh@kroah.com> (raw)
In-Reply-To: <20220816090116.3350445-1-sudeep.holla@arm.com>
On Tue, Aug 16, 2022 at 10:01:16AM +0100, Sudeep Holla wrote:
> commit 689640efc0a2c4e07e6f88affe6d42cd40cc3f85 upstream.
>
> When scpi probe fails, at any point, we need to ensure that the scpi_info
> is not set and will remain NULL until the probe succeeds. If it is not
> taken care, then it could result use-after-free as the value is exported
> via get_scpi_ops() and could refer to a memory allocated via devm_kzalloc()
> but freed when the probe fails.
>
> Link: https://lore.kernel.org/r/20220701160310.148344-1-sudeep.holla@arm.com
> Cc: stable@vger.kernel.org # 4.19+
> Reported-by: huhai <huhai@kylinos.cn>
> Reviewed-by: Jackie Liu <liuyun01@kylinos.cn>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
> drivers/firmware/arm_scpi.c | 61 +++++++++++++++++++++----------------
> 1 file changed, 35 insertions(+), 26 deletions(-)
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2022-08-19 11:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-16 9:01 [BACKPORT][PATCH -stable v4.19] firmware: arm_scpi: Ensure scpi_info is not assigned if the probe fails Sudeep Holla
2022-08-19 11:12 ` Greg KH [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=Yv9wNRC/K2ojLDHh@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=huhai@kylinos.cn \
--cc=liuyun01@kylinos.cn \
--cc=stable@vger.kernel.org \
--cc=sudeep.holla@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.