1542 Commits

Author SHA1 Message Date
Masahiro Yamada
c466d17e3a kbuild: drop -Wno-unknown-warning-option from clang options
commit a0ae981eba8f07dbc74bce38fd3a462b69a5bc8e upstream.

Since commit c3f0d0bc5b01 ("kbuild, LLVMLinux: Add -Werror to
cc-option to support clang"), cc-option and friends work nicely
for clang.

However, -Wno-unknown-warning-option makes clang happy with any
unknown warning options even if -Werror is specified.

Once -Wno-unknown-warning-option is added, any succeeding call of
cc-disable-warning is evaluated positive, then unknown warning
options are accepted.  This should be dropped.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-23 08:20:35 +01:00
Michael Davidson
cd9a7644a3 kbuild: clang: add -no-integrated-as to KBUILD_[AC]FLAGS
commit a37c45cd82e62a361706b9688a984a3a63957321 upstream.

The Linux Kernel relies on GCC's acceptance of inline assembly as an
opaque object which will not have any validation performed on the content.
The current behaviour in LLVM is to perform validation of the contents by
means of parsing the input if the MC layer can handle it.

Disable clangs integrated assembler and use the GNU assembler instead.

Wording-mostly-from: Saleem Abdulrasool <compnerd@compnerd.org>
Signed-off-by: Michael Davidson <md@google.com>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-23 08:20:34 +01:00
Behan Webster
7135c75e00 kbuild: Add better clang cross build support
commit 785f11aa595bc3d4e74096cbd598ada54ecc0d81 upstream.

Add cross target to CC if using clang. Also add custom gcc toolchain
path for fallback gcc tools.

Clang will fallback to using things like ld, as, and libgcc if
(respectively) one of the llvm linkers isn't available, the integrated
assembler is turned off, or an appropriately cross-compiled version of
compiler-rt isn't available. To this end, you can specify the path to
this fallback gcc toolchain with GCC_TOOLCHAIN.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-23 08:20:34 +01:00
Greg Kroah-Hartman
7a4dc3f839 Linux 4.9.138 2018-11-21 09:26:04 +01:00
Greg Kroah-Hartman
5552683784 Linux 4.9.137 2018-11-13 11:17:06 -08:00
Greg Kroah-Hartman
0bb1a5e5aa Linux 4.9.136 2018-11-10 07:43:01 -08:00
Greg Kroah-Hartman
b24c9962b1 Linux 4.9.135 2018-10-20 09:51:33 +02:00
Greg Kroah-Hartman
1d326a94d1 Linux 4.9.134 2018-10-18 09:13:26 +02:00
Greg Kroah-Hartman
deb3303f66 Linux 4.9.133 2018-10-13 09:18:59 +02:00
Greg Kroah-Hartman
3622426cc9 Linux 4.9.132 2018-10-10 08:53:23 +02:00
Greg Kroah-Hartman
cdd48f386d Linux 4.9.131 2018-10-03 17:01:55 -07:00
Greg Kroah-Hartman
46f9f7c3c3 Linux 4.9.130 2018-09-29 03:07:35 -07:00
Greg Kroah-Hartman
6ceccdf5ca Linux 4.9.129 2018-09-26 08:36:41 +02:00
Greg Kroah-Hartman
70915e25e1 Linux 4.9.128 2018-09-19 22:47:17 +02:00
Greg Kroah-Hartman
927556eb3a Linux 4.9.127 2018-09-15 09:43:07 +02:00
Greg Kroah-Hartman
66f5a871e5 Linux 4.9.126 2018-09-09 20:01:26 +02:00
Greg Kroah-Hartman
9eabacaf4c Linux 4.9.125 2018-09-05 09:20:11 +02:00
Greg Kroah-Hartman
e8d49e4292 Linux 4.9.124 2018-08-24 13:12:43 +02:00
Greg Kroah-Hartman
676054232e Linux 4.9.123 2018-08-22 07:47:16 +02:00
Greg Kroah-Hartman
ea101a7026 Linux 4.9.122 2018-08-18 10:47:20 +02:00
Greg Kroah-Hartman
d0e3227f31 Linux 4.9.121 2018-08-17 20:59:30 +02:00
Andrey Konovalov
76b6f30f94 kasan: don't emit builtin calls when sanitization is off
commit 0e410e158e5baa1300bdf678cea4f4e0cf9d8b94 upstream.

With KASAN enabled the kernel has two different memset() functions, one
with KASAN checks (memset) and one without (__memset).  KASAN uses some
macro tricks to use the proper version where required.  For example
memset() calls in mm/slub.c are without KASAN checks, since they operate
on poisoned slab object metadata.

The issue is that clang emits memset() calls even when there is no
memset() in the source code.  They get linked with improper memset()
implementation and the kernel fails to boot due to a huge amount of KASAN
reports during early boot stages.

The solution is to add -fno-builtin flag for files with KASAN_SANITIZE :=
n marker.

Link: http://lkml.kernel.org/r/8ffecfffe04088c52c42b92739c2bd8a0bcb3f5e.1516384594.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ Sami: Backported to 4.9 avoiding c5caf21ab0cf8 and e7c52b84fb ]
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-17 20:59:29 +02:00
Greg Kroah-Hartman
93e02ae420 Linux 4.9.120 2018-08-15 18:14:55 +02:00
Greg Kroah-Hartman
8f21ecb424 Linux 4.9.119 2018-08-09 12:18:00 +02:00
Greg Kroah-Hartman
e01202b36f Linux 4.9.118 2018-08-06 16:23:04 +02:00
Greg Kroah-Hartman
ddd28fff50 Linux 4.9.117 2018-08-03 07:55:27 +02:00
Greg Kroah-Hartman
94c67449c7 Linux 4.9.116 2018-07-28 07:49:14 +02:00
Arnd Bergmann
b1a1d9bdb1 turn off -Wattribute-alias
Starting with gcc-8.1, we get a warning about all system call definitions,
which use an alias between functions with incompatible prototypes, e.g.:

In file included from ../mm/process_vm_access.c:19:
../include/linux/syscalls.h:211:18: warning: 'sys_process_vm_readv' alias between functions of incompatible types 'long int(pid_t,  const struct iovec *, long unsigned int,  const struct iovec *, long unsigned int,  long unsigned int)' {aka 'long int(int,  const struct iovec *, long unsigned int,  const struct iovec *, long unsigned int,  long unsigned int)'} and 'long int(long int,  long int,  long int,  long int,  long int,  long int)' [-Wattribute-alias]
  asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
                  ^~~
../include/linux/syscalls.h:207:2: note: in expansion of macro '__SYSCALL_DEFINEx'
  __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
  ^~~~~~~~~~~~~~~~~
../include/linux/syscalls.h:201:36: note: in expansion of macro 'SYSCALL_DEFINEx'
 #define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
                                    ^~~~~~~~~~~~~~~
../mm/process_vm_access.c:300:1: note: in expansion of macro 'SYSCALL_DEFINE6'
 SYSCALL_DEFINE6(process_vm_readv, pid_t, pid, const struct iovec __user *, lvec,
 ^~~~~~~~~~~~~~~
../include/linux/syscalls.h:215:18: note: aliased declaration here
  asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
                  ^~~
../include/linux/syscalls.h:207:2: note: in expansion of macro '__SYSCALL_DEFINEx'
  __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
  ^~~~~~~~~~~~~~~~~
../include/linux/syscalls.h:201:36: note: in expansion of macro 'SYSCALL_DEFINEx'
 #define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
                                    ^~~~~~~~~~~~~~~
../mm/process_vm_access.c:300:1: note: in expansion of macro 'SYSCALL_DEFINE6'
 SYSCALL_DEFINE6(process_vm_readv, pid_t, pid, const struct iovec __user *, lvec,

This is really noisy and does not indicate a real problem. In the latest
mainline kernel, this was addressed by commit bee20031772a ("disable
-Wattribute-alias warning for SYSCALL_DEFINEx()"), which seems too invasive
to backport.

This takes a much simpler approach and just disables the warning across the
kernel.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-28 07:49:13 +02:00
Greg Kroah-Hartman
dbcdf42bab Linux 4.9.115 2018-07-25 11:24:03 +02:00
Greg Kroah-Hartman
19e5f4da12 Linux 4.9.114 2018-07-22 14:27:43 +02:00
Greg Kroah-Hartman
f77982e691 Linux 4.9.113 2018-07-17 11:37:54 +02:00
Greg Kroah-Hartman
060744011e Linux 4.9.112 2018-07-11 16:26:46 +02:00
Greg Kroah-Hartman
e692f66fab Linux 4.9.111 2018-07-03 11:23:18 +02:00
Greg Kroah-Hartman
c806e08569 Linux 4.9.110 2018-06-26 08:08:09 +08:00
Greg Kroah-Hartman
8e52b94e19 Linux 4.9.109 2018-06-16 09:52:35 +02:00
Greg Kroah-Hartman
4f42dc62be Linux 4.9.108 2018-06-13 16:16:44 +02:00
Greg Kroah-Hartman
3c3d05fc6e Linux 4.9.107 2018-06-06 16:44:39 +02:00
Greg Kroah-Hartman
2460c23c35 Linux 4.9.106 2018-06-05 10:28:58 +02:00
Greg Kroah-Hartman
3762b3e2aa Linux 4.9.105 2018-05-30 22:25:17 +02:00
Greg Kroah-Hartman
5b90d559d4 Linux 4.9.104 2018-05-30 07:50:52 +02:00
Greg Kroah-Hartman
aa4b4ace9c Linux 4.9.103 2018-05-25 16:13:16 +02:00
Greg Kroah-Hartman
2272cdd5d5 Linux 4.9.102 2018-05-22 16:58:04 +02:00
Greg Kroah-Hartman
6ba89b52ba Linux 4.9.101 2018-05-19 10:27:01 +02:00
Greg Kroah-Hartman
872e1aead3 Linux 4.9.100 2018-05-16 10:08:45 +02:00
Greg Kroah-Hartman
04cd74a759 Linux 4.9.99 2018-05-09 09:50:24 +02:00
Greg Kroah-Hartman
eff40cb190 Linux 4.9.98 2018-05-01 15:13:10 -07:00
Greg Kroah-Hartman
ba3cd57962 Linux 4.9.97 2018-04-29 11:32:03 +02:00
Greg Kroah-Hartman
5cd35f3eb5 Linux 4.9.96 2018-04-24 09:34:18 +02:00
Greg Kroah-Hartman
eedaf21fb3 Linux 4.9.95 2018-04-20 08:21:08 +02:00
Greg Kroah-Hartman
cc0eb4dd50 Linux 4.9.94 2018-04-13 19:48:37 +02:00