[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200917110427.GA98505@C02TD0UTHF1T.local>
Date: Thu, 17 Sep 2020 12:04:27 +0100
From: Mark Rutland <mark.rutland@....com>
To: Daniel Kiss <Daniel.Kiss@....com>
Cc: Marco Elver <elver@...gle.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Rong Chen <rong.a.chen@...el.com>,
kernel test robot <lkp@...el.com>,
"Li, Philip" <philip.li@...el.com>, x86-ml <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>,
Masahiro Yamada <masahiroy@...nel.org>,
kasan-dev <kasan-dev@...glegroups.com>,
Momchil Velikov <Momchil.Velikov@....com>
Subject: Re: [tip:x86/seves] BUILD SUCCESS WITH WARNING
e6eb15c9ba3165698488ae5c34920eea20eaa38e
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.
Powered by blists - more mailing lists