[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202202220258.LyXgZyyT-lkp@intel.com>
Date: Tue, 22 Feb 2022 02:24:29 +0800
From: kernel test robot <lkp@...el.com>
To: Tom Zanussi <zanussi@...nel.org>
Cc: kbuild-all@...ts.01.org,
GNU/Weeb Mailing List <gwml@...r.gnuweeb.org>,
linux-kernel@...r.kernel.org,
"Steven Rostedt (Google)" <rostedt@...dmis.org>
Subject: [ammarfaizi2-block:rostedt/linux-trace/for-next 19/32]
kernel/trace/trace_events_synth.c:65:9: warning: 'strncpy' specified bound
depends on the length of the source argument
tree: https://github.com/ammarfaizi2/linux-block rostedt/linux-trace/for-next
head: 864ea0e10cc90416a01b46f0d47a6f26dc020820
commit: 27c888da9867725784bad3d6455d6e53b425fa2b [19/32] tracing: Remove size restriction on synthetic event cmd error logging
config: arm-randconfig-r022-20220221 (https://download.01.org/0day-ci/archive/20220222/202202220258.LyXgZyyT-lkp@intel.com/config)
compiler: arm-linux-gnueabi-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://github.com/ammarfaizi2/linux-block/commit/27c888da9867725784bad3d6455d6e53b425fa2b
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block rostedt/linux-trace/for-next
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=arm SHELL=/bin/bash kernel/trace/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.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
Powered by blists - more mailing lists