]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
efivars: respect EFI_UNSUPPORTED return from firmware
authorShawn Guo <shawn.guo@linaro.org>
Wed, 17 Mar 2021 06:36:06 +0000 (14:36 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:42:17 +0000 (15:42 -0500)
commit26ce58a28a456efb81bd1fbb3ef4b054ea5618f4
tree7ae2cad66db72546a6b53bd866b1740b590b030e
parent83fa4b7df99d7c4e7da640647d9f45a4f12c7950
efivars: respect EFI_UNSUPPORTED return from firmware

BugLink: https://bugs.launchpad.net/bugs/1921712
commit 483028edacab374060d93955382b4865a9e07cba upstream.

As per UEFI spec 2.8B section 8.2, EFI_UNSUPPORTED may be returned by
EFI variable runtime services if no variable storage is supported by
firmware.  In this case, there is no point for kernel to continue
efivars initialization.  That said, efivar_init() should fail by
returning an error code, so that efivarfs will not be mounted on
/sys/firmware/efi/efivars at all.  Otherwise, user space like efibootmgr
will be confused by the EFIVARFS_MAGIC seen there, while EFI variable
calls cannot be made successfully.

Cc: <stable@vger.kernel.org> # v5.10+
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/firmware/efi/vars.c