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: <202311070051.jj6o85Vg-lkp@intel.com>
Date:   Tue, 7 Nov 2023 00:36:23 +0800
From:   kernel test robot <lkp@...el.com>
To:     Grygorii Strashko <grygorii.strashko@...com>
Cc:     oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Andrew Lunn <andrew@...n.ch>
Subject: drivers/net/ethernet/ti/cpsw_ethtool.c:244:21: warning: ': '
 directive output may be truncated writing 2 bytes into a region of size
 between 1 and 19

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d2f51b3516dade79269ff45eae2a7668ae711b25
commit: c24eef283a23b85cbd755265539dc4dbe3fee949 net: ethernet: ti: cpsw: move ethtool func in separate file
date:   4 years, 6 months ago
config: x86_64-buildonly-randconfig-006-20230915 (https://download.01.org/0day-ci/archive/20231107/202311070051.jj6o85Vg-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231107/202311070051.jj6o85Vg-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/202311070051.jj6o85Vg-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/ti/cpsw_ethtool.c: In function 'cpsw_add_ch_strings':
>> drivers/net/ethernet/ti/cpsw_ethtool.c:244:21: warning: ': ' directive output may be truncated writing 2 bytes into a region of size between 1 and 19 [-Wformat-truncation=]
        "%s DMA chan %ld: %s", rx_dir ? "Rx" : "Tx",
                        ^~
   drivers/net/ethernet/ti/cpsw_ethtool.c:243:3: note: 'snprintf' output 16 or more bytes (assuming 34) into a destination of size 32
      snprintf(*p, ETH_GSTRING_LEN,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        "%s DMA chan %ld: %s", rx_dir ? "Rx" : "Tx",
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        (long)(i / CPSW_STATS_CH_LEN),
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cpsw_gstrings_ch_stats[line].stat_string);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +244 drivers/net/ethernet/ti/cpsw_ethtool.c

   233	
   234	static void cpsw_add_ch_strings(u8 **p, int ch_num, int rx_dir)
   235	{
   236		int ch_stats_len;
   237		int line;
   238		int i;
   239	
   240		ch_stats_len = CPSW_STATS_CH_LEN * ch_num;
   241		for (i = 0; i < ch_stats_len; i++) {
   242			line = i % CPSW_STATS_CH_LEN;
   243			snprintf(*p, ETH_GSTRING_LEN,
 > 244				 "%s DMA chan %ld: %s", rx_dir ? "Rx" : "Tx",
   245				 (long)(i / CPSW_STATS_CH_LEN),
   246				 cpsw_gstrings_ch_stats[line].stat_string);
   247			*p += ETH_GSTRING_LEN;
   248		}
   249	}
   250	

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