Re: debug_defconfig: error: call to '__write_overflow' declared with attribute error: detected write beyond size of object passed as 1st parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux