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] [day] [month] [year] [list]
Message-ID: <tip-a9c640ac96e19b3966357ec9bb586edd2e1e74de@git.kernel.org>
Date:   Thu, 21 Mar 2019 04:28:12 -0700
From:   tip-bot for Nick Desaulniers <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     mingo@...nel.org, tglx@...utronix.de, ubizjak@...il.com,
        ndesaulniers@...gle.com, fanc.fnst@...fujitsu.com,
        sfr@...b.auug.org.au, natechancellor@...il.com, hpa@...or.com,
        linux-kernel@...r.kernel.org
Subject: [tip:x86/urgent] x86/boot: Restrict header scope to make Clang
 happy

Commit-ID:  a9c640ac96e19b3966357ec9bb586edd2e1e74de
Gitweb:     https://git.kernel.org/tip/a9c640ac96e19b3966357ec9bb586edd2e1e74de
Author:     Nick Desaulniers <ndesaulniers@...gle.com>
AuthorDate: Thu, 14 Mar 2019 15:14:57 -0700
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Thu, 21 Mar 2019 12:24:38 +0100

x86/boot: Restrict header scope to make Clang happy

The inclusion of <linux/kernel.h> was causing issue as the definition of
__arch_hweight64 from arch/x86/include/asm/arch_hweight.h eventually gets
included. The definition is problematic when compiled with -m16 (all code
in arch/x86/boot/ is) as the "D" inline assembly constraint is rejected
by both compilers when passed an argument of type long long (regardless
of signedness, anything smaller is fine).

Because GCC performs inlining before semantic analysis, and
__arch_hweight64 is dead in this translation unit, GCC does not report
any issues at compile time.  Clang does the semantic analysis in the
front end, before inlining (run in the middle) can determine the code is
dead. I consider this another case of PR33587, which I think we can do
more work to solve.

It turns out that arch/x86/boot/string.c doesn't actually need
linux/kernel.h, simply linux/limits.h and linux/compiler.h.

Suggested-by: Stephen Rothwell <sfr@...b.auug.org.au>
Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Tested-by: Nathan Chancellor <natechancellor@...il.com>
Reviewed-by: Nathan Chancellor <natechancellor@...il.com>
Cc: bp@...en8.de
Cc: niravd@...gle.com
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: Chao Fan <fanc.fnst@...fujitsu.com>
Cc: Uros Bizjak <ubizjak@...il.com>
Link: https://bugs.llvm.org/show_bug.cgi?id=33587
Link: https://github.com/ClangBuiltLinux/linux/issues/347
Link: https://lkml.kernel.org/r/20190314221458.83047-1-ndesaulniers@google.com

---
 arch/x86/boot/string.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 315a67b8896b..90154df8f125 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -13,8 +13,9 @@
  */
 
 #include <linux/types.h>
-#include <linux/kernel.h>
+#include <linux/compiler.h>
 #include <linux/errno.h>
+#include <linux/limits.h>
 #include <asm/asm.h>
 #include "ctype.h"
 #include "string.h"

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ