Skip to content

Commit ca14c99

Browse files
nivedita76Ingo Molnar
authored andcommitted
x86/purgatory: Disable the stackleak GCC plugin for the purgatory
Since commit: b059f80 ("x86/purgatory: Use CFLAGS_REMOVE rather than reset KBUILD_CFLAGS") kexec breaks if GCC_PLUGIN_STACKLEAK=y is enabled, as the purgatory contains undefined references to stackleak_track_stack. Attempting to load a kexec kernel results in this failure: kexec: Undefined symbol: stackleak_track_stack kexec-bzImage64: Loading purgatory failed Fix this by disabling the stackleak plugin for the purgatory. Signed-off-by: Arvind Sankar <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Fixes: b059f80 ("x86/purgatory: Use CFLAGS_REMOVE rather than reset KBUILD_CFLAGS") Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 7f2444d commit ca14c99

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/x86/purgatory/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ KCOV_INSTRUMENT := n
2323

2424
PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel
2525
PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss
26+
PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN)
2627

2728
# Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That
2829
# in turn leaves some undefined symbols like __fentry__ in purgatory and not

0 commit comments

Comments
 (0)