From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: gregkh@linuxfoundation.org
Cc: rafael.j.wysocki@intel.com, rishabhb@codeaurora.org,
stable@vger.kernel.org
Subject: Re: FAILED: patch "[PATCH] firmware: Always initialize the fw_priv list object" failed to apply to 4.14-stable tree
Date: Mon, 8 Oct 2018 11:43:33 -0700 [thread overview]
Message-ID: <20181008184333.GD1331@tuxbook-pro> (raw)
In-Reply-To: <15390206251907@kroah.com>
On Mon 08 Oct 10:43 PDT 2018, gregkh@linuxfoundation.org wrote:
>
> The patch below does not apply to the 4.14-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
>
Hi Greg,
If/when you pick 422b3db2a503 ("firmware: Fix security issue with
request_firmware_into_buf()") for stable you need this patch as well.
Is there any particular way you would like me to annotate the Fixes/Cc
tags in the future to make this clear?
Regards,
Bjorn
> thanks,
>
> greg k-h
>
> ------------------ original commit in Linus's tree ------------------
>
> From 7012040576c6ae25a47035659ee48673612c2c27 Mon Sep 17 00:00:00 2001
> From: Bjorn Andersson <bjorn.andersson@linaro.org>
> Date: Wed, 19 Sep 2018 18:09:38 -0700
> Subject: [PATCH] firmware: Always initialize the fw_priv list object
>
> When freeing the fw_priv the item is taken off the list. This causes an
> oops in the FW_OPT_NOCACHE case as the list object is not initialized.
>
> Make sure to initialize the list object regardless of this flag.
>
> Fixes: 422b3db2a503 ("firmware: Fix security issue with request_firmware_into_buf()")
> Cc: stable@vger.kernel.org
> Cc: Rishabh Bhatnagar <rishabhb@codeaurora.org>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c
> index b3c0498ee433..8e9213b36e31 100644
> --- a/drivers/base/firmware_loader/main.c
> +++ b/drivers/base/firmware_loader/main.c
> @@ -226,8 +226,11 @@ static int alloc_lookup_fw_priv(const char *fw_name,
> }
>
> tmp = __allocate_fw_priv(fw_name, fwc, dbuf, size);
> - if (tmp && !(opt_flags & FW_OPT_NOCACHE))
> - list_add(&tmp->list, &fwc->head);
> + if (tmp) {
> + INIT_LIST_HEAD(&tmp->list);
> + if (!(opt_flags & FW_OPT_NOCACHE))
> + list_add(&tmp->list, &fwc->head);
> + }
> spin_unlock(&fwc->lock);
>
> *fw_priv = tmp;
>
next prev parent reply other threads:[~2018-10-09 1:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-08 17:43 FAILED: patch "[PATCH] firmware: Always initialize the fw_priv list object" failed to apply to 4.14-stable tree gregkh
2018-10-08 18:43 ` Bjorn Andersson [this message]
2018-10-09 7:13 ` Greg KH
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=20181008184333.GD1331@tuxbook-pro \
--to=bjorn.andersson@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rishabhb@codeaurora.org \
--cc=stable@vger.kernel.org \
/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