[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <B5C0B917-BB17-460B-9CC3-51E7D49F04A7@arm.com>
Date: Thu, 17 Sep 2020 11:16:32 +0000
From: Daniel Kiss <Daniel.Kiss@....com>
To: Mark Rutland <Mark.Rutland@....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 17 Sep 2020, at 13:04, Mark Rutland <mark.rutland@....com> wrote:
>
> 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?
Yes, that is correct.
>
> 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. :/
I don’t know but I have motivation to backport all PAC/BTI fixes to LLVM11.0.1.
>
> Thanks,
> Mark.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Powered by blists - more mailing lists