linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* debug_defconfig: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object passed as 1st parameter
@ 2021-09-24 22:02 Jan-Benedict Glaw
  2021-09-28 10:43 ` Heiko Carstens
  0 siblings, 1 reply; 2+ messages in thread
From: Jan-Benedict Glaw @ 2021-09-24 22:02 UTC (permalink / raw)
  To: linux-s390

[-- Attachment #1: Type: text/plain, Size: 4541 bytes --]

Hi!

I'm building a lot of Binutils/GCC targets and with those the Linux
kernel defconfigs.

For s390, I started to see a build error when building the
debug_defconfig:

[mk all 2021-09-20 04:27:45]   s390x-linux-gnu-gcc -Wp,-MMD,arch/s390/crypto/.paes_s390.o.d -nostdinc -isystem /var/lib/laminar/run/linux-s390-debug_defconfig/8/toolchain/bin/../lib/gcc/s390x-linux-gnu/12.0.0/include -I./arch/s390/include -I./arch/s390/include/generated  -I./include -I./arch/s390/include/uapi -I./arch/s390/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -m64 -fPIE -mbackchain -msoft-float -march=zEC12 -mtune=zEC12 -Wa,-I./arch/s390/include -mpacked-stack -D__PACK_STACK -mindirect-branch=thunk -mfunction-return=thunk -mindirect-branch-table -DCC_USING_EXPOLINE -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -DCONFIG_AS_CFI_VAL_OFFSET=1 -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=2048 -fno-stack-protector -Wimplicit-fallthrough=5 -Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -fno-stack-clash-protection -g -gdwarf-4 -pg -mrecord-mcount -mnop-mcount -mfentry -DCC_USING_NOP_MCOUNT -DCC_USING_FENTRY -fno-inline-functions-called-once -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned  -DMODULE -fPIC  -DKBUILD_BASENAME='"paes_s390"' -DKBUILD_MODNAME='"paes_s390"' -D__KBUILD_MODNAME=kmod_paes_s390 -c -o arch/s390/crypto/paes_s390.o arch/s390/crypto/paes_s390.c
[mk all 2021-09-20 04:27:47] In file included from ./include/linux/string.h:262,
[mk all 2021-09-20 04:27:47]                  from ./include/linux/bitmap.h:10,
[mk all 2021-09-20 04:27:47]                  from ./include/linux/cpumask.h:12,
[mk all 2021-09-20 04:27:47]                  from ./include/linux/smp.h:13,
[mk all 2021-09-20 04:27:47]                  from ./include/linux/lockdep.h:14,
[mk all 2021-09-20 04:27:47]                  from ./include/linux/spinlock.h:63,
[mk all 2021-09-20 04:27:47]                  from ./include/linux/mmzone.h:8,
[mk all 2021-09-20 04:27:47]                  from ./include/linux/gfp.h:6,
[mk all 2021-09-20 04:27:47]                  from ./include/linux/slab.h:15,
[mk all 2021-09-20 04:27:47]                  from ./include/linux/crypto.h:20,
[mk all 2021-09-20 04:27:47]                  from ./include/crypto/aes.h:10,
[mk all 2021-09-20 04:27:47]                  from arch/s390/crypto/paes_s390.c:16:
[mk all 2021-09-20 04:27:47] In function 'memcpy',
[mk all 2021-09-20 04:27:47]     inlined from '__paes_convert_key.part.0' at arch/s390/crypto/paes_s390.c:153:2:
[mk all 2021-09-20 04:27:47] ./include/linux/fortify-string.h:185:25: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object passed as 1st parameter
[mk all 2021-09-20 04:27:47]   185 |                         __write_overflow();
[mk all 2021-09-20 04:27:47]       |                         ^~~~~~~~~~~~~~~~~~
[mk all 2021-09-20 04:27:47] make[2]: *** [scripts/Makefile.build:277: arch/s390/crypto/paes_s390.o] Error 1
[mk all 2021-09-20 04:27:47] make[1]: *** [scripts/Makefile.build:540: arch/s390/crypto] Error 2
[mk all 2021-09-20 04:27:47] make: *** [Makefile:1868: arch/s390] Error 2


On a first glimpse, I don't see how this overflows. Is it a compiler
bug? Used GCC is "s390x-linux-gnu-gcc (GCC) 12.0.0 20210917
(experimental)", while an older build for debug_defconfig (using an
older GCC, probably ce3316e9c02c81c509173572c71a101f4eb62a24 as of Thu
Jun 24 13:49:51 2021 -0400) succeeded.

  OTOH, I might have failed to pinpoint the actual bug and the newer GCC
correctly caught it?

Thanks,
  Jan-Benedict

-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: debug_defconfig: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object passed as 1st parameter
  2021-09-24 22:02 debug_defconfig: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object passed as 1st parameter Jan-Benedict Glaw
@ 2021-09-28 10:43 ` Heiko Carstens
  0 siblings, 0 replies; 2+ messages in thread
From: Heiko Carstens @ 2021-09-28 10:43 UTC (permalink / raw)
  To: Jan-Benedict Glaw; +Cc: linux-s390, Harald Freudenberger

On Sat, Sep 25, 2021 at 12:02:35AM +0200, Jan-Benedict Glaw wrote:
> Hi!
> 
> I'm building a lot of Binutils/GCC targets and with those the Linux
> kernel defconfigs.
> 
> For s390, I started to see a build error when building the
> debug_defconfig:
> 
> [mk all 2021-09-20 04:27:45]   s390x-linux-gnu-gcc -Wp,-MMD,arch/s390/crypto/.paes_s390.o.d -nostdinc -isystem /var/lib/laminar/run/linux-s390-debug_defconfig/8/toolchain/bin/../lib/gcc/s390x-linux-gnu/12.0.0/include -I./arch/s390/include -I./arch/s390/include/generated  -I./include -I./arch/s390/include/uapi -I./arch/s390/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -m64 -fPIE -mbackchain -msoft-float -march=zEC12 -mtune=zEC12 -Wa,-I./arch/s390/include -mpacked-stack -D__PACK_STACK -mindirect-branch=thunk -mfunction-return=thunk -mindirect-branch-table -DCC_USING_EXPOLINE -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -DCONFIG_AS_CFI_VAL_OFFSET=1 -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=2048 -fno-stack-protector -Wimplicit-fallthrough=5 -Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -fno-stack-clash-protection -g -gdwarf-4 -pg -mrecord-mcount -mnop-mcount -mfentry -DCC_USING_NOP_MCOUNT -DCC_USING_FENTRY -fno-inline-functions-called-once -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned  -DMODULE -fPIC  -DKBUILD_BASENAME='"paes_s390"' -DKBUILD_MODNAME='"paes_s390"' -D__KBUILD_MODNAME=kmod_paes_s390 -c -o arch/s390/crypto/paes_s390.o arch/s390/crypto/paes_s390.c
> [mk all 2021-09-20 04:27:47] In file included from ./include/linux/string.h:262,
> [mk all 2021-09-20 04:27:47]                  from ./include/linux/bitmap.h:10,
> [mk all 2021-09-20 04:27:47]                  from ./include/linux/cpumask.h:12,
> [mk all 2021-09-20 04:27:47]                  from ./include/linux/smp.h:13,
> [mk all 2021-09-20 04:27:47]                  from ./include/linux/lockdep.h:14,
> [mk all 2021-09-20 04:27:47]                  from ./include/linux/spinlock.h:63,
> [mk all 2021-09-20 04:27:47]                  from ./include/linux/mmzone.h:8,
> [mk all 2021-09-20 04:27:47]                  from ./include/linux/gfp.h:6,
> [mk all 2021-09-20 04:27:47]                  from ./include/linux/slab.h:15,
> [mk all 2021-09-20 04:27:47]                  from ./include/linux/crypto.h:20,
> [mk all 2021-09-20 04:27:47]                  from ./include/crypto/aes.h:10,
> [mk all 2021-09-20 04:27:47]                  from arch/s390/crypto/paes_s390.c:16:
> [mk all 2021-09-20 04:27:47] In function 'memcpy',
> [mk all 2021-09-20 04:27:47]     inlined from '__paes_convert_key.part.0' at arch/s390/crypto/paes_s390.c:153:2:
> [mk all 2021-09-20 04:27:47] ./include/linux/fortify-string.h:185:25: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object passed as 1st parameter
> [mk all 2021-09-20 04:27:47]   185 |                         __write_overflow();
> [mk all 2021-09-20 04:27:47]       |                         ^~~~~~~~~~~~~~~~~~
> [mk all 2021-09-20 04:27:47] make[2]: *** [scripts/Makefile.build:277: arch/s390/crypto/paes_s390.o] Error 1
> [mk all 2021-09-20 04:27:47] make[1]: *** [scripts/Makefile.build:540: arch/s390/crypto] Error 2
> [mk all 2021-09-20 04:27:47] make: *** [Makefile:1868: arch/s390] Error 2
> 
> 
> On a first glimpse, I don't see how this overflows. Is it a compiler
> bug? Used GCC is "s390x-linux-gnu-gcc (GCC) 12.0.0 20210917
> (experimental)", while an older build for debug_defconfig (using an
> older GCC, probably ce3316e9c02c81c509173572c71a101f4eb62a24 as of Thu
> Jun 24 13:49:51 2021 -0400) succeeded.
> 
>   OTOH, I might have failed to pinpoint the actual bug and the newer GCC
> correctly caught it?

This _looks_ like a compiler bug. Disassembling the function plus
using pahole told me that everything should be ok. However I used
gcc-11 instead of experimental gcc-12.

Adding Harald, just in case I missed something.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-28 10:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-24 22:02 debug_defconfig: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object passed as 1st parameter Jan-Benedict Glaw
2021-09-28 10:43 ` Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).