linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* include/linux/fortify-string.h:187:4: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter
@ 2021-03-11  8:08 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-03-11  8:08 UTC (permalink / raw)
  To: Francis Laniel
  Cc: kbuild-all, linux-kernel, Andrew Morton, Linux Memory Management List

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a74e6a014c9d4d4161061f770c9b4f98372ac778
commit: a28a6e860c6cf231cf3c5171c75c342adcd00406 string.h: move fortified functions definitions in a dedicated header.
date:   13 days ago
config: mips-randconfig-r021-20210311 (attached as .config)
compiler: mipsel-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/torvalds/linux.git/commit/?id=a28a6e860c6cf231cf3c5171c75c342adcd00406
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout a28a6e860c6cf231cf3c5171c75c342adcd00406
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

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

All errors (new ones prefixed by >>):

   arch/mips/dec/prom/memory.c: In function 'pmax_setup_memory_region':
   arch/mips/dec/prom/memory.c:32:39: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]
      32 |  volatile unsigned char *memory_page, dummy;
         |                                       ^~~~~
   In file included from include/linux/string.h:269,
                    from include/linux/bitmap.h:9,
                    from include/linux/cpumask.h:12,
                    from arch/mips/include/asm/processor.h:15,
                    from arch/mips/include/asm/thread_info.h:16,
                    from include/linux/thread_info.h:58,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/mips/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from include/linux/spinlock.h:51,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:6,
                    from include/linux/mm.h:10,
                    from arch/mips/dec/prom/memory.c:10:
   In function 'memcpy',
       inlined from 'prom_meminit' at arch/mips/dec/prom/memory.c:38:2:
>> include/linux/fortify-string.h:187:4: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter
     187 |    __read_overflow2();
         |    ^~~~~~~~~~~~~~~~~~


vim +/__read_overflow2 +187 include/linux/fortify-string.h

   177	
   178	__FORTIFY_INLINE void *memcpy(void *p, const void *q, __kernel_size_t size)
   179	{
   180		size_t p_size = __builtin_object_size(p, 0);
   181		size_t q_size = __builtin_object_size(q, 0);
   182	
   183		if (__builtin_constant_p(size)) {
   184			if (p_size < size)
   185				__write_overflow();
   186			if (q_size < size)
 > 187				__read_overflow2();
   188		}
   189		if (p_size < size || q_size < size)
   190			fortify_panic(__func__);
   191		return __underlying_memcpy(p, q, size);
   192	}
   193	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-11  8:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11  8:08 include/linux/fortify-string.h:187:4: error: call to '__read_overflow2' declared with attribute error: detected read beyond size of object passed as 2nd parameter kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox