lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202412031437.vX580pxx-lkp@intel.com>
Date: Tue, 3 Dec 2024 14:58:52 +0800
From: kernel test robot <lkp@...el.com>
To: Rajat Khandelwal <rajat.khandelwal@...ux.intel.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Subject: drivers/usb/typec/mux/intel_pmc_mux.c:664:43: warning: '%d'
 directive output may be truncated writing between 1 and 3 bytes into a
 region of size 2

Hi Rajat,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   cdd30ebb1b9f36159d66f088b61aee264e649d7a
commit: 0a453dc9f260281e3a063e07b526a7e494e496fe usb: typec: intel_pmc_mux: Expose IOM port status to debugfs
date:   1 year, 6 months ago
config: x86_64-buildonly-randconfig-002-20240106 (https://download.01.org/0day-ci/archive/20241203/202412031437.vX580pxx-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/20241203/202412031437.vX580pxx-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/202412031437.vX580pxx-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/usb/typec/mux/intel_pmc_mux.c: In function 'pmc_usb_probe':
>> drivers/usb/typec/mux/intel_pmc_mux.c:664:43: warning: '%d' directive output may be truncated writing between 1 and 3 bytes into a region of size 2 [-Wformat-truncation=]
     664 |         snprintf(name, sizeof(name), "port%d", port->usb3_port - 1);
         |                                           ^~
   In function 'pmc_mux_port_debugfs_init',
       inlined from 'pmc_usb_probe' at drivers/usb/typec/mux/intel_pmc_mux.c:723:3:
   drivers/usb/typec/mux/intel_pmc_mux.c:664:38: note: directive argument in the range [-1, 254]
     664 |         snprintf(name, sizeof(name), "port%d", port->usb3_port - 1);
         |                                      ^~~~~~~~
   drivers/usb/typec/mux/intel_pmc_mux.c:664:9: note: 'snprintf' output between 6 and 8 bytes into a destination of size 6
     664 |         snprintf(name, sizeof(name), "port%d", port->usb3_port - 1);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +664 drivers/usb/typec/mux/intel_pmc_mux.c

   658	
   659	static void pmc_mux_port_debugfs_init(struct pmc_usb_port *port)
   660	{
   661		struct dentry *debugfs_dir;
   662		char name[6];
   663	
 > 664		snprintf(name, sizeof(name), "port%d", port->usb3_port - 1);
   665	
   666		debugfs_dir = debugfs_create_dir(name, port->pmc->dentry);
   667		debugfs_create_file("iom_status", 0400, debugfs_dir, port,
   668				    &port_iom_status_fops);
   669	}
   670	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ