lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3036fbe6-3cb7-5358-75ed-2fe421f6f7aa@molgen.mpg.de>
Date:   Tue, 14 Jul 2020 15:40:45 +0200
From:   Paul Menzel <pmenzel@...gen.mpg.de>
To:     Sedat Dilek <sedat.dilek@...il.com>
Cc:     Sami Tolvanen <samitolvanen@...gle.com>,
        Masahiro Yamada <masahiroy@...nel.org>,
        Will Deacon <will@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Paul E. McKenney" <paulmck@...nel.org>,
        Kees Cook <keescook@...omium.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Clang-Built-Linux ML <clang-built-linux@...glegroups.com>,
        Kernel Hardening <kernel-hardening@...ts.openwall.com>,
        linux-arch@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kbuild <linux-kbuild@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>, linux-pci@...r.kernel.org,
        x86@...nel.org
Subject: Re: [PATCH 00/22] add support for Clang LTO

Dear Sedat,


Am 14.07.20 um 14:35 schrieb Sedat Dilek:
> On Tue, Jul 14, 2020 at 2:16 PM Paul Menzel <pmenzel@...gen.mpg.de> wrote:

>> Am 13.07.20 um 01:34 schrieb Sami Tolvanen:
>>> On Sat, Jul 11, 2020 at 9:32 AM Paul Menzel <pmenzel@...gen.mpg.de> wrote:
>>>> Thank you very much for sending these changes.
>>>>
>>>> Do you have a branch, where your current work can be pulled from? Your
>>>> branch on GitHub [1] seems 15 months old.
>>>
>>> The clang-lto branch is rebased regularly on top of Linus' tree.
>>> GitHub just looks at the commit date of the last commit in the tree,
>>> which isn't all that informative.
>>
>> Thank you for clearing this up, and sorry for not checking myself.
>>
>>>> Out of curiosity, I applied the changes, allowed the selection for i386
>>>> (x86), and with Clang 1:11~++20200701093119+ffee8040534-1~exp1 from
>>>> Debian experimental, it failed with `Invalid absolute R_386_32
>>>> relocation: KERNEL_PAGES`:
>>>
>>> I haven't looked at getting this to work on i386, which is why we only
>>> select ARCH_SUPPORTS_LTO for x86_64. I would expect there to be a few
>>> issues to address.
>>>
>>>>>     arch/x86/tools/relocs vmlinux > arch/x86/boot/compressed/vmlinux.relocs;arch/x86/tools/relocs --abs-relocs vmlinux
>>>>> Invalid absolute R_386_32 relocation: KERNEL_PAGES
>>>
>>> KERNEL_PAGES looks like a constant, so it's probably safe to ignore
>>> the absolute relocation in tools/relocs.c.
>>
>> Thank you for pointing me to the right direction. I am happy to report,
>> that with the diff below (no idea to what list to add the string), Linux
>> 5.8-rc5 with the LLVM/Clang/LTO patches on top, builds and boots on the
>> ASRock E350M1.
>>
>> ```
>> diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
>> index 8f3bf34840cef..e91af127ed3c0 100644
>> --- a/arch/x86/tools/relocs.c
>> +++ b/arch/x86/tools/relocs.c
>> @@ -79,6 +79,7 @@ static const char * const
>> sym_regex_kernel[S_NSYMTYPES] = {
>>           "__end_rodata_hpage_align|"
>>    #endif
>>           "__vvar_page|"
>> +       "KERNEL_PAGES|"
>>           "_end)$"
>>    };
>> ```
> 
> What llvm-toolchain and version did you use?

See above. ;-) Clang 1:11~++20200701093119+ffee8040534-1~exp1 from 
Debian experimental and the build command below.

     make bindeb-pkg -j32 ARCH=i386 LLVM=1

> Can you post your linux-config?

Sure. Attached.

     $ grep _LTO config-5.8.0-rc5-00107-g5b634a79fc2fa
     CONFIG_LTO=y
     CONFIG_ARCH_SUPPORTS_LTO_CLANG=y
     # CONFIG_LTO_NONE is not set
     CONFIG_LTO_CLANG=y


Kind regards,

Paul

View attachment "config-5.8.0-rc5-00107-g5b634a79fc2fa" of type "text/plain" (142605 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ