Kernel-hardening archive on
 help / color / Atom feed
From: Oscar Carter <>
To: Kees Cook <>,
	Steven Rostedt <>,
	Ingo Molnar <>,
	"James E . J . Bottomley" <>,
	Helge Deller <>
	Oscar Carter <>
Subject: [PATCH] parisc/kernel/ftrace: Remove function callback casts
Date: Sat, 27 Jun 2020 15:43:48 +0200
Message-ID: <> (raw)

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

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 <>
 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);

-	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;


             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-27 13:43 Oscar Carter [this message]
2020-06-27 20:09 ` Helge Deller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Kernel-hardening archive on

Archives are clonable:
	git clone --mirror kernel-hardening/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernel-hardening kernel-hardening/ \
	public-inbox-index kernel-hardening

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone