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: <20211027075936.7fd3e7a5@gandalf.local.home>
Date:   Wed, 27 Oct 2021 07:59:36 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Randy Dunlap <rdunlap@...radead.org>
Cc:     linux-kernel@...r.kernel.org, kernel test robot <lkp@...el.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Zong Li <zong@...estech.com>, Nick Hu <nickhu@...estech.com>,
        Vincent Chen <deanbo422@...il.com>
Subject: Re: [PATCH] nds32: ftrace: fix pointer comparison warning

On Tue, 26 Oct 2021 22:55:54 -0700
Randy Dunlap <rdunlap@...radead.org> wrote:

> GCC 11.1.0 for nds32 (nds32le if it matters) complains:
> 
> ../arch/nds32/kernel/ftrace.c: In function '_mcount':
> ../arch/nds32/kernel/ftrace.c:24:35: error: comparison of distinct pointer types lacks a cast [-Werror]
>    24 |         if (ftrace_trace_function != ftrace_stub)
>       |                                   ^~
> 
> Cast the second function (pointer) to (void *) to avoid the warning.
> 
> Fixes: a18082575c66 ("nds32/ftrace: Support static function tracer")
> Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
> Reported-by: kernel test robot <lkp@...el.com>
> To: Greentime Hu <green.hu@...il.com>
> Cc: Steven Rostedt (VMware) <rostedt@...dmis.org>
> Cc: Masami Hiramatsu <mhiramat@...nel.org>
> Cc: Zong Li <zong@...estech.com>
> Cc: Nick Hu <nickhu@...estech.com>
> Cc: Vincent Chen <deanbo422@...il.com>
> ---
>  arch/nds32/kernel/ftrace.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-next-20211026.orig/arch/nds32/kernel/ftrace.c
> +++ linux-next-20211026/arch/nds32/kernel/ftrace.c
> @@ -21,7 +21,7 @@ noinline void _mcount(unsigned long pare
>  
>  	unsigned long ip = (unsigned long)__builtin_return_address(0);
>  
> -	if (ftrace_trace_function != ftrace_stub)
> +	if (ftrace_trace_function != (void *)ftrace_stub)
>  		ftrace_trace_function(ip - MCOUNT_INSN_SIZE, parent_ip,
>  				      NULL, NULL);
>  

Or update ftrace_trace_function prototype that was missed when ftrace_stub
prototype was updated.

Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
---
diff --git a/arch/nds32/kernel/ftrace.c b/arch/nds32/kernel/ftrace.c
index f0ef4842d191..711bc8cd186d 100644
--- a/arch/nds32/kernel/ftrace.c
+++ b/arch/nds32/kernel/ftrace.c
@@ -6,7 +6,7 @@
 
 #ifndef CONFIG_DYNAMIC_FTRACE
 extern void (*ftrace_trace_function)(unsigned long, unsigned long,
-				     struct ftrace_ops*, struct pt_regs*);
+				     struct ftrace_ops*, struct ftrace_regs*);
 extern void ftrace_graph_caller(void);
 
 noinline void __naked ftrace_stub(unsigned long ip, unsigned long parent_ip,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ