2023-11-21 02:19:21

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the kspp-gustavo tree

Hi all,

After merging the kspp-gustavo tree, today's linux-next build (powerpc
pseries_le_defconfig) failed like this:

arch/powerpc/crypto/aes-gcm-p10-glue.c: In function 'gcmp10_init':
arch/powerpc/crypto/aes-gcm-p10-glue.c:120:9: error: 'gcm_init_htable' accessing 256 bytes in a region of size 224 [-Werror=stringop-overflow=]
120 | gcm_init_htable(hash->Htable+32, hash->H);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/crypto/aes-gcm-p10-glue.c:120:9: note: referencing argument 1 of type 'unsigned char[256]'
arch/powerpc/crypto/aes-gcm-p10-glue.c:120:9: note: referencing argument 2 of type 'unsigned char[16]'
arch/powerpc/crypto/aes-gcm-p10-glue.c:40:17: note: in a call to function 'gcm_init_htable'
40 | asmlinkage void gcm_init_htable(unsigned char htable[256], unsigned char Xi[16]);
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Caused by commit

167820dd258d ("Makefile: Enable -Wstringop-overflow globally")

I have used the kspp-gustavo tree from next-20231120 for today.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2023-11-21 16:32:01

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kspp-gustavo tree

Hi Stephen,

On 11/20/23 20:19, Stephen Rothwell wrote:
> Hi all,
>
> After merging the kspp-gustavo tree, today's linux-next build (powerpc
> pseries_le_defconfig) failed like this:
>
> arch/powerpc/crypto/aes-gcm-p10-glue.c: In function 'gcmp10_init':
> arch/powerpc/crypto/aes-gcm-p10-glue.c:120:9: error: 'gcm_init_htable' accessing 256 bytes in a region of size 224 [-Werror=stringop-overflow=]
> 120 | gcm_init_htable(hash->Htable+32, hash->H);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/powerpc/crypto/aes-gcm-p10-glue.c:120:9: note: referencing argument 1 of type 'unsigned char[256]'
> arch/powerpc/crypto/aes-gcm-p10-glue.c:120:9: note: referencing argument 2 of type 'unsigned char[16]'
> arch/powerpc/crypto/aes-gcm-p10-glue.c:40:17: note: in a call to function 'gcm_init_htable'
> 40 | asmlinkage void gcm_init_htable(unsigned char htable[256], unsigned char Xi[16]);
> | ^~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
>
> Caused by commit
>
> 167820dd258d ("Makefile: Enable -Wstringop-overflow globally")
>
> I have used the kspp-gustavo tree from next-20231120 for today.
>

Thanks a lot for the report, again!

We are pretty close to enabling this compiler option, and it seems you
are catching issues that neither 0-day folks nor I have caught before.

I wonder if you could help me catch the rest of these issues by disabling
WERROR (so we can get all the warnings) and letting your builds run with the
following patch on top:

diff --git a/Makefile b/Makefile
index ede0bd241056..596c33e6319b 100644
--- a/Makefile
+++ b/Makefile
@@ -982,6 +982,8 @@ NOSTDINC_FLAGS += -nostdinc
# perform bounds checking.
KBUILD_CFLAGS += $(call cc-option, -fstrict-flex-arrays=3)

+KBUILD_CFLAGS += $(call cc-option, -Wstringop-overflow)
+
# disable invalid "can't wrap" optimizations for signed / pointers
KBUILD_CFLAGS += -fno-strict-overflow

diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index 2fe6f2828d37..1527199161d7 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -106,7 +106,6 @@ KBUILD_CFLAGS += $(call cc-option, -Wunused-const-variable)
KBUILD_CFLAGS += $(call cc-option, -Wpacked-not-aligned)
KBUILD_CFLAGS += $(call cc-option, -Wformat-overflow)
KBUILD_CFLAGS += $(call cc-option, -Wformat-truncation)
-KBUILD_CFLAGS += $(call cc-option, -Wstringop-overflow)
KBUILD_CFLAGS += $(call cc-option, -Wstringop-truncation)

KBUILD_CPPFLAGS += -Wundef
@@ -122,7 +121,6 @@ KBUILD_CFLAGS += $(call cc-disable-warning, restrict)
KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned)
KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
-KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow)
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)

ifdef CONFIG_CC_IS_CLANG


Thank you!
--
Gustavo

2023-11-21 23:17:06

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the kspp-gustavo tree

Hi Gustavo,

On Tue, 21 Nov 2023 10:31:16 -0600 "Gustavo A. R. Silva" <[email protected]> wrote:
>
> I wonder if you could help me catch the rest of these issues by disabling
> WERROR (so we can get all the warnings) and letting your builds run with the
> following patch on top:

That seems to be working OK. I moved your tree to merge just after the
fixes for the current release and added a CONFIG_WERROR=n to all the
builds. I'll keep it like that for a while and then go back to getting
errors.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature