Commit graph

1626 commits

Author SHA1 Message Date
Greg Kroah-Hartman
b3a99fd385 Linux 4.19.129 2020-06-22 09:05:30 +02:00
Masahiro Yamada
5ec83ff488 kbuild: force to build vmlinux if CONFIG_MODVERSION=y
commit 4b50c8c4eaf06a825d1c005c0b1b4a8307087b83 upstream.

This code does not work as stated in the comment.

$(CONFIG_MODVERSIONS) is always empty because it is expanded before
include/config/auto.conf is included. Hence, 'make modules' with
CONFIG_MODVERSION=y cannot record the version CRCs.

This has been broken since 2003, commit ("kbuild: Enable modules to be
build using the "make dir/" syntax"). [1]

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=15c6240cdc44bbeef3c4797ec860f9765ef4f1a7
Cc: linux-stable <stable@vger.kernel.org> # v2.5.71+
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-22 09:05:29 +02:00
Greg Kroah-Hartman
3fc898571b Linux 4.19.128 2020-06-10 21:35:02 +02:00
Greg Kroah-Hartman
106fa147d3 Linux 4.19.127 2020-06-07 13:17:57 +02:00
Greg Kroah-Hartman
4707d8e572 Linux 4.19.126 2020-06-03 08:19:49 +02:00
Greg Kroah-Hartman
2d16cf4817 Linux 4.19.125 2020-05-27 17:37:46 +02:00
Greg Kroah-Hartman
1bab61d3e8 Linux 4.19.124 2020-05-20 08:18:54 +02:00
Sergei Trofimovich
bf7d61e56e Makefile: disallow data races on gcc-10 as well
commit b1112139a103b4b1101d0d2d72931f2d33d8c978 upstream.

gcc-10 will rename --param=allow-store-data-races=0
to -fno-allow-store-data-races.

The flag change happened at https://gcc.gnu.org/PR92046.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Cc: Thomas Backlund <tmb@mageia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:18:54 +02:00
Linus Torvalds
28b0bceefe gcc-10: disable 'restrict' warning for now
commit adc71920969870dfa54e8f40dac8616284832d02 upstream.

gcc-10 now warns about passing aliasing pointers to functions that take
restricted pointers.

That's actually a great warning, and if we ever start using 'restrict'
in the kernel, it might be quite useful.  But right now we don't, and it
turns out that the only thing this warns about is an idiom where we have
declared a few functions to be "printf-like" (which seems to make gcc
pick up the restricted pointer thing), and then we print to the same
buffer that we also use as an input.

And people do that as an odd concatenation pattern, with code like this:

    #define sysfs_show_gen_prop(buffer, fmt, ...) \
        snprintf(buffer, PAGE_SIZE, "%s"fmt, buffer, __VA_ARGS__)

where we have 'buffer' as both the destination of the final result, and
as the initial argument.

Yes, it's a bit questionable.  And outside of the kernel, people do have
standard declarations like

    int snprintf( char *restrict buffer, size_t bufsz,
                  const char *restrict format, ... );

where that output buffer is marked as a restrict pointer that cannot
alias with any other arguments.

But in the context of the kernel, that 'use snprintf() to concatenate to
the end result' does work, and the pattern shows up in multiple places.
And we have not marked our own version of snprintf() as taking restrict
pointers, so the warning is incorrect for now, and gcc picks it up on
its own.

If we do start using 'restrict' in the kernel (and it might be a good
idea if people find places where it matters), we'll need to figure out
how to avoid this issue for snprintf and friends.  But in the meantime,
this warning is not useful.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:18:46 +02:00
Linus Torvalds
8a5530c2f0 gcc-10: disable 'stringop-overflow' warning for now
commit 5a76021c2eff7fcf2f0918a08fd8a37ce7922921 upstream.

This is the final array bounds warning removal for gcc-10 for now.

Again, the warning is good, and we should re-enable all these warnings
when we have converted all the legacy array declaration cases to
flexible arrays. But in the meantime, it's just noise.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:18:46 +02:00
Linus Torvalds
fa8487621f gcc-10: disable 'array-bounds' warning for now
commit 44720996e2d79e47d508b0abe99b931a726a3197 upstream.

This is another fine warning, related to the 'zero-length-bounds' one,
but hitting the same historical code in the kernel.

Because C didn't historically support flexible array members, we have
code that instead uses a one-sized array, the same way we have cases of
zero-sized arrays.

The one-sized arrays come from either not wanting to use the gcc
zero-sized array extension, or from a slight convenience-feature, where
particularly for strings, the size of the structure now includes the
allocation for the final NUL character.

So with a "char name[1];" at the end of a structure, you can do things
like

       v = my_malloc(sizeof(struct vendor) + strlen(name));

and avoid the "+1" for the terminator.

Yes, the modern way to do that is with a flexible array, and using
'offsetof()' instead of 'sizeof()', and adding the "+1" by hand.  That
also technically gets the size "more correct" in that it avoids any
alignment (and thus padding) issues, but this is another long-term
cleanup thing that will not happen for 5.7.

So disable the warning for now, even though it's potentially quite
useful.  Having a slew of warnings that then hide more urgent new issues
is not an improvement.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:18:46 +02:00
Linus Torvalds
7f43fca7ea gcc-10: disable 'zero-length-bounds' warning for now
commit 5c45de21a2223fe46cf9488c99a7fbcf01527670 upstream.

This is a fine warning, but we still have a number of zero-length arrays
in the kernel that come from the traditional gcc extension.  Yes, they
are getting converted to flexible arrays, but in the meantime the gcc-10
warning about zero-length bounds is very verbose, and is hiding other
issues.

I missed one actual build failure because it was hidden among hundreds
of lines of warning.  Thankfully I caught it on the second go before
pushing things out, but it convinced me that I really need to disable
the new warnings for now.

We'll hopefully be all done with our conversion to flexible arrays in
the not too distant future, and we can then re-enable this warning.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:18:46 +02:00
Linus Torvalds
ec22322218 Stop the ad-hoc games with -Wno-maybe-initialized
commit 78a5255ffb6a1af189a83e493d916ba1c54d8c75 upstream.

We have some rather random rules about when we accept the
"maybe-initialized" warnings, and when we don't.

For example, we consider it unreliable for gcc versions < 4.9, but also
if -O3 is enabled, or if optimizing for size.  And then various kernel
config options disabled it, because they know that they trigger that
warning by confusing gcc sufficiently (ie PROFILE_ALL_BRANCHES).

And now gcc-10 seems to be introducing a lot of those warnings too, so
it falls under the same heading as 4.9 did.

At the same time, we have a very straightforward way to _enable_ that
warning when wanted: use "W=2" to enable more warnings.

So stop playing these ad-hoc games, and just disable that warning by
default, with the known and straight-forward "if you want to work on the
extra compiler warnings, use W=123".

Would it be great to have code that is always so obvious that it never
confuses the compiler whether a variable is used initialized or not?
Yes, it would.  In a perfect world, the compilers would be smarter, and
our source code would be simpler.

That's currently not the world we live in, though.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:18:45 +02:00
Masahiro Yamada
9088569b56 kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig
commit b303c6df80c9f8f13785aa83a0471fca7e38b24d upstream.

Since -Wmaybe-uninitialized was introduced by GCC 4.7, we have patched
various false positives:

 - commit e74fc973b6 ("Turn off -Wmaybe-uninitialized when building
   with -Os") turned off this option for -Os.

 - commit 815eb71e71 ("Kbuild: disable 'maybe-uninitialized' warning
   for CONFIG_PROFILE_ALL_BRANCHES") turned off this option for
   CONFIG_PROFILE_ALL_BRANCHES

 - commit a76bcf557e ("Kbuild: enable -Wmaybe-uninitialized warning
   for "make W=1"") turned off this option for GCC < 4.9
   Arnd provided more explanation in https://lkml.org/lkml/2017/3/14/903

I think this looks better by shifting the logic from Makefile to Kconfig.

Link: https://github.com/ClangBuiltLinux/linux/issues/350
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:18:45 +02:00
Greg Kroah-Hartman
258f0cf7ac Linux 4.19.123 2020-05-14 07:57:23 +02:00
Greg Kroah-Hartman
033c4ea49a Linux 4.19.122 2020-05-10 10:30:13 +02:00
Greg Kroah-Hartman
84920cc7fb Linux 4.19.121 2020-05-06 08:13:35 +02:00
Greg Kroah-Hartman
fdc072324f Linux 4.19.120 2020-05-02 17:26:01 +02:00
Greg Kroah-Hartman
765675379b Linux 4.19.119 2020-04-29 16:31:35 +02:00
Greg Kroah-Hartman
7edd66cf61 Linux 4.19.118 2020-04-23 10:30:24 +02:00
Greg Kroah-Hartman
8e2406c851 Linux 4.19.117 2020-04-21 09:03:13 +02:00
Greg Kroah-Hartman
8488c3f3bc Linux 4.19.116 2020-04-17 10:48:55 +02:00
Greg Kroah-Hartman
6dd0e32665 Linux 4.19.115 2020-04-13 10:45:17 +02:00
Greg Kroah-Hartman
dda0e29203 Linux 4.19.114 2020-04-02 15:28:25 +02:00
Greg Kroah-Hartman
54b4fa6d39 Linux 4.19.113 2020-03-25 08:06:15 +01:00
Greg Kroah-Hartman
14cfdbd39e Linux 4.19.112 2020-03-20 11:56:00 +01:00
Greg Kroah-Hartman
93556fb211 Linux 4.19.111 2020-03-18 07:14:26 +01:00
Greg Kroah-Hartman
339485c9a8 Linux 4.19.110 2020-03-16 09:52:03 +01:00
Greg Kroah-Hartman
5692097116 Linux 4.19.109 2020-03-11 14:15:13 +01:00
Greg Kroah-Hartman
7472c4028e Linux 4.19.108 2020-03-05 16:42:23 +01:00
Greg Kroah-Hartman
a083db7611 Linux 4.19.107 2020-02-28 16:39:01 +01:00
Greg Kroah-Hartman
f25804f389 Linux 4.19.106 2020-02-24 08:34:54 +01:00
Greg Kroah-Hartman
4fccc25035 Linux 4.19.105 2020-02-19 19:51:59 +01:00
Greg Kroah-Hartman
9b15f7fae6 Linux 4.19.104 2020-02-14 16:33:28 -05:00
Greg Kroah-Hartman
357668399c Linux 4.19.103 2020-02-11 04:34:19 -08:00
Greg Kroah-Hartman
b499cf4b3a Linux 4.19.102 2020-02-05 14:43:55 +00:00
Greg Kroah-Hartman
32ee7492f1 Linux 4.19.101 2020-02-01 09:37:12 +00:00
Greg Kroah-Hartman
7cdefde351 Linux 4.19.100 2020-01-29 16:43:27 +01:00
Greg Kroah-Hartman
88d6de67e3 Linux 4.19.99 2020-01-27 14:51:23 +01:00
Masahiro Yamada
ed94750a2e kbuild: mark prepare0 as PHONY to fix external module build
[ Upstream commit e00d8880481497474792d28c14479a9fb6752046 ]

Commit c3ff2a5193fa ("powerpc/32: add stack protector support")
caused kernel panic on PowerPC when an external module is used with
CONFIG_STACKPROTECTOR because the 'prepare' target was not executed
for the external module build.

Commit e07db28eea38 ("kbuild: fix single target build for external
module") turned it into a build error because the 'prepare' target is
now executed but the 'prepare0' target is missing for the external
module build.

External module on arm/arm64 with CONFIG_STACKPROTECTOR_PER_TASK is
also broken in the same way.

Move 'PHONY += prepare0' to the common place. GNU Make is fine with
missing rule for phony targets. I also removed the comment which is
wrong irrespective of this commit.

I minimize the change so it can be easily backported to 4.20.x

To fix v4.20, please backport e07db28eea38 ("kbuild: fix single target
build for external module"), and then this commit.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=201891
Fixes: e07db28eea38 ("kbuild: fix single target build for external module")
Fixes: c3ff2a5193fa ("powerpc/32: add stack protector support")
Fixes: 189af4657186 ("ARM: smp: add support for per-task stack canaries")
Fixes: 0a1213fa7432 ("arm64: enable per-task stack canaries")
Cc: linux-stable <stable@vger.kernel.org> # v4.20
Reported-by: Samuel Holland <samuel@sholland.org>
Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:50:13 +01:00
Greg Kroah-Hartman
d183c8e264 Linux 4.19.98 2020-01-23 08:21:39 +01:00
Greg Kroah-Hartman
dc4ba5be1b Linux 4.19.97 2020-01-17 19:47:17 +01:00
Greg Kroah-Hartman
db5b9190ff Linux 4.19.96 2020-01-14 20:07:09 +01:00
Greg Kroah-Hartman
dcd8889835 Linux 4.19.95 2020-01-12 12:17:30 +01:00
Greg Kroah-Hartman
cb1f9a169a Linux 4.19.94 2020-01-09 10:19:10 +01:00
Greg Kroah-Hartman
3d40d7117e Linux 4.19.93 2020-01-04 19:13:46 +01:00
Greg Kroah-Hartman
c7ecf3e3a7 Linux 4.19.92 2019-12-31 16:36:37 +01:00
Greg Kroah-Hartman
672481c2de Linux 4.19.91 2019-12-21 10:57:45 +01:00
Greg Kroah-Hartman
7d120bf21c Linux 4.19.90 2019-12-17 20:36:04 +01:00
Greg Kroah-Hartman
312017a460 Linux 4.19.89 2019-12-13 08:52:59 +01:00