* [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide [not found] <20260115004328.194142-1-coxu@redhat.com> @ 2026-01-15 0:43 ` Coiby Xu 2026-01-15 18:14 ` Mimi Zohar 2026-01-16 9:41 ` Ard Biesheuvel 2026-01-15 0:43 ` [PATCH 2/3] evm: Don't enable fix mode when secure boot is enabled Coiby Xu 2026-01-15 0:43 ` [PATCH 3/3] s390: Drop unnecessary CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT Coiby Xu 2 siblings, 2 replies; 21+ messages in thread From: Coiby Xu @ 2026-01-15 0:43 UTC (permalink / raw) To: linux-integrity Cc: Heiko Carstens, Mimi Zohar, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Ard Biesheuvel, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY EVM and other LSMs need the ability to query the secure boot status of the system, without directly calling the IMA arch_ima_get_secureboot function. Refactor the secure boot status check into a general, integrity-wide function named arch_integrity_get_secureboot. Define a new Kconfig option CONFIG_INTEGRITY_SECURE_BOOT, which is automatically configured by the supported architectures. The existing IMA_SECURE_AND_OR_TRUSTED_BOOT Kconfig loads the architecture specific IMA policy based on the refactored secure boot status code. Reported-and-suggested-by: Mimi Zohar <zohar@linux.ibm.com> Suggested-by: Roberto Sassu <roberto.sassu@huaweicloud.com> Signed-off-by: Coiby Xu <coxu@redhat.com> --- arch/arm64/Kconfig | 1 + arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/Makefile | 2 +- arch/powerpc/kernel/ima_arch.c | 5 -- arch/powerpc/kernel/integrity_sb_arch.c | 13 +++++ arch/s390/Kconfig | 1 + arch/s390/kernel/Makefile | 1 + arch/s390/kernel/ima_arch.c | 6 -- arch/s390/kernel/integrity_sb_arch.c | 9 +++ arch/x86/Kconfig | 1 + arch/x86/include/asm/efi.h | 4 +- arch/x86/platform/efi/efi.c | 2 +- include/linux/ima.h | 7 +-- include/linux/integrity.h | 8 +++ security/integrity/Kconfig | 6 ++ security/integrity/Makefile | 3 + security/integrity/efi_secureboot.c | 56 +++++++++++++++++++ security/integrity/ima/ima_appraise.c | 2 +- security/integrity/ima/ima_efi.c | 47 +--------------- security/integrity/ima/ima_main.c | 4 +- security/integrity/platform_certs/load_uefi.c | 2 +- 21 files changed, 111 insertions(+), 70 deletions(-) create mode 100644 arch/powerpc/kernel/integrity_sb_arch.c create mode 100644 arch/s390/kernel/integrity_sb_arch.c create mode 100644 security/integrity/efi_secureboot.c diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 93173f0a09c7..4c265b7386bb 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -2427,6 +2427,7 @@ config EFI select EFI_STUB select EFI_GENERIC_STUB imply IMA_SECURE_AND_OR_TRUSTED_BOOT + imply INTEGRITY_SECURE_BOOT default y help This option provides support for runtime services provided diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 9537a61ebae0..878f752c35fb 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -1058,6 +1058,7 @@ config PPC_SECURE_BOOT depends on PPC_POWERNV || PPC_PSERIES depends on IMA_ARCH_POLICY imply IMA_SECURE_AND_OR_TRUSTED_BOOT + imply INTEGRITY_SECURE_BOOT select PSERIES_PLPKS if PPC_PSERIES help Systems with firmware secure boot enabled need to define security diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 2f0a2e69c607..3bb1fb9a1e0e 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -168,7 +168,7 @@ ifneq ($(CONFIG_PPC_POWERNV)$(CONFIG_PPC_SVM),) obj-y += ucall.o endif -obj-$(CONFIG_PPC_SECURE_BOOT) += secure_boot.o ima_arch.o secvar-ops.o +obj-$(CONFIG_PPC_SECURE_BOOT) += secure_boot.o ima_arch.o integrity_sb_arch.o secvar-ops.o obj-$(CONFIG_PPC_SECVAR_SYSFS) += secvar-sysfs.o # Disable GCOV, KCOV & sanitizers in odd or sensitive code diff --git a/arch/powerpc/kernel/ima_arch.c b/arch/powerpc/kernel/ima_arch.c index b7029beed847..0d8892a03526 100644 --- a/arch/powerpc/kernel/ima_arch.c +++ b/arch/powerpc/kernel/ima_arch.c @@ -7,11 +7,6 @@ #include <linux/ima.h> #include <asm/secure_boot.h> -bool arch_ima_get_secureboot(void) -{ - return is_ppc_secureboot_enabled(); -} - /* * The "secure_rules" are enabled only on "secureboot" enabled systems. * These rules verify the file signatures against known good values. diff --git a/arch/powerpc/kernel/integrity_sb_arch.c b/arch/powerpc/kernel/integrity_sb_arch.c new file mode 100644 index 000000000000..29f9494391a3 --- /dev/null +++ b/arch/powerpc/kernel/integrity_sb_arch.c @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2019 IBM Corporation + * Author: Nayna Jain + */ + +#include <linux/integrity.h> +#include <asm/secure_boot.h> + +bool arch_integrity_get_secureboot(void) +{ + return is_ppc_secureboot_enabled(); +} diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 0e5fad5f06ca..db0383b19493 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -78,6 +78,7 @@ config S390 # Note: keep this list sorted alphabetically # imply IMA_SECURE_AND_OR_TRUSTED_BOOT + imply INTEGRITY_SECURE_BOOT select ALTERNATE_USER_ADDRESS_SPACE select ARCH_32BIT_USTAT_F_TINODE select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile index 42c83d60d6fa..ee976a27e677 100644 --- a/arch/s390/kernel/Makefile +++ b/arch/s390/kernel/Makefile @@ -72,6 +72,7 @@ obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file.o kexec_image.o obj-$(CONFIG_KEXEC_FILE) += kexec_elf.o obj-$(CONFIG_CERT_STORE) += cert_store.o obj-$(CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT) += ima_arch.o +obj-$(CONFIG_INTEGRITY_SECURE_BOOT) += integrity_sb_arch.o obj-$(CONFIG_PERF_EVENTS) += perf_event.o obj-$(CONFIG_PERF_EVENTS) += perf_cpum_cf.o perf_cpum_sf.o diff --git a/arch/s390/kernel/ima_arch.c b/arch/s390/kernel/ima_arch.c index f3c3e6e1c5d3..6ccbe34ce408 100644 --- a/arch/s390/kernel/ima_arch.c +++ b/arch/s390/kernel/ima_arch.c @@ -1,12 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/ima.h> -#include <asm/boot_data.h> - -bool arch_ima_get_secureboot(void) -{ - return ipl_secure_flag; -} const char * const *arch_get_ima_policy(void) { diff --git a/arch/s390/kernel/integrity_sb_arch.c b/arch/s390/kernel/integrity_sb_arch.c new file mode 100644 index 000000000000..208a28cb9961 --- /dev/null +++ b/arch/s390/kernel/integrity_sb_arch.c @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include <linux/integrity.h> +#include <asm/boot_data.h> + +bool arch_integrity_get_secureboot(void) +{ + return ipl_secure_flag; +} diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 80527299f859..5051cc80309a 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -330,6 +330,7 @@ config X86 select FUNCTION_ALIGNMENT_16B if X86_64 || X86_ALIGNMENT_16 select FUNCTION_ALIGNMENT_4B imply IMA_SECURE_AND_OR_TRUSTED_BOOT if EFI + imply INTEGRITY_SECURE_BOOT if EFI select HAVE_DYNAMIC_FTRACE_NO_PATCHABLE select ARCH_SUPPORTS_PT_RECLAIM if X86_64 select ARCH_SUPPORTS_SCHED_SMT if SMP diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index f227a70ac91f..d409f11da331 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -401,9 +401,9 @@ extern int __init efi_memmap_split_count(efi_memory_desc_t *md, extern void __init efi_memmap_insert(struct efi_memory_map *old_memmap, void *buf, struct efi_mem_range *mem); -extern enum efi_secureboot_mode __x86_ima_efi_boot_mode(void); +enum efi_secureboot_mode __x86_integrity_efi_boot_mode(void); -#define arch_ima_efi_boot_mode __x86_ima_efi_boot_mode() +#define arch_integrity_efi_boot_mode __x86_integrity_efi_boot_mode() #ifdef CONFIG_EFI_RUNTIME_MAP int efi_get_runtime_map_size(void); diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 463b784499a8..94704858f17a 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -921,7 +921,7 @@ umode_t efi_attr_is_visible(struct kobject *kobj, struct attribute *attr, int n) return attr->mode; } -enum efi_secureboot_mode __x86_ima_efi_boot_mode(void) +enum efi_secureboot_mode __x86_integrity_efi_boot_mode(void) { return boot_params.secure_boot; } diff --git a/include/linux/ima.h b/include/linux/ima.h index 8e29cb4e6a01..fc0ce1e27a2f 100644 --- a/include/linux/ima.h +++ b/include/linux/ima.h @@ -11,6 +11,7 @@ #include <linux/fs.h> #include <linux/security.h> #include <linux/kexec.h> +#include <linux/integrity.h> #include <crypto/hash_info.h> struct linux_binprm; @@ -72,14 +73,8 @@ int __init ima_get_kexec_buffer(void **addr, size_t *size); #endif #ifdef CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT -extern bool arch_ima_get_secureboot(void); extern const char * const *arch_get_ima_policy(void); #else -static inline bool arch_ima_get_secureboot(void) -{ - return false; -} - static inline const char * const *arch_get_ima_policy(void) { return NULL; diff --git a/include/linux/integrity.h b/include/linux/integrity.h index f5842372359b..39e8961b58dd 100644 --- a/include/linux/integrity.h +++ b/include/linux/integrity.h @@ -61,5 +61,13 @@ integrity_inode_attrs_changed(const struct integrity_inode_attributes *attrs, !inode_eq_iversion(inode, attrs->version)); } +#ifdef CONFIG_INTEGRITY_SECURE_BOOT +bool arch_integrity_get_secureboot(void); +#else +static inline bool arch_integrity_get_secureboot(void) +{ + return false; +} +#endif #endif /* _LINUX_INTEGRITY_H */ diff --git a/security/integrity/Kconfig b/security/integrity/Kconfig index 916d4f2bfc44..1c3e54df3b73 100644 --- a/security/integrity/Kconfig +++ b/security/integrity/Kconfig @@ -97,6 +97,12 @@ config INTEGRITY_CA_MACHINE_KEYRING_MAX will not be loaded. The remaining MOK keys are loaded into the .platform keyring. +config INTEGRITY_SECURE_BOOT + bool + help + This option is selected by architectures to provide secure boot + related helper functions. + config LOAD_UEFI_KEYS depends on INTEGRITY_PLATFORM_KEYRING depends on EFI diff --git a/security/integrity/Makefile b/security/integrity/Makefile index 92b63039c654..08622460e6fd 100644 --- a/security/integrity/Makefile +++ b/security/integrity/Makefile @@ -18,6 +18,9 @@ integrity-$(CONFIG_LOAD_IPL_KEYS) += platform_certs/load_ipl_s390.o integrity-$(CONFIG_LOAD_PPC_KEYS) += platform_certs/efi_parser.o \ platform_certs/load_powerpc.o \ platform_certs/keyring_handler.o +ifeq ($(CONFIG_EFI),y) +integrity-$(CONFIG_INTEGRITY_SECURE_BOOT) += efi_secureboot.o +endif # The relative order of the 'ima' and 'evm' LSMs depends on the order below. obj-$(CONFIG_IMA) += ima/ obj-$(CONFIG_EVM) += evm/ diff --git a/security/integrity/efi_secureboot.c b/security/integrity/efi_secureboot.c new file mode 100644 index 000000000000..93d5086217d2 --- /dev/null +++ b/security/integrity/efi_secureboot.c @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: GPL-1.0+ +/* + * Copyright (C) 2018 IBM Corporation + */ +#include <linux/efi.h> +#include <linux/integrity.h> +#include <asm/efi.h> + +#ifndef arch_integrity_efi_boot_mode +#define arch_integrity_efi_boot_mode efi_secureboot_mode_unset +#endif + +static enum efi_secureboot_mode get_sb_mode(void) +{ + enum efi_secureboot_mode mode; + + if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) { + pr_info("integrity: secureboot mode unknown, no efi\n"); + return efi_secureboot_mode_unknown; + } + + mode = efi_get_secureboot_mode(efi.get_variable); + if (mode == efi_secureboot_mode_disabled) + pr_info("integrity: secureboot mode disabled\n"); + else if (mode == efi_secureboot_mode_unknown) + pr_info("integrity: secureboot mode unknown\n"); + else + pr_info("integrity: secureboot mode enabled\n"); + return mode; +} + +/* + * Query secure boot status + * + * Note don't call this function too early e.g. in __setup hook otherwise the + * kernel may hang when calling efi_get_secureboot_mode. + * + */ +bool arch_integrity_get_secureboot(void) +{ + static enum efi_secureboot_mode sb_mode; + static bool initialized; + + if (!initialized && efi_enabled(EFI_BOOT)) { + sb_mode = arch_integrity_efi_boot_mode; + + if (sb_mode == efi_secureboot_mode_unset) + sb_mode = get_sb_mode(); + initialized = true; + } + + if (sb_mode == efi_secureboot_mode_enabled) + return true; + else + return false; +} diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c index 5149ff4fd50d..f45106cad443 100644 --- a/security/integrity/ima/ima_appraise.c +++ b/security/integrity/ima/ima_appraise.c @@ -27,7 +27,7 @@ core_param(ima_appraise, ima_appraise_cmdline_default, charp, 0); void __init ima_appraise_parse_cmdline(void) { const char *str = ima_appraise_cmdline_default; - bool sb_state = arch_ima_get_secureboot(); + bool sb_state = arch_integrity_get_secureboot(); int appraisal_state = ima_appraise; if (!str) diff --git a/security/integrity/ima/ima_efi.c b/security/integrity/ima/ima_efi.c index 138029bfcce1..d6545ae446c7 100644 --- a/security/integrity/ima/ima_efi.c +++ b/security/integrity/ima/ima_efi.c @@ -2,52 +2,8 @@ /* * Copyright (C) 2018 IBM Corporation */ -#include <linux/efi.h> #include <linux/module.h> #include <linux/ima.h> -#include <asm/efi.h> - -#ifndef arch_ima_efi_boot_mode -#define arch_ima_efi_boot_mode efi_secureboot_mode_unset -#endif - -static enum efi_secureboot_mode get_sb_mode(void) -{ - enum efi_secureboot_mode mode; - - if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) { - pr_info("ima: secureboot mode unknown, no efi\n"); - return efi_secureboot_mode_unknown; - } - - mode = efi_get_secureboot_mode(efi.get_variable); - if (mode == efi_secureboot_mode_disabled) - pr_info("ima: secureboot mode disabled\n"); - else if (mode == efi_secureboot_mode_unknown) - pr_info("ima: secureboot mode unknown\n"); - else - pr_info("ima: secureboot mode enabled\n"); - return mode; -} - -bool arch_ima_get_secureboot(void) -{ - static enum efi_secureboot_mode sb_mode; - static bool initialized; - - if (!initialized && efi_enabled(EFI_BOOT)) { - sb_mode = arch_ima_efi_boot_mode; - - if (sb_mode == efi_secureboot_mode_unset) - sb_mode = get_sb_mode(); - initialized = true; - } - - if (sb_mode == efi_secureboot_mode_enabled) - return true; - else - return false; -} /* secureboot arch rules */ static const char * const sb_arch_rules[] = { @@ -67,7 +23,8 @@ static const char * const sb_arch_rules[] = { const char * const *arch_get_ima_policy(void) { - if (IS_ENABLED(CONFIG_IMA_ARCH_POLICY) && arch_ima_get_secureboot()) { + if (IS_ENABLED(CONFIG_IMA_ARCH_POLICY) && + arch_integrity_get_secureboot()) { if (IS_ENABLED(CONFIG_MODULE_SIG)) set_module_sig_enforced(); if (IS_ENABLED(CONFIG_KEXEC_SIG)) diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index 5770cf691912..3f267557dfbe 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c @@ -949,8 +949,8 @@ static int ima_load_data(enum kernel_load_data_id id, bool contents) switch (id) { case LOADING_KEXEC_IMAGE: - if (IS_ENABLED(CONFIG_KEXEC_SIG) - && arch_ima_get_secureboot()) { + if (IS_ENABLED(CONFIG_KEXEC_SIG) && + arch_integrity_get_secureboot()) { pr_err("impossible to appraise a kernel image without a file descriptor; try using kexec_file_load syscall.\n"); return -EACCES; } diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c index d1fdd113450a..3042a0c536d6 100644 --- a/security/integrity/platform_certs/load_uefi.c +++ b/security/integrity/platform_certs/load_uefi.c @@ -212,7 +212,7 @@ static int __init load_uefi_certs(void) } /* the MOK/MOKx can not be trusted when secure boot is disabled */ - if (!arch_ima_get_secureboot()) + if (!arch_integrity_get_secureboot()) return 0; mokx = get_cert_list(L"MokListXRT", &mok_var, &mokxsize, &status); -- 2.52.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-01-15 0:43 ` [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide Coiby Xu @ 2026-01-15 18:14 ` Mimi Zohar 2026-01-16 9:41 ` Ard Biesheuvel 1 sibling, 0 replies; 21+ messages in thread From: Mimi Zohar @ 2026-01-15 18:14 UTC (permalink / raw) To: Coiby Xu, linux-integrity Cc: Heiko Carstens, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Ard Biesheuvel, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY On Thu, 2026-01-15 at 08:43 +0800, Coiby Xu wrote: > EVM and other LSMs need the ability to query the secure boot status of > the system, without directly calling the IMA arch_ima_get_secureboot > function. Refactor the secure boot status check into a general, > integrity-wide function named arch_integrity_get_secureboot. > > Define a new Kconfig option CONFIG_INTEGRITY_SECURE_BOOT, which is > automatically configured by the supported architectures. The existing > IMA_SECURE_AND_OR_TRUSTED_BOOT Kconfig loads the architecture specific > IMA policy based on the refactored secure boot status code. > > Reported-and-suggested-by: Mimi Zohar <zohar@linux.ibm.com> > Suggested-by: Roberto Sassu <roberto.sassu@huaweicloud.com> > Signed-off-by: Coiby Xu <coxu@redhat.com> Thanks, Coiby! Reviewed-by: Mimi Zohar <zohar@linux.ibm.com> ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-01-15 0:43 ` [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide Coiby Xu 2026-01-15 18:14 ` Mimi Zohar @ 2026-01-16 9:41 ` Ard Biesheuvel 2026-01-16 13:11 ` Mimi Zohar 1 sibling, 1 reply; 21+ messages in thread From: Ard Biesheuvel @ 2026-01-16 9:41 UTC (permalink / raw) To: Coiby Xu Cc: linux-integrity, Heiko Carstens, Mimi Zohar, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY On Thu, 15 Jan 2026 at 01:43, Coiby Xu <coxu@redhat.com> wrote: > > EVM and other LSMs need the ability to query the secure boot status of > the system, without directly calling the IMA arch_ima_get_secureboot > function. Refactor the secure boot status check into a general, > integrity-wide function named arch_integrity_get_secureboot. > > Define a new Kconfig option CONFIG_INTEGRITY_SECURE_BOOT, which is > automatically configured by the supported architectures. The existing > IMA_SECURE_AND_OR_TRUSTED_BOOT Kconfig loads the architecture specific > IMA policy based on the refactored secure boot status code. > > Reported-and-suggested-by: Mimi Zohar <zohar@linux.ibm.com> > Suggested-by: Roberto Sassu <roberto.sassu@huaweicloud.com> > Signed-off-by: Coiby Xu <coxu@redhat.com> > --- > arch/arm64/Kconfig | 1 + > arch/powerpc/Kconfig | 1 + > arch/powerpc/kernel/Makefile | 2 +- > arch/powerpc/kernel/ima_arch.c | 5 -- > arch/powerpc/kernel/integrity_sb_arch.c | 13 +++++ > arch/s390/Kconfig | 1 + > arch/s390/kernel/Makefile | 1 + > arch/s390/kernel/ima_arch.c | 6 -- > arch/s390/kernel/integrity_sb_arch.c | 9 +++ > arch/x86/Kconfig | 1 + > arch/x86/include/asm/efi.h | 4 +- > arch/x86/platform/efi/efi.c | 2 +- > include/linux/ima.h | 7 +-- > include/linux/integrity.h | 8 +++ > security/integrity/Kconfig | 6 ++ > security/integrity/Makefile | 3 + > security/integrity/efi_secureboot.c | 56 +++++++++++++++++++ > security/integrity/ima/ima_appraise.c | 2 +- > security/integrity/ima/ima_efi.c | 47 +--------------- > security/integrity/ima/ima_main.c | 4 +- > security/integrity/platform_certs/load_uefi.c | 2 +- > 21 files changed, 111 insertions(+), 70 deletions(-) > create mode 100644 arch/powerpc/kernel/integrity_sb_arch.c > create mode 100644 arch/s390/kernel/integrity_sb_arch.c > create mode 100644 security/integrity/efi_secureboot.c > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 93173f0a09c7..4c265b7386bb 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -2427,6 +2427,7 @@ config EFI > select EFI_STUB > select EFI_GENERIC_STUB > imply IMA_SECURE_AND_OR_TRUSTED_BOOT > + imply INTEGRITY_SECURE_BOOT This allows both to be en/disabled individually, which I don't think is what we want. It also results in more churn across the arch-specific Kconfigs than needed. Wouldn't it be better if IMA_SECURE_AND_OR_TRUSTED_BOOT 'select'ed INTEGRITY_SECURE_BOOT in its Kconfig definition? ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-01-16 9:41 ` Ard Biesheuvel @ 2026-01-16 13:11 ` Mimi Zohar 2026-01-16 13:18 ` Ard Biesheuvel 0 siblings, 1 reply; 21+ messages in thread From: Mimi Zohar @ 2026-01-16 13:11 UTC (permalink / raw) To: Ard Biesheuvel, Coiby Xu Cc: linux-integrity, Heiko Carstens, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY On Fri, 2026-01-16 at 10:41 +0100, Ard Biesheuvel wrote: > On Thu, 15 Jan 2026 at 01:43, Coiby Xu <coxu@redhat.com> wrote: > > > > EVM and other LSMs need the ability to query the secure boot status of > > the system, without directly calling the IMA arch_ima_get_secureboot > > function. Refactor the secure boot status check into a general, > > integrity-wide function named arch_integrity_get_secureboot. > > > > Define a new Kconfig option CONFIG_INTEGRITY_SECURE_BOOT, which is > > automatically configured by the supported architectures. The existing > > IMA_SECURE_AND_OR_TRUSTED_BOOT Kconfig loads the architecture specific > > IMA policy based on the refactored secure boot status code. > > > > Reported-and-suggested-by: Mimi Zohar <zohar@linux.ibm.com> > > Suggested-by: Roberto Sassu <roberto.sassu@huaweicloud.com> > > Signed-off-by: Coiby Xu <coxu@redhat.com> > > --- > > arch/arm64/Kconfig | 1 + > > arch/powerpc/Kconfig | 1 + > > arch/powerpc/kernel/Makefile | 2 +- > > arch/powerpc/kernel/ima_arch.c | 5 -- > > arch/powerpc/kernel/integrity_sb_arch.c | 13 +++++ > > arch/s390/Kconfig | 1 + > > arch/s390/kernel/Makefile | 1 + > > arch/s390/kernel/ima_arch.c | 6 -- > > arch/s390/kernel/integrity_sb_arch.c | 9 +++ > > arch/x86/Kconfig | 1 + > > arch/x86/include/asm/efi.h | 4 +- > > arch/x86/platform/efi/efi.c | 2 +- > > include/linux/ima.h | 7 +-- > > include/linux/integrity.h | 8 +++ > > security/integrity/Kconfig | 6 ++ > > security/integrity/Makefile | 3 + > > security/integrity/efi_secureboot.c | 56 +++++++++++++++++++ > > security/integrity/ima/ima_appraise.c | 2 +- > > security/integrity/ima/ima_efi.c | 47 +--------------- > > security/integrity/ima/ima_main.c | 4 +- > > security/integrity/platform_certs/load_uefi.c | 2 +- > > 21 files changed, 111 insertions(+), 70 deletions(-) > > create mode 100644 arch/powerpc/kernel/integrity_sb_arch.c > > create mode 100644 arch/s390/kernel/integrity_sb_arch.c > > create mode 100644 security/integrity/efi_secureboot.c > > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > index 93173f0a09c7..4c265b7386bb 100644 > > --- a/arch/arm64/Kconfig > > +++ b/arch/arm64/Kconfig > > @@ -2427,6 +2427,7 @@ config EFI > > select EFI_STUB > > select EFI_GENERIC_STUB > > imply IMA_SECURE_AND_OR_TRUSTED_BOOT > > + imply INTEGRITY_SECURE_BOOT > > This allows both to be en/disabled individually, which I don't think > is what we want. It also results in more churn across the > arch-specific Kconfigs than needed. > > Wouldn't it be better if IMA_SECURE_AND_OR_TRUSTED_BOOT 'select'ed > INTEGRITY_SECURE_BOOT in its Kconfig definition? As much as possible, EVM (and other LSMs) shouldn't be dependent on another LSM, in this case IMA, being configured. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-01-16 13:11 ` Mimi Zohar @ 2026-01-16 13:18 ` Ard Biesheuvel 2026-01-16 16:38 ` Mimi Zohar 0 siblings, 1 reply; 21+ messages in thread From: Ard Biesheuvel @ 2026-01-16 13:18 UTC (permalink / raw) To: Mimi Zohar Cc: Coiby Xu, linux-integrity, Heiko Carstens, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY On Fri, 16 Jan 2026 at 14:11, Mimi Zohar <zohar@linux.ibm.com> wrote: > > On Fri, 2026-01-16 at 10:41 +0100, Ard Biesheuvel wrote: > > On Thu, 15 Jan 2026 at 01:43, Coiby Xu <coxu@redhat.com> wrote: > > > > > > EVM and other LSMs need the ability to query the secure boot status of > > > the system, without directly calling the IMA arch_ima_get_secureboot > > > function. Refactor the secure boot status check into a general, > > > integrity-wide function named arch_integrity_get_secureboot. > > > > > > Define a new Kconfig option CONFIG_INTEGRITY_SECURE_BOOT, which is > > > automatically configured by the supported architectures. The existing > > > IMA_SECURE_AND_OR_TRUSTED_BOOT Kconfig loads the architecture specific > > > IMA policy based on the refactored secure boot status code. > > > > > > Reported-and-suggested-by: Mimi Zohar <zohar@linux.ibm.com> > > > Suggested-by: Roberto Sassu <roberto.sassu@huaweicloud.com> > > > Signed-off-by: Coiby Xu <coxu@redhat.com> > > > --- > > > arch/arm64/Kconfig | 1 + > > > arch/powerpc/Kconfig | 1 + > > > arch/powerpc/kernel/Makefile | 2 +- > > > arch/powerpc/kernel/ima_arch.c | 5 -- > > > arch/powerpc/kernel/integrity_sb_arch.c | 13 +++++ > > > arch/s390/Kconfig | 1 + > > > arch/s390/kernel/Makefile | 1 + > > > arch/s390/kernel/ima_arch.c | 6 -- > > > arch/s390/kernel/integrity_sb_arch.c | 9 +++ > > > arch/x86/Kconfig | 1 + > > > arch/x86/include/asm/efi.h | 4 +- > > > arch/x86/platform/efi/efi.c | 2 +- > > > include/linux/ima.h | 7 +-- > > > include/linux/integrity.h | 8 +++ > > > security/integrity/Kconfig | 6 ++ > > > security/integrity/Makefile | 3 + > > > security/integrity/efi_secureboot.c | 56 +++++++++++++++++++ > > > security/integrity/ima/ima_appraise.c | 2 +- > > > security/integrity/ima/ima_efi.c | 47 +--------------- > > > security/integrity/ima/ima_main.c | 4 +- > > > security/integrity/platform_certs/load_uefi.c | 2 +- > > > 21 files changed, 111 insertions(+), 70 deletions(-) > > > create mode 100644 arch/powerpc/kernel/integrity_sb_arch.c > > > create mode 100644 arch/s390/kernel/integrity_sb_arch.c > > > create mode 100644 security/integrity/efi_secureboot.c > > > > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > > index 93173f0a09c7..4c265b7386bb 100644 > > > --- a/arch/arm64/Kconfig > > > +++ b/arch/arm64/Kconfig > > > @@ -2427,6 +2427,7 @@ config EFI > > > select EFI_STUB > > > select EFI_GENERIC_STUB > > > imply IMA_SECURE_AND_OR_TRUSTED_BOOT > > > + imply INTEGRITY_SECURE_BOOT > > > > This allows both to be en/disabled individually, which I don't think > > is what we want. It also results in more churn across the > > arch-specific Kconfigs than needed. > > > > Wouldn't it be better if IMA_SECURE_AND_OR_TRUSTED_BOOT 'select'ed > > INTEGRITY_SECURE_BOOT in its Kconfig definition? > > As much as possible, EVM (and other LSMs) shouldn't be dependent on another LSM, > in this case IMA, being configured. Sure, but that is not my point. This arrangement allows for IMA_SECURE_AND_OR_TRUSTED_BOOT to be enabled without INTEGRITY_SECURE_BOOT, resulting in the stub implementation of arch_integrity_get_secureboot() being used, which always returns false. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-01-16 13:18 ` Ard Biesheuvel @ 2026-01-16 16:38 ` Mimi Zohar 2026-01-16 17:27 ` Ard Biesheuvel 0 siblings, 1 reply; 21+ messages in thread From: Mimi Zohar @ 2026-01-16 16:38 UTC (permalink / raw) To: Ard Biesheuvel Cc: Coiby Xu, linux-integrity, Heiko Carstens, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY On Fri, 2026-01-16 at 14:18 +0100, Ard Biesheuvel wrote: > On Fri, 16 Jan 2026 at 14:11, Mimi Zohar <zohar@linux.ibm.com> wrote: > > > > On Fri, 2026-01-16 at 10:41 +0100, Ard Biesheuvel wrote: > > > On Thu, 15 Jan 2026 at 01:43, Coiby Xu <coxu@redhat.com> wrote: > > > > > > > > EVM and other LSMs need the ability to query the secure boot status of > > > > the system, without directly calling the IMA arch_ima_get_secureboot > > > > function. Refactor the secure boot status check into a general, > > > > integrity-wide function named arch_integrity_get_secureboot. > > > > > > > > Define a new Kconfig option CONFIG_INTEGRITY_SECURE_BOOT, which is > > > > automatically configured by the supported architectures. The existing > > > > IMA_SECURE_AND_OR_TRUSTED_BOOT Kconfig loads the architecture specific > > > > IMA policy based on the refactored secure boot status code. > > > > > > > > Reported-and-suggested-by: Mimi Zohar <zohar@linux.ibm.com> > > > > Suggested-by: Roberto Sassu <roberto.sassu@huaweicloud.com> > > > > Signed-off-by: Coiby Xu <coxu@redhat.com> > > > > --- > > > > arch/arm64/Kconfig | 1 + > > > > arch/powerpc/Kconfig | 1 + > > > > arch/powerpc/kernel/Makefile | 2 +- > > > > arch/powerpc/kernel/ima_arch.c | 5 -- > > > > arch/powerpc/kernel/integrity_sb_arch.c | 13 +++++ > > > > arch/s390/Kconfig | 1 + > > > > arch/s390/kernel/Makefile | 1 + > > > > arch/s390/kernel/ima_arch.c | 6 -- > > > > arch/s390/kernel/integrity_sb_arch.c | 9 +++ > > > > arch/x86/Kconfig | 1 + > > > > arch/x86/include/asm/efi.h | 4 +- > > > > arch/x86/platform/efi/efi.c | 2 +- > > > > include/linux/ima.h | 7 +-- > > > > include/linux/integrity.h | 8 +++ > > > > security/integrity/Kconfig | 6 ++ > > > > security/integrity/Makefile | 3 + > > > > security/integrity/efi_secureboot.c | 56 +++++++++++++++++++ > > > > security/integrity/ima/ima_appraise.c | 2 +- > > > > security/integrity/ima/ima_efi.c | 47 +--------------- > > > > security/integrity/ima/ima_main.c | 4 +- > > > > security/integrity/platform_certs/load_uefi.c | 2 +- > > > > 21 files changed, 111 insertions(+), 70 deletions(-) > > > > create mode 100644 arch/powerpc/kernel/integrity_sb_arch.c > > > > create mode 100644 arch/s390/kernel/integrity_sb_arch.c > > > > create mode 100644 security/integrity/efi_secureboot.c > > > > > > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > > > index 93173f0a09c7..4c265b7386bb 100644 > > > > --- a/arch/arm64/Kconfig > > > > +++ b/arch/arm64/Kconfig > > > > @@ -2427,6 +2427,7 @@ config EFI > > > > select EFI_STUB > > > > select EFI_GENERIC_STUB > > > > imply IMA_SECURE_AND_OR_TRUSTED_BOOT > > > > + imply INTEGRITY_SECURE_BOOT > > > > > > This allows both to be en/disabled individually, which I don't think > > > is what we want. It also results in more churn across the > > > arch-specific Kconfigs than needed. > > > > > > Wouldn't it be better if IMA_SECURE_AND_OR_TRUSTED_BOOT 'select'ed > > > INTEGRITY_SECURE_BOOT in its Kconfig definition? > > > > As much as possible, EVM (and other LSMs) shouldn't be dependent on another LSM, > > in this case IMA, being configured. > > Sure, but that is not my point. > > This arrangement allows for IMA_SECURE_AND_OR_TRUSTED_BOOT to be > enabled without INTEGRITY_SECURE_BOOT, resulting in the stub > implementation of arch_integrity_get_secureboot() being used, which > always returns false. I understand your concern, but instead of "select"ing INTEGRITY_SECURE_BOOT from IMA_SECURE_AND_OR_TRUSTED_BOOT, how making IMA_SECURE_AND_OR_TRUSTED_BOOT dependent on both IMA_ARCH_POLICY and INTEGRITY_SECURE_BOOT. Including the "imply INTEGRITY_SECURE_BOOT" here in the arch Kconfig allows EVM to query the secure boot state without relying on IMA_SECURE_AND_OR_TRUSTED_BOOT being configured. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-01-16 16:38 ` Mimi Zohar @ 2026-01-16 17:27 ` Ard Biesheuvel 2026-01-18 18:25 ` Mimi Zohar 0 siblings, 1 reply; 21+ messages in thread From: Ard Biesheuvel @ 2026-01-16 17:27 UTC (permalink / raw) To: Mimi Zohar Cc: Coiby Xu, linux-integrity, Heiko Carstens, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY On Fri, 16 Jan 2026 at 17:39, Mimi Zohar <zohar@linux.ibm.com> wrote: > > On Fri, 2026-01-16 at 14:18 +0100, Ard Biesheuvel wrote: > > On Fri, 16 Jan 2026 at 14:11, Mimi Zohar <zohar@linux.ibm.com> wrote: > > > > > > On Fri, 2026-01-16 at 10:41 +0100, Ard Biesheuvel wrote: > > > > On Thu, 15 Jan 2026 at 01:43, Coiby Xu <coxu@redhat.com> wrote: > > > > > > > > > > EVM and other LSMs need the ability to query the secure boot status of > > > > > the system, without directly calling the IMA arch_ima_get_secureboot > > > > > function. Refactor the secure boot status check into a general, > > > > > integrity-wide function named arch_integrity_get_secureboot. > > > > > > > > > > Define a new Kconfig option CONFIG_INTEGRITY_SECURE_BOOT, which is > > > > > automatically configured by the supported architectures. The existing > > > > > IMA_SECURE_AND_OR_TRUSTED_BOOT Kconfig loads the architecture specific > > > > > IMA policy based on the refactored secure boot status code. > > > > > > > > > > Reported-and-suggested-by: Mimi Zohar <zohar@linux.ibm.com> > > > > > Suggested-by: Roberto Sassu <roberto.sassu@huaweicloud.com> > > > > > Signed-off-by: Coiby Xu <coxu@redhat.com> > > > > > --- > > > > > arch/arm64/Kconfig | 1 + > > > > > arch/powerpc/Kconfig | 1 + > > > > > arch/powerpc/kernel/Makefile | 2 +- > > > > > arch/powerpc/kernel/ima_arch.c | 5 -- > > > > > arch/powerpc/kernel/integrity_sb_arch.c | 13 +++++ > > > > > arch/s390/Kconfig | 1 + > > > > > arch/s390/kernel/Makefile | 1 + > > > > > arch/s390/kernel/ima_arch.c | 6 -- > > > > > arch/s390/kernel/integrity_sb_arch.c | 9 +++ > > > > > arch/x86/Kconfig | 1 + > > > > > arch/x86/include/asm/efi.h | 4 +- > > > > > arch/x86/platform/efi/efi.c | 2 +- > > > > > include/linux/ima.h | 7 +-- > > > > > include/linux/integrity.h | 8 +++ > > > > > security/integrity/Kconfig | 6 ++ > > > > > security/integrity/Makefile | 3 + > > > > > security/integrity/efi_secureboot.c | 56 +++++++++++++++++++ > > > > > security/integrity/ima/ima_appraise.c | 2 +- > > > > > security/integrity/ima/ima_efi.c | 47 +--------------- > > > > > security/integrity/ima/ima_main.c | 4 +- > > > > > security/integrity/platform_certs/load_uefi.c | 2 +- > > > > > 21 files changed, 111 insertions(+), 70 deletions(-) > > > > > create mode 100644 arch/powerpc/kernel/integrity_sb_arch.c > > > > > create mode 100644 arch/s390/kernel/integrity_sb_arch.c > > > > > create mode 100644 security/integrity/efi_secureboot.c > > > > > > > > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > > > > index 93173f0a09c7..4c265b7386bb 100644 > > > > > --- a/arch/arm64/Kconfig > > > > > +++ b/arch/arm64/Kconfig > > > > > @@ -2427,6 +2427,7 @@ config EFI > > > > > select EFI_STUB > > > > > select EFI_GENERIC_STUB > > > > > imply IMA_SECURE_AND_OR_TRUSTED_BOOT > > > > > + imply INTEGRITY_SECURE_BOOT > > > > > > > > This allows both to be en/disabled individually, which I don't think > > > > is what we want. It also results in more churn across the > > > > arch-specific Kconfigs than needed. > > > > > > > > Wouldn't it be better if IMA_SECURE_AND_OR_TRUSTED_BOOT 'select'ed > > > > INTEGRITY_SECURE_BOOT in its Kconfig definition? > > > > > > As much as possible, EVM (and other LSMs) shouldn't be dependent on another LSM, > > > in this case IMA, being configured. > > > > Sure, but that is not my point. > > > > This arrangement allows for IMA_SECURE_AND_OR_TRUSTED_BOOT to be > > enabled without INTEGRITY_SECURE_BOOT, resulting in the stub > > implementation of arch_integrity_get_secureboot() being used, which > > always returns false. > > I understand your concern, but instead of "select"ing INTEGRITY_SECURE_BOOT from > IMA_SECURE_AND_OR_TRUSTED_BOOT, how making IMA_SECURE_AND_OR_TRUSTED_BOOT > dependent on both IMA_ARCH_POLICY and INTEGRITY_SECURE_BOOT. > Given that INTEGRITY_SECURE_BOOT has no dependencies of its own, afaict, selecting it is the least disruptive option, as otherwise, existing configs will disable IMA_SECURE_AND_OR_TRUSTED_BOOT as the kernel is being upgraded. But conceptually, I agree that they are equivalent. > Including the "imply INTEGRITY_SECURE_BOOT" here in the arch Kconfig allows EVM > to query the secure boot state without relying on IMA_SECURE_AND_OR_TRUSTED_BOOT > being configured. Yes, I understand that this is the whole point of the exercise. But 'imply' should be used with care, and in this case, implying both from CONFIG_EFI really makes little sense. INTEGRITY_SECURE_BOOT should be selected by options that need the functionality, not 'implied' by options that might provide it. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-01-16 17:27 ` Ard Biesheuvel @ 2026-01-18 18:25 ` Mimi Zohar 2026-01-19 4:04 ` Coiby Xu 2026-01-19 18:44 ` Dave Hansen 0 siblings, 2 replies; 21+ messages in thread From: Mimi Zohar @ 2026-01-18 18:25 UTC (permalink / raw) To: Ard Biesheuvel Cc: Coiby Xu, linux-integrity, Heiko Carstens, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY On Fri, 2026-01-16 at 18:27 +0100, Ard Biesheuvel wrote: > On Fri, 16 Jan 2026 at 17:39, Mimi Zohar <zohar@linux.ibm.com> wrote: > > > > On Fri, 2026-01-16 at 14:18 +0100, Ard Biesheuvel wrote: > > > On Fri, 16 Jan 2026 at 14:11, Mimi Zohar <zohar@linux.ibm.com> wrote: > > > > > > > > On Fri, 2026-01-16 at 10:41 +0100, Ard Biesheuvel wrote: > > > > > On Thu, 15 Jan 2026 at 01:43, Coiby Xu <coxu@redhat.com> wrote: > > > > > > > > > > > > EVM and other LSMs need the ability to query the secure boot status of > > > > > > the system, without directly calling the IMA arch_ima_get_secureboot > > > > > > function. Refactor the secure boot status check into a general, > > > > > > integrity-wide function named arch_integrity_get_secureboot. > > > > > > > > > > > > Define a new Kconfig option CONFIG_INTEGRITY_SECURE_BOOT, which is > > > > > > automatically configured by the supported architectures. The existing > > > > > > IMA_SECURE_AND_OR_TRUSTED_BOOT Kconfig loads the architecture specific > > > > > > IMA policy based on the refactored secure boot status code. > > > > > > > > > > > > Reported-and-suggested-by: Mimi Zohar <zohar@linux.ibm.com> > > > > > > Suggested-by: Roberto Sassu <roberto.sassu@huaweicloud.com> > > > > > > Signed-off-by: Coiby Xu <coxu@redhat.com> > > > > > > --- > > > > > > arch/arm64/Kconfig | 1 + > > > > > > arch/powerpc/Kconfig | 1 + > > > > > > arch/powerpc/kernel/Makefile | 2 +- > > > > > > arch/powerpc/kernel/ima_arch.c | 5 -- > > > > > > arch/powerpc/kernel/integrity_sb_arch.c | 13 +++++ > > > > > > arch/s390/Kconfig | 1 + > > > > > > arch/s390/kernel/Makefile | 1 + > > > > > > arch/s390/kernel/ima_arch.c | 6 -- > > > > > > arch/s390/kernel/integrity_sb_arch.c | 9 +++ > > > > > > arch/x86/Kconfig | 1 + > > > > > > arch/x86/include/asm/efi.h | 4 +- > > > > > > arch/x86/platform/efi/efi.c | 2 +- > > > > > > include/linux/ima.h | 7 +-- > > > > > > include/linux/integrity.h | 8 +++ > > > > > > security/integrity/Kconfig | 6 ++ > > > > > > security/integrity/Makefile | 3 + > > > > > > security/integrity/efi_secureboot.c | 56 +++++++++++++++++++ > > > > > > security/integrity/ima/ima_appraise.c | 2 +- > > > > > > security/integrity/ima/ima_efi.c | 47 +--------------- > > > > > > security/integrity/ima/ima_main.c | 4 +- > > > > > > security/integrity/platform_certs/load_uefi.c | 2 +- > > > > > > 21 files changed, 111 insertions(+), 70 deletions(-) > > > > > > create mode 100644 arch/powerpc/kernel/integrity_sb_arch.c > > > > > > create mode 100644 arch/s390/kernel/integrity_sb_arch.c > > > > > > create mode 100644 security/integrity/efi_secureboot.c > > > > > > > > > > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > > > > > index 93173f0a09c7..4c265b7386bb 100644 > > > > > > --- a/arch/arm64/Kconfig > > > > > > +++ b/arch/arm64/Kconfig > > > > > > @@ -2427,6 +2427,7 @@ config EFI > > > > > > select EFI_STUB > > > > > > select EFI_GENERIC_STUB > > > > > > imply IMA_SECURE_AND_OR_TRUSTED_BOOT > > > > > > + imply INTEGRITY_SECURE_BOOT > > > > > > > > > > This allows both to be en/disabled individually, which I don't think > > > > > is what we want. It also results in more churn across the > > > > > arch-specific Kconfigs than needed. > > > > > > > > > > Wouldn't it be better if IMA_SECURE_AND_OR_TRUSTED_BOOT 'select'ed > > > > > INTEGRITY_SECURE_BOOT in its Kconfig definition? > > > > > > > > As much as possible, EVM (and other LSMs) shouldn't be dependent on another LSM, > > > > in this case IMA, being configured. > > > > > > Sure, but that is not my point. > > > > > > This arrangement allows for IMA_SECURE_AND_OR_TRUSTED_BOOT to be > > > enabled without INTEGRITY_SECURE_BOOT, resulting in the stub > > > implementation of arch_integrity_get_secureboot() being used, which > > > always returns false. > > > > I understand your concern, but instead of "select"ing INTEGRITY_SECURE_BOOT from > > IMA_SECURE_AND_OR_TRUSTED_BOOT, how making IMA_SECURE_AND_OR_TRUSTED_BOOT > > dependent on both IMA_ARCH_POLICY and INTEGRITY_SECURE_BOOT. > > > > Given that INTEGRITY_SECURE_BOOT has no dependencies of its own, > afaict, selecting it is the least disruptive option, as otherwise, > existing configs will disable IMA_SECURE_AND_OR_TRUSTED_BOOT as the > kernel is being upgraded. But conceptually, I agree that they are > equivalent. > > > Including the "imply INTEGRITY_SECURE_BOOT" here in the arch Kconfig allows EVM > > to query the secure boot state without relying on IMA_SECURE_AND_OR_TRUSTED_BOOT > > being configured. > > Yes, I understand that this is the whole point of the exercise. But > 'imply' should be used with care, and in this case, implying both from > CONFIG_EFI really makes little sense. INTEGRITY_SECURE_BOOT should be > selected by options that need the functionality, not 'implied' by > options that might provide it. As not all arch's implement arch_integrity_get_secureboot, the definition in include/linux/integrity.h would need to be updated. Something like: -#ifdef CONFIG_INTEGRITY_SECURE_BOOT +#if (defined(CONFIG_INTEGRITY_SECURE_BOOT) && \ + (defined(CONFIG_X86) && defined(CONFIG_EFI)) || defined(CONFIG_S390) \ + || defined(CONFIG_PPC_SECURE_BOOT)) Then IMA_SECURE_AND_OR_TRUSTED_BOOT and EVM could select INTEGRITY_SECURE_BOOT, as suggested. Mimi ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-01-18 18:25 ` Mimi Zohar @ 2026-01-19 4:04 ` Coiby Xu 2026-01-21 15:40 ` Mimi Zohar 2026-01-19 18:44 ` Dave Hansen 1 sibling, 1 reply; 21+ messages in thread From: Coiby Xu @ 2026-01-19 4:04 UTC (permalink / raw) To: Ard Biesheuvel, Mimi Zohar Cc: linux-integrity, Heiko Carstens, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY On Sun, Jan 18, 2026 at 01:25:52PM -0500, Mimi Zohar wrote: >On Fri, 2026-01-16 at 18:27 +0100, Ard Biesheuvel wrote: Hi Ard and Mimi, Thanks for your discussion on improving the patch! >> On Fri, 16 Jan 2026 at 17:39, Mimi Zohar <zohar@linux.ibm.com> wrote: >> > >> > On Fri, 2026-01-16 at 14:18 +0100, Ard Biesheuvel wrote: >> > > On Fri, 16 Jan 2026 at 14:11, Mimi Zohar <zohar@linux.ibm.com> wrote: >> > > > >> > > > On Fri, 2026-01-16 at 10:41 +0100, Ard Biesheuvel wrote: >> > > > > On Thu, 15 Jan 2026 at 01:43, Coiby Xu <coxu@redhat.com> wrote: >> > > > > > >> > > > > > EVM and other LSMs need the ability to query the secure boot status of >> > > > > > the system, without directly calling the IMA arch_ima_get_secureboot >> > > > > > function. Refactor the secure boot status check into a general, >> > > > > > integrity-wide function named arch_integrity_get_secureboot. >> > > > > > >> > > > > > Define a new Kconfig option CONFIG_INTEGRITY_SECURE_BOOT, which is >> > > > > > automatically configured by the supported architectures. The existing >> > > > > > IMA_SECURE_AND_OR_TRUSTED_BOOT Kconfig loads the architecture specific >> > > > > > IMA policy based on the refactored secure boot status code. >> > > > > > >> > > > > > Reported-and-suggested-by: Mimi Zohar <zohar@linux.ibm.com> >> > > > > > Suggested-by: Roberto Sassu <roberto.sassu@huaweicloud.com> >> > > > > > Signed-off-by: Coiby Xu <coxu@redhat.com> >> > > > > > --- >> > > > > > arch/arm64/Kconfig | 1 + >> > > > > > arch/powerpc/Kconfig | 1 + >> > > > > > arch/powerpc/kernel/Makefile | 2 +- >> > > > > > arch/powerpc/kernel/ima_arch.c | 5 -- >> > > > > > arch/powerpc/kernel/integrity_sb_arch.c | 13 +++++ >> > > > > > arch/s390/Kconfig | 1 + >> > > > > > arch/s390/kernel/Makefile | 1 + >> > > > > > arch/s390/kernel/ima_arch.c | 6 -- >> > > > > > arch/s390/kernel/integrity_sb_arch.c | 9 +++ >> > > > > > arch/x86/Kconfig | 1 + >> > > > > > arch/x86/include/asm/efi.h | 4 +- >> > > > > > arch/x86/platform/efi/efi.c | 2 +- >> > > > > > include/linux/ima.h | 7 +-- >> > > > > > include/linux/integrity.h | 8 +++ >> > > > > > security/integrity/Kconfig | 6 ++ >> > > > > > security/integrity/Makefile | 3 + >> > > > > > security/integrity/efi_secureboot.c | 56 +++++++++++++++++++ >> > > > > > security/integrity/ima/ima_appraise.c | 2 +- >> > > > > > security/integrity/ima/ima_efi.c | 47 +--------------- >> > > > > > security/integrity/ima/ima_main.c | 4 +- >> > > > > > security/integrity/platform_certs/load_uefi.c | 2 +- >> > > > > > 21 files changed, 111 insertions(+), 70 deletions(-) >> > > > > > create mode 100644 arch/powerpc/kernel/integrity_sb_arch.c >> > > > > > create mode 100644 arch/s390/kernel/integrity_sb_arch.c >> > > > > > create mode 100644 security/integrity/efi_secureboot.c >> > > > > > >> > > > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig >> > > > > > index 93173f0a09c7..4c265b7386bb 100644 >> > > > > > --- a/arch/arm64/Kconfig >> > > > > > +++ b/arch/arm64/Kconfig >> > > > > > @@ -2427,6 +2427,7 @@ config EFI >> > > > > > select EFI_STUB >> > > > > > select EFI_GENERIC_STUB >> > > > > > imply IMA_SECURE_AND_OR_TRUSTED_BOOT >> > > > > > + imply INTEGRITY_SECURE_BOOT >> > > > > >> > > > > This allows both to be en/disabled individually, which I don't think >> > > > > is what we want. It also results in more churn across the >> > > > > arch-specific Kconfigs than needed. >> > > > > >> > > > > Wouldn't it be better if IMA_SECURE_AND_OR_TRUSTED_BOOT 'select'ed >> > > > > INTEGRITY_SECURE_BOOT in its Kconfig definition? >> > > > >> > > > As much as possible, EVM (and other LSMs) shouldn't be dependent on another LSM, >> > > > in this case IMA, being configured. >> > > >> > > Sure, but that is not my point. >> > > >> > > This arrangement allows for IMA_SECURE_AND_OR_TRUSTED_BOOT to be >> > > enabled without INTEGRITY_SECURE_BOOT, resulting in the stub >> > > implementation of arch_integrity_get_secureboot() being used, which >> > > always returns false. Since both INTEGRITY_SECURE_BOOT and IMA_SECURE_AND_OR_TRUSTED_BOOT don't define a prompt, they are not user-configurable and will always be enable/disabled together with arch-specific secure boot feature. So despite the "imply" key word, the case where IMA_SECURE_AND_OR_TRUSTED_BOOT is enabled whereas INTEGRITY_SECURE_BOOT is disabled won't happen. But I agree an arch may not care much about INTEGRITY_SECURE_BOOT so it may be a churn. So limiting it to the scope of the integrity subsystem can be a better idea. >> > >> > I understand your concern, but instead of "select"ing INTEGRITY_SECURE_BOOT from >> > IMA_SECURE_AND_OR_TRUSTED_BOOT, how making IMA_SECURE_AND_OR_TRUSTED_BOOT >> > dependent on both IMA_ARCH_POLICY and INTEGRITY_SECURE_BOOT. >> > >> >> Given that INTEGRITY_SECURE_BOOT has no dependencies of its own, >> afaict, selecting it is the least disruptive option, as otherwise, >> existing configs will disable IMA_SECURE_AND_OR_TRUSTED_BOOT as the >> kernel is being upgraded. But conceptually, I agree that they are >> equivalent. As already pointed out on by Mimi, INTEGRITY_SECURE_BOOT depend on arch-specific secure boot feature. So we can't say INTEGRITY_SECURE_BOOT has no dependencies. >> >> > Including the "imply INTEGRITY_SECURE_BOOT" here in the arch Kconfig allows EVM >> > to query the secure boot state without relying on IMA_SECURE_AND_OR_TRUSTED_BOOT >> > being configured. >> >> Yes, I understand that this is the whole point of the exercise. But >> 'imply' should be used with care, and in this case, implying both from >> CONFIG_EFI really makes little sense. INTEGRITY_SECURE_BOOT should be >> selected by options that need the functionality, not 'implied' by >> options that might provide it. But again I agree INTEGRITY_SECURE_BOOT should "not 'implied' by options that might provide it". > >As not all arch's implement arch_integrity_get_secureboot, the definition in >include/linux/integrity.h would need to be updated. Something like: > >-#ifdef CONFIG_INTEGRITY_SECURE_BOOT >+#if (defined(CONFIG_INTEGRITY_SECURE_BOOT) && \ >+ (defined(CONFIG_X86) && defined(CONFIG_EFI)) || defined(CONFIG_S390) \ >+ || defined(CONFIG_PPC_SECURE_BOOT)) > >Then IMA_SECURE_AND_OR_TRUSTED_BOOT and EVM could select INTEGRITY_SECURE_BOOT, >as suggested. Since INTEGRITY_SECURE_BOOT has a dependency, select doesn't seem to be a good choice. If EVM does select INTEGRITY_SECURE_BOOT, INTEGRITY_SECURE_BOOT will be enabled even if arch-specific secure boot feature is disabled and this can lead to a building failure. How about always enabling INTEGRITY_SECURE_BOOT when secure boot feature is enabled and also making IMA_SECURE_AND_OR_TRUSTED_BOOT depend on INTEGRITY_SECURE_BOOT? diff --git a/security/integrity/Kconfig b/security/integrity/Kconfig index 916d4f2bfc44..cd44b46d0325 100644 --- a/security/integrity/Kconfig +++ b/security/integrity/Kconfig @@ -97,6 +97,13 @@ config INTEGRITY_CA_MACHINE_KEYRING_MAX will not be loaded. The remaining MOK keys are loaded into the .platform keyring. +config INTEGRITY_SECURE_BOOT + def_bool y + depends on EFI || PPC_SECURE_BOOT || S390 + help + Provide secure boot related helper functions like querying the + secure boot status. + diff --git a/security/integrity/ima/Kconfig b/security/integrity/ima/Kconfig index 976e75f9b9ba..5dce572192d6 100644 --- a/security/integrity/ima/Kconfig +++ b/security/integrity/ima/Kconfig @@ -311,6 +311,7 @@ config IMA_QUEUE_EARLY_BOOT_KEYS config IMA_SECURE_AND_OR_TRUSTED_BOOT bool depends on IMA_ARCH_POLICY + depends on INTEGRITY_SECURE_BOOT Another idea is make a tree-wide arch_get_secureboot i.e. to move current arch_ima_get_secureboot code to arch-specific secure boot implementation. By this way, there will no need for a new Kconfig option INTEGRITY_SECURE_BOOT. But I'm not sure if there is any unforeseen concern. -- Best regards, Coiby ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-01-19 4:04 ` Coiby Xu @ 2026-01-21 15:40 ` Mimi Zohar 2026-01-21 16:25 ` Ard Biesheuvel 0 siblings, 1 reply; 21+ messages in thread From: Mimi Zohar @ 2026-01-21 15:40 UTC (permalink / raw) To: Coiby Xu, Ard Biesheuvel, Dave Hansen Cc: linux-integrity, Heiko Carstens, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY On Mon, 2026-01-19 at 12:04 +0800, Coiby Xu wrote: > diff --git a/security/integrity/ima/Kconfig b/security/integrity/ima/Kconfig > index 976e75f9b9ba..5dce572192d6 100644 > --- a/security/integrity/ima/Kconfig > +++ b/security/integrity/ima/Kconfig > @@ -311,6 +311,7 @@ config IMA_QUEUE_EARLY_BOOT_KEYS > config IMA_SECURE_AND_OR_TRUSTED_BOOT > bool > depends on IMA_ARCH_POLICY > + depends on INTEGRITY_SECURE_BOOT > > > Another idea is make a tree-wide arch_get_secureboot i.e. to move > current arch_ima_get_secureboot code to arch-specific secure boot > implementation. By this way, there will no need for a new Kconfig option > INTEGRITY_SECURE_BOOT. But I'm not sure if there is any unforeseen > concern. Originally basing IMA policy on the secure boot mode was an exception. As long as making it public isn't an issue any longer, this sounds to me. Ard, Dave, do you have any issues with replacing arch_ima_get_secureboot() with arch_get_secureboot()? ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-01-21 15:40 ` Mimi Zohar @ 2026-01-21 16:25 ` Ard Biesheuvel 2026-01-24 0:18 ` Coiby Xu 2026-02-25 0:03 ` Mimi Zohar 0 siblings, 2 replies; 21+ messages in thread From: Ard Biesheuvel @ 2026-01-21 16:25 UTC (permalink / raw) To: Mimi Zohar Cc: Coiby Xu, Dave Hansen, linux-integrity, Heiko Carstens, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY On Wed, 21 Jan 2026 at 16:41, Mimi Zohar <zohar@linux.ibm.com> wrote: > > On Mon, 2026-01-19 at 12:04 +0800, Coiby Xu wrote: > > > diff --git a/security/integrity/ima/Kconfig b/security/integrity/ima/Kconfig > > index 976e75f9b9ba..5dce572192d6 100644 > > --- a/security/integrity/ima/Kconfig > > +++ b/security/integrity/ima/Kconfig > > @@ -311,6 +311,7 @@ config IMA_QUEUE_EARLY_BOOT_KEYS > > config IMA_SECURE_AND_OR_TRUSTED_BOOT > > bool > > depends on IMA_ARCH_POLICY > > + depends on INTEGRITY_SECURE_BOOT > > > > > > Another idea is make a tree-wide arch_get_secureboot i.e. to move > > current arch_ima_get_secureboot code to arch-specific secure boot > > implementation. By this way, there will no need for a new Kconfig option > > INTEGRITY_SECURE_BOOT. But I'm not sure if there is any unforeseen > > concern. > > Originally basing IMA policy on the secure boot mode was an exception. As long > as making it public isn't an issue any longer, this sounds to me. Ard, Dave, do > you have any issues with replacing arch_ima_get_secureboot() with > arch_get_secureboot()? I don't see an issue with that. If there is a legitimate need to determine this even if IMA is not enabled, then this makes sense. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-01-21 16:25 ` Ard Biesheuvel @ 2026-01-24 0:18 ` Coiby Xu 2026-02-25 0:03 ` Mimi Zohar 1 sibling, 0 replies; 21+ messages in thread From: Coiby Xu @ 2026-01-24 0:18 UTC (permalink / raw) To: Ard Biesheuvel, Mimi Zohar Cc: Dave Hansen, linux-integrity, Heiko Carstens, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY On Wed, Jan 21, 2026 at 05:25:39PM +0100, Ard Biesheuvel wrote: >On Wed, 21 Jan 2026 at 16:41, Mimi Zohar <zohar@linux.ibm.com> wrote: >> >> On Mon, 2026-01-19 at 12:04 +0800, Coiby Xu wrote: >> >> > diff --git a/security/integrity/ima/Kconfig b/security/integrity/ima/Kconfig >> > index 976e75f9b9ba..5dce572192d6 100644 >> > --- a/security/integrity/ima/Kconfig >> > +++ b/security/integrity/ima/Kconfig >> > @@ -311,6 +311,7 @@ config IMA_QUEUE_EARLY_BOOT_KEYS >> > config IMA_SECURE_AND_OR_TRUSTED_BOOT >> > bool >> > depends on IMA_ARCH_POLICY >> > + depends on INTEGRITY_SECURE_BOOT >> > >> > >> > Another idea is make a tree-wide arch_get_secureboot i.e. to move >> > current arch_ima_get_secureboot code to arch-specific secure boot >> > implementation. By this way, there will no need for a new Kconfig option >> > INTEGRITY_SECURE_BOOT. But I'm not sure if there is any unforeseen >> > concern. >> >> Originally basing IMA policy on the secure boot mode was an exception. As long >> as making it public isn't an issue any longer, this sounds to me. Ard, Dave, do >> you have any issues with replacing arch_ima_get_secureboot() with >> arch_get_secureboot()? > >I don't see an issue with that. If there is a legitimate need to >determine this even if IMA is not enabled, then this makes sense. Thanks for the confirmation! Here's the updated patch https://github.com/coiby/linux/commit/c222c1d08d90ef1ec85ef81ece90afc9efde7937.patch If there is no objection, I'll send v2. -- Best regards, Coiby ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-01-21 16:25 ` Ard Biesheuvel 2026-01-24 0:18 ` Coiby Xu @ 2026-02-25 0:03 ` Mimi Zohar 2026-02-26 10:23 ` Ard Biesheuvel 1 sibling, 1 reply; 21+ messages in thread From: Mimi Zohar @ 2026-02-25 0:03 UTC (permalink / raw) To: Ard Biesheuvel Cc: Coiby Xu, Dave Hansen, linux-integrity, Heiko Carstens, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY On Wed, 2026-01-21 at 17:25 +0100, Ard Biesheuvel wrote: > On Wed, 21 Jan 2026 at 16:41, Mimi Zohar <zohar@linux.ibm.com> wrote: > > > > On Mon, 2026-01-19 at 12:04 +0800, Coiby Xu wrote: > > > > > diff --git a/security/integrity/ima/Kconfig b/security/integrity/ima/Kconfig > > > index 976e75f9b9ba..5dce572192d6 100644 > > > --- a/security/integrity/ima/Kconfig > > > +++ b/security/integrity/ima/Kconfig > > > @@ -311,6 +311,7 @@ config IMA_QUEUE_EARLY_BOOT_KEYS > > > config IMA_SECURE_AND_OR_TRUSTED_BOOT > > > bool > > > depends on IMA_ARCH_POLICY > > > + depends on INTEGRITY_SECURE_BOOT > > > > > > > > > Another idea is make a tree-wide arch_get_secureboot i.e. to move > > > current arch_ima_get_secureboot code to arch-specific secure boot > > > implementation. By this way, there will no need for a new Kconfig option > > > INTEGRITY_SECURE_BOOT. But I'm not sure if there is any unforeseen > > > concern. > > > > Originally basing IMA policy on the secure boot mode was an exception. As long > > as making it public isn't an issue any longer, this sounds to me. Ard, Dave, do > > you have any issues with replacing arch_ima_get_secureboot() with > > arch_get_secureboot()? > > I don't see an issue with that. If there is a legitimate need to > determine this even if IMA is not enabled, then this makes sense. Ard, Dave - FYI, Coiby posted v3 of this patch set[1], which is queued in the next- integrity-testing branch[2]. [1] https://lore.kernel.org/linux-integrity/20260213012851.2532722-1-coxu@redhat.com/ [2] https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git/ Mimi ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-02-25 0:03 ` Mimi Zohar @ 2026-02-26 10:23 ` Ard Biesheuvel 0 siblings, 0 replies; 21+ messages in thread From: Ard Biesheuvel @ 2026-02-26 10:23 UTC (permalink / raw) To: Mimi Zohar Cc: Coiby Xu, Dave Hansen, linux-integrity, Heiko Carstens, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H . Peter Anvin, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY On Wed, 25 Feb 2026, at 01:03, Mimi Zohar wrote: > On Wed, 2026-01-21 at 17:25 +0100, Ard Biesheuvel wrote: >> On Wed, 21 Jan 2026 at 16:41, Mimi Zohar <zohar@linux.ibm.com> wrote: >> > >> > On Mon, 2026-01-19 at 12:04 +0800, Coiby Xu wrote: >> > >> > > diff --git a/security/integrity/ima/Kconfig b/security/integrity/ima/Kconfig >> > > index 976e75f9b9ba..5dce572192d6 100644 >> > > --- a/security/integrity/ima/Kconfig >> > > +++ b/security/integrity/ima/Kconfig >> > > @@ -311,6 +311,7 @@ config IMA_QUEUE_EARLY_BOOT_KEYS >> > > config IMA_SECURE_AND_OR_TRUSTED_BOOT >> > > bool >> > > depends on IMA_ARCH_POLICY >> > > + depends on INTEGRITY_SECURE_BOOT >> > > >> > > >> > > Another idea is make a tree-wide arch_get_secureboot i.e. to move >> > > current arch_ima_get_secureboot code to arch-specific secure boot >> > > implementation. By this way, there will no need for a new Kconfig option >> > > INTEGRITY_SECURE_BOOT. But I'm not sure if there is any unforeseen >> > > concern. >> > >> > Originally basing IMA policy on the secure boot mode was an exception. As long >> > as making it public isn't an issue any longer, this sounds to me. Ard, Dave, do >> > you have any issues with replacing arch_ima_get_secureboot() with >> > arch_get_secureboot()? >> >> I don't see an issue with that. If there is a legitimate need to >> determine this even if IMA is not enabled, then this makes sense. > > Ard, Dave - > > FYI, Coiby posted v3 of this patch set[1], which is queued in the next- > integrity-testing branch[2]. > > [1] > https://lore.kernel.org/linux-integrity/20260213012851.2532722-1-coxu@redhat.com/ > > [2] https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git/ > Ack. Looks fine to me. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-01-18 18:25 ` Mimi Zohar 2026-01-19 4:04 ` Coiby Xu @ 2026-01-19 18:44 ` Dave Hansen 2026-01-21 15:29 ` Mimi Zohar 1 sibling, 1 reply; 21+ messages in thread From: Dave Hansen @ 2026-01-19 18:44 UTC (permalink / raw) To: Mimi Zohar, Ard Biesheuvel Cc: Coiby Xu, linux-integrity, Heiko Carstens, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY On 1/18/26 10:25, Mimi Zohar wrote: > As not all arch's implement arch_integrity_get_secureboot, the definition in > include/linux/integrity.h would need to be updated. Something like: > > -#ifdef CONFIG_INTEGRITY_SECURE_BOOT > +#if (defined(CONFIG_INTEGRITY_SECURE_BOOT) && \ > + (defined(CONFIG_X86) && defined(CONFIG_EFI)) || defined(CONFIG_S390) \ > + || defined(CONFIG_PPC_SECURE_BOOT)) > > Then IMA_SECURE_AND_OR_TRUSTED_BOOT and EVM could select INTEGRITY_SECURE_BOOT, > as suggested. This seems to be going a wee bit sideways. :) This kind of CONFIG complexity really should be left to Kconfig. C macros really aren't a great place to do it. The other idiom we use a lot is this in generic code: #ifndef arch_foo static inline void arch_foo(void) {} #endif Then all you have to do is make sure the arch header that #defines it is included before the generic code. I'm not a super huge fan of these because it can be hard to tell (for humans at least) _if_ the architecture has done the #define. But it sure beats that #ifdef maze. ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide 2026-01-19 18:44 ` Dave Hansen @ 2026-01-21 15:29 ` Mimi Zohar 0 siblings, 0 replies; 21+ messages in thread From: Mimi Zohar @ 2026-01-21 15:29 UTC (permalink / raw) To: Dave Hansen, Ard Biesheuvel Cc: Coiby Xu, linux-integrity, Heiko Carstens, Roberto Sassu, Catalin Marinas, Will Deacon, Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP), Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, Jarkko Sakkinen, moderated list:ARM64 PORT (AARCH64 ARCHITECTURE), open list, open list:LINUX FOR POWERPC (32-BIT AND 64-BIT), open list:S390 ARCHITECTURE, open list:EXTENSIBLE FIRMWARE INTERFACE (EFI), open list:SECURITY SUBSYSTEM, open list:KEYS/KEYRINGS_INTEGRITY Hi Dave! On Mon, 2026-01-19 at 10:44 -0800, Dave Hansen wrote: > On 1/18/26 10:25, Mimi Zohar wrote: > > As not all arch's implement arch_integrity_get_secureboot, the definition in > > include/linux/integrity.h would need to be updated. Something like: > > > > -#ifdef CONFIG_INTEGRITY_SECURE_BOOT > > +#if (defined(CONFIG_INTEGRITY_SECURE_BOOT) && \ > > + (defined(CONFIG_X86) && defined(CONFIG_EFI)) || defined(CONFIG_S390) \ > > + || defined(CONFIG_PPC_SECURE_BOOT)) > > > > Then IMA_SECURE_AND_OR_TRUSTED_BOOT and EVM could select INTEGRITY_SECURE_BOOT, > > as suggested. > > This seems to be going a wee bit sideways. :) Agreed, that was my point. :) "imply" was cleaner, but Ard objected to two imply's. > > This kind of CONFIG complexity really should be left to Kconfig. C > macros really aren't a great place to do it. > > The other idiom we use a lot is this in generic code: > > #ifndef arch_foo > static inline void arch_foo(void) {} > #endif > > Then all you have to do is make sure the arch header that #defines it is > included before the generic code. I'm not a super huge fan of these > because it can be hard to tell (for humans at least) _if_ the > architecture has done the #define. > > But it sure beats that #ifdef maze. Sure. ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 2/3] evm: Don't enable fix mode when secure boot is enabled [not found] <20260115004328.194142-1-coxu@redhat.com> 2026-01-15 0:43 ` [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide Coiby Xu @ 2026-01-15 0:43 ` Coiby Xu 2026-01-15 18:15 ` Mimi Zohar 2026-01-15 0:43 ` [PATCH 3/3] s390: Drop unnecessary CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT Coiby Xu 2 siblings, 1 reply; 21+ messages in thread From: Coiby Xu @ 2026-01-15 0:43 UTC (permalink / raw) To: linux-integrity Cc: Heiko Carstens, Mimi Zohar, Roberto Sassu, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, open list:SECURITY SUBSYSTEM, open list Similar to IMA fix mode, forbid EVM fix mode when secure boot is enabled. Reported-and-suggested-by: Mimi Zohar <zohar@linux.ibm.com> Suggested-by: Roberto Sassu <roberto.sassu@huaweicloud.com> Signed-off-by: Coiby Xu <coxu@redhat.com> --- security/integrity/evm/evm_main.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c index 73d500a375cb..00bba266231d 100644 --- a/security/integrity/evm/evm_main.c +++ b/security/integrity/evm/evm_main.c @@ -72,17 +72,25 @@ static struct xattr_list evm_config_default_xattrnames[] = { LIST_HEAD(evm_config_xattrnames); +static char *evm_cmdline __initdata; +core_param(evm, evm_cmdline, charp, 0); + static int evm_fixmode __ro_after_init; -static int __init evm_set_fixmode(char *str) +static void __init evm_set_fixmode(void) { - if (strncmp(str, "fix", 3) == 0) - evm_fixmode = 1; - else - pr_err("invalid \"%s\" mode", str); + if (!evm_cmdline) + return; - return 1; + if (strncmp(evm_cmdline, "fix", 3) == 0) { + if (arch_integrity_get_secureboot()) { + pr_info("Secure boot enabled: ignoring evm=fix"); + return; + } + evm_fixmode = 1; + } else { + pr_err("invalid \"%s\" mode", evm_cmdline); + } } -__setup("evm=", evm_set_fixmode); static void __init evm_init_config(void) { @@ -1119,6 +1127,8 @@ static int __init init_evm(void) evm_init_config(); + evm_set_fixmode(); + error = integrity_init_keyring(INTEGRITY_KEYRING_EVM); if (error) goto error; -- 2.52.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH 2/3] evm: Don't enable fix mode when secure boot is enabled 2026-01-15 0:43 ` [PATCH 2/3] evm: Don't enable fix mode when secure boot is enabled Coiby Xu @ 2026-01-15 18:15 ` Mimi Zohar 2026-01-16 12:06 ` Roberto Sassu 0 siblings, 1 reply; 21+ messages in thread From: Mimi Zohar @ 2026-01-15 18:15 UTC (permalink / raw) To: Coiby Xu, linux-integrity Cc: Heiko Carstens, Roberto Sassu, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, open list:SECURITY SUBSYSTEM, open list On Thu, 2026-01-15 at 08:43 +0800, Coiby Xu wrote: > Similar to IMA fix mode, forbid EVM fix mode when secure boot is > enabled. > > Reported-and-suggested-by: Mimi Zohar <zohar@linux.ibm.com> > Suggested-by: Roberto Sassu <roberto.sassu@huaweicloud.com> > Signed-off-by: Coiby Xu <coxu@redhat.com> Thanks, Coiby! Reviewed-by: Mimi Zohar <zohar@linux.ibm.com> ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 2/3] evm: Don't enable fix mode when secure boot is enabled 2026-01-15 18:15 ` Mimi Zohar @ 2026-01-16 12:06 ` Roberto Sassu 2026-01-19 4:10 ` Coiby Xu 0 siblings, 1 reply; 21+ messages in thread From: Roberto Sassu @ 2026-01-16 12:06 UTC (permalink / raw) To: Mimi Zohar, Coiby Xu, linux-integrity Cc: Heiko Carstens, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, open list:SECURITY SUBSYSTEM, open list On Thu, 2026-01-15 at 13:15 -0500, Mimi Zohar wrote: > On Thu, 2026-01-15 at 08:43 +0800, Coiby Xu wrote: > > Similar to IMA fix mode, forbid EVM fix mode when secure boot is > > enabled. > > > > Reported-and-suggested-by: Mimi Zohar <zohar@linux.ibm.com> > > Suggested-by: Roberto Sassu <roberto.sassu@huaweicloud.com> Ah, if possible, could you please change the email to roberto.sassu@huawei.com? Thanks Roberto > > Signed-off-by: Coiby Xu <coxu@redhat.com> > > Thanks, Coiby! > > Reviewed-by: Mimi Zohar <zohar@linux.ibm.com> ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 2/3] evm: Don't enable fix mode when secure boot is enabled 2026-01-16 12:06 ` Roberto Sassu @ 2026-01-19 4:10 ` Coiby Xu 0 siblings, 0 replies; 21+ messages in thread From: Coiby Xu @ 2026-01-19 4:10 UTC (permalink / raw) To: Roberto Sassu Cc: Mimi Zohar, linux-integrity, Heiko Carstens, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Paul Moore, James Morris, Serge E. Hallyn, open list:SECURITY SUBSYSTEM, open list On Fri, Jan 16, 2026 at 01:06:32PM +0100, Roberto Sassu wrote: >On Thu, 2026-01-15 at 13:15 -0500, Mimi Zohar wrote: >> On Thu, 2026-01-15 at 08:43 +0800, Coiby Xu wrote: >> > Similar to IMA fix mode, forbid EVM fix mode when secure boot is >> > enabled. >> > >> > Reported-and-suggested-by: Mimi Zohar <zohar@linux.ibm.com> >> > Suggested-by: Roberto Sassu <roberto.sassu@huaweicloud.com> > >Ah, if possible, could you please change the email to >roberto.sassu@huawei.com? Thanks for the reminder! I'll use the above email. -- Best regards, Coiby ^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 3/3] s390: Drop unnecessary CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT [not found] <20260115004328.194142-1-coxu@redhat.com> 2026-01-15 0:43 ` [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide Coiby Xu 2026-01-15 0:43 ` [PATCH 2/3] evm: Don't enable fix mode when secure boot is enabled Coiby Xu @ 2026-01-15 0:43 ` Coiby Xu 2 siblings, 0 replies; 21+ messages in thread From: Coiby Xu @ 2026-01-15 0:43 UTC (permalink / raw) To: linux-integrity Cc: Heiko Carstens, Vasily Gorbik, Alexander Gordeev, Christian Borntraeger, Sven Schnelle, open list:S390 ARCHITECTURE, open list Commit b5ca117365d9 ("ima: prevent kexec_load syscall based on runtime secureboot flag") and commit 268a78404973 ("s390/kexec_file: Disable kexec_load when IPLed secure") disabled the kexec_load syscall based on the secureboot mode. Commit 9e2b4be377f0 ("ima: add a new CONFIG for loading arch-specific policies") needed to detect the secure boot mode, not to load an IMA architecture specific policy. Since there is the new CONFIG_INTEGRITY_SECURE_BOOT, drop CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT for s390. Signed-off-by: Coiby Xu <coxu@redhat.com> --- arch/s390/Kconfig | 1 - arch/s390/kernel/Makefile | 1 - arch/s390/kernel/ima_arch.c | 8 -------- 3 files changed, 10 deletions(-) delete mode 100644 arch/s390/kernel/ima_arch.c diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index db0383b19493..1095536c84a3 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -77,7 +77,6 @@ config S390 # # Note: keep this list sorted alphabetically # - imply IMA_SECURE_AND_OR_TRUSTED_BOOT imply INTEGRITY_SECURE_BOOT select ALTERNATE_USER_ADDRESS_SPACE select ARCH_32BIT_USTAT_F_TINODE diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile index ee976a27e677..00a74dd15d16 100644 --- a/arch/s390/kernel/Makefile +++ b/arch/s390/kernel/Makefile @@ -71,7 +71,6 @@ obj-$(CONFIG_STACKPROTECTOR) += stackprotector.o obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file.o kexec_image.o obj-$(CONFIG_KEXEC_FILE) += kexec_elf.o obj-$(CONFIG_CERT_STORE) += cert_store.o -obj-$(CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT) += ima_arch.o obj-$(CONFIG_INTEGRITY_SECURE_BOOT) += integrity_sb_arch.o obj-$(CONFIG_PERF_EVENTS) += perf_event.o diff --git a/arch/s390/kernel/ima_arch.c b/arch/s390/kernel/ima_arch.c deleted file mode 100644 index 6ccbe34ce408..000000000000 --- a/arch/s390/kernel/ima_arch.c +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include <linux/ima.h> - -const char * const *arch_get_ima_policy(void) -{ - return NULL; -} -- 2.52.0 ^ permalink raw reply related [flat|nested] 21+ messages in thread
end of thread, other threads:[~2026-02-26 10:24 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260115004328.194142-1-coxu@redhat.com>
2026-01-15 0:43 ` [PATCH 1/3] integrity: Make arch_ima_get_secureboot integrity-wide Coiby Xu
2026-01-15 18:14 ` Mimi Zohar
2026-01-16 9:41 ` Ard Biesheuvel
2026-01-16 13:11 ` Mimi Zohar
2026-01-16 13:18 ` Ard Biesheuvel
2026-01-16 16:38 ` Mimi Zohar
2026-01-16 17:27 ` Ard Biesheuvel
2026-01-18 18:25 ` Mimi Zohar
2026-01-19 4:04 ` Coiby Xu
2026-01-21 15:40 ` Mimi Zohar
2026-01-21 16:25 ` Ard Biesheuvel
2026-01-24 0:18 ` Coiby Xu
2026-02-25 0:03 ` Mimi Zohar
2026-02-26 10:23 ` Ard Biesheuvel
2026-01-19 18:44 ` Dave Hansen
2026-01-21 15:29 ` Mimi Zohar
2026-01-15 0:43 ` [PATCH 2/3] evm: Don't enable fix mode when secure boot is enabled Coiby Xu
2026-01-15 18:15 ` Mimi Zohar
2026-01-16 12:06 ` Roberto Sassu
2026-01-19 4:10 ` Coiby Xu
2026-01-15 0:43 ` [PATCH 3/3] s390: Drop unnecessary CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT Coiby Xu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox