All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] firmware: Always initialize the fw_priv list object" failed to apply to 4.14-stable tree
@ 2018-10-08 17:43 gregkh
  2018-10-08 18:43 ` Bjorn Andersson
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2018-10-08 17:43 UTC (permalink / raw)
  To: bjorn.andersson, gregkh, rafael.j.wysocki, rishabhb; +Cc: stable


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>.

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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] firmware: Always initialize the fw_priv list object" failed to apply to 4.14-stable tree
  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
  2018-10-09  7:13   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Andersson @ 2018-10-08 18:43 UTC (permalink / raw)
  To: gregkh; +Cc: rafael.j.wysocki, rishabhb, stable

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;
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] firmware: Always initialize the fw_priv list object" failed to apply to 4.14-stable tree
  2018-10-08 18:43 ` Bjorn Andersson
@ 2018-10-09  7:13   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2018-10-09  7:13 UTC (permalink / raw)
  To: Bjorn Andersson; +Cc: rafael.j.wysocki, rishabhb, stable

On Mon, Oct 08, 2018 at 11:43:33AM -0700, Bjorn Andersson wrote:
> 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?

No, the way it was marked was fine, I just wanted everyone to know that
both patches failed to apply.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-09 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2018-10-09  7:13   ` Greg KH

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.