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: <202202261717.NzgEagBk-lkp@intel.com>
Date:   Sat, 26 Feb 2022 17:29:26 +0800
From:   kernel test robot <lkp@...el.com>
To:     "Martin K. Petersen" <martin.petersen@...cle.com>
Cc:     kbuild-all@...ts.01.org,
        GNU/Weeb Mailing List <gwml@...r.gnuweeb.org>,
        linux-kernel@...r.kernel.org, Mark Brown <broonie@...nel.org>
Subject: [ammarfaizi2-block:next/linux-next/akpm-base 54/86]
 drivers/scsi/aacraid/aachba.c:841:26: warning: array subscript 12 is outside
 array bounds of 'struct scsi_cmnd[1]'

tree:   https://github.com/ammarfaizi2/linux-block next/linux-next/akpm-base
head:   96e1561b10f208e7e599796f3dc3717d357ab4a1
commit: 4d3f3f514ee62c43ee39f5596408b95cccb46fbb [54/86] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
config: microblaze-buildonly-randconfig-r003-20220225 (https://download.01.org/0day-ci/archive/20220226/202202261717.NzgEagBk-lkp@intel.com/config)
compiler: microblaze-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://github.com/ammarfaizi2/linux-block/commit/4d3f3f514ee62c43ee39f5596408b95cccb46fbb
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block next/linux-next/akpm-base
        git checkout 4d3f3f514ee62c43ee39f5596408b95cccb46fbb
        # 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=microblaze SHELL=/bin/bash drivers/scsi/aacraid/

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/scsi/aacraid/aachba.c: In function 'aac_probe_container':
>> drivers/scsi/aacraid/aachba.c:841:26: warning: array subscript 12 is outside array bounds of 'struct scsi_cmnd[1]' [-Warray-bounds]
     841 |         status = cmd_priv->status;
         |                          ^~
   drivers/scsi/aacraid/aachba.c:821:37: note: referencing an object of size 196 allocated by 'kzalloc.constprop'
     821 |         struct scsi_cmnd *scsicmd = kzalloc(sizeof(*scsicmd), GFP_KERNEL);
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +841 drivers/scsi/aacraid/aachba.c

779dfcf6435b9a Phong Tran      2020-03-09  818  
fe76df4235986c Mark Haverkamp  2007-03-15  819  int aac_probe_container(struct aac_dev *dev, int cid)
fe76df4235986c Mark Haverkamp  2007-03-15  820  {
7afdb863799749 Bart Van Assche 2021-10-07  821  	struct scsi_cmnd *scsicmd = kzalloc(sizeof(*scsicmd), GFP_KERNEL);
76a3451b64c6d1 Bart Van Assche 2022-02-18  822  	struct aac_cmd_priv *cmd_priv = aac_priv(scsicmd);
7afdb863799749 Bart Van Assche 2021-10-07  823  	struct scsi_device *scsidev = kzalloc(sizeof(*scsidev), GFP_KERNEL);
fe76df4235986c Mark Haverkamp  2007-03-15  824  	int status;
fe76df4235986c Mark Haverkamp  2007-03-15  825  
fe76df4235986c Mark Haverkamp  2007-03-15  826  	if (!scsicmd || !scsidev) {
fe76df4235986c Mark Haverkamp  2007-03-15  827  		kfree(scsicmd);
fe76df4235986c Mark Haverkamp  2007-03-15  828  		kfree(scsidev);
fe76df4235986c Mark Haverkamp  2007-03-15  829  		return -ENOMEM;
fe76df4235986c Mark Haverkamp  2007-03-15  830  	}
^1da177e4c3f41 Linus Torvalds  2005-04-16  831  
fe76df4235986c Mark Haverkamp  2007-03-15  832  	scsicmd->device = scsidev;
fe76df4235986c Mark Haverkamp  2007-03-15  833  	scsidev->sdev_state = 0;
fe76df4235986c Mark Haverkamp  2007-03-15  834  	scsidev->id = cid;
fe76df4235986c Mark Haverkamp  2007-03-15  835  	scsidev->host = dev->scsi_host_ptr;
fe76df4235986c Mark Haverkamp  2007-03-15  836  
fe76df4235986c Mark Haverkamp  2007-03-15  837  	if (_aac_probe_container(scsicmd, aac_probe_container_callback1) == 0)
fe76df4235986c Mark Haverkamp  2007-03-15  838  		while (scsicmd->device == scsidev)
fe76df4235986c Mark Haverkamp  2007-03-15  839  			schedule();
802ae2f05b646c Salyzyn, Mark   2007-03-21  840  	kfree(scsidev);
76a3451b64c6d1 Bart Van Assche 2022-02-18 @841  	status = cmd_priv->status;
fe76df4235986c Mark Haverkamp  2007-03-15  842  	kfree(scsicmd);
^1da177e4c3f41 Linus Torvalds  2005-04-16  843  	return status;
^1da177e4c3f41 Linus Torvalds  2005-04-16  844  }
^1da177e4c3f41 Linus Torvalds  2005-04-16  845  

:::::: The code at line 841 was first introduced by commit
:::::: 76a3451b64c6d1718a651697670bd5dc557ed148 scsi: aacraid: Move the SCSI pointer to private command data

:::::: TO: Bart Van Assche <bvanassche@....org>
:::::: CC: Martin K. Petersen <martin.petersen@...cle.com>

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