# git rev-parse -q --verify d5f6545934c47e97c0b48a645418e877b452a992^{commit} d5f6545934c47e97c0b48a645418e877b452a992 already have revision, skipping fetch # git checkout -q -f -B kisskb d5f6545934c47e97c0b48a645418e877b452a992 # git clean -qxdf # < git log -1 # commit d5f6545934c47e97c0b48a645418e877b452a992 # Author: Linus Torvalds # Date: Mon Sep 20 10:26:21 2021 -0700 # # qnx4: work around gcc false positive warning bug # # In commit b7213ffa0e58 ("qnx4: avoid stringop-overread errors") I tried # to teach gcc about how the directory entry structure can be two # different things depending on a status flag. It made the code clearer, # and it seemed to make gcc happy. # # However, Arnd points to a gcc bug, where despite using two different # members of a union, gcc then gets confused, and uses the size of one of # the members to decide if a string overrun happens. And not necessarily # the rigth one. # # End result: with some configurations, gcc-11 will still complain about # the source buffer size being overread: # # fs/qnx4/dir.c: In function 'qnx4_readdir': # fs/qnx4/dir.c:76:32: error: 'strnlen' specified bound [16, 48] exceeds source size 1 [-Werror=stringop-overread] # 76 | size = strnlen(name, size); # | ^~~~~~~~~~~~~~~~~~~ # fs/qnx4/dir.c:26:22: note: source object declared here # 26 | char de_name; # | ^~~~~~~ # # because gcc will get confused about which union member entry is actually # getting accessed, even when the source code is very clear about it. Gcc # internally will have combined two "redundant" pointers (pointing to # different union elements that are at the same offset), and takes the # size checking from one or the other - not necessarily the right one. # # This is clearly a gcc bug, but we can work around it fairly easily. The # biggest thing here is the big honking comment about why we do what we # do. # # Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c6 # Reported-and-tested-by: Arnd Bergmann # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/mips-linux/bin/mips-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/mips-linux/bin/mips-linux-ld --version # < git log --format=%s --max-count=1 d5f6545934c47e97c0b48a645418e877b452a992 # < make -s -j 32 ARCH=mips O=/kisskb/build/linus_mips-allmodconfig_mips-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/mips-linux/bin/mips-linux- allmodconfig # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # Added to kconfig CONFIG_SAMPLES=n # Added to kconfig CONFIG_MIPS_CPS_NS16550_BASE=0x1b0003f8 # Added to kconfig CONFIG_MIPS_CPS_NS16550_SHIFT=0 # < make -s -j 32 ARCH=mips O=/kisskb/build/linus_mips-allmodconfig_mips-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/mips-linux/bin/mips-linux- help # make -s -j 32 ARCH=mips O=/kisskb/build/linus_mips-allmodconfig_mips-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/mips-linux/bin/mips-linux- olddefconfig .config:13220:warning: override: reassigning to symbol MIPS_CPS_NS16550_SHIFT # make -s -j 32 ARCH=mips O=/kisskb/build/linus_mips-allmodconfig_mips-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/mips-linux/bin/mips-linux- /kisskb/src/arch/mips/boot/dts/img/boston.dts:128.19-178.5: Warning (pci_device_reg): /pci@14000000/pci2_root@0,0,0: PCI unit address format error, expected "0,0" In file included from /kisskb/src/arch/mips/include/asm/sibyte/sb1250.h:28, from /kisskb/src/drivers/watchdog/sb_wdog.c:58: /kisskb/src/arch/mips/include/asm/sibyte/bcm1480_scd.h:261: error: "M_SPC_CFG_CLEAR" redefined [-Werror] #define M_SPC_CFG_CLEAR M_BCM1480_SPC_CFG_CLEAR In file included from /kisskb/src/arch/mips/include/asm/sibyte/sb1250.h:27, from /kisskb/src/drivers/watchdog/sb_wdog.c:58: /kisskb/src/arch/mips/include/asm/sibyte/sb1250_scd.h:392: note: this is the location of the previous definition #define M_SPC_CFG_CLEAR _SB_MAKEMASK1(32) In file included from /kisskb/src/arch/mips/include/asm/sibyte/sb1250.h:28, from /kisskb/src/drivers/watchdog/sb_wdog.c:58: /kisskb/src/arch/mips/include/asm/sibyte/bcm1480_scd.h:262: error: "M_SPC_CFG_ENABLE" redefined [-Werror] #define M_SPC_CFG_ENABLE M_BCM1480_SPC_CFG_ENABLE In file included from /kisskb/src/arch/mips/include/asm/sibyte/sb1250.h:27, from /kisskb/src/drivers/watchdog/sb_wdog.c:58: /kisskb/src/arch/mips/include/asm/sibyte/sb1250_scd.h:393: note: this is the location of the previous definition #define M_SPC_CFG_ENABLE _SB_MAKEMASK1(33) cc1: all warnings being treated as errors make[3]: *** [/kisskb/src/scripts/Makefile.build:277: drivers/watchdog/sb_wdog.o] Error 1 make[2]: *** [/kisskb/src/scripts/Makefile.build:540: drivers/watchdog] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/kisskb/src/Makefile:1868: drivers] Error 2 make: *** [Makefile:219: __sub-make] Error 2 Command 'make -s -j 32 ARCH=mips O=/kisskb/build/linus_mips-allmodconfig_mips-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/mips-linux/bin/mips-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/linus_mips-allmodconfig_mips-gcc8 # Build took: 0:11:50.810457