# git rev-parse -q --verify 5c4e0a21fae877a7ef89be6dcc6263ec672372b8^{commit} 5c4e0a21fae877a7ef89be6dcc6263ec672372b8 already have revision, skipping fetch # git checkout -q -f -B kisskb 5c4e0a21fae877a7ef89be6dcc6263ec672372b8 # git clean -qxdf # < git log -1 # commit 5c4e0a21fae877a7ef89be6dcc6263ec672372b8 # Author: Guenter Roeck # Date: Tue Nov 2 07:24:20 2021 -0700 # # string: uninline memcpy_and_pad # # When building m68k:allmodconfig, recent versions of gcc generate the # following error if the length of UTS_RELEASE is less than 8 bytes. # # In function 'memcpy_and_pad', # inlined from 'nvmet_execute_disc_identify' at # drivers/nvme/target/discovery.c:268:2: arch/m68k/include/asm/string.h:72:25: error: # '__builtin_memcpy' reading 8 bytes from a region of size 7 # # Discussions around the problem suggest that this only happens if an # architecture does not provide strlen(), if -ffreestanding is provided as # compiler option, and if CONFIG_FORTIFY_SOURCE=n. All of this is the case # for m68k. The exact reasons are unknown, but seem to be related to the # ability of the compiler to evaluate the return value of strlen() and # the resulting execution flow in memcpy_and_pad(). It would be possible # to work around the problem by using sizeof(UTS_RELEASE) instead of # strlen(UTS_RELEASE), but that would only postpone the problem until the # function is called in a similar way. Uninline memcpy_and_pad() instead # to solve the problem for good. # # Suggested-by: Linus Torvalds # Reviewed-by: Geert Uytterhoeven # Acked-by: Andy Shevchenko # Signed-off-by: Guenter Roeck # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux-ld --version # < git log --format=%s --max-count=1 5c4e0a21fae877a7ef89be6dcc6263ec672372b8 # < make -s -j 32 ARCH=parisc O=/kisskb/build/linus_generic-32bit_defconfig_parisc-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux- generic-32bit_defconfig # < make -s -j 32 ARCH=parisc O=/kisskb/build/linus_generic-32bit_defconfig_parisc-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux- help # make -s -j 32 ARCH=parisc O=/kisskb/build/linus_generic-32bit_defconfig_parisc-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux- olddefconfig # make -s -j 32 ARCH=parisc O=/kisskb/build/linus_generic-32bit_defconfig_parisc-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux- In file included from : /kisskb/src/include/linux/sched.h: In function 'task_cpu': /kisskb/src/include/linux/sched.h:2129:38: error: 'const struct thread_info' has no member named 'cpu' return READ_ONCE(task_thread_info(p)->cpu); ^~ /kisskb/src/include/linux/compiler_types.h:297:9: note: in definition of macro '__compiletime_assert' if (!(condition)) \ ^~~~~~~~~ /kisskb/src/include/linux/compiler_types.h:317:2: note: in expansion of macro '_compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^~~~~~~~~~~~~~~~~~~ /kisskb/src/include/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert' compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ ^~~~~~~~~~~~~~~~~~ /kisskb/src/include/asm-generic/rwonce.h:36:21: note: in expansion of macro '__native_word' compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ ^~~~~~~~~~~~~ /kisskb/src/include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type' compiletime_assert_rwonce_type(x); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/sched.h:2129:9: note: in expansion of macro 'READ_ONCE' return READ_ONCE(task_thread_info(p)->cpu); ^~~~~~~~~ /kisskb/src/include/linux/sched.h:2129:38: error: 'const struct thread_info' has no member named 'cpu' return READ_ONCE(task_thread_info(p)->cpu); ^~ /kisskb/src/include/linux/compiler_types.h:297:9: note: in definition of macro '__compiletime_assert' if (!(condition)) \ ^~~~~~~~~ /kisskb/src/include/linux/compiler_types.h:317:2: note: in expansion of macro '_compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^~~~~~~~~~~~~~~~~~~ /kisskb/src/include/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert' compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ ^~~~~~~~~~~~~~~~~~ /kisskb/src/include/asm-generic/rwonce.h:36:21: note: in expansion of macro '__native_word' compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ ^~~~~~~~~~~~~ /kisskb/src/include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type' compiletime_assert_rwonce_type(x); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/sched.h:2129:9: note: in expansion of macro 'READ_ONCE' return READ_ONCE(task_thread_info(p)->cpu); ^~~~~~~~~ /kisskb/src/include/linux/sched.h:2129:38: error: 'const struct thread_info' has no member named 'cpu' return READ_ONCE(task_thread_info(p)->cpu); ^~ /kisskb/src/include/linux/compiler_types.h:297:9: note: in definition of macro '__compiletime_assert' if (!(condition)) \ ^~~~~~~~~ /kisskb/src/include/linux/compiler_types.h:317:2: note: in expansion of macro '_compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^~~~~~~~~~~~~~~~~~~ /kisskb/src/include/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert' compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ ^~~~~~~~~~~~~~~~~~ /kisskb/src/include/asm-generic/rwonce.h:36:21: note: in expansion of macro '__native_word' compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ ^~~~~~~~~~~~~ /kisskb/src/include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type' compiletime_assert_rwonce_type(x); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/sched.h:2129:9: note: in expansion of macro 'READ_ONCE' return READ_ONCE(task_thread_info(p)->cpu); ^~~~~~~~~ /kisskb/src/include/linux/sched.h:2129:38: error: 'const struct thread_info' has no member named 'cpu' return READ_ONCE(task_thread_info(p)->cpu); ^~ /kisskb/src/include/linux/compiler_types.h:297:9: note: in definition of macro '__compiletime_assert' if (!(condition)) \ ^~~~~~~~~ /kisskb/src/include/linux/compiler_types.h:317:2: note: in expansion of macro '_compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^~~~~~~~~~~~~~~~~~~ /kisskb/src/include/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert' compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ ^~~~~~~~~~~~~~~~~~ /kisskb/src/include/asm-generic/rwonce.h:36:21: note: in expansion of macro '__native_word' compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ ^~~~~~~~~~~~~ /kisskb/src/include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type' compiletime_assert_rwonce_type(x); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/sched.h:2129:9: note: in expansion of macro 'READ_ONCE' return READ_ONCE(task_thread_info(p)->cpu); ^~~~~~~~~ /kisskb/src/include/linux/sched.h:2129:38: error: 'const struct thread_info' has no member named 'cpu' return READ_ONCE(task_thread_info(p)->cpu); ^~ /kisskb/src/include/linux/compiler_types.h:297:9: note: in definition of macro '__compiletime_assert' if (!(condition)) \ ^~~~~~~~~ /kisskb/src/include/linux/compiler_types.h:317:2: note: in expansion of macro '_compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^~~~~~~~~~~~~~~~~~~ /kisskb/src/include/asm-generic/rwonce.h:36:2: note: in expansion of macro 'compiletime_assert' compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \ ^~~~~~~~~~~~~~~~~~ /kisskb/src/include/asm-generic/rwonce.h:49:2: note: in expansion of macro 'compiletime_assert_rwonce_type' compiletime_assert_rwonce_type(x); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/sched.h:2129:9: note: in expansion of macro 'READ_ONCE' return READ_ONCE(task_thread_info(p)->cpu); ^~~~~~~~~ /kisskb/src/include/linux/sched.h:2129:38: error: 'const struct thread_info' has no member named 'cpu' return READ_ONCE(task_thread_info(p)->cpu); ^~ /kisskb/src/include/linux/compiler_types.h:279:13: note: in definition of macro '__unqual_scalar_typeof' _Generic((x), \ ^ /kisskb/src/include/asm-generic/rwonce.h:50:2: note: in expansion of macro '__READ_ONCE' __READ_ONCE(x); \ ^~~~~~~~~~~ /kisskb/src/include/linux/sched.h:2129:9: note: in expansion of macro 'READ_ONCE' return READ_ONCE(task_thread_info(p)->cpu); ^~~~~~~~~ In file included from ./arch/parisc/include/generated/asm/rwonce.h:1, from /kisskb/src/include/linux/compiler.h:266, from /kisskb/src/include/linux/kernel.h:11, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/rculist.h:10, from /kisskb/src/include/linux/pid.h:5, from /kisskb/src/include/linux/sched.h:14, from /kisskb/src/arch/parisc/kernel/asm-offsets.c:20: /kisskb/src/include/linux/sched.h:2129:38: error: 'const struct thread_info' has no member named 'cpu' return READ_ONCE(task_thread_info(p)->cpu); ^~ /kisskb/src/include/asm-generic/rwonce.h:44:72: note: in definition of macro '__READ_ONCE' #define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x)) ^ /kisskb/src/include/linux/sched.h:2129:9: note: in expansion of macro 'READ_ONCE' return READ_ONCE(task_thread_info(p)->cpu); ^~~~~~~~~ In file included from /kisskb/src/arch/parisc/kernel/asm-offsets.c:24: /kisskb/src/arch/parisc/kernel/asm-offsets.c: In function 'main': /kisskb/src/include/linux/compiler_types.h:140:35: error: 'struct task_struct' has no member named 'cpu' #define __compiler_offsetof(a, b) __builtin_offsetof(a, b) ^~~~~~~~~~~~~~~~~~ /kisskb/src/include/linux/kbuild.h:6:62: note: in definition of macro 'DEFINE' asm volatile("\n.ascii \"->" #sym " %0 " #val "\"" : : "i" (val)) ^~~ /kisskb/src/include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof' #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER) ^~~~~~~~~~~~~~~~~~~ /kisskb/src/arch/parisc/kernel/asm-offsets.c:43:19: note: in expansion of macro 'offsetof' DEFINE(TASK_CPU, offsetof(struct task_struct, cpu)); ^~~~~~~~ make[2]: *** [/kisskb/src/scripts/Makefile.build:121: arch/parisc/kernel/asm-offsets.s] Error 1 make[1]: *** [/kisskb/src/Makefile:1223: prepare0] Error 2 make: *** [Makefile:219: __sub-make] Error 2 Command 'make -s -j 32 ARCH=parisc O=/kisskb/build/linus_generic-32bit_defconfig_parisc-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/hppa-linux/bin/hppa-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/linus_generic-32bit_defconfig_parisc-gcc8 # Build took: 0:00:07.242606