All of lore.kernel.org
 help / color / mirror / Atom feed
* [tip:irq/core 55/56] kernel/irq/debugfs.c:233:26: warning: 'sprintf' may write a terminating nul past the end of the destination
@ 2025-05-15  2:37 kernel test robot
  2025-05-15  8:19 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-05-15  2:37 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: oe-kbuild-all, linux-kernel, x86, Thomas Gleixner

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@intel.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

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

* Re: [tip:irq/core 55/56] kernel/irq/debugfs.c:233:26: warning: 'sprintf' may write a terminating nul past the end of the destination
  2025-05-15  2:37 [tip:irq/core 55/56] kernel/irq/debugfs.c:233:26: warning: 'sprintf' may write a terminating nul past the end of the destination kernel test robot
@ 2025-05-15  8:19 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2025-05-15  8:19 UTC (permalink / raw)
  To: kernel test robot; +Cc: oe-kbuild-all, linux-kernel, x86, Thomas Gleixner

On Thu, May 15, 2025 at 10:37:19AM +0800, kernel test robot wrote:
> 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@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202505151057.xbyXAbEn-lkp@intel.com/

Definitely not my change was a culprit, but this one is easy to fix, I'll send
a patch later this week.

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2025-05-15  8:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-15  2:37 [tip:irq/core 55/56] kernel/irq/debugfs.c:233:26: warning: 'sprintf' may write a terminating nul past the end of the destination kernel test robot
2025-05-15  8:19 ` Andy Shevchenko

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.