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:for-next/Warray-bounds 3/3] include/uapi/linux/bcache.h:109:32: warning: 'memcpy' offset [17, 24] from the object at 'alloc' is out of the bounds of referenced subobject 'key' with type 'struct bkey' at offset 0
Date: Tue, 8 Jun 2021 11:01:12 +0800	[thread overview]
Message-ID: <202106081101.44hi1y2F-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git for-next/Warray-bounds
head:   12f0a8412db185d4fe79208083b373a0c02b6ee9
commit: 12f0a8412db185d4fe79208083b373a0c02b6ee9 [3/3] Makefile: Enable -Warray-bounds
config: nds32-allyesconfig (attached as .config)
compiler: nds32le-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=12f0a8412db185d4fe79208083b373a0c02b6ee9
        git remote add gustavoars-linux https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
        git fetch --no-tags gustavoars-linux for-next/Warray-bounds
        git checkout 12f0a8412db185d4fe79208083b373a0c02b6ee9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32 

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

   In file included from drivers/md/bcache/bcache.h:181,
                    from drivers/md/bcache/alloc.c:64:
   In function 'pick_data_bucket',
       inlined from 'bch_alloc_sectors' at drivers/md/bcache/alloc.c:627:15:
>> include/uapi/linux/bcache.h:109:32: warning: 'memcpy' offset [17, 24] from the object at 'alloc' is out of the bounds of referenced subobject 'key' with type 'struct bkey' at offset 0 [-Warray-bounds]
     109 | #define bkey_copy(_dest, _src) memcpy(_dest, _src, bkey_bytes(_src))
         |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/md/bcache/alloc.c:586:3: note: in expansion of macro 'bkey_copy'
     586 |   bkey_copy(&ret->key, alloc);
         |   ^~~~~~~~~
--
   drivers/media/platform/omap3isp/ispstat.c: In function 'omap3isp_stat_request_statistics_time32':
>> drivers/media/platform/omap3isp/ispstat.c:524:2: warning: 'memcpy' offset [21, 32] from the object at 'data64' is out of the bounds of referenced subobject 'buf' with type 'void *' at offset 16 [-Warray-bounds]
     524 |  memcpy(&data->buf, &data64.buf, sizeof(*data) - sizeof(data->ts));
         |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +109 include/uapi/linux/bcache.h

81ab4190ac17df Kent Overstreet 2013-10-31  108  
81ab4190ac17df Kent Overstreet 2013-10-31 @109  #define bkey_copy(_dest, _src)	memcpy(_dest, _src, bkey_bytes(_src))
81ab4190ac17df Kent Overstreet 2013-10-31  110  

:::::: The code at line 109 was first introduced by commit
:::::: 81ab4190ac17df41686a37c97f701623276b652a bcache: Pull on disk data structures out into a separate header

:::::: TO: Kent Overstreet <kmo@daterainc.com>
:::::: CC: Kent Overstreet <kmo@daterainc.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: 60587 bytes --]

                 reply	other threads:[~2021-06-08  3:02 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=202106081101.44hi1y2F-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