# git rev-parse -q --verify b7213ffa0e585feb1aee3e7173e965e66ee0abaa^{commit} # git fetch -q -n -f git://fs.ozlabs.ibm.com/kernel/linus master # git rev-parse -q --verify b7213ffa0e585feb1aee3e7173e965e66ee0abaa^{commit} b7213ffa0e585feb1aee3e7173e965e66ee0abaa # git checkout -q -f -B kisskb b7213ffa0e585feb1aee3e7173e965e66ee0abaa # git clean -qxdf # < git log -1 # commit b7213ffa0e585feb1aee3e7173e965e66ee0abaa # Author: Linus Torvalds # Date: Wed Sep 15 13:56:37 2021 -0700 # # qnx4: avoid stringop-overread errors # # The qnx4 directory entries are 64-byte blocks that have different # contents depending on the a status byte that is in the last byte of the # block. # # In particular, a directory entry can be either a "link info" entry with # a 48-byte name and pointers to the real inode information, or an "inode # entry" with a smaller 16-byte name and the full inode information. # # But the code was written to always just treat the directory name as if # it was part of that "inode entry", and just extend the name to the # longer case if the status byte said it was a link entry. # # That work just fine and gives the right results, but now that gcc is # tracking data structure accesses much more, the code can trigger a # compiler error about using up to 48 bytes (the long name) in a structure # that only has that shorter name in it: # # fs/qnx4/dir.c: In function ‘qnx4_readdir’: # fs/qnx4/dir.c:51:32: error: ‘strnlen’ specified bound 48 exceeds source size 16 [-Werror=stringop-overread] # 51 | size = strnlen(de->di_fname, size); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ # In file included from fs/qnx4/qnx4.h:3, # from fs/qnx4/dir.c:16: # include/uapi/linux/qnx4_fs.h:45:25: note: source object declared here # 45 | char di_fname[QNX4_SHORT_NAME_MAX]; # | ^~~~~~~~ # # which is because the source code doesn't really make this whole "one of # two different types" explicit. # # Fix this by introducing a very explicit union of the two types, and # basically explaining to the compiler what is really going on. # # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 b7213ffa0e585feb1aee3e7173e965e66ee0abaa # < make -s -j 10 ARCH=powerpc O=/kisskb/build/linus-rand_powerpc-randconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- randconfig # Added to kconfig CONFIG_STANDALONE=y # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # Added to kconfig CONFIG_CPU_BIG_ENDIAN=y # Added to kconfig CONFIG_PPC64=y # Added to kconfig CONFIG_PPC_DISABLE_WERROR=y # Added to kconfig CONFIG_SECTION_MISMATCH_WARN_ONLY=y # Added to kconfig CONFIG_PREVENT_FIRMWARE_BUILD=y # Added to kconfig CONFIG_CC_STACKPROTECTOR_STRONG=n # Added to kconfig CONFIG_GCC_PLUGINS=n # Added to kconfig CONFIG_LD_HEAD_STUB_CATCH=y # Added to kconfig CONFIG_TRIM_UNUSED_KSYMS=n # Added to kconfig CONFIG_UBSAN=n # < make -s -j 10 ARCH=powerpc O=/kisskb/build/linus-rand_powerpc-randconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 10 ARCH=powerpc O=/kisskb/build/linus-rand_powerpc-randconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig .config:6301:warning: override: reassigning to symbol PPC64 .config:6302:warning: override: reassigning to symbol PPC_DISABLE_WERROR .config:6303:warning: override: reassigning to symbol SECTION_MISMATCH_WARN_ONLY .config:6304:warning: override: reassigning to symbol PREVENT_FIRMWARE_BUILD .config:6306:warning: override: reassigning to symbol GCC_PLUGINS # make -s -j 10 ARCH=powerpc O=/kisskb/build/linus-rand_powerpc-randconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- In file included from /kisskb/src/mm/damon/vaddr.c:672: /kisskb/src/mm/damon/vaddr-test.h: In function 'damon_test_three_regions_in_vmas': /kisskb/src/mm/damon/vaddr-test.h:96:1: warning: the frame size of 1248 bytes is larger than 1024 bytes [-Wframe-larger-than=] 96 | } | ^ /kisskb/src/lib/test_objagg.c: In function 'test_hints_case.constprop': /kisskb/src/lib/test_objagg.c:994:1: warning: the frame size of 1056 bytes is larger than 1024 bytes [-Wframe-larger-than=] 994 | } | ^ Completed OK # rm -rf /kisskb/build/linus-rand_powerpc-randconfig_powerpc-gcc9 # Build took: 0:12:12.444941