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: <CA+icZUU=qAJ7xqYs_k=NNG-Sj3Xv770MUNToA4JqiO3rAzUxNA@mail.gmail.com>
Date:	Sun, 13 Sep 2015 04:33:39 +0200
From:	Sedat Dilek <sedat.dilek@...il.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Baoquan He <bhe@...hat.com>, Denys Vlasenko <dvlasenk@...hat.com>,
	Tejun Heo <tj@...nel.org>, Christoph Lameter <cl@...ux.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	David Rientjes <rientjes@...gle.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Thomas Graf <tgraf@...g.ch>, Ingo Molnar <mingo@...nel.org>,
	"the arch/x86 maintainers" <x86@...nel.org>
Subject: Re: [llvmlinux] percpu | bitmap issue? (Cannot boot on bare metal due
 to a kernel NULL pointer dereference)

On Sat, Sep 12, 2015 at 11:22 PM, Sedat Dilek <sedat.dilek@...il.com> wrote:
> On Wed, Sep 9, 2015 at 2:54 PM, Peter Zijlstra <peterz@...radead.org> wrote:
>> On Wed, Sep 09, 2015 at 12:05:50PM +0200, Sedat Dilek wrote:
>>> I can boot into a CLANG v3.7 compiled Linux-kernel when lib/bitmap is
>>> compiled with GCC (here: v4.9).
>>>
>>> CONFIG_OPTIMIZE_INLINING has no effect on this.
>>>
>>> Attached are the single llvmlinux patch for AMD64 (x86_64), my
>>> kernel-config and 2 objdumps with bitmap.o file alltogether.
>>
>> I suggest you go tell the LLVM people their compiler is broken.
>
> It looks like an inline-optimization bug in CLANG when the compiler's
> optimization-level is higher than -O2.
>
> Level -O0 and -O1 are OK - I can boot in such Linux-kernel v4.2.
>
> With Level -Oz when CONFIG_CC_OPTIMIZE_FOR_SIZE=y (equivalent to GCC's
> -Os) the objdump looked sane but I cannot boot on bare metal.
> Re-compiling lib/bitmap with -O0 or -O1 is fine again.
>
> - Sedat -
>
> [1] http://lists.linuxfoundation.org/pipermail/llvmlinux/2015-September/001355.html

After some discussion on #llvm it turned out to be a known issue in LLVMLinux!

Unfortunately, an existing patch [1] got archived which is still
required to build x86_64 correctly.
I refreshed this patch against Linux v4.2 (see file attachments).
( According to llvm guys that patch should go upstream and affects
also building with GCC. )
( That's up to the experts. )

$ cat /proc/version
Linux version 4.2.0-3-llvmlinux-amd64 (sedat.dilek@...il.com@...box)
(clang version 3.7.0 (tags/RELEASE_370/final)) #1 SMP Sun Sep 13
02:02:47 CEST 2015

H00ray!

- Sedat -

[1] http://git.linuxfoundation.org/?p=llvmlinux.git;a=blob_plain;f=arch/x86_64/patches/ARCHIVE/0029-Fix-ARCH_HWEIGHT-for-compilation-with-clang.patch;hb=HEAD

View attachment "dmesg_4.2.0-3-llvmlinux-amd64.txt" of type "text/plain" (60453 bytes)

View attachment "llvmlinux-Fix-ARCH_HWEIGHT-for-compilation-with-clang.patch" of type "text/x-patch" (1381 bytes)

Download attachment "config-4.2.0-3-llvmlinux-amd64" of type "application/octet-stream" (128613 bytes)

View attachment "4.2.0-3-llvmlinux-amd64.patch" of type "text/x-patch" (36072 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ