From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED6D0C433EF for ; Wed, 6 Oct 2021 21:10:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C2E03611C0 for ; Wed, 6 Oct 2021 21:10:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239488AbhJFVMM (ORCPT ); Wed, 6 Oct 2021 17:12:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:58794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239454AbhJFVML (ORCPT ); Wed, 6 Oct 2021 17:12:11 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 07E8F61177; Wed, 6 Oct 2021 21:10:17 +0000 (UTC) Date: Wed, 6 Oct 2021 17:10:16 -0400 From: Steven Rostedt To: Josh Poimboeuf Cc: Sami Tolvanen , X86 ML , Kees Cook , Peter Zijlstra , Nathan Chancellor , Nick Desaulniers , Sedat Dilek , linux-hardening@vger.kernel.org, LKML , llvm@lists.linux.dev Subject: Re: [PATCH v4 06/15] ftrace: Use an opaque type for functions not callable from C Message-ID: <20211006171016.07d90b59@gandalf.local.home> In-Reply-To: <20211006204335.xtymxt6wk4akx6fc@treble> References: <20210930180531.1190642-1-samitolvanen@google.com> <20210930180531.1190642-7-samitolvanen@google.com> <20211006032945.axlqh3vehgar6adr@treble> <20211006090249.248c65b0@gandalf.local.home> <20211006125809.5389b2a3@gandalf.local.home> <20211006204335.xtymxt6wk4akx6fc@treble> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org On Wed, 6 Oct 2021 13:43:35 -0700 Josh Poimboeuf 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 wrote: > > > > > > On Wed, 6 Oct 2021 09:31:04 -0700 > > > Sami Tolvanen 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." ? -- Steve