]> git.hungrycats.org Git - linux/commit
integrity: Eliminate weak definition of arch_get_secureboot()
authorNathan Chancellor <nathan@kernel.org>
Mon, 9 Mar 2026 20:37:02 +0000 (13:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Sep 2026 11:36:18 +0000 (13:36 +0200)
commit0268313b5de3ece197efc155840eb43dbed018a7
treef25abb0c75bdf78d1582fad1e002e3b1a26dd60b
parent60aee9cbb82e0bff4407c1f5a702164dfdd13c9d
integrity: Eliminate weak definition of arch_get_secureboot()

[ Upstream commit 7caedbb5ade345df0eec0bf01035c780919a9f56 ]

security/integrity/secure_boot.c contains a single __weak function,
which breaks recordmcount when building with clang:

  $ make -skj"$(nproc)" ARCH=powerpc LLVM=1 ppc64_defconfig security/integrity/secure_boot.o
  Cannot find symbol for section 2: .text.
  security/integrity/secure_boot.o: failed

Introduce a Kconfig symbol, CONFIG_HAVE_ARCH_GET_SECUREBOOT, to indicate
that an architecture provides a definition of arch_get_secureboot().
Provide a static inline stub when this symbol is not defined to achieve
the same effect as the __weak function, allowing secure_boot.c to be
removed altogether. Move the s390 definition of arch_get_secureboot()
out of the CONFIG_KEXEC_FILE block to ensure it is always available, as
it does not actually depend on KEXEC_FILE.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 31a6a07eefeb ("integrity: Make arch_ima_get_secureboot integrity-wide")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/Kconfig
arch/powerpc/Kconfig
arch/s390/Kconfig
arch/s390/kernel/ipl.c
include/linux/secure_boot.h
security/integrity/Makefile
security/integrity/secure_boot.c [deleted file]