Re: [PATCH 10/11] x86/purgatory: Compile purgatory.c with -D__NO_FORTIFY

From: Thomas Huth

Date: Wed Sep 16 2026 - 06:53:32 EST


On 16/09/2026 04.27, Borislav Petkov wrote:
On Tue, Aug 18, 2026 at 10:53:53AM +0200, Thomas Huth wrote:
@@ -37,6 +37,7 @@ PURGATORY_CFLAGS := -mcmodel=small -ffreestanding
-fno-zero-initialized-in-bss -
PURGATORY_CFLAGS += -fpic -fvisibility=hidden
PURGATORY_CFLAGS += $(DISABLE_KSTACK_ERASE) -DDISABLE_BRANCH_PROFILING
PURGATORY_CFLAGS += -fno-stack-protector
+PURGATORY_CFLAGS += -D__NO_FORTIFY

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

WDYT?

I guess... I probably don't care too much about string checks in the
purgatory thing...

But please explain in more detail in the commit message what "compilation
problems" are avoided by disabling those additional string checks.
Thanks, I've updated the patch now accordingly in v4:

https://lore.kernel.org/all/20260916095022.604354-11-thuth@xxxxxxxxxx/

Thomas