tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git 
testing/warray-bounds
head:   8bd0f043b3e94069930bec5cb3fbb5c857748c80
commit: 5f8bd90197ff7ab1cf9f06dd9c594f3636c71297 [1/13] Makefile: Enable 
-Warray-bounds
config: alpha-randconfig-r013-20210415 (attached as .config)
compiler: alpha-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=5f8bd90197ff7ab1cf9f06dd9c594f3636c71297
        git remote add gustavoars-linux 
https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
        git fetch --no-tags gustavoars-linux testing/warray-bounds
        git checkout 5f8bd90197ff7ab1cf9f06dd9c594f3636c71297
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 
ARCH=alpha 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/string.h:21,
                    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/ipc.h:5,
                    from include/uapi/linux/sem.h:5,
                    from include/linux/sem.h:5,
                    from include/linux/compat.h:14,
                    from drivers/ide/ide-ioctls.c:6:
   In function 'ide_task_ioctl',
       inlined from 'generic_ide_ioctl' at drivers/ide/ide-ioctls.c:287:10:
>> arch/alpha/include/asm/string.h:22:16: warning: '__builtin_memcpy' offset 
>> [3, 7] from the object at 'cmd' is out of the bounds of referenced subobject 
>> 'feature' with type 'unsigned char' at offset 1 [-Warray-bounds]
      22 | #define memcpy __builtin_memcpy
   drivers/ide/ide-ioctls.c:213:2: note: in expansion of macro 'memcpy'
     213 |  memcpy(&cmd.tf.feature, &args[1], 6);
         |  ^~~~~~
>> arch/alpha/include/asm/string.h:22:16: warning: '__builtin_memcpy' offset 
>> [3, 7] from the object at 'cmd' is out of the bounds of referenced subobject 
>> 'feature' with type 'unsigned char' at offset 1 [-Warray-bounds]
      22 | #define memcpy __builtin_memcpy
   drivers/ide/ide-ioctls.c:221:2: note: in expansion of macro 'memcpy'
     221 |  memcpy(&args[1], &cmd.tf.feature, 6);
         |  ^~~~~~
--
   In file included from include/linux/string.h:21,
                    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/wait.h:9,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from include/linux/highmem.h:5,
                    from include/linux/bio.h:8,
                    from drivers/md/bcache/bcache.h:182,
                    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:
>> arch/alpha/include/asm/string.h:22:16: warning: '__builtin_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]
      22 | #define memcpy __builtin_memcpy
   include/uapi/linux/bcache.h:109:32: note: in expansion of macro 'memcpy'
     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);
         |   ^~~~~~~~~
--
   In file included from include/linux/string.h:21,
                    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/umh.h:4,
                    from include/linux/kmod.h:9,
                    from include/linux/module.h:16,
                    from drivers/media/pci/ngene/ngene-core.c:13:
   drivers/media/pci/ngene/ngene-core.c: In function 
'ngene_command_config_free_buf':
>> arch/alpha/include/asm/string.h:22:16: warning: '__builtin_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]
      22 | #define memcpy __builtin_memcpy
   drivers/media/pci/ngene/ngene-core.c:388:2: note: in expansion of macro 
'memcpy'
     388 |  memcpy(&com.cmd.ConfigureBuffers.config, config, 6);
         |  ^~~~~~


vim +22 arch/alpha/include/asm/string.h

^1da177e4c3f415 include/asm-alpha/string.h Linus Torvalds 2005-04-16  21  
^1da177e4c3f415 include/asm-alpha/string.h Linus Torvalds 2005-04-16 @22  
#define memcpy __builtin_memcpy
^1da177e4c3f415 include/asm-alpha/string.h Linus Torvalds 2005-04-16  23  

:::::: The code at line 22 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torva...@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torva...@ppc970.osdl.org>

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

Attachment: .config.gz
Description: application/gzip

Reply via email to