[openeuler:openEuler-1.0-LTS 1597/1597] include/linux/string.h:249:16: warning: '__builtin_strncpy' accessing 80 bytes at offsets 100 and 36 may overlap up to 0 bytes at offset [9223372036854775807, -9223372036854775808]

tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 7bd21c560a6f5df598200cc367cad1a683cef8ef commit: a24ec7d8d3462ba48b4bd932960c397d92de8782 [1597/1597] ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set config: arm64-randconfig-002-20250429 (https://download.01.org/0day-ci/archive/20250429/202504291551.FOwjwu8e-lkp@i...) compiler: aarch64-linux-gcc (GCC) 11.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250429/202504291551.FOwjwu8e-lkp@i...) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202504291551.FOwjwu8e-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from arch/arm64/include/asm/processor.h:41, from include/linux/rcupdate.h:43, from include/linux/rculist.h:11, from include/linux/pid.h:5, from include/linux/sched.h:14, from arch/arm64/include/asm/compat.h:25, from arch/arm64/include/asm/stat.h:24, from include/linux/stat.h:6, from include/linux/module.h:11, from sound/soc/soc-generic-dmaengine-pcm.c:6: In function 'strncpy', inlined from 'dmaengine_pcm_new' at sound/soc/soc-generic-dmaengine-pcm.c:318:4:
include/linux/string.h:249:16: warning: '__builtin_strncpy' accessing 80 bytes at offsets 100 and 36 may overlap up to 0 bytes at offset [9223372036854775807, -9223372036854775808] [-Wrestrict] 249 | return __builtin_strncpy(p, q, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/__builtin_strncpy +249 include/linux/string.h 6974f0c4555e28 Daniel Micay 2017-07-12 240 6974f0c4555e28 Daniel Micay 2017-07-12 241 #if !defined(__NO_FORTIFY) && defined(__OPTIMIZE__) && defined(CONFIG_FORTIFY_SOURCE) 6974f0c4555e28 Daniel Micay 2017-07-12 242 __FORTIFY_INLINE char *strncpy(char *p, const char *q, __kernel_size_t size) 6974f0c4555e28 Daniel Micay 2017-07-12 243 { 6974f0c4555e28 Daniel Micay 2017-07-12 244 size_t p_size = __builtin_object_size(p, 0); 6974f0c4555e28 Daniel Micay 2017-07-12 245 if (__builtin_constant_p(size) && p_size < size) 6974f0c4555e28 Daniel Micay 2017-07-12 246 __write_overflow(); 6974f0c4555e28 Daniel Micay 2017-07-12 247 if (p_size < size) 6974f0c4555e28 Daniel Micay 2017-07-12 248 fortify_panic(__func__); 6974f0c4555e28 Daniel Micay 2017-07-12 @249 return __builtin_strncpy(p, q, size); 6974f0c4555e28 Daniel Micay 2017-07-12 250 } 6974f0c4555e28 Daniel Micay 2017-07-12 251 :::::: The code at line 249 was first introduced by commit :::::: 6974f0c4555e285ab217cee58b6e874f776ff409 include/linux/string.h: add the option of fortified string.h functions :::::: TO: Daniel Micay <danielmicay@gmail.com> :::::: CC: Linus Torvalds <torvalds@linux-foundation.org> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot