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]
Date:   Fri, 14 Jan 2022 02:34:53 +0800
From:   kernel test robot <lkp@...el.com>
To:     Heiko Carstens <hca@...ux.ibm.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: drivers/s390/net/qeth_core_main.c:6194:9: warning: 'strncpy'
 specified bound 20 equals destination size

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   455e73a07f6e288b0061dfcf4fcf54fa9fe06458
commit: 334ef6ed06fa1a54e35296b77b693bcf6d63ee9e init/Kconfig: make COMPILE_TEST depend on !S390
date:   1 year, 2 months ago
config: s390-randconfig-r016-20220113 (https://download.01.org/0day-ci/archive/20220114/202201140208.SgphJJdy-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=334ef6ed06fa1a54e35296b77b693bcf6d63ee9e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 334ef6ed06fa1a54e35296b77b693bcf6d63ee9e
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=s390 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   drivers/s390/net/qeth_core_main.c: In function 'qeth_dbf_longtext':
   drivers/s390/net/qeth_core_main.c:6066:9: warning: function 'qeth_dbf_longtext' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
    6066 |         vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args);
         |         ^~~~~~~~~
   drivers/s390/net/qeth_core_main.c: In function 'qeth_add_dbf_entry':
>> drivers/s390/net/qeth_core_main.c:6194:9: warning: 'strncpy' specified bound 20 equals destination size [-Wstringop-truncation]
    6194 |         strncpy(new_entry->dbf_name, name, DBF_NAME_LEN);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/strncpy +6194 drivers/s390/net/qeth_core_main.c

819dc537fd7fcd Stefan Raspl 2013-01-21  6179  
819dc537fd7fcd Stefan Raspl 2013-01-21  6180  static int qeth_add_dbf_entry(struct qeth_card *card, char *name)
819dc537fd7fcd Stefan Raspl 2013-01-21  6181  {
819dc537fd7fcd Stefan Raspl 2013-01-21  6182  	struct qeth_dbf_entry *new_entry;
819dc537fd7fcd Stefan Raspl 2013-01-21  6183  
819dc537fd7fcd Stefan Raspl 2013-01-21  6184  	card->debug = debug_register(name, 2, 1, 8);
819dc537fd7fcd Stefan Raspl 2013-01-21  6185  	if (!card->debug) {
819dc537fd7fcd Stefan Raspl 2013-01-21  6186  		QETH_DBF_TEXT_(SETUP, 2, "%s", "qcdbf");
819dc537fd7fcd Stefan Raspl 2013-01-21  6187  		goto err;
819dc537fd7fcd Stefan Raspl 2013-01-21  6188  	}
819dc537fd7fcd Stefan Raspl 2013-01-21  6189  	if (debug_register_view(card->debug, &debug_hex_ascii_view))
819dc537fd7fcd Stefan Raspl 2013-01-21  6190  		goto err_dbg;
819dc537fd7fcd Stefan Raspl 2013-01-21  6191  	new_entry = kzalloc(sizeof(struct qeth_dbf_entry), GFP_KERNEL);
819dc537fd7fcd Stefan Raspl 2013-01-21  6192  	if (!new_entry)
819dc537fd7fcd Stefan Raspl 2013-01-21  6193  		goto err_dbg;
819dc537fd7fcd Stefan Raspl 2013-01-21 @6194  	strncpy(new_entry->dbf_name, name, DBF_NAME_LEN);
819dc537fd7fcd Stefan Raspl 2013-01-21  6195  	new_entry->dbf_info = card->debug;
819dc537fd7fcd Stefan Raspl 2013-01-21  6196  	mutex_lock(&qeth_dbf_list_mutex);
819dc537fd7fcd Stefan Raspl 2013-01-21  6197  	list_add(&new_entry->dbf_list, &qeth_dbf_list);
819dc537fd7fcd Stefan Raspl 2013-01-21  6198  	mutex_unlock(&qeth_dbf_list_mutex);
819dc537fd7fcd Stefan Raspl 2013-01-21  6199  
819dc537fd7fcd Stefan Raspl 2013-01-21  6200  	return 0;
819dc537fd7fcd Stefan Raspl 2013-01-21  6201  
819dc537fd7fcd Stefan Raspl 2013-01-21  6202  err_dbg:
819dc537fd7fcd Stefan Raspl 2013-01-21  6203  	debug_unregister(card->debug);
819dc537fd7fcd Stefan Raspl 2013-01-21  6204  err:
819dc537fd7fcd Stefan Raspl 2013-01-21  6205  	return -ENOMEM;
819dc537fd7fcd Stefan Raspl 2013-01-21  6206  }
819dc537fd7fcd Stefan Raspl 2013-01-21  6207  

:::::: The code at line 6194 was first introduced by commit
:::::: 819dc537fd7fcd799c5f7f85693d29e2635a84f9 qeth: Make s390dbf card entries persistent

:::::: TO: Stefan Raspl <raspl@...ux.vnet.ibm.com>
:::::: CC: David S. Miller <davem@...emloft.net>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ