[linux-next:master 9226/9381] include/net/bluetooth/bluetooth.h:364:16: warning: 'memcmp' specified bound 6 exceeds source size 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   c9f2baaa18b5ea8f006a2b3a616da9597c71d15e
commit: d70e44fef8621aeae895e1cbc62059df9e31836b [9226/9381] Bluetooth: Reject connection with the device which has same BD_ADDR
config: arm64-randconfig-r002-20230421 (https://download.01.org/0day-ci/archive/20231003/202310032158.OvfQjd58-lkp@xxxxxxxxx/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231003/202310032158.OvfQjd58-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310032158.OvfQjd58-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   net/bluetooth/hci_event.c: In function 'hci_cc_read_class_of_dev':
   net/bluetooth/hci_event.c:522:9: warning: 'memcpy' writing 3 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
     522 |         memcpy(hdev->dev_class, rp->dev_class, 3);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: note: destination object is likely at address zero
   In file included from net/bluetooth/hci_event.c:30:
   In function 'bacmp',
       inlined from 'hci_conn_request_evt' at net/bluetooth/hci_event.c:3274:7:
>> include/net/bluetooth/bluetooth.h:364:16: warning: 'memcmp' specified bound 6 exceeds source size 0 [-Wstringop-overread]
     364 |         return memcmp(ba1, ba2, sizeof(bdaddr_t));
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/memcmp +364 include/net/bluetooth/bluetooth.h

^1da177e4c3f41 Linus Torvalds   2005-04-16  360  
^1da177e4c3f41 Linus Torvalds   2005-04-16  361  /* Copy, swap, convert BD Address */
f53c20e93612f7 David Rheinsberg 2013-04-06  362  static inline int bacmp(const bdaddr_t *ba1, const bdaddr_t *ba2)
^1da177e4c3f41 Linus Torvalds   2005-04-16  363  {
^1da177e4c3f41 Linus Torvalds   2005-04-16 @364  	return memcmp(ba1, ba2, sizeof(bdaddr_t));
^1da177e4c3f41 Linus Torvalds   2005-04-16  365  }
f53c20e93612f7 David Rheinsberg 2013-04-06  366  static inline void bacpy(bdaddr_t *dst, const bdaddr_t *src)
^1da177e4c3f41 Linus Torvalds   2005-04-16  367  {
^1da177e4c3f41 Linus Torvalds   2005-04-16  368  	memcpy(dst, src, sizeof(bdaddr_t));
^1da177e4c3f41 Linus Torvalds   2005-04-16  369  }
^1da177e4c3f41 Linus Torvalds   2005-04-16  370  

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

:::::: TO: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux