]> git.baikalelectronics.ru Git - 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)
committerArd Biesheuvel <ardb@kernel.org>
Wed, 17 Mar 2021 08:40:24 +0000 (09:40 +0100)
commit5cbb32c1c262fec878632a18ade04c901d55c500
tree61673bc7d53917e5446402f3148a0b7dd029db13
parentbabd3e44f5782c93de4fc62d07d806c3aeeb5c47
efivars: respect EFI_UNSUPPORTED return from firmware

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>
drivers/firmware/efi/vars.c