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: <202502182036.RChzXKS8-lkp@intel.com>
Date: Tue, 18 Feb 2025 20:28:37 +0800
From: kernel test robot <lkp@...el.com>
To: James Smart <jsmart2021@...il.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	"Martin K. Petersen" <martin.petersen@...cle.com>,
	Hannes Reinecke <hare@...e.de>, Daniel Wagner <dwagner@...e.de>,
	Ram Vegesna <ram.vegesna@...adcom.com>
Subject: drivers/scsi/elx/libefc/efc_node.c:254:70: warning: '%s' directive
 output may be truncated writing up to 15 bytes into a region of size between
 0 and 31

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2408a807bfc3f738850ef5ad5e3fd59d66168996
commit: ebc076b3eddc807729bd81f7bc48e798a3ddc477 scsi: elx: efct: Tie into kernel Kconfig and build process
date:   3 years, 8 months ago
config: x86_64-randconfig-001-20241126 (https://download.01.org/0day-ci/archive/20250218/202502182036.RChzXKS8-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/20250218/202502182036.RChzXKS8-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/202502182036.RChzXKS8-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/scsi/elx/libefc/efc_node.c: In function 'efc_node_alloc':
>> drivers/scsi/elx/libefc/efc_node.c:254:70: warning: '%s' directive output may be truncated writing up to 15 bytes into a region of size between 0 and 31 [-Wformat-truncation=]
     254 |         snprintf(node->display_name, sizeof(node->display_name), "%s.%s",
         |                                                                      ^~
     255 |                  nport->display_name, portid_display);
         |                                       ~~~~~~~~~~~~~~                  
   In function 'efc_node_update_display_name',
       inlined from 'efc_node_alloc' at drivers/scsi/elx/libefc/efc_node.c:95:2:
   drivers/scsi/elx/libefc/efc_node.c:254:9: note: 'snprintf' output between 2 and 48 bytes into a destination of size 32
     254 |         snprintf(node->display_name, sizeof(node->display_name), "%s.%s",
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     255 |                  nport->display_name, portid_display);
         |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/elx/libefc/efc_node.c: In function 'efc_node_update_display_name':
>> drivers/scsi/elx/libefc/efc_node.c:254:70: warning: '%s' directive output may be truncated writing up to 15 bytes into a region of size between 0 and 31 [-Wformat-truncation=]
     254 |         snprintf(node->display_name, sizeof(node->display_name), "%s.%s",
         |                                                                      ^~
     255 |                  nport->display_name, portid_display);
         |                                       ~~~~~~~~~~~~~~                  
   drivers/scsi/elx/libefc/efc_node.c:254:9: note: 'snprintf' output between 2 and 48 bytes into a destination of size 32
     254 |         snprintf(node->display_name, sizeof(node->display_name), "%s.%s",
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     255 |                  nport->display_name, portid_display);
         |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +254 drivers/scsi/elx/libefc/efc_node.c

6bc6180d7b5c97 James Smart 2021-06-01  244  
6bc6180d7b5c97 James Smart 2021-06-01  245  void
6bc6180d7b5c97 James Smart 2021-06-01  246  efc_node_update_display_name(struct efc_node *node)
6bc6180d7b5c97 James Smart 2021-06-01  247  {
6bc6180d7b5c97 James Smart 2021-06-01  248  	u32 port_id = node->rnode.fc_id;
6bc6180d7b5c97 James Smart 2021-06-01  249  	struct efc_nport *nport = node->nport;
6bc6180d7b5c97 James Smart 2021-06-01  250  	char portid_display[16];
6bc6180d7b5c97 James Smart 2021-06-01  251  
6bc6180d7b5c97 James Smart 2021-06-01  252  	efc_node_fcid_display(port_id, portid_display, sizeof(portid_display));
6bc6180d7b5c97 James Smart 2021-06-01  253  
6bc6180d7b5c97 James Smart 2021-06-01 @254  	snprintf(node->display_name, sizeof(node->display_name), "%s.%s",
6bc6180d7b5c97 James Smart 2021-06-01  255  		 nport->display_name, portid_display);
6bc6180d7b5c97 James Smart 2021-06-01  256  }
6bc6180d7b5c97 James Smart 2021-06-01  257  

:::::: The code at line 254 was first introduced by commit
:::::: 6bc6180d7b5c972c10a2f5392621921de32ce5bc scsi: elx: libefc: Remote node state machine interfaces

:::::: TO: James Smart <jsmart2021@...il.com>
:::::: CC: Martin K. Petersen <martin.petersen@...cle.com>

-- 
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