stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Vladis Dronov <vdronov@redhat.com>
Cc: stable@vger.kernel.org, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 4.19, 4.14, 4.9, 4.4 2/2] efi: Add a sanity check to efivar_store_raw()
Date: Mon, 16 Mar 2020 16:50:51 +0100	[thread overview]
Message-ID: <20200316155051.GA28536@kroah.com> (raw)
In-Reply-To: <20200316131938.31453-3-vdronov@redhat.com>

On Mon, Mar 16, 2020 at 02:19:38PM +0100, Vladis Dronov wrote:
> commit d6c066fda90d578aacdf19771a027ed484a79825 upstream.
> 
> Add a sanity check to efivar_store_raw() the same way
> efivar_{attr,size,data}_read() and efivar_show_raw() have it.
> 
> Signed-off-by: Vladis Dronov <vdronov@redhat.com>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> Cc: <stable@vger.kernel.org>
> Link: https://lore.kernel.org/r/20200305084041.24053-3-vdronov@redhat.com
> Link: https://lore.kernel.org/r/20200308080859.21568-25-ardb@kernel.org
> ---
>  drivers/firmware/efi/efivars.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c
> index c8688490f148..1c65f5ac4368 100644
> --- a/drivers/firmware/efi/efivars.c
> +++ b/drivers/firmware/efi/efivars.c
> @@ -272,6 +272,9 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count)
>  	u8 *data;
>  	int err;
>  
> +	if (!entry || !buf)
> +		return -EINVAL;
> +
>  	if (is_compat()) {
>  		struct compat_efi_variable *compat;
>  
> -- 
> 2.20.1
> 

Now queued up, thanks.

greg k-h

      reply	other threads:[~2020-03-16 15:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 13:19 [PATCH 4.19, 4.14, 4.9, 4.4 0/2] efi: fix a race and add a sanity check Vladis Dronov
2020-03-16 13:19 ` [PATCH 4.19, 4.14, 4.9, 4.4 1/2] efi: Fix a race and a buffer overflow while reading efivars via sysfs Vladis Dronov
2020-03-16 13:27   ` Greg KH
2020-03-16 14:32     ` Vladis Dronov
2020-03-16 13:19 ` [PATCH 4.19, 4.14, 4.9, 4.4 2/2] efi: Add a sanity check to efivar_store_raw() Vladis Dronov
2020-03-16 15:50   ` 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=20200316155051.GA28536@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=vdronov@redhat.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).