lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250206093853.4e55405ccfcba7111705f395@kernel.org>
Date: Thu, 6 Feb 2025 09:38:53 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Haiyue Wang <haiyuewa@....com>
Cc: x86@...nel.org, linux-trace-kernel@...r.kernel.org,
 samitolvanen@...gle.com, Steven Rostedt <rostedt@...dmis.org>, Masami
 Hiramatsu <mhiramat@...nel.org>, Mark Rutland <mark.rutland@....com>,
 Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
 Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
 "H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org (open
 list:FUNCTION HOOKS (FTRACE))
Subject: Re: [PATCH v1] ftrace: Fix compile error when CONFIG_GENDWARFKSYMS
 is enabled

On Thu,  6 Feb 2025 02:00:42 +0800
Haiyue Wang <haiyuewa@....com> wrote:

> When switching from CONFIG_GENKSYMS to CONFIG_GENDWARFKSYMS enabled, the
> build is failed:
> 
>   AS      arch/x86/entry/entry.o
> In file included from ./arch/x86/include/asm/asm-prototypes.h:2,
>                  from <stdin>:3:
> ./arch/x86/include/asm/ftrace.h: In function ‘arch_ftrace_get_symaddr’:
> ./arch/x86/include/asm/ftrace.h:46:21: error: implicit declaration of function ‘get_kernel_nofault’ [-Werror=implicit-function-declaration]
>    46 |                 if (get_kernel_nofault(instr, (u32 *)(fentry_ip - ENDBR_INSN_SIZE)))
>       |                     ^~~~~~~~~~~~~~~~~~
> cc1: some warnings being treated as errors
> 
> File "asm-prototypes.h" is added to entry.S by 'scripts/Makefile.build',
> adding the missed declaration header file can also fix the error:
> 
>  getasmexports =                                                        \
>     { echo "\#include <linux/kernel.h>" ;                               \
>       echo "\#include <linux/string.h>" ;                               \
> +     echo "\#include <linux/uaccess.h>";                               \
>       echo "\#include <asm/asm-prototypes.h>" ;                         \
>       $(call getexportsymbols,EXPORT_SYMBOL(\1);) ; }
> 
> Fixes: 2bc56fdae1ba ("ftrace: Add ftrace_get_symaddr to convert fentry_ip to symaddr")

Thanks for the fix. And this fixes one of problems.
Another one is that `is_endbr()` is defined in <asm/ibt.h> but that also depend
on CONFIG_HAVE_FENTRY.

Let's pick this and fix above issue.

Acked-by: Masami Hiramatsu (Google) <mhiramat@...nel.org>

Thank you,

> 
> Signed-off-by: Haiyue Wang <haiyuewa@....com>
> ---
>  arch/x86/include/asm/ftrace.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
> index f9cb4d07df58..063ce70837bb 100644
> --- a/arch/x86/include/asm/ftrace.h
> +++ b/arch/x86/include/asm/ftrace.h
> @@ -34,6 +34,10 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
>  	return addr;
>  }
>  
> +#ifdef CONFIG_X86_KERNEL_IBT
> +#include <linux/uaccess.h>
> +#endif
> +
>  static inline unsigned long arch_ftrace_get_symaddr(unsigned long fentry_ip)
>  {
>  #ifdef CONFIG_X86_KERNEL_IBT
> -- 
> 2.48.1
> 
> 


-- 
Masami Hiramatsu (Google) <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ