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:   Tue, 25 Jan 2022 15:35:50 +0800
From:   kernel test robot <lkp@...el.com>
To:     Kees Cook <keescook@...omium.org>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        "Gustavo A. R. Silva" <gustavoars@...nel.org>
Subject: [kees:for-next/array-bounds 9/10] arch/sh/kernel/machvec.c:105:33:
 warning: array subscript 'struct sh_machine_vector[0]' is partly outside
 array bounds of 'long int[1]'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/array-bounds
head:   3ccac0d2ba34a8e6f722975136f06c30fb586ca0
commit: 4ba545781e20f49cf1175e11d9f606e621040acf [9/10] Makefile: Enable -Warray-bounds
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20220125/202201251510.55XdBprq-lkp@intel.com/config)
compiler: sh4-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/kees/linux.git/commit/?id=4ba545781e20f49cf1175e11d9f606e621040acf
        git remote add kees https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
        git fetch --no-tags kees for-next/array-bounds
        git checkout 4ba545781e20f49cf1175e11d9f606e621040acf
        # 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=sh SHELL=/bin/bash arch/sh/kernel/

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

   arch/sh/kernel/machvec.c: In function 'early_parse_mv':
   arch/sh/kernel/machvec.c:44:15: warning: variable 'mv_comma' set but not used [-Wunused-but-set-variable]
      44 |         char *mv_comma;
         |               ^~~~~~~~
   arch/sh/kernel/machvec.c: In function 'sh_mv_setup':
>> arch/sh/kernel/machvec.c:105:33: warning: array subscript 'struct sh_machine_vector[0]' is partly outside array bounds of 'long int[1]' [-Warray-bounds]
     105 |                         sh_mv = *(struct sh_machine_vector *)&__machvec_start;
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from arch/sh/kernel/machvec.c:13:
   arch/sh/include/asm/sections.h:7:13: note: while referencing '__machvec_start'
       7 | extern long __machvec_start, __machvec_end;
         |             ^~~~~~~~~~~~~~~


vim +105 arch/sh/kernel/machvec.c

9655ad03af2d23 Paul Mundt 2007-05-14   80  
9655ad03af2d23 Paul Mundt 2007-05-14   81  void __init sh_mv_setup(void)
9655ad03af2d23 Paul Mundt 2007-05-14   82  {
82f81f4784479d Paul Mundt 2007-05-15   83  	/*
82f81f4784479d Paul Mundt 2007-05-15   84  	 * Only overload the machvec if one hasn't been selected on
82f81f4784479d Paul Mundt 2007-05-15   85  	 * the command line with sh_mv=
82f81f4784479d Paul Mundt 2007-05-15   86  	 */
fd8f20e8e2f8f1 Paul Mundt 2007-05-15   87  	if (!machvec_selected) {
82f81f4784479d Paul Mundt 2007-05-15   88  		unsigned long machvec_size;
82f81f4784479d Paul Mundt 2007-05-15   89  
82f81f4784479d Paul Mundt 2007-05-15   90  		machvec_size = ((unsigned long)&__machvec_end -
82f81f4784479d Paul Mundt 2007-05-15   91  				(unsigned long)&__machvec_start);
82f81f4784479d Paul Mundt 2007-05-15   92  
5556410e220387 Paul Mundt 2007-08-07   93  		/*
5556410e220387 Paul Mundt 2007-08-07   94  		 * Sanity check for machvec section alignment. Ensure
5556410e220387 Paul Mundt 2007-08-07   95  		 * __initmv hasn't been misused.
5556410e220387 Paul Mundt 2007-08-07   96  		 */
5556410e220387 Paul Mundt 2007-08-07   97  		if (machvec_size % sizeof(struct sh_machine_vector))
5556410e220387 Paul Mundt 2007-08-07   98  			panic("machvec misaligned, invalid __initmv use?");
5556410e220387 Paul Mundt 2007-08-07   99  
82f81f4784479d Paul Mundt 2007-05-15  100  		/*
82f81f4784479d Paul Mundt 2007-05-15  101  		 * If the machvec hasn't been preselected, use the first
82f81f4784479d Paul Mundt 2007-05-15  102  		 * vector (usually the only one) from .machvec.init.
82f81f4784479d Paul Mundt 2007-05-15  103  		 */
82f81f4784479d Paul Mundt 2007-05-15  104  		if (machvec_size >= sizeof(struct sh_machine_vector))
82f81f4784479d Paul Mundt 2007-05-15 @105  			sh_mv = *(struct sh_machine_vector *)&__machvec_start;

:::::: The code at line 105 was first introduced by commit
:::::: 82f81f4784479df17a80caff4a7156da0a2f7dea sh: Kill off machvec aliases.

:::::: TO: Paul Mundt <lethal@...ux-sh.org>
:::::: CC: Paul Mundt <lethal@...a.kernel.org>

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