linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: stacktrace: include asm/sections.h in asm/stacktrace.h
@ 2025-08-07  7:18 Arnd Bergmann
  2025-08-18 15:27 ` Linus Walleij
  2025-08-25 13:19 ` Kees Cook
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2025-08-07  7:18 UTC (permalink / raw)
  To: Russell King, Li Huafei, Russell King (Oracle), Linus Waleij
  Cc: Arnd Bergmann, Kees Cook, linux-arm-kernel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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 <kees@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/include/asm/stacktrace.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/stacktrace.h b/arch/arm/include/asm/stacktrace.h
index f80a85b091d6..ba2f771cca23 100644
--- a/arch/arm/include/asm/stacktrace.h
+++ b/arch/arm/include/asm/stacktrace.h
@@ -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 {
 	/*
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: stacktrace: include asm/sections.h in asm/stacktrace.h
  2025-08-07  7:18 [PATCH] ARM: stacktrace: include asm/sections.h in asm/stacktrace.h Arnd Bergmann
@ 2025-08-18 15:27 ` Linus Walleij
  2025-08-25 13:19 ` Kees Cook
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2025-08-18 15:27 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Russell King, Li Huafei, Russell King (Oracle), Arnd Bergmann,
	Kees Cook, linux-arm-kernel, linux-kernel

On Thu, Aug 7, 2025 at 9:19 AM Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
>
> 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 <kees@kernel.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Looks like the correct fix to me:

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: stacktrace: include asm/sections.h in asm/stacktrace.h
  2025-08-07  7:18 [PATCH] ARM: stacktrace: include asm/sections.h in asm/stacktrace.h Arnd Bergmann
  2025-08-18 15:27 ` Linus Walleij
@ 2025-08-25 13:19 ` Kees Cook
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2025-08-25 13:19 UTC (permalink / raw)
  To: Russell King, Li Huafei, Russell King (Oracle), Linus Waleij,
	Arnd Bergmann
  Cc: Kees Cook, Arnd Bergmann, linux-arm-kernel, linux-kernel

On Thu, 07 Aug 2025 09:18:58 +0200, Arnd Bergmann wrote:
> 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,

-- 
Kees Cook


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-25 13:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-07  7:18 [PATCH] ARM: stacktrace: include asm/sections.h in asm/stacktrace.h Arnd Bergmann
2025-08-18 15:27 ` Linus Walleij
2025-08-25 13:19 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).