linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Francis Laniel <laniel_francis@privacyrequired.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: 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
Date: Thu, 11 Mar 2021 16:08:31 +0800	[thread overview]
Message-ID: <202103111629.qSlY7WIl-lkp@intel.com> (raw)

[-- 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 --]

                 reply	other threads:[~2021-03-11  8:09 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=202103111629.qSlY7WIl-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=laniel_francis@privacyrequired.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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