include/linux/string.h:377:4: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter
From: kernel test robot
Date: Thu Aug 20 2020 - 10:49:39 EST
Hi Karsten,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7eac66d0456fe12a462e5c14c68e97c7460989da
commit: f3811fd7bc97587b142fed9edf8c726694220cb2 net/smc: send DELETE_LINK, ALL message and wait for send to complete
date: 4 months ago
config: arm-randconfig-r006-20200820 (attached as .config)
compiler: arm-linux-gnueabi-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
git checkout f3811fd7bc97587b142fed9edf8c726694220cb2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All errors (new ones prefixed by >>):
net/smc/smc_llc.c: In function 'smc_llc_cli_conf_link':
net/smc/smc_llc.c:754:31: warning: variable 'del_llc' set but not used [-Wunused-but-set-variable]
754 | struct smc_llc_msg_del_link *del_llc;
| ^~~~~~~
net/smc/smc_llc.c: In function 'smc_llc_process_srv_delete_link':
net/smc/smc_llc.c:1301:33: warning: variable 'del_llc_resp' set but not used [-Wunused-but-set-variable]
1301 | struct smc_llc_msg_del_link *del_llc_resp;
| ^~~~~~~~~~~~
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/net/tcp.h:19,
from net/smc/smc_llc.c:13:
net/smc/smc_llc.c: In function 'smc_llc_add_pending_send':
include/linux/compiler.h:350:38: error: call to '__compiletime_assert_240' declared with attribute error: must increase SMC_WR_BUF_SIZE to at least sizeof(struct smc_llc_msg)
350 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler.h:331:4: note: in definition of macro '__compiletime_assert'
331 | prefix ## suffix(); \
| ^~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
350 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
net/smc/smc_llc.c:348:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
348 | BUILD_BUG_ON_MSG(
| ^~~~~~~~~~~~~~~~
include/linux/compiler.h:350:38: error: call to '__compiletime_assert_241' declared with attribute error: must adapt SMC_WR_TX_SIZE to sizeof(struct smc_llc_msg); if not all smc_wr upper layer protocols use the same message size any more, must start to set link->wr_tx_sges[i].length on each individual smc_wr_tx_send()
350 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler.h:331:4: note: in definition of macro '__compiletime_assert'
331 | prefix ## suffix(); \
| ^~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
350 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
net/smc/smc_llc.c:351:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
351 | BUILD_BUG_ON_MSG(
| ^~~~~~~~~~~~~~~~
In file included from include/linux/bitmap.h:9,
from include/linux/nodemask.h:95,
from include/linux/mmzone.h:17,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from include/linux/bvec.h:13,
from include/linux/skbuff.h:17,
from include/linux/tcp.h:17,
from include/net/tcp.h:20,
from net/smc/smc_llc.c:13:
In function 'memcpy',
inlined from 'smc_llc_send_message_wait' at net/smc/smc_llc.c:578:2,
inlined from 'smc_llc_send_link_delete_all' at net/smc/smc_llc.c:1255:8:
>> include/linux/string.h:377:4: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter
377 | __read_overflow2();
| ^~~~~~~~~~~~~~~~~~
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f3811fd7bc97587b142fed9edf8c726694220cb2
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout f3811fd7bc97587b142fed9edf8c726694220cb2
vim +/__read_overflow2 +377 include/linux/string.h
6974f0c4555e285 Daniel Micay 2017-07-12 368
6974f0c4555e285 Daniel Micay 2017-07-12 369 __FORTIFY_INLINE void *memcpy(void *p, const void *q, __kernel_size_t size)
6974f0c4555e285 Daniel Micay 2017-07-12 370 {
6974f0c4555e285 Daniel Micay 2017-07-12 371 size_t p_size = __builtin_object_size(p, 0);
6974f0c4555e285 Daniel Micay 2017-07-12 372 size_t q_size = __builtin_object_size(q, 0);
6974f0c4555e285 Daniel Micay 2017-07-12 373 if (__builtin_constant_p(size)) {
6974f0c4555e285 Daniel Micay 2017-07-12 374 if (p_size < size)
6974f0c4555e285 Daniel Micay 2017-07-12 375 __write_overflow();
6974f0c4555e285 Daniel Micay 2017-07-12 376 if (q_size < size)
6974f0c4555e285 Daniel Micay 2017-07-12 @377 __read_overflow2();
6974f0c4555e285 Daniel Micay 2017-07-12 378 }
6974f0c4555e285 Daniel Micay 2017-07-12 379 if (p_size < size || q_size < size)
6974f0c4555e285 Daniel Micay 2017-07-12 380 fortify_panic(__func__);
6974f0c4555e285 Daniel Micay 2017-07-12 381 return __builtin_memcpy(p, q, size);
6974f0c4555e285 Daniel Micay 2017-07-12 382 }
6974f0c4555e285 Daniel Micay 2017-07-12 383
:::::: The code at line 377 was first introduced by commit
:::::: 6974f0c4555e285ab217cee58b6e874f776ff409 include/linux/string.h: add the option of fortified string.h functions
:::::: TO: Daniel Micay <danielmicay@xxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip