Skip to content

Commit b584bfb

Browse files
nathanchancerafaeljw
authored andcommitted
ACPI: APEI: GHES: Disable KASAN instrumentation when compile testing with clang < 18
After a recent innocuous change to drivers/acpi/apei/ghes.c, building ARCH=arm64 allmodconfig with clang-17 or older (which has both CONFIG_KASAN=y and CONFIG_WERROR=y) fails with: drivers/acpi/apei/ghes.c:902:13: error: stack frame size (2768) exceeds limit (2048) in 'ghes_do_proc' [-Werror,-Wframe-larger-than] 902 | static void ghes_do_proc(struct ghes *ghes, | ^ A KASAN pass that removes unneeded stack instrumentation, enabled by default in clang-18 [1], drastically improves stack usage in this case. To avoid the warning in the common allmodconfig case when it can break the build, disable KASAN for ghes.o when compile testing with clang-17 and older. Disabling KASAN outright may hide legitimate runtime issues, so live with the warning in that case; the user can either increase the frame warning limit or disable -Werror, which they should probably do when debugging with KASAN anyways. Closes: ClangBuiltLinux#2148 Link: llvm/llvm-project@51fbab1 [1] Signed-off-by: Nathan Chancellor <nathan@kernel.org> Cc: All applicable <stable@vger.kernel.org> Link: https://patch.msgid.link/20260114-ghes-avoid-wflt-clang-older-than-18-v1-1-9c8248bfe4f4@kernel.org Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 95350ef commit b584bfb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/acpi/apei/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# SPDX-License-Identifier: GPL-2.0
22
obj-$(CONFIG_ACPI_APEI) += apei.o
33
obj-$(CONFIG_ACPI_APEI_GHES) += ghes.o
4+
# clang versions prior to 18 may blow out the stack with KASAN
5+
ifeq ($(CONFIG_COMPILE_TEST)_$(CONFIG_CC_IS_CLANG)_$(call clang-min-version, 180000),y_y_)
6+
KASAN_SANITIZE_ghes.o := n
7+
endif
48
obj-$(CONFIG_ACPI_APEI_PCIEAER) += ghes_helpers.o
59
obj-$(CONFIG_ACPI_APEI_EINJ) += einj.o
610
einj-y := einj-core.o

0 commit comments

Comments
 (0)