public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: kbuild-all@lists.01.org,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [gustavoars-linux:testing/uapi/nfsd/nfsfh 1/2] drivers/media/pci/ngene/ngene-core.c:388:2: warning: 'memcpy' offset [12, 16] from the object at 'com' is out of the bounds of referenced subobject 'config' with type 'unsigned char' at offset 10
Date: Wed, 10 Feb 2021 06:24:58 +0800	[thread overview]
Message-ID: <202102100646.RhG8946d-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3805 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/uapi/nfsd/nfsfh
head:   d28670226e028e65b0de5e6744c5df188fc2728b
commit: 5c976c3f03be89378ca672c1a3c7ce7048d90606 [1/2] Makefile: Enable -Warray-bounds
config: riscv-randconfig-r004-20210209 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.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/gustavoars/linux.git/commit/?id=5c976c3f03be89378ca672c1a3c7ce7048d90606
        git remote add gustavoars-linux https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
        git fetch --no-tags gustavoars-linux testing/uapi/nfsd/nfsfh
        git checkout 5c976c3f03be89378ca672c1a3c7ce7048d90606
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv 

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

All warnings (new ones prefixed by >>):

   drivers/media/pci/ngene/ngene-core.c: In function 'ngene_command_config_free_buf':
>> drivers/media/pci/ngene/ngene-core.c:388:2: warning: 'memcpy' offset [12, 16] from the object at 'com' is out of the bounds of referenced subobject 'config' with type 'unsigned char' at offset 10 [-Warray-bounds]
     388 |  memcpy(&com.cmd.ConfigureBuffers.config, config, 6);
         |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +388 drivers/media/pci/ngene/ngene-core.c

dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  381  
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  382  static int ngene_command_config_free_buf(struct ngene *dev, u8 *config)
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  383  {
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  384  	struct ngene_command com;
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  385  
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  386  	com.cmd.hdr.Opcode = CMD_CONFIGURE_FREE_BUFFER;
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  387  	com.cmd.hdr.Length = 6;
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18 @388  	memcpy(&com.cmd.ConfigureBuffers.config, config, 6);
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  389  	com.in_len = 6;
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  390  	com.out_len = 0;
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  391  
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  392  	if (ngene_command(dev, &com) < 0)
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  393  		return -EIO;
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  394  
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  395  	return 0;
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  396  }
dae52d009fc950 drivers/media/dvb/ngene/ngene-core.c Matthias Benesch 2009-12-18  397  

:::::: The code at line 388 was first introduced by commit
:::::: dae52d009fc950b5c209260d50fcc000f5becd3c V4L/DVB: ngene: Initial check-in

:::::: TO: Matthias Benesch <twoof7@freenet.de>
:::::: CC: Mauro Carvalho Chehab <mchehab@redhat.com>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 24308 bytes --]

                 reply	other threads:[~2021-02-10  1:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202102100646.RhG8946d-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=gustavo@embeddedor.com \
    --cc=gustavoars@kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox