Skip to contentSkip to conversation

linux-next: build failure after merge of the kspp-gustavo tree

DISCUSSION Stephen Rothwell 2 participants 3 messages Nov 21, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

Hi Stephen,

Quoted 14 lines · Stephen Rothwell

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]);
       |                 ^~~~~~~~~~~~~~~
Quoted 8 lines

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:

Makefile +2 -0
index ede0bd241056..596c33e6319b 100644
@@ -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
 
scripts/Makefile.extrawarn +0 -2
index 2fe6f2828d37..1527199161d7 100644
@@ -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

#2 lore raw

Hi Gustavo,

Quoted 4 lines · On Tue, 21 Nov 2023 10:31:16 -0600 "Gustavo A. R. Silva"…

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.

Signature · 2 lines
Cheers,
Stephen Rothwell