Linux-EFI Archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Oleksandr Tymoshenko <ovt@google.com>
Cc: Johan Hovold <johan+linaro@kernel.org>,
	stable@vger.kernel.org,  linux-efi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] efi: fix panic in kdump kernel
Date: Sat, 23 Mar 2024 14:15:50 +0200	[thread overview]
Message-ID: <CAMj1kXF0oM4CZM6GBQ+JNdk0ipf62cVJWjaR7Qy8YEU2B6=MVg@mail.gmail.com> (raw)
In-Reply-To: <20240323063334.735219-1-ovt@google.com>

On Sat, 23 Mar 2024 at 08:33, Oleksandr Tymoshenko <ovt@google.com> wrote:
>
> Check if get_next_variable() is actually valid pointer before
> calling it. In kdump kernel this method is set to NULL that causes
> panic during the kexec-ed kernel boot.
>
> Tested with QEMU and OVMF firmware.
>
> Fixes: bad267f9e18f ("efi: verify that variable services are supported")
> Cc: stable@vger.kernel.org
> Signed-off-by: Oleksandr Tymoshenko <ovt@google.com>

Thanks. Queued as a fix.

> ---
> Changes in v2:
>   - Style fix
>   - Added Cc: stable
>   - Added Fixes: trailer
> ---
>  drivers/firmware/efi/efi.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> index 8859fb0b006d..fdf07dd6f459 100644
> --- a/drivers/firmware/efi/efi.c
> +++ b/drivers/firmware/efi/efi.c
> @@ -203,6 +203,8 @@ static bool generic_ops_supported(void)
>
>         name_size = sizeof(name);
>
> +       if (!efi.get_next_variable)
> +               return false;
>         status = efi.get_next_variable(&name_size, &name, &guid);
>         if (status == EFI_UNSUPPORTED)
>                 return false;
> --
> 2.44.0.396.g6e790dbe36-goog
>

      reply	other threads:[~2024-03-23 12:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-23  6:33 [PATCH v2] efi: fix panic in kdump kernel Oleksandr Tymoshenko
2024-03-23 12:15 ` Ard Biesheuvel [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='CAMj1kXF0oM4CZM6GBQ+JNdk0ipf62cVJWjaR7Qy8YEU2B6=MVg@mail.gmail.com' \
    --to=ardb@kernel.org \
    --cc=johan+linaro@kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ovt@google.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).