Re: [PATCH] s390: disable -Warray-bounds

From: Linus Torvalds
Date: Wed Jun 08 2022 - 21:22:45 EST


On Wed, Jun 8, 2022 at 5:39 PM Kees Cook <keescook@xxxxxxxxxxxx> wrote:
>
> I'll take a look; thanks! Should I send them back as a pull request?

That would be good.

> Yeah. Happily, this has already been solved, but it looks like David didn't do a pull yet for it?
>
> https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=fscache-next

Good.

> For gcc's UBSAN_SHIFT (I typoed this in my first reply) bug, netdev has been moving it to W=1 builds on a per-source basis for the moment:
>
> https://git.kernel.org/linus/e95032988053c17baf6c7e27024f5103a19a5f4a

Ugh. That's sad. Since now the gcc-12 misfeature ends up biting
everybody else too.

> Perhaps these could be even more carefully limited to GCC 12 only, using the Kconfig you suggested?

Yeah, I'd rather just say "gcc-12 gets this thing entirely wrong,
let's disable it there" than disable it for compilers that get it
right.

In fact, I'd rather have that global "gcc-12 is broken, disable it",
than marking "this file shouldn't get checked" kind of logic.

It's wrong blaming the C code, when the compiler is doing bad sh*t.

Linus