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: <202207150057.RUJOxIhW-lkp@intel.com>
Date:   Fri, 15 Jul 2022 00:32:06 +0800
From:   kernel test robot <lkp@...el.com>
To:     Dani Liberman <dliberman@...ana.ai>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Oded Gabbay <ogabbay@...nel.org>
Subject: [ogabbay:habanalabs-next 1/3]
 drivers/misc/habanalabs/common/debugfs.c:599:9: warning: function
 'hl_engine_data_sprintf' might be a candidate for 'gnu_printf' format
 attribute

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git habanalabs-next
head:   0339d759da283025aa01ba72cb7e5b6df9978670
commit: b916f64dace37d374de75823a203749caf30fd7c [1/3] habanalabs: removed seq_file parameter from is_idle asic functions
config: i386-randconfig-a001 (https://download.01.org/0day-ci/archive/20220715/202207150057.RUJOxIhW-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git/commit/?id=b916f64dace37d374de75823a203749caf30fd7c
        git remote add ogabbay https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git
        git fetch --no-tags ogabbay habanalabs-next
        git checkout b916f64dace37d374de75823a203749caf30fd7c
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/misc/

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

All warnings (new ones prefixed by >>):

   drivers/misc/habanalabs/common/debugfs.c: In function 'hl_engine_data_sprintf':
>> drivers/misc/habanalabs/common/debugfs.c:599:9: warning: function 'hl_engine_data_sprintf' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
     599 |         str_size = vsnprintf(NULL, 0, fmt, args) + 1;
         |         ^~~~~~~~
   drivers/misc/habanalabs/common/debugfs.c:604:17: warning: function 'hl_engine_data_sprintf' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
     604 |                 vsnprintf(e->buf + e->actual_size, str_size, fmt, args);
         |                 ^~~~~~~~~


vim +599 drivers/misc/habanalabs/common/debugfs.c

   589	
   590	void hl_engine_data_sprintf(struct engines_data *e, const char *fmt, ...)
   591	{
   592		va_list args;
   593		int str_size;
   594	
   595		va_start(args, fmt);
   596		/* Calculate formatted string length. Assuming each string is null terminated, hence
   597		 * increment result by 1
   598		 */
 > 599		str_size = vsnprintf(NULL, 0, fmt, args) + 1;
   600		va_end(args);
   601	
   602		if ((e->actual_size + str_size) < e->allocated_buf_size) {
   603			va_start(args, fmt);
   604			vsnprintf(e->buf + e->actual_size, str_size, fmt, args);
   605			va_end(args);
   606		}
   607	
   608		/* Need to update the size even when not updating destination buffer to get the exact size
   609		 * of all input strings
   610		 */
   611		e->actual_size += str_size;
   612	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ