All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Gary Lin <glin@suse.com>
Cc: linux-efi <linux-efi@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] efi/x86: Fix the deletion of variables in mixed mode
Date: Wed, 8 Apr 2020 10:20:50 +0200	[thread overview]
Message-ID: <CAMj1kXFwZiirOQ2gu2CcScdb3H782vpL2qT6ijqTfdQ8-cKSgw@mail.gmail.com> (raw)
In-Reply-To: <20200408081606.1504-1-glin@suse.com>

On Wed, 8 Apr 2020 at 10:18, Gary Lin <glin@suse.com> wrote:
>
> efi_thunk_set_variable() treated the NULL "data" pointer as an invalid
> parameter, and this broke the deletion of variables in mixed mode.
> This commit fixes the check of data so that the userspace program can
> delete a variable in mixed mode.
>
> Fixes: 8319e9d5ad98ffcc ("efi/x86: Handle by-ref arguments covering multiple pages in mixed mode")
> Cc: linux-efi@vger.kernel.org
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Gary Lin <glin@suse.com>

Thanks Gary.

I'll queue this in efi/urgent.



> ---
>  arch/x86/platform/efi/efi_64.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
> index 211bb9358b73..e0e2e8136cf5 100644
> --- a/arch/x86/platform/efi/efi_64.c
> +++ b/arch/x86/platform/efi/efi_64.c
> @@ -638,7 +638,7 @@ efi_thunk_set_variable(efi_char16_t *name, efi_guid_t *vendor,
>         phys_vendor = virt_to_phys_or_null(vnd);
>         phys_data = virt_to_phys_or_null_size(data, data_size);
>
> -       if (!phys_name || !phys_data)
> +       if (!phys_name || (data && !phys_data))
>                 status = EFI_INVALID_PARAMETER;
>         else
>                 status = efi_thunk(set_variable, phys_name, phys_vendor,
> @@ -669,7 +669,7 @@ efi_thunk_set_variable_nonblocking(efi_char16_t *name, efi_guid_t *vendor,
>         phys_vendor = virt_to_phys_or_null(vnd);
>         phys_data = virt_to_phys_or_null_size(data, data_size);
>
> -       if (!phys_name || !phys_data)
> +       if (!phys_name || (data && !phys_data))
>                 status = EFI_INVALID_PARAMETER;
>         else
>                 status = efi_thunk(set_variable, phys_name, phys_vendor,
> --
> 2.25.1
>

  reply	other threads:[~2020-04-08  8:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08  8:16 [PATCH] efi/x86: Fix the deletion of variables in mixed mode Gary Lin
2020-04-08  8:20 ` Ard Biesheuvel [this message]
2020-04-14  8:20 ` [tip: efi/urgent] " tip-bot2 for Gary Lin

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=CAMj1kXFwZiirOQ2gu2CcScdb3H782vpL2qT6ijqTfdQ8-cKSgw@mail.gmail.com \
    --to=ardb@kernel.org \
    --cc=glin@suse.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /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.