linux-kernel.vger.kernel.org archive mirror
 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/array-bounds 2/2] arch/m68k/include/asm/string.h:72:25: warning: '__builtin_memcpy' offset 174 from the object at 'ls' is out of the bounds of referenced subobject 'ls_remove_spin' with type 'struct spinlock' at offset 174
Date: Fri, 23 Jul 2021 19:45:55 +0800	[thread overview]
Message-ID: <202107231944.luUzV64q-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git for-next/array-bounds
head:   530fa69573b2e7c05bc744cedced782fa76fa3a5
commit: 530fa69573b2e7c05bc744cedced782fa76fa3a5 [2/2] Makefile: Enable -Warray-bounds=2
config: m68k-defconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 10.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=530fa69573b2e7c05bc744cedced782fa76fa3a5
        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/array-bounds
        git checkout 530fa69573b2e7c05bc744cedced782fa76fa3a5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=m68k 

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 include/linux/string.h:20,
                    from include/linux/bitmap.h:10,
                    from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/rcupdate.h:29,
                    from include/linux/rbtree.h:22,
                    from fs/dlm/lock.c:57:
   In function 'rsb_cmp',
       inlined from 'wait_pending_remove' at fs/dlm/lock.c:1631:7,
       inlined from 'set_master' at fs/dlm/lock.c:2749:2:
>> arch/m68k/include/asm/string.h:72:25: warning: '__builtin_memcpy' offset 174 from the object at 'ls' is out of the bounds of referenced subobject 'ls_remove_spin' with type 'struct spinlock' at offset 174 [-Warray-bounds]
      72 | #define memcpy(d, s, n) __builtin_memcpy(d, s, n)
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
   fs/dlm/lock.c:441:2: note: in expansion of macro 'memcpy'
     441 |  memcpy(maxname, name, nlen);
         |  ^~~~~~
   In file included from fs/dlm/lock.c:59:
   fs/dlm/lock.c: In function 'set_master':
   fs/dlm/dlm_internal.h:583:14: note: subobject 'ls_remove_spin' declared here
     583 |  spinlock_t  ls_remove_spin;
         |              ^~~~~~~~~~~~~~
   In file included from include/linux/string.h:20,
                    from include/linux/bitmap.h:10,
                    from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/rcupdate.h:29,
                    from include/linux/rbtree.h:22,
                    from fs/dlm/lock.c:57:
   fs/dlm/lock.c: In function 'shrink_bucket':
   arch/m68k/include/asm/string.h:72:25: warning: '__builtin_memcpy' offset [174, 237] from the object at 'ls' is out of the bounds of referenced subobject 'ls_remove_spin' with type 'struct spinlock' at offset 174 [-Warray-bounds]
      72 | #define memcpy(d, s, n) __builtin_memcpy(d, s, n)
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
   fs/dlm/lock.c:1784:3: note: in expansion of macro 'memcpy'
    1784 |   memcpy(ls->ls_remove_name, name, DLM_RESNAME_MAXLEN);
         |   ^~~~~~
   In file included from fs/dlm/lock.c:59:
   fs/dlm/dlm_internal.h:583:14: note: subobject 'ls_remove_spin' declared here
     583 |  spinlock_t  ls_remove_spin;
         |              ^~~~~~~~~~~~~~
   In file included from include/linux/string.h:20,
                    from include/linux/bitmap.h:10,
                    from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/rcupdate.h:29,
                    from include/linux/rbtree.h:22,
                    from fs/dlm/lock.c:57:
>> arch/m68k/include/asm/string.h:68:25: warning: '__builtin_memset' offset [174, 237] from the object at 'ls' is out of the bounds of referenced subobject 'ls_remove_spin' with type 'struct spinlock' at offset 174 [-Warray-bounds]
      68 | #define memset(d, c, n) __builtin_memset(d, c, n)
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
   fs/dlm/lock.c:1793:3: note: in expansion of macro 'memset'
    1793 |   memset(ls->ls_remove_name, 0, DLM_RESNAME_MAXLEN);
         |   ^~~~~~
   In file included from fs/dlm/lock.c:59:
   fs/dlm/dlm_internal.h:583:14: note: subobject 'ls_remove_spin' declared here
     583 |  spinlock_t  ls_remove_spin;
         |              ^~~~~~~~~~~~~~
   In file included from include/linux/string.h:20,
                    from include/linux/bitmap.h:10,
                    from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/rcupdate.h:29,
                    from include/linux/rbtree.h:22,
                    from fs/dlm/lock.c:57:
   fs/dlm/lock.c: In function 'send_repeat_remove':
   arch/m68k/include/asm/string.h:72:25: warning: '__builtin_memcpy' offset [174, 237] from the object at 'ls' is out of the bounds of referenced subobject 'ls_remove_spin' with type 'struct spinlock' at offset 174 [-Warray-bounds]
      72 | #define memcpy(d, s, n) __builtin_memcpy(d, s, n)
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
   fs/dlm/lock.c:4050:2: note: in expansion of macro 'memcpy'
    4050 |  memcpy(ls->ls_remove_name, name, DLM_RESNAME_MAXLEN);
         |  ^~~~~~
   In file included from fs/dlm/lock.c:59:
   fs/dlm/dlm_internal.h:583:14: note: subobject 'ls_remove_spin' declared here
     583 |  spinlock_t  ls_remove_spin;
         |              ^~~~~~~~~~~~~~
   In file included from include/linux/string.h:20,
                    from include/linux/bitmap.h:10,
                    from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/rcupdate.h:29,
                    from include/linux/rbtree.h:22,
                    from fs/dlm/lock.c:57:
>> arch/m68k/include/asm/string.h:68:25: warning: '__builtin_memset' offset [174, 237] from the object at 'ls' is out of the bounds of referenced subobject 'ls_remove_spin' with type 'struct spinlock' at offset 174 [-Warray-bounds]
      68 | #define memset(d, c, n) __builtin_memset(d, c, n)
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
   fs/dlm/lock.c:4066:2: note: in expansion of macro 'memset'
    4066 |  memset(ls->ls_remove_name, 0, DLM_RESNAME_MAXLEN);
         |  ^~~~~~
   In file included from fs/dlm/lock.c:59:
   fs/dlm/dlm_internal.h:583:14: note: subobject 'ls_remove_spin' declared here
     583 |  spinlock_t  ls_remove_spin;
         |              ^~~~~~~~~~~~~~
--
   In file included from include/linux/string.h:20,
                    from include/linux/bitmap.h:10,
                    from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from include/linux/lockdep.h:14,
                    from include/linux/spinlock.h:59,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:6,
                    from include/linux/slab.h:15,
                    from fs/ocfs2/dlmglue.c:11:
   fs/ocfs2/dlmglue.c: In function 'ocfs2_lock_res_free.part.0':
>> arch/m68k/include/asm/string.h:68:25: warning: '__builtin_memset' offset [86, 167] from the object at 'res' is out of the bounds of referenced subobject 'l_lock' with type 'struct spinlock' at offset 86 [-Warray-bounds]
      68 | #define memset(d, c, n) __builtin_memset(d, c, n)
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ocfs2/dlmglue.c:789:2: note: in expansion of macro 'memset'
     789 |  memset(&res->l_lksb, 0, sizeof(res->l_lksb));
         |  ^~~~~~
   In file included from fs/ocfs2/dlmglue.c:25:
   fs/ocfs2/ocfs2.h:182:27: note: subobject 'l_lock' declared here
     182 |  spinlock_t               l_lock;
         |                           ^~~~~~


vim +72 arch/m68k/include/asm/string.h

ea61bc461d09e8 Greg Ungerer 2010-09-07  65  
ea61bc461d09e8 Greg Ungerer 2010-09-07  66  #define __HAVE_ARCH_MEMSET
ea61bc461d09e8 Greg Ungerer 2010-09-07  67  extern void *memset(void *, int, __kernel_size_t);
ea61bc461d09e8 Greg Ungerer 2010-09-07 @68  #define memset(d, c, n) __builtin_memset(d, c, n)
ea61bc461d09e8 Greg Ungerer 2010-09-07  69  
ea61bc461d09e8 Greg Ungerer 2010-09-07  70  #define __HAVE_ARCH_MEMCPY
ea61bc461d09e8 Greg Ungerer 2010-09-07  71  extern void *memcpy(void *, const void *, __kernel_size_t);
ea61bc461d09e8 Greg Ungerer 2010-09-07 @72  #define memcpy(d, s, n) __builtin_memcpy(d, s, n)
ea61bc461d09e8 Greg Ungerer 2010-09-07  73  

:::::: The code at line 72 was first introduced by commit
:::::: ea61bc461d09e8d331a307916530aaae808c72a2 m68k/m68knommu: merge MMU and non-MMU string.h

:::::: TO: Greg Ungerer <gerg@snapgear.com>
:::::: CC: Geert Uytterhoeven <geert@linux-m68k.org>

---
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: 17193 bytes --]

                 reply	other threads:[~2021-07-23 11:46 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=202107231944.luUzV64q-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;
as well as URLs for NNTP newsgroup(s).