Commit c0d80ddab899 ("kernel/extable.c: mark core_kernel_text notrace")
made core_kernel_text() notrace, because the MIPS function graph tracer
calls it and tracing it recursed without bound. core_kernel_text()
calls is_kernel_text() and is_kernel_inittext(), and is_kernel_text()
calls __is_kernel_text(). These are plain inline functions, so an
out-of-line copy of any of them is untraced only because inline implies
notrace.

Mark them notrace explicitly. No functional change.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <[email protected]>
---
 include/asm-generic/sections.h | 4 ++--
 include/linux/kallsyms.h       | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 0755bc39b0d8..d478ddc02316 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -193,7 +193,7 @@ static inline bool is_kernel_ro_after_init(unsigned long 
addr)
  *
  * Returns: true if the address is located in .init.text, false otherwise.
  */
-static inline bool is_kernel_inittext(unsigned long addr)
+static inline bool notrace is_kernel_inittext(unsigned long addr)
 {
        return addr >= (unsigned long)_sinittext &&
               addr < (unsigned long)_einittext;
@@ -208,7 +208,7 @@ static inline bool is_kernel_inittext(unsigned long addr)
  * Returns: true if the address is located in .text, false otherwise.
  * Note: an internal helper, only check the range of _stext to _etext.
  */
-static inline bool __is_kernel_text(unsigned long addr)
+static inline bool notrace __is_kernel_text(unsigned long addr)
 {
        return addr >= (unsigned long)_stext &&
               addr < (unsigned long)_etext;
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index d5dd54c53ace..93c830b35aeb 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -24,7 +24,7 @@
 struct cred;
 struct module;
 
-static inline int is_kernel_text(unsigned long addr)
+static inline int notrace is_kernel_text(unsigned long addr)
 {
        if (__is_kernel_text(addr))
                return 1;
-- 
2.53.0-Meta


Reply via email to