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]
Date:   Sat, 27 Feb 2021 21:13:54 +0100
From:   Sedat Dilek <sedat.dilek@...il.com>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Arnd Bergmann <arnd@...db.de>,
        Kees Cook <keescook@...omium.org>,
        Mark Brown <broonie@...nel.org>,
        Vincenzo Frascino <vincenzo.frascino@....com>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Kristina Martsenko <kristina.martsenko@....com>,
        Ionela Voinescu <ionela.voinescu@....com>,
        Mark Rutland <mark.rutland@....com>,
        Andrew Scull <ascull@...gle.com>,
        David Brazdil <dbrazdil@...gle.com>,
        Marc Zyngier <maz@...nel.org>,
        Ard Biesheuvel <ardb@...nel.org>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Clang-Built-Linux ML <clang-built-linux@...glegroups.com>
Subject: Re: [PATCH] [RFC] arm64: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION

On Fri, Feb 26, 2021 at 11:02 AM Sedat Dilek <sedat.dilek@...il.com> wrote:
>
> On Fri, Feb 26, 2021 at 10:51 AM Arnd Bergmann <arnd@...nel.org> wrote:
> >
> > On Fri, Feb 26, 2021 at 10:05 AM Sedat Dilek <sedat.dilek@...il.com> wrote:
> > > On Fri, Feb 26, 2021 at 9:14 AM Arnd Bergmann <arnd@...nel.org> wrote:
> > >
> > > > > BTW, is CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y setable for x86 (64bit)?
> > > > > ( Did not look or check for it. )
> > > >
> > > > No, in mainline, HAVE_LD_DEAD_CODE_DATA_ELIMINATION is currently
> > > > only selected on MIPS and PowerPC. I only sent experimental patches to
> > > > enable it on arm64 and m68k, but have not tried booting them. If you
> > > > select the symbol on x86, you should see similar results.
> > > >
> > >
> > > OK, i see:
> > >
> > > $ git grep HAVE_LD_DEAD_CODE_DATA_ELIMINATION arch/mips/
> > > arch/mips/Kconfig:      select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
> > >
> > > $ git grep HAVE_LD_DEAD_CODE_DATA_ELIMINATION arch/powerpc/
> > > arch/powerpc/Kconfig:   select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
> > >
> > > So, I need to add this to arch/x86/Kconfig.
> > >
> > > You happen to know if changes to arch/x86/kernel/vmlinux.lds.S
> > > (sections) are needed?
> >
> > No idea. I'm still debugging a possible regression on arm64, but both
> > issues I found for arm64 are specific to that architecture and won't
> > happen on x86. It's likely that something else breaks though.
> >
>
> My first experiences with gc were with the freetz project (mips
> embedded router) and don't ask me what GCC version.
>
> I will try with gc + trim + cfi later after my current build has finished.
>
> > > Last question:
> > > The last days I see a lot of fixes touching inlining with LLVM/Clang v13-git.
> > > What git tag are you using?
> > > What are your experiences?
> > > Pending patches (kernel-side)?
> > >
> > > I use:
> > > $ /opt/llvm-toolchain/bin/clang --version
> > > dileks clang version 13.0.0 (https://github.com/llvm/llvm-project.git
> > > c465429f286f50e52a8d2b3b39f38344f3381cce)
> >
> > This is what I have on the build box:
> > Ubuntu clang version
> > 13.0.0-++20210223104451+ebca13c66504-1~exp1~20210223095200.234
> >
>
> Distro-clang takes much longer here.
> Selfmade stage1-only LLVM toolchain compiles here 10% faster.
> cfi takes approx. 20% longer.
> With trim + gc I suppose it will take much longer.
>
> Let me test.
> Will report later.
>

With the attached patch and diff (some modules need whitelisted
symbols) I was able to compile an x86-64 Linux-kernel.
It does not boot on bare metal.

If someone wants to play with it.

- Sedat -

View attachment "0001-x86-kconfig-Enable-HAVE_LD_DEAD_CODE_DATA_ELIMINATIO.patch" of type "text/x-patch" (746 bytes)

View attachment "gen_autoksyms_sh-v3.diff" of type "text/x-patch" (1964 bytes)

Download attachment "config-5.11.0-11603.3-amd64-clang13-cfi" of type "application/octet-stream" (239746 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ