gsmi: fix null-deref in gsmi_get_variable
authorKhazhismel Kumykov <khazhy@chromium.org>
Wed, 18 Jan 2023 01:02:12 +0000 (17:02 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Jan 2023 06:22:47 +0000 (07:22 +0100)
commiteb0421d90f916dffe96b4c049ddf01c0c50620d2
tree331c76ee970995223036b9c4c733b486e2192fab
parentb8d99cda526b4066cf817a3d57e69af4e710149d
gsmi: fix null-deref in gsmi_get_variable

commit a769b05eeed7accc4019a1ed9799dd72067f1ce8 upstream.

We can get EFI variables without fetching the attribute, so we must
allow for that in gsmi.

commit 859748255b43 ("efi: pstore: Omit efivars caching EFI varstore
access layer") added a new get_variable call with attr=NULL, which
triggers panic in gsmi.

Fixes: 74c5b31c6618 ("driver: Google EFI SMI")
Cc: stable <stable@kernel.org>
Signed-off-by: Khazhismel Kumykov <khazhy@google.com>
Link: https://lore.kernel.org/r/20230118010212.1268474-1-khazhy@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/google/gsmi.c