On Tue, Jan 03, 2023 at 02:44AM +0800, kernel test robot wrote: > tree: https://github.com/ammarfaizi2/linux-block stable/linux-stable-rc/queue/5.15 > head: 6b61636f89bfa685895515e024c7d07c0fdebaa9 > commit: 6b61636f89bfa685895515e024c7d07c0fdebaa9 [54/54] kcsan: Instrument memcpy/memset/memmove with newer Clang > config: s390-randconfig-r021-20230102 > compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 7a8cb6cd4e3ff8aaadebff2b9d3ee9e2a326d444) > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # install s390 cross compiling tool for clang build > # apt-get install binutils-s390x-linux-gnu > # https://github.com/ammarfaizi2/linux-block/commit/6b61636f89bfa685895515e024c7d07c0fdebaa9 > git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block > git fetch --no-tags ammarfaizi2-block stable/linux-stable-rc/queue/5.15 > git checkout 6b61636f89bfa685895515e024c7d07c0fdebaa9 > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=s390 olddefconfig > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash kernel/kcsan/ > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot > > All errors (new ones prefixed by >>): > > >> kernel/kcsan/core.c:1076:49: error: too many arguments to function call, expected 3, have 4 > check_access(s, check_len, KCSAN_ACCESS_WRITE, _RET_IP_); > ~~~~~~~~~~~~ ^~~~~~~~ > include/linux/kernel.h:57:19: note: expanded from macro '_RET_IP_' > #define _RET_IP_ (unsigned long)__builtin_return_address(0) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > kernel/kcsan/core.c:601:29: note: 'check_access' declared here > static __always_inline void check_access(const volatile void *ptr, size_t size, > ^ > kernel/kcsan/core.c:1090:51: error: too many arguments to function call, expected 3, have 4 > check_access(dst, check_len, KCSAN_ACCESS_WRITE, _RET_IP_); > ~~~~~~~~~~~~ ^~~~~~~~ > include/linux/kernel.h:57:19: note: expanded from macro '_RET_IP_' > #define _RET_IP_ (unsigned long)__builtin_return_address(0) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > kernel/kcsan/core.c:601:29: note: 'check_access' declared here > static __always_inline void check_access(const volatile void *ptr, size_t size, > ^ > kernel/kcsan/core.c:1091:34: error: too many arguments to function call, expected 3, have 4 > check_access(src, check_len, 0, _RET_IP_); > ~~~~~~~~~~~~ ^~~~~~~~ > include/linux/kernel.h:57:19: note: expanded from macro '_RET_IP_' > #define _RET_IP_ (unsigned long)__builtin_return_address(0) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > kernel/kcsan/core.c:601:29: note: 'check_access' declared here > static __always_inline void check_access(const volatile void *ptr, size_t size, > ^ > kernel/kcsan/core.c:1105:51: error: too many arguments to function call, expected 3, have 4 > check_access(dst, check_len, KCSAN_ACCESS_WRITE, _RET_IP_); > ~~~~~~~~~~~~ ^~~~~~~~ > include/linux/kernel.h:57:19: note: expanded from macro '_RET_IP_' > #define _RET_IP_ (unsigned long)__builtin_return_address(0) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > kernel/kcsan/core.c:601:29: note: 'check_access' declared here > static __always_inline void check_access(const volatile void *ptr, size_t size, > ^ > kernel/kcsan/core.c:1106:34: error: too many arguments to function call, expected 3, have 4 > check_access(src, check_len, 0, _RET_IP_); > ~~~~~~~~~~~~ ^~~~~~~~ > include/linux/kernel.h:57:19: note: expanded from macro '_RET_IP_' > #define _RET_IP_ (unsigned long)__builtin_return_address(0) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > kernel/kcsan/core.c:601:29: note: 'check_access' declared here > static __always_inline void check_access(const volatile void *ptr, size_t size, > ^ > 5 errors generated. > > > vim +1076 kernel/kcsan/core.c > > 1065 > 1066 #ifdef __HAVE_ARCH_MEMSET > 1067 void *__tsan_memset(void *s, int c, size_t count); > 1068 noinline void *__tsan_memset(void *s, int c, size_t count) > 1069 { > 1070 /* > 1071 * Instead of not setting up watchpoints where accessed size is greater > 1072 * than MAX_ENCODABLE_SIZE, truncate checked size to MAX_ENCODABLE_SIZE. > 1073 */ > 1074 size_t check_len = min_t(size_t, count, MAX_ENCODABLE_SIZE); > 1075 > > 1076 check_access(s, check_len, KCSAN_ACCESS_WRITE, _RET_IP_); > 1077 return memset(s, c, count); > 1078 } > 1079 #else > 1080 void *__tsan_memset(void *s, int c, size_t count) __alias(memset); > 1081 #endif > 1082 EXPORT_SYMBOL(__tsan_memset); > 1083 For 5.10 and 5.15 stable kernels we require a separate backport (see attached), because check_access() was changed in commit 55a55fec5015b. Thanks, -- Marco