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: <CAKwvOdn-=u1v8B1ni8QqiOXaimhc_tG6O=8kMb4c2vv62=D42g@mail.gmail.com>
Date:   Tue, 2 Jul 2019 15:09:02 -0700
From:   Nick Desaulniers <ndesaulniers@...gle.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        clang-built-linux <clang-built-linux@...glegroups.com>,
        Kees Cook <keescook@...gle.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Craig Topper <craig.topper@...el.com>,
        Alexander Potapenko <glider@...gle.com>,
        Bill Wendling <morbo@...gle.com>,
        Stephen Hines <srhines@...gle.com>,
        Chandler Carruth <chandlerc@...gle.com>
Subject: Re: objtool warnings in prerelease clang-9

On Tue, Jul 2, 2019 at 2:58 PM Thomas Gleixner <tglx@...utronix.de> wrote:
> On Tue, 2 Jul 2019, Nick Desaulniers wrote:
> > TL;DR
> > LLVM currently has a bug when unrolling loops containing asm goto and
> > we have a fix in hand.
> >
> > Conservatively, we can block loop unrolling when we see asm goto in a loop:
>
> Makes sense in order to make progress.

I have the conservative fix posted for review: https://reviews.llvm.org/D64101.
I've modified the test case there for what it should look like when we
can and do inline it:
https://gist.github.com/nickdesaulniers/7216f6e5a17c7064285190440cb88f1d
I feel like I'm pretty close to just fixing the block duplication in
unrolling outright and can probably have a working fix in the next day
or two.

> > This causes objtool to not find any issues in
> > arch/x86/kernel/cpu/mtrr/generic.o.  I don't observe any duplication
> > in the __jump_table section of the resulting .o file.  It also cuts
> > down the objtool warnings I observe in a defconfig (listed at the
> > beginning of the email) from 4 to 2. (platform-quirks.o predates asm
> > goto,
>
> It does not have asm goto inside :)

I think you're conflating arch/x86/kernel/cpu/mtrr/generic.o with
arch/x86/kernel/platform-quirks.o.

> platform-quirks.o:
>
>         if (x86_platform.set_legacy_features)
>   74:   4c 8b 1d 00 00 00 00    mov    0x0(%rip),%r11        # 7b <x86_early_init_platform_quirks+0x7b>
>   7b:   4d 85 db                test   %r11,%r11
>   7e:   0f 85 00 00 00 00       jne    84 <x86_early_init_platform_quirks+0x84>
>                 x86_platform.set_legacy_features();
> }
>   84:   c3                      retq
>
> That jne jumps to __x86_indirect_thunk_r11, aka. ratpoutine.

As an American with 100% French Canadian ancestry, I approve of the
term ratpoutine over retpoline.

> No idea why objtool thinks that the instruction at 0x84 is not
> reachable. Josh?


-- 
Thanks,
~Nick Desaulniers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ