[28/30] efi: Add an EFI_SECURE_BOOT flag to indicate secure boot mode
authorDavid Howells <dhowells@redhat.com>
Mon, 18 Feb 2019 12:45:03 +0000 (12:45 +0000)
committerBen Hutchings <benh@debian.org>
Thu, 3 Oct 2024 21:58:46 +0000 (23:58 +0200)
commitd8432004e185aaa144cfb65a0e53a7cdd24ef944
tree628fdd97f2f9967add4bda70aff80560f10ed9d5
parent8504ad74e6e0fe5134b09ec0dfba5606901fb386
[28/30] efi: Add an EFI_SECURE_BOOT flag to indicate secure boot mode

Origin: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/commit?id=a5d70c55c603233c192b375f72116a395909da28

UEFI machines can be booted in Secure Boot mode.  Add an EFI_SECURE_BOOT
flag that can be passed to efi_enabled() to find out whether secure boot is
enabled.

Move the switch-statement in x86's setup_arch() that inteprets the
secure_boot boot parameter to generic code and set the bit there.

Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
cc: linux-efi@vger.kernel.org
[rperier: Forward-ported to 5.5:
 - Use pr_warn()
 - Adjust context]
[bwh: Forward-ported to 5.6: adjust context]
[bwh: Forward-ported to 5.7:
 - Use the next available bit in efi.flags
 - Adjust context]

Gbp-Pq: Topic features/all/lockdown
Gbp-Pq: Name efi-add-an-efi_secure_boot-flag-to-indicate-secure-b.patch
arch/x86/kernel/setup.c
drivers/firmware/efi/Makefile
drivers/firmware/efi/secureboot.c [new file with mode: 0644]
include/linux/efi.h