Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200627134348.30601-1-oscar.carter@gmx.com>
Date: Sat, 27 Jun 2020 15:43:48 +0200
From: Oscar Carter <oscar.carter@....com>
To: Kees Cook <keescook@...omium.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Ingo Molnar <mingo@...hat.com>,
	"James E . J . Bottomley" <James.Bottomley@...senPartnership.com>,
	Helge Deller <deller@....de>
Cc: kernel-hardening@...ts.openwall.com,
	linux-parisc@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Oscar Carter <oscar.carter@....com>
Subject: [PATCH] parisc/kernel/ftrace: Remove function callback casts

In an effort to enable -Wcast-function-type in the top-level Makefile to
support Control Flow Integrity builds, remove all the function callback
casts.

To do this remove the cast to a function pointer type in the comparison
statement and add to the right and left operand a cast to unsigned long
type. This can be done since the comparison is against function address
(these operands are not function calls).

Signed-off-by: Oscar Carter <oscar.carter@....com>
---
 arch/parisc/kernel/ftrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/parisc/kernel/ftrace.c b/arch/parisc/kernel/ftrace.c
index 1df0f67ed667..86b49a5fc049 100644
--- a/arch/parisc/kernel/ftrace.c
+++ b/arch/parisc/kernel/ftrace.c
@@ -64,7 +64,7 @@ void notrace __hot ftrace_function_trampoline(unsigned long parent,
 				function_trace_op, regs);

 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
-	if (ftrace_graph_return != (trace_func_graph_ret_t) ftrace_stub ||
+	if ((unsigned long)ftrace_graph_return != (unsigned long)ftrace_stub ||
 	    ftrace_graph_entry != ftrace_graph_entry_stub) {
 		unsigned long *parent_rp;

--
2.20.1

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.