All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Sami Tolvanen <samitolvanen@google.com>, X86 ML <x86@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Sedat Dilek <sedat.dilek@gmail.com>,
	linux-hardening@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	llvm@lists.linux.dev
Subject: Re: [PATCH v4 06/15] ftrace: Use an opaque type for functions not callable from C
Date: Wed, 6 Oct 2021 14:23:55 -0700	[thread overview]
Message-ID: <20211006212355.mfuyci3pnsdlbp3w@treble> (raw)
In-Reply-To: <20211006171016.07d90b59@gandalf.local.home>

On Wed, Oct 06, 2021 at 05:10:16PM -0400, Steven Rostedt wrote:
> On Wed, 6 Oct 2021 13:43:35 -0700
> Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> 
> > On Wed, Oct 06, 2021 at 10:45:41AM -0700, Sami Tolvanen wrote:
> > > On Wed, Oct 6, 2021 at 9:58 AM Steven Rostedt <rostedt@goodmis.org> wrote:  
> > > >
> > > > On Wed, 6 Oct 2021 09:31:04 -0700
> > > > Sami Tolvanen <samitolvanen@google.com> wrote:
> > > >  
> > > > > > > On Thu, Sep 30, 2021 at 11:05:22AM -0700, Sami Tolvanen wrote:  
> > > > > > > > With CONFIG_CFI_CLANG, the compiler changes function references to point
> > > > > > > > to the CFI jump table. As ftrace_call, ftrace_regs_call, and mcount_call
> > > > > > > > are not called from C, use DECLARE_ASM_FUNC_SYMBOL to declare them.  
> > > > > >
> > > > > > "not called from C" is a bit confusing.  
> > > > >
> > > > > Any thoughts on how to make this less confusing?  
> > > >
> > > >  "Not called by C code, but injected by the compiler."
> > > >
> > > > ?  
> > > 
> > > Sure, sounds good to me. I'll update this in v5.  
> > 
> > "injected by the compiler" sounds even more confusing.  It almost sounds
> > like those functions are generated by GCC, which they are most
> > definitely not.
> > 
> 
> Heh, I was thinking of the locations that are injected (mcount / fentry) as
> these are just replacements for them. Those injections are added by GCC.
>
> So, continuing the bikeshedding, what about "not called by C code, but are
> trampolines injected as calls replacing the nops at the start of
> functions added by the compiler." ?

I'm not quite sure what that means, but I'll allow it ;-)

-- 
Josh


  reply	other threads:[~2021-10-06 21:24 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 18:05 [PATCH v4 00/15] x86: Add support for Clang CFI Sami Tolvanen
2021-09-30 18:05 ` Sami Tolvanen
2021-09-30 18:05 ` [PATCH v4 01/15] objtool: Add CONFIG_CFI_CLANG support Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-09-30 18:40   ` Nick Desaulniers
2021-09-30 18:40     ` Nick Desaulniers
2021-10-06  3:36   ` Josh Poimboeuf
2021-10-06 16:18     ` Sami Tolvanen
2021-09-30 18:05 ` [PATCH v4 02/15] objtool: Add ASM_STACK_FRAME_NON_STANDARD Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-10-06  3:37   ` Josh Poimboeuf
2021-09-30 18:05 ` [PATCH v4 03/15] linkage: Add DECLARE_ASM_FUNC_SYMBOL Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-09-30 18:05 ` [PATCH v4 04/15] cfi: Add DEFINE_CFI_IMMEDIATE_RETURN_STUB Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-09-30 18:50   ` Nick Desaulniers
2021-09-30 18:50     ` Nick Desaulniers
2021-10-01 20:07     ` Sami Tolvanen
2021-10-01 20:07       ` Sami Tolvanen
2021-10-04 13:50   ` Peter Zijlstra
2021-10-04 19:10     ` Sami Tolvanen
2021-10-05  6:59       ` Peter Zijlstra
2021-10-05 20:29         ` Sami Tolvanen
2021-10-05 20:56           ` Peter Zijlstra
2021-10-05 21:53             ` Sami Tolvanen
2021-09-30 18:05 ` [PATCH v4 05/15] tracepoint: Exclude tp_stub_func from CFI checking Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-09-30 18:50   ` Nick Desaulniers
2021-09-30 18:50     ` Nick Desaulniers
2021-10-01 20:08     ` Sami Tolvanen
2021-10-01 20:08       ` Sami Tolvanen
2021-09-30 18:05 ` [PATCH v4 06/15] ftrace: Use an opaque type for functions not callable from C Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-10-06  3:29   ` Josh Poimboeuf
2021-10-06 13:02     ` Steven Rostedt
2021-10-06 13:54       ` Josh Poimboeuf
2021-10-06 14:16         ` Steven Rostedt
2021-10-06 16:31       ` Sami Tolvanen
2021-10-06 16:58         ` Steven Rostedt
2021-10-06 17:45           ` Sami Tolvanen
2021-10-06 20:43             ` Josh Poimboeuf
2021-10-06 21:10               ` Steven Rostedt
2021-10-06 21:23                 ` Josh Poimboeuf [this message]
2021-10-06 23:14                   ` Sami Tolvanen
2021-10-07  0:56                     ` Steven Rostedt
2021-09-30 18:05 ` [PATCH v4 07/15] lkdtm: Disable UNSET_SMEP with CFI Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-09-30 18:05 ` [PATCH v4 08/15] lkdtm: Use an opaque type for lkdtm_rodata_do_nothing Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-09-30 18:05 ` [PATCH v4 09/15] x86: Use an opaque type for functions not callable from C Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-09-30 18:05 ` [PATCH v4 10/15] x86/purgatory: Disable CFI Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-09-30 19:05   ` Nick Desaulniers
2021-09-30 19:05     ` Nick Desaulniers
2021-09-30 18:05 ` [PATCH v4 11/15] x86, relocs: Ignore __typeid__ relocations Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-10-06  3:31   ` Josh Poimboeuf
2021-10-06 16:17     ` Sami Tolvanen
2021-09-30 18:05 ` [PATCH v4 12/15] x86, module: " Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-09-30 18:05 ` [PATCH v4 13/15] x86, cpu: Use LTO for cpu.c with CFI Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-09-30 18:05 ` [PATCH v4 14/15] x86, kprobes: Fix optprobe_template_func type mismatch Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-09-30 18:05 ` [PATCH v4 15/15] x86, build: Allow CONFIG_CFI_CLANG to be selected Sami Tolvanen
2021-09-30 18:05   ` Sami Tolvanen
2021-09-30 18:38 ` [PATCH v4 00/15] x86: Add support for Clang CFI Nick Desaulniers
2021-09-30 18:38   ` Nick Desaulniers
2021-10-01 20:55   ` Sedat Dilek
2021-10-01 20:55     ` Sedat Dilek
2021-10-05 20:36 ` Josh Poimboeuf
2021-10-05 21:52   ` Sami Tolvanen
2021-10-06  2:42     ` Josh Poimboeuf

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=20211006212355.mfuyci3pnsdlbp3w@treble \
    --to=jpoimboe@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=samitolvanen@google.com \
    --cc=sedat.dilek@gmail.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.