Skip to contentSkip to conversation

ARM: stacktrace: include asm/sections.h in asm/stacktrace.h

PATCH Applied Arnd Bergmann 3 participants 3 messages Aug 7, 2025 – Aug 25, 2025 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: stacktrace: include asm/sections.h in asm/stacktrace.h

From: Arnd Bergmann <[email protected]>

The recent kstack erase changes appear to have uncovered an existing issue with a missing header inclusion:

In file included from drivers/misc/lkdtm/kstack_erase.c:12:
In file included from include/linux/kstack_erase.h:16:
arch/arm/include/asm/stacktrace.h:48:21: error: call to undeclared function 'in_entry_text'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
48 | frame->ex_frame = in_entry_text(frame->pc);
| ^

Include asm/sections.h here so the compiler can see the in_entry_text() declaration.

Fixes 752ec621ef5c ("ARM: 9234/1: stacktrace: Avoid duplicate saving of exception PC value")
Cc Kees Cook <[email protected]>
---
 arch/arm/include/asm/stacktrace.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/include/asm/stacktrace.h +2 -1
index f80a85b091d6..ba2f771cca23 100644
@@ -2,8 +2,9 @@
 #ifndef __ASM_STACKTRACE_H
 #define __ASM_STACKTRACE_H
 
-#include <asm/ptrace.h>
 #include <linux/llist.h>
+#include <asm/ptrace.h>
+#include <asm/sections.h>
 
 struct stackframe {
 	/*
Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The recent kstack erase changes appear to have uncovered an existing issue with a missing header inclusion:

In file included from drivers/misc/lkdtm/kstack_erase.c:12:
In file included from include/linux/kstack_erase.h:16:
arch/arm/include/asm/stacktrace.h:48:21: error: call to undeclared function 'in_entry_text'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
48 | frame->ex_frame = in_entry_text(frame->pc);
| ^

Quoted 6 lines

Include asm/sections.h here so the compiler can see the in_entry_text() declaration.

Fixes 752ec621ef5c ("ARM: 9234/1: stacktrace: Avoid duplicate saving of exception PC value")
Cc Kees Cook <[email protected]>

Looks like the correct fix to me:

Yours,
Linus Walleij

Applied
#2 lore raw
In reply to Arnd Bergmann
Quoted 10 lines · Arnd Bergmann

The recent kstack erase changes appear to have uncovered an existing issue with a missing header inclusion:

In file included from drivers/misc/lkdtm/kstack_erase.c:12:
In file included from include/linux/kstack_erase.h:16:
arch/arm/include/asm/stacktrace.h:48:21: error: call to undeclared function 'in_entry_text'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
48 | frame->ex_frame = in_entry_text(frame->pc);
| ^

[...]

Applied to for-linus/hardening, thanks!

[1/1] ARM: stacktrace: include asm/sections.h in asm/stacktrace.h

      https://git.kernel.org/kees/c/f05995cc6d3b

Take care,

Signature · 1 line
Kees Cook