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:   Mon, 27 Sep 2021 21:28:54 +0800
From:   kernel test robot <lkp@...el.com>
To:     John Ogness <john.ogness@...utronix.de>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Petr Mladek <pmladek@...e.com>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Subject: kernel/printk/printk.c:1913:9: warning: function 'printk_sprint'
 might be a candidate for 'gnu_printf' format attribute

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   92477dd1faa650e50bd3bb35a6c0b8d09198cc35
commit: b031a684bfd01d633c79d281bd0cf11c2f834ada printk: remove logbuf_lock writer-protection of ringbuffer
date:   10 months ago
:::::: branch date: 6 days ago
:::::: commit date: 10 months ago
config: mips-randconfig-r012-20210927 (attached as .config)
compiler: mips-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=b031a684bfd01d633c79d281bd0cf11c2f834ada
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout b031a684bfd01d633c79d281bd0cf11c2f834ada
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=mips 

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

   kernel/printk/printk.c: In function 'printk_sprint':
>> kernel/printk/printk.c:1913:9: warning: function 'printk_sprint' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
    1913 |         text_len = vscnprintf(text, size, fmt, args);
         |         ^~~~~~~~


vim +1913 kernel/printk/printk.c

b031a684bfd01d John Ogness 2020-12-09  1907  
b031a684bfd01d John Ogness 2020-12-09  1908  static u16 printk_sprint(char *text, u16 size, int facility, enum log_flags *lflags,
b031a684bfd01d John Ogness 2020-12-09  1909  			 const char *fmt, va_list args)
b031a684bfd01d John Ogness 2020-12-09  1910  {
b031a684bfd01d John Ogness 2020-12-09  1911  	u16 text_len;
b031a684bfd01d John Ogness 2020-12-09  1912  
b031a684bfd01d John Ogness 2020-12-09 @1913  	text_len = vscnprintf(text, size, fmt, args);
b031a684bfd01d John Ogness 2020-12-09  1914  
b031a684bfd01d John Ogness 2020-12-09  1915  	/* Mark and strip a trailing newline. */
b031a684bfd01d John Ogness 2020-12-09  1916  	if (text_len && text[text_len - 1] == '\n') {
b031a684bfd01d John Ogness 2020-12-09  1917  		text_len--;
b031a684bfd01d John Ogness 2020-12-09  1918  		*lflags |= LOG_NEWLINE;
b031a684bfd01d John Ogness 2020-12-09  1919  	}
b031a684bfd01d John Ogness 2020-12-09  1920  
b031a684bfd01d John Ogness 2020-12-09  1921  	/* Strip log level and control flags. */
b031a684bfd01d John Ogness 2020-12-09  1922  	if (facility == 0) {
b031a684bfd01d John Ogness 2020-12-09  1923  		u16 prefix_len;
b031a684bfd01d John Ogness 2020-12-09  1924  
b031a684bfd01d John Ogness 2020-12-09  1925  		prefix_len = parse_prefix(text, NULL, NULL);
b031a684bfd01d John Ogness 2020-12-09  1926  		if (prefix_len) {
b031a684bfd01d John Ogness 2020-12-09  1927  			text_len -= prefix_len;
b031a684bfd01d John Ogness 2020-12-09  1928  			memmove(text, text + prefix_len, text_len);
b031a684bfd01d John Ogness 2020-12-09  1929  		}
b031a684bfd01d John Ogness 2020-12-09  1930  	}
b031a684bfd01d John Ogness 2020-12-09  1931  
b031a684bfd01d John Ogness 2020-12-09  1932  	return text_len;
b031a684bfd01d John Ogness 2020-12-09  1933  }
b031a684bfd01d John Ogness 2020-12-09  1934  

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

Download attachment ".config.gz" of type "application/gzip" (28516 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ