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, 15 Aug 2020 16:39:52 +0200
From:   Sedat Dilek <sedat.dilek@...il.com>
To:     Nick Desaulniers <ndesaulniers@...gle.com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        Peter Collingbourne <pcc@...gle.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
        "H. Peter Anvin" <hpa@...or.com>,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Zhenzhong Duan <zhenzhong.duan@...cle.com>,
        Kees Cook <keescook@...omium.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Juergen Gross <jgross@...e.com>,
        Andy Lutomirski <luto@...nel.org>,
        Andrew Cooper <andrew.cooper3@...rix.com>,
        LKML <linux-kernel@...r.kernel.org>,
        clang-built-linux <clang-built-linux@...glegroups.com>
Subject: Re: [PATCH] x86: work around clang IAS bug referencing __force_order

On Sat, Aug 15, 2020 at 12:46 PM Sedat Dilek <sedat.dilek@...il.com> wrote:
>
> On Sat, Aug 15, 2020 at 10:23 AM Sedat Dilek <sedat.dilek@...il.com> wrote:
> >
> > On Sat, Aug 15, 2020 at 5:28 AM Sedat Dilek <sedat.dilek@...il.com> wrote:
> > >
> > > On Sat, Aug 15, 2020 at 2:27 AM Nick Desaulniers
> > > <ndesaulniers@...gle.com> wrote:
> > > >
> > > > On Fri, Aug 14, 2020 at 3:57 PM Nick Desaulniers
> > > > <ndesaulniers@...gle.com> wrote:
> > > > >
> > > > > On Fri, Aug 14, 2020 at 2:19 PM Sedat Dilek <sedat.dilek@...il.com> wrote:
> > > > > >
> > > > > > On Fri, Aug 14, 2020 at 7:29 PM Sedat Dilek <sedat.dilek@...il.com> wrote:
> > > > > > >
> > > > > > > Thanks for the proposal.
> > > > > > >
> > > > > > > I have adapted it to fit my patchset against Linux v5.8.
> > > > > > >
> > > > > > > Both Debian's GCC-10 and a snapshot version of LLVM toolchain
> > > > > > > v11.0.0-rc1+ seems to be OK.
> > > > > > >
> > > > > >
> > > > > > Yupp, OK.
> > > > > >
> > > > > > I was able to boot FreeDOS 1.2 VM in VirtualBox GUI.
> > > > >
> > > > > Hi Sedat,
> > > > > Apologies, but it's not clear to me precisely which patch you tested.
> > > > > Can you please confirm whether you tested:
> > > > > 1. Arnd's patch that started this thread.
> > > > > 2. My proposed diff adding -fno-addrsig to CFLAGS_powernow-k6.o.
> > > > > 3. My proposed diff removing __force_order from the kernel.
> > > > >
> > > > > I'm hoping you were referring to testing 3., but it's not clear to me.
> > > >
> > > > Ah, sorry, I missed your comment on github:
> > > > https://github.com/ClangBuiltLinux/linux/issues/1120#issuecomment-674282107
> > > >
> > > > Ok, I will look at more disassembly next week and hopefully have a
> > > > patch ready, with your tested by tag.
> > > >
> > >
> > > Sorry for not being precise - I tested with solution (3.).
> > > Later I added the diff I used as mentioned in your above comment.
> > >
> > > See [1]:
> > >
> > > > In a 2nd run building with a selfmade clang-11 and LLVM "bin"utils is fine, too.
> > >
> > > I cannot say much to older versions of GCC and/or LLVM/Clang if
> > > removing "__force_order" works fine.
> > >
> > > Another (4.) solution:
> > > Sami tried successfully by adding "__weak" declaration with
> > > CONFIG_LKDTM=m (see [2]).
> > > I am OK if this works, too.
> > >
> > > Please, see my attachments.
> > >
> > > - Sedat -
> > >
> > > [1] https://github.com/ClangBuiltLinux/linux/issues/1120#issuecomment-674340760
> > > [2] https://github.com/ClangBuiltLinux/linux/issues/1120#issuecomment-674182703
> >
> > Unfortunately, the diff from Sami does not work together with Arvind's
> > patchset...
> >
> > x86/boot: Remove run-time relocations from compressed kernel
> >
> > ...which got included in <tip.git#x86/boot> recently.
> >
> > I see the following:
> >
> >   ld.lld-11 -m elf_x86_64  -pie  --no-dynamic-linker -T
> > arch/x86/boot/compressed/vmlinux.lds
> > arch/x86/boot/compressed/kernel_info.o
> > arch/x86/boot/compressed/head_64.o arch/x86/boot/compressed/misc.o
> > arch/x86/boot/compressed/string.o arch/x86/boot/compressed/cmdline.o
> > arch/x86/boot/compressed/error.o arch/x86/boot/compressed/piggy.o
> > arch/x86/boot/compressed/cpuflags.o
> > arch/x86/boot/compressed/early_serial_console.o
> > arch/x86/boot/compressed/kaslr.o arch/x86/boot/compressed/kaslr_64.o
> > arch/x86/boot/compressed/mem_encrypt.o
> > arch/x86/boot/compressed/pgtable_64.o arch/x86/boot/compressed/acpi.o
> > arch/x86/boot/compressed/efi_thunk_64.o
> > drivers/firmware/efi/libstub/lib.a -o arch/x86/boot/compressed/vmlinux
> > ld.lld-11: error: Unexpected GOT entries detected!
> > ld.lld-11: error: Unexpected run-time relocations detected!
> > ld.lld-11: error: Unexpected GOT entries detected!
> > ld.lld-11: error: Unexpected run-time relocations detected!
> > make[5]: *** [arch/x86/boot/compressed/Makefile:91:
> > arch/x86/boot/compressed/vmlinux] Error 1
> >
> > When you need further informations, please let me know.
> >
> > - Sedat -
> >
> > [1] https://github.com/ClangBuiltLinux/linux/issues/1120#issuecomment-674182703
>
> When I revert...
>
> commit df6d4f9db79c1a5d6f48b59db35ccd1e9ff9adfc
> "x86/boot/compressed: Don't declare __force_order in kaslr_64.c"
>
> ...I can build, boot on bare metal and start FreeDOS VM in VirtualBox.
>
> For more details see [2].
>
> - Sedat -
>
> [1] https://git.kernel.org/linus/df6d4f9db79c1a5d6f48b59db35ccd1e9ff9adfc
> [2] https://github.com/ClangBuiltLinux/linux/issues/1120#issuecomment-674378085

Fine with using Debian's GCC v10.2 and GNU/ld v2.35 (from binutils v2.35).

All details in [1].

[1] https://github.com/ClangBuiltLinux/linux/issues/1120#issuecomment-674406068

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ