All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Mark Rutland <mark.rutland@arm.com>
Cc: Kees Cook <keescook@chromium.org>,
	Sami Tolvanen <samitolvanen@google.com>
Subject: Re: [PATCH] ftrace,kcfi: Separate ftrace_stub() and ftrace_stub_graph()
Date: Tue, 18 Oct 2022 14:36:53 +0200	[thread overview]
Message-ID: <Y06d5X39EmKVamLN@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <Y06dg4e1xF6JTdQq@hirez.programming.kicks-ass.net>

On Tue, Oct 18, 2022 at 02:35:16PM +0200, Peter Zijlstra wrote:
> 
> Different function signatures means they needs to be different
> functions; otherwise CFI gets upset.
> 
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
> 
> Notable; this patch depends on eac828eaef29 ("x86/ftrace: Remove
> ftrace_epilogue()") which can be cleanly picked on top of -rc1.
> 
> Since kCFI is upstream this should go into some /urgent tree.

Combined (eac828eaef29 + this patch) generate a conflict against
tip/x86/core. Resolution looks like:

diff --cc arch/x86/kernel/ftrace_64.S
index 2a4be92fd144,6a7e6d666a12..000000000000
--- a/arch/x86/kernel/ftrace_64.S
+++ b/arch/x86/kernel/ftrace_64.S
@@@ -4,7 -4,7 +4,8 @@@
   */
  
  #include <linux/linkage.h>
 +#include <linux/cfi_types.h>
+ #include <asm/asm-offsets.h>
  #include <asm/ptrace.h>
  #include <asm/ftrace.h>
  #include <asm/export.h>
@@@ -130,14 -130,6 +131,16 @@@
  
  	.endm
  
 +SYM_TYPED_FUNC_START(ftrace_stub)
++	CALL_DEPTH_ACCOUNT
 +	RET
 +SYM_FUNC_END(ftrace_stub)
 +
 +SYM_TYPED_FUNC_START(ftrace_stub_graph)
++	CALL_DEPTH_ACCOUNT
 +	RET
 +SYM_FUNC_END(ftrace_stub_graph)
 +
  #ifdef CONFIG_DYNAMIC_FTRACE
  
  SYM_FUNC_START(__fentry__)
@@@ -284,8 -305,13 +311,10 @@@ STACK_FRAME_NON_STANDARD_FP(ftrace_regs
  #else /* ! CONFIG_DYNAMIC_FTRACE */
  
  SYM_FUNC_START(__fentry__)
+ 	CALL_DEPTH_ACCOUNT
+ 
  	cmpq $ftrace_stub, ftrace_trace_function
  	jnz trace
 -
 -SYM_INNER_LABEL(ftrace_stub, SYM_L_GLOBAL)
 -	ENDBR
  	RET
  
  trace:

  reply	other threads:[~2022-10-18 12:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 12:35 [PATCH] ftrace,kcfi: Separate ftrace_stub() and ftrace_stub_graph() Peter Zijlstra
2022-10-18 12:36 ` Peter Zijlstra [this message]
2022-10-18 13:18 ` Peter Zijlstra
2022-10-18 13:26   ` Mark Rutland
2022-10-18 14:28   ` Kees Cook
2022-10-18 15:00     ` Peter Zijlstra
2022-10-18 18:22       ` Kees Cook
2022-10-18 14:21 ` Steven Rostedt
2022-10-18 15:02   ` Peter Zijlstra
2022-10-20 15:17 ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=Y06d5X39EmKVamLN@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=rostedt@goodmis.org \
    --cc=samitolvanen@google.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.