linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 4605/11713] kernel/trace/trace_events_synth.c:65:9: warning: 'strncpy' specified bound depends on the length of the source argument
@ 2022-03-09 15:48 kernel test robot
  2022-03-10 15:12 ` Tom Zanussi
  0 siblings, 1 reply; 7+ messages in thread
From: kernel test robot @ 2022-03-09 15:48 UTC (permalink / raw)
  To: Tom Zanussi
  Cc: kbuild-all, Linux Memory Management List, Steven Rostedt (Google)

Hi Tom,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   4e7a74a6856f8613dab9794da4b5cfb8fd54fb8c
commit: 27c888da9867725784bad3d6455d6e53b425fa2b [4605/11713] tracing: Remove size restriction on synthetic event cmd error logging
config: powerpc64-buildonly-randconfig-r006-20220309 (https://download.01.org/0day-ci/archive/20220309/202203092349.i2I1pdlw-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 11.2.0
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=27c888da9867725784bad3d6455d6e53b425fa2b
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 27c888da9867725784bad3d6455d6e53b425fa2b
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash kernel/trace/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   kernel/trace/trace_events_synth.c: In function 'last_cmd_set':
>> kernel/trace/trace_events_synth.c:65:9: warning: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-truncation]
      65 |         strncpy(last_cmd, str, strlen(str) + 1);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/trace/trace_events_synth.c:65:32: note: length computed here
      65 |         strncpy(last_cmd, str, strlen(str) + 1);
         |                                ^~~~~~~~~~~


vim +/strncpy +65 kernel/trace/trace_events_synth.c

    54	
    55	static void last_cmd_set(const char *str)
    56	{
    57		if (!str)
    58			return;
    59	
    60		kfree(last_cmd);
    61		last_cmd = kzalloc(strlen(str) + 1, GFP_KERNEL);
    62		if (!last_cmd)
    63			return;
    64	
  > 65		strncpy(last_cmd, str, strlen(str) + 1);
    66	}
    67	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-10 17:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-09 15:48 [linux-next:master 4605/11713] kernel/trace/trace_events_synth.c:65:9: warning: 'strncpy' specified bound depends on the length of the source argument kernel test robot
2022-03-10 15:12 ` Tom Zanussi
2022-03-10 15:49   ` Steven Rostedt
2022-03-10 16:08     ` Tom Zanussi
2022-03-10 16:26       ` Steven Rostedt
2022-03-10 16:45         ` Tom Zanussi
2022-03-10 17:07           ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox