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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 11 May 2018 13:52:30 +0200
From:   Sedat Dilek <sedat.dilek@...il.com>
To:     Matthias Kaehlcke <mka@...omium.org>
Cc:     lkml <linux-kernel@...r.kernel.org>, Arnd Bergmann <arnd@...db.de>,
        Nick Desaulniers <nick.desaulniers@...il.com>,
        Manoj Gupta <manojgupta@...omium.org>,
        AlistairStrachan <astrachan@...gle.com>,
        "Steven Rostedt (VMware)" <rostedt@...dmis.org>
Subject: Re: Clang patch stacks for LTS kernels (v4.4 and v4.9) and status update

On Mon, May 7, 2018 at 7:49 PM, Matthias Kaehlcke <mka@...omium.org> wrote:

[...]

>> Hi Matthias,
>>
>> again you helped me a lot.
>>
>> I recalled that I had success in the early days of llvmlinux with...
>>
>>     CONFIG_PARAVIRT=n
>>
>> ...as suggested by Steve Rostedt.
>>
>> This needed some more hackish kconfig kungfu these days - patches attached.
>>
>> In the end I could boot into a 4.14.37-1-iniza-llvmlinux kernel
>> (kernel-config and dmesg-log attached).
>>
>> Concerning your analysis...
>>
>> Is this a clang-bug?
>> Or can this be solved in the linux-kernel code?
>> What are your suggestion?
>> And can you help on getting this fixed with the help of your Chromium
>> team and/or bring it to the right persons?
>
> Apparently stack-protector code is clobbering RCX, however the
> paravirt code expects the register to be preserved:
>
> struct pv_irq_ops {
>         /*
>          * ...
>          * NOTE: These functions callers expect the callee to preserve
>          * more registers than the standard C calling convention.
>          */
>         struct paravirt_callee_save save_fl;
>
> We think the solution is to mark native_save_fl with
> '__nostackprotector', however this requires adding support for
> such an attribute to clang. Our compiler team is working on this.
>

[ CC Steven Rostedt ]

Hi Matthias,

as a confirmation I could boot into a paravirtualized llvm-kernel
v4.14.40 with CC_STACKPROTECTOR_NONE=y.

$ ./scripts/diffconfig /boot/config-4.14.37-1-iniza-llvmlinux
/boot/config-4.14.40-1-iniza-llvmlinux | grep CC_STACKPROTECTOR
 CC_STACKPROTECTOR y -> n
 CC_STACKPROTECTOR_NONE n -> y
 CC_STACKPROTECTOR_STRONG y -> n

$ grep -i paravirt qemu-log_4.14.40-1-iniza-llvmlinux.txt
[    0.000000] Booting paravirtualized kernel on KVM

Both kernel-configs, the qemu-script and qemu-logs are attached.

For people following I can send you the used patch-series (see below).

Thanks.

Regards,
- Sedat -

P.S.: Patchset contains patchstack from llvm_v4.14_ext by Matthias &
coworkers with reverted stuff (mostly kbuild) being in
linux-stable-4.14.y plus some more patches (xen VLAIS, kbuild HOSTCC,
etc.)

$ git log --oneline v4.14.40..
590207f1e63c (HEAD -> 4.14.40-1-iniza-llvmlinux) Merge branch
'for-4.14/x86-xen-clang-fixes' into 4.14.40-1-iniza-llvmlinux
36a1c0f031f4 Merge branch 'for-4.14/kbuild-clang-fixes' into
4.14.40-1-iniza-llvmlinux
c3afa4921927 Merge branch
'for-llvm_v4.14_ext/revert-clang-kbuild-fixes' into
4.14.40-1-iniza-llvmlinux
32f3dd55b9c8 (for-4.14/x86-xen-clang-fixes) x86: xen: remove the use of VLAIS
6b78d2ecfae1 (for-4.14/kbuild-clang-fixes) kbuild: clang: remove
crufty HOSTCFLAGS
53da106d34a3 (for-llvm_v4.14_ext/revert-clang-kbuild-fixes) Revert
"UPSTREAM: kbuild: fix linker feature test macros when cross compiling
with Clang"
6136ef7f8eaf Revert "BACKPORT: kbuild: Set KBUILD_CFLAGS before incl.
arch Makefile"
73a00f4cfd62 Revert "BACKPORT: kbuild: disable clang's default use of
-fmerge-all-constants"
6d945349c761 Revert "CLANG4: crypto: arm64/aes-ce: Explicitly pass
through assembler options"
dc09abad371e Revert "CLANG4: kbuild: Add -meabi gnu to the clang parameters"
b4d76971bd02 Revert "CLANG4: arm64: prefetch: Use
__builtin_arm_prefetch() for clang"
c779654513fd Revert "CLANG4: Disable lkdtm when ftrace is enabled"
c52593cc5e62 Revert "CLANG4: futex: don't optimize
futex_detect_cmpxchg() on ARM64"
a7074de141fb Revert "CLANG3: core: clang: work around x86 regparm /
intrinsics bug"
c03a7ac96a18 (llvm_v4.14_ext) UPSTREAM: sched/sysctl: Fix attributes
of some extern declarations
fc0f14867820 UPSTREAM: x86/boot: Disable Clang warnings about GNU extensions
9a7e28aa6b4a HACK: arm64: Mark CONFIG_CPU_BIG_ENDIAN as broken
a0092455e775 HACK: arm64: Mark CONFIG_ARM64_LSE_ATOMICS as broken
9de3cf0e0462 HACK: media: camss: Mark as broken
82951cf7d32c HACK: kasan: Mark as broken
2732c83a4fa4 HACK: exofs: Mark as broken
6a3124b1d1f8 UPSTREAM: serial: sh-sci: Fix init data attribute for
struct 'port_cfg'
b3b270e93807 UPSTREAM: bcache: Avoid nested function definition
6098eb444464 UPSTREAM: nfp: don't depend on compiler constant propagation
e95e3974644d UPSTREAM: md: raid10: remove VLAIS
69e44656ae43 CLANG3: core: clang: work around x86 regparm / intrinsics bug
222b88977a00 CLANG4: futex: don't optimize futex_detect_cmpxchg() on ARM64
cdfcf1e45537 CLANG4: Disable lkdtm when ftrace is enabled
26f14c9225a6 CLANG4: arm64: prefetch: Use __builtin_arm_prefetch() for clang
0385a18e9995 CLANG4: kbuild: Add -meabi gnu to the clang parameters
68dab143c9b4 CLANG4: crypto: arm64/aes-ce: Explicitly pass through
assembler options
9af5ddf981ed (llvm_v4.14) BACKPORT: kbuild: disable clang's default
use of -fmerge-all-constants
b84e202d9cd6 UPSTREAM: crypto: arm64/aes-ce-cipher - move assembler
code to .S file
f24088a3842c BACKPORT: kbuild: Set KBUILD_CFLAGS before incl. arch Makefile
d4dfe384346d UPSTREAM: kbuild: fix linker feature test macros when
cross compiling with Clang

View attachment "qemu-log_4.14.40-1-iniza-llvmlinux.txt" of type "text/plain" (19650 bytes)

Download attachment "config-4.14.37-1-iniza-llvmlinux" of type "application/octet-stream" (195387 bytes)

Download attachment "config-4.14.40-1-iniza-llvmlinux" of type "application/octet-stream" (197149 bytes)

Download attachment "run_qemu.sh" of type "application/x-shellscript" (218 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ