Patch "ACPI: APEI: GHES: Disable KASAN instrumentation when compile testing with clang < 18" has been added to the 6.12-stable tree
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 55 lines · Sasha Levin
This is a note to let you know that I've just added the patch titled
ACPI: APEI: GHES: Disable KASAN instrumentation when compile testing with clang < 18
to the 6.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryThe filename of the patch is:
acpi-apei-ghes-disable-kasan-instrumentation-when-co.patch
and it can be found in the queue-6.12 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
commit
ccd3cab8095d5c53eaf8a6598ff339ffaad6a696Author: Nathan Chancellor <[email protected]> Date: Wed Jan 14 16:27:11 2026 -0700ACPI: APEI: GHES: Disable KASAN instrumentation when compile testing with clang < 18
[ Upstream commit
b584bfbd7ec417f257f651cc00a90c66e31dfbf1]After a recent innocuous change to
drivers/acpi/apei/ghes.c, building ARCH=arm64 allmodconfig with clang-17 or older (which has bothCONFIG_KASAN=yandCONFIG_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.
Signed-off-by Nathan Chancellor <[email protected]>Cc All applicable <[email protected]>Link https://patch.msgid.link/20260114-ghes-avoid-wflt-clang-older-than-18-v1-1-9c8248bfe4f4@kernel.org open hereSigned-off-by Rafael J. Wysocki <[email protected]>Signed-off-by Sasha Levin <[email protected]>drivers/acpi/apei/Makefile +0
-0
drivers/acpi/apei/Makefile line 10
Quoted 10 lines
drivers/acpi/apei/Makefile +4
-0@@ -1,6 +1,10 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_ACPI_APEI) += apei.o obj-$(CONFIG_ACPI_APEI_GHES) += ghes.o +# clang versions prior to 18 may blow out the stack with KASAN +ifeq ($(CONFIG_COMPILE_TEST)_$(CONFIG_CC_IS_CLANG)_$(call clang-min-version, 180000),y_y_) +KASAN_SANITIZE_ghes.o := n +endif obj-$(CONFIG_ACPI_APEI_PCIEAER) += ghes_helpers.o obj-$(CONFIG_ACPI_APEI_EINJ) += einj.o einj-y := einj-core.o
The backports you have taken to make this apply cleanly to 6.12
[email protected]
[email protected]
[email protected]
[email protected]
are excessive in my opinion. I think you should just address the conflict... There is absolutely no dependency on those changes so "Stable-dep-of" is a bit misleading.
drivers/acpi/apei/Makefile +4 -0
@@ -1,6 +1,10 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_ACPI_APEI) += apei.o obj-$(CONFIG_ACPI_APEI_GHES) += ghes.o +# clang versions prior to 18 may blow out the stack with KASAN +ifeq ($(CONFIG_COMPILE_TEST)_$(CONFIG_CC_IS_CLANG)_$(call clang-min-version, 180000),y_y_) +KASAN_SANITIZE_ghes.o := n +endif obj-$(CONFIG_ACPI_APEI_EINJ) += einj.o einj-y := einj-core.o einj-$(CONFIG_ACPI_APEI_EINJ_CXL) += einj-cxl.o
Sasha Levin
maintainerQuoted 69 lines · Nathan Chancellor
Quoted 55 lines · Sasha Levin
This is a note to let you know that I've just added the patch titled
ACPI: APEI: GHES: Disable KASAN instrumentation when compile testing with clang < 18
to the 6.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryThe filename of the patch is:
acpi-apei-ghes-disable-kasan-instrumentation-when-co.patch
and it can be found in the queue-6.12 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
commit
ccd3cab8095d5c53eaf8a6598ff339ffaad6a696Author: Nathan Chancellor <[email protected]> Date: Wed Jan 14 16:27:11 2026 -0700ACPI: APEI: GHES: Disable KASAN instrumentation when compile testing with clang < 18
[ Upstream commit
b584bfbd7ec417f257f651cc00a90c66e31dfbf1]After a recent innocuous change to
drivers/acpi/apei/ghes.c, building ARCH=arm64 allmodconfig with clang-17 or older (which has bothCONFIG_KASAN=yandCONFIG_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.
Signed-off-by Nathan Chancellor <[email protected]>Cc All applicable <[email protected]>Link https://patch.msgid.link/20260114-ghes-avoid-wflt-clang-older-than-18-v1-1-9c8248bfe4f4@kernel.org open hereSigned-off-by Rafael J. Wysocki <[email protected]>Signed-off-by Sasha Levin <[email protected]>drivers/acpi/apei/Makefile +0
-0drivers/acpi/apei/Makefile line 10
Quoted 10 lines
drivers/acpi/apei/Makefile +4
-0@@ -1,6 +1,10 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_ACPI_APEI) += apei.o obj-$(CONFIG_ACPI_APEI_GHES) += ghes.o +# clang versions prior to 18 may blow out the stack with KASAN +ifeq ($(CONFIG_COMPILE_TEST)_$(CONFIG_CC_IS_CLANG)_$(call clang-min-version, 180000),y_y_) +KASAN_SANITIZE_ghes.o := n +endif obj-$(CONFIG_ACPI_APEI_PCIEAER) += ghes_helpers.o obj-$(CONFIG_ACPI_APEI_EINJ) += einj.o einj-y := einj-core.oThe backports you have taken to make this apply cleanly to 6.12
Quoted 8 lines
[email protected]
[email protected]
[email protected]
[email protected]are excessive in my opinion. I think you should just address the conflict... There is absolutely no dependency on those changes so "Stable-dep-of" is a bit misleading.
ack
Signature · 2 lines
Thanks, Sasha