[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <202505151057.xbyXAbEn-lkp@intel.com>
Date: Thu, 15 May 2025 10:37:19 +0800
From: kernel test robot <lkp@...el.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	x86@...nel.org, Thomas Gleixner <tglx@...utronix.de>
Subject: [tip:irq/core 55/56] kernel/irq/debugfs.c:233:26: warning: 'sprintf'
 may write a terminating nul past the end of the destination
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
head:   58eb5721a445ea0af310d1410d7117a1910627bc
commit: 47af06c9d31fe558493de4e04f9a07847dc4992f [55/56] genirq: Consistently use '%u' format specifier for unsigned int variables
config: x86_64-randconfig-123-20250515 (https://download.01.org/0day-ci/archive/20250515/202505151057.xbyXAbEn-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/20250515/202505151057.xbyXAbEn-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505151057.xbyXAbEn-lkp@intel.com/
All warnings (new ones prefixed by >>):
   kernel/irq/debugfs.c: In function 'irq_debugfs_init':
>> kernel/irq/debugfs.c:233:26: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
     233 |         sprintf(name, "%u", irq);
         |                          ^
   In function 'irq_add_debugfs_entry',
       inlined from 'irq_add_debugfs_entry' at kernel/irq/debugfs.c:226:6,
       inlined from 'irq_debugfs_init' at kernel/irq/debugfs.c:251:3:
   kernel/irq/debugfs.c:233:9: note: 'sprintf' output between 2 and 11 bytes into a destination of size 10
     233 |         sprintf(name, "%u", irq);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
vim +/sprintf +233 kernel/irq/debugfs.c
   225	
   226	void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc)
   227	{
   228		char name [10];
   229	
   230		if (!irq_dir || !desc || desc->debugfs_file)
   231			return;
   232	
 > 233		sprintf(name, "%u", irq);
   234		desc->debugfs_file = debugfs_create_file(name, 0644, irq_dir, desc,
   235							 &dfs_irq_ops);
   236	}
   237	
-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists