All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [tglx-devel:x86/topology 22/41] arch/x86/kernel/cpu/debugfs.c:53:35: warning: 'sprintf' may write a terminating nul past the end of the destination
Date: Wed, 20 Sep 2023 00:02:26 +0800	[thread overview]
Message-ID: <202309192324.p3ySFahn-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git x86/topology
head:   68e2a6fab985dc1ed5e9e7e2b0a8998ef2951772
commit: b8f285eb46639df7f680c92122aa65302f32e2cd [22/41] x86/cpu: Provide debug interface
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230919/202309192324.p3ySFahn-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230919/202309192324.p3ySFahn-lkp@intel.com/reproduce)

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/202309192324.p3ySFahn-lkp@intel.com/

All warnings (new ones prefixed by >>):

   arch/x86/kernel/cpu/debugfs.c: In function 'cpu_init_debugfs':
>> arch/x86/kernel/cpu/debugfs.c:53:35: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
      53 |                 sprintf(name, "%lu", id);
         |                                   ^
   arch/x86/kernel/cpu/debugfs.c:53:17: note: 'sprintf' output between 2 and 11 bytes into a destination of size 10
      53 |                 sprintf(name, "%lu", id);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~


vim +/sprintf +53 arch/x86/kernel/cpu/debugfs.c

    44	
    45	static __init int cpu_init_debugfs(void)
    46	{
    47		struct dentry *dir, *base = debugfs_create_dir("topo", arch_debugfs_dir);
    48		unsigned long id;
    49		char name[10];
    50	
    51		dir = debugfs_create_dir("cpus", base);
    52		for_each_possible_cpu(id) {
  > 53			sprintf(name, "%lu", id);

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2023-09-19 16:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202309192324.p3ySFahn-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.