All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Daniel Kiss <Daniel.Kiss@arm.com>
Cc: Marco Elver <elver@google.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Borislav Petkov <bp@alien8.de>, Rong Chen <rong.a.chen@intel.com>,
	kernel test robot <lkp@intel.com>,
	"Li, Philip" <philip.li@intel.com>, x86-ml <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	kasan-dev <kasan-dev@googlegroups.com>,
	Momchil Velikov <Momchil.Velikov@arm.com>
Subject: Re: [tip:x86/seves] BUILD SUCCESS WITH WARNING e6eb15c9ba3165698488ae5c34920eea20eaa38e
Date: Thu, 17 Sep 2020 12:04:27 +0100	[thread overview]
Message-ID: <20200917110427.GA98505@C02TD0UTHF1T.local> (raw)
In-Reply-To: <333D40A0-4550-4309-9693-1ABA4AC75399@arm.com>

On Wed, Sep 16, 2020 at 10:30:42PM +0100, Daniel Kiss wrote:
> 
>     Thanks for the summary -- yeah, that was my suspicion, that some
>     attribute was being lost somewhere. And I think if we generalize this,
>     and don't just try to attach "frame-pointer" attr to the function, we
>     probably also solve the BTI issue that Mark still pointed out with
>     these module_ctor/dtors.
> 
>     I was trying to see if there was a generic way to attach all the
>     common attributes to the function generated here:
>     https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Utils/
>     ModuleUtils.cpp#L122
>     -- but we probably can't attach all attributes, and need to remove a
>     bunch of them again like the sanitizers (or alternatively just select
>     the ones we need). But, I'm still digging for the function that
>     attaches all the common attributes…
> 
> 
> We had the problem with not just the sanitisers.  Same problem pops with
> functions 
> that created elsewhere in clang (e.g _clang_call_terminate ) or llvm.
> 
> In case of BTI the flag even controllable by function attributes which makes it
> more trickier so
> the module flags found the only reliable way to pass this information down. 
> Scanning existing functions is fragile for data only compilation units for
> example.
> 
> Our solution, not generic enough but might help.
> https://reviews.llvm.org/D85649 

Thanks for the pointer -- I've subscribed to that now.

Just to check my understanding, is the issue that generated functions
don't implicitly get function attributes like
"branch-target-enforcement", and so the BTI insertion pass skips those?

I'm guessing that it's unlikely this'll be fixed for an LLVM 11 release?
On the kernel side I guess we'll have to guard affected features as
being incompatible with BTI until there's a viable fix on the compiler
side. :/

Thanks,
Mark.

  parent reply	other threads:[~2020-09-17 11:36 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 13:42 [tip:x86/seves] BUILD SUCCESS WITH WARNING e6eb15c9ba3165698488ae5c34920eea20eaa38e kernel test robot
2020-09-15 13:55 ` Borislav Petkov
2020-09-15 14:18   ` Rong Chen
2020-09-15 14:41     ` Borislav Petkov
2020-09-15 16:05     ` Borislav Petkov
2020-09-15 17:02       ` Josh Poimboeuf
2020-09-15 17:21         ` Borislav Petkov
2020-09-15 17:34           ` Borislav Petkov
2020-09-15 17:41             ` Nick Desaulniers
2020-09-15 18:01               ` Borislav Petkov
2020-09-15 18:04                 ` Nick Desaulniers
2020-09-15 17:40           ` Nick Desaulniers
2020-09-15 18:09             ` Marco Elver
2020-09-16  8:30               ` peterz
2020-09-16  8:46                 ` Marco Elver
2020-09-16  9:06                   ` peterz
2020-09-16  9:33                     ` Marco Elver
2020-09-16 18:22                   ` Nick Desaulniers
2020-09-16 18:51                     ` Marco Elver
2020-09-17  4:11                       ` Fangrui Song
     [not found]                       ` <333D40A0-4550-4309-9693-1ABA4AC75399@arm.com>
2020-09-17 11:04                         ` Mark Rutland [this message]
2020-09-17 11:16                           ` Daniel Kiss
2020-09-17 18:39                     ` Josh Poimboeuf
2020-09-15 17:44         ` Nick Desaulniers
2020-09-15 20:12         ` Nick Desaulniers
2020-09-15 20:49           ` Borislav Petkov
2020-09-15 21:02             ` Josh Poimboeuf
2020-09-15 21:14               ` Borislav Petkov
2020-09-15 22:34               ` Nick Desaulniers
2020-09-16  7:03                 ` Ilie Halip
2020-09-16  8:59                 ` Marco Elver
2020-09-21 16:51                 ` [tip: objtool/core] objtool: Ignore unreachable trap after call to noreturn functions tip-bot2 for Ilie Halip
2020-09-15 21:50             ` [tip:x86/seves] BUILD SUCCESS WITH WARNING e6eb15c9ba3165698488ae5c34920eea20eaa38e Arvind Sankar
2020-09-15 21:59               ` Nick Desaulniers
2020-09-15 22:44                 ` Arvind Sankar
2020-09-16 11:34               ` Borislav Petkov
2020-09-16 18:28                 ` Nick Desaulniers
2020-09-16 18:48                   ` Borislav Petkov
2020-09-15 21:13           ` Nick Desaulniers
2020-09-15 21:28             ` Josh Poimboeuf
2020-09-15 23:35               ` Marco Elver

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=20200917110427.GA98505@C02TD0UTHF1T.local \
    --to=mark.rutland@arm.com \
    --cc=Daniel.Kiss@arm.com \
    --cc=Momchil.Velikov@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=elver@google.com \
    --cc=jpoimboe@redhat.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=masahiroy@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=philip.li@intel.com \
    --cc=rong.a.chen@intel.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.