linux-stable/arch
Linus Torvalds f0be87c42c gcc-12: disable '-Warray-bounds' universally for now
In commit 8b202ee218 ("s390: disable -Warray-bounds") the s390 people
disabled the '-Warray-bounds' warning for gcc-12, because the new logic
in gcc would cause warnings for their use of the S390_lowcore macro,
which accesses absolute pointers.

It turns out gcc-12 has many other issues in this area, so this takes
that s390 warning disable logic, and turns it into a kernel build config
entry instead.

Part of the intent is that we can make this all much more targeted, and
use this conflig flag to disable it in only particular configurations
that cause problems, with the s390 case as an example:

        select GCC12_NO_ARRAY_BOUNDS

and we could do that for other configuration cases that cause issues.

Or we could possibly use the CONFIG_CC_NO_ARRAY_BOUNDS thing in a more
targeted way, and disable the warning only for particular uses: again
the s390 case as an example:

  KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_CC_NO_ARRAY_BOUNDS),-Wno-array-bounds)

but this ends up just doing it globally in the top-level Makefile, since
the current issues are spread fairly widely all over:

  KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds

We'll try to limit this later, since the gcc-12 problems are rare enough
that *much* of the kernel can be built with it without disabling this
warning.

Cc: Kees Cook <keescook@chromium.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-06-09 10:11:12 -07:00
..
alpha Cleanups (and one fix) around struct mount handling. 2022-06-04 19:00:05 -07:00
arc This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
arm This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
arm64 This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
csky This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
hexagon fork: Generalize PF_IO_WORKER handling 2022-05-07 09:01:59 -05:00
ia64 Bitmap patches for 5.19-rc1 2022-06-04 14:04:27 -07:00
loongarch LoongArch: Add Loongson-3 default config file 2022-06-03 20:09:29 +08:00
m68k This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
microblaze This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
mips This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
nios2 This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
openrisc This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
parisc Kbuild updates for v5.19 (2nd) 2022-06-05 09:06:03 -07:00
powerpc This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
riscv Bitmap patches for 5.19-rc1 2022-06-04 14:04:27 -07:00
s390 gcc-12: disable '-Warray-bounds' universally for now 2022-06-09 10:11:12 -07:00
sh This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
sparc This set of changes updates init and user mode helper tasks to be 2022-06-03 16:03:05 -07:00
um While looking at the ptrace problems with PREEMPT_RT and the problems 2022-06-03 16:13:25 -07:00
x86 * Fix syzkaller NULL pointer dereference 2022-06-08 09:16:31 -07:00
xtensa While looking at the ptrace problems with PREEMPT_RT and the problems 2022-06-03 16:13:25 -07:00
.gitignore
Kconfig A set of objtool fixes: 2022-06-05 09:45:27 -07:00