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-next>] [day] [month] [year] [list]
Message-ID: <20180615211441.GO88063@google.com>
Date:   Fri, 15 Jun 2018 14:14:41 -0700
From:   Matthias Kaehlcke <mka@...omium.org>
To:     Josh Poimboeuf <jpoimboe@...hat.com>
Cc:     linux-kernel@...r.kernel.org,
        Manoj Gupta <manojgupta@...omium.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>
Subject: clang: objtool: native_machine_emergency_restart() falls through to
 next function

Hi Josh,

with your work on objtool and the upcoming implementation of
-fno-delete-null-pointer-checks (https://reviews.llvm.org/D47894,
https://reviews.llvm.org/D47895) in clang most objtool warnings
for clang builds will be fixed.

However even with -fno-delete-null-pointer-checks we currently still
get a warning about native_machine_emergency_restart():

arch/x86/kernel/reboot.o: warning: objtool:
  native_machine_emergency_restart()
  falls through to next function machine_power_off()

This only occurs when building with -Oz.

One of our compiler engineers looked into this, LLVM optimizes the
return statement away since the function has an endless loop, and
actually never returns.

Is there a way to tell objtool that the function is not expected to
return (I tried the attribute __noreturn, but it doesn't make a
difference), or do we have to tell clang to restrain from optimizing
returns out?

To repro:

git checkout v4.16
make CC=clang defconfig
echo "CONFIG_CC_OPTIMIZE_FOR_SIZE=y" >> .config
make CC=clang arch/x86/kernel/reboot.o

Thanks

Matthias

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ