public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Ingo Molnar <mingo@kernel.org>
Subject: mm/kasan/shadow.c:49: multiple definition of `memset'; arch/x86/lib/memset_64.o:arch/x86/um/../lib/memset_64.S:29: first defined here
Date: Sat, 17 Jun 2023 13:16:30 +0800	[thread overview]
Message-ID: <202306171302.fa4CDGXG-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1639fae5132bc8a904af28d97cea0bedb3af802e
commit: 69d4c0d3218692ffa56b0e1b9c76c50c699d7044 entry, kasan, x86: Disallow overriding mem*() functions
date:   5 months ago
config: um-randconfig-r012-20230617 (https://download.01.org/0day-ci/archive/20230617/202306171302.fa4CDGXG-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=69d4c0d3218692ffa56b0e1b9c76c50c699d7044
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 69d4c0d3218692ffa56b0e1b9c76c50c699d7044
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=um olddefconfig
        make W=1 O=build_dir ARCH=um SHELL=/bin/bash

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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306171302.fa4CDGXG-lkp@intel.com/

All errors (new ones prefixed by >>):

   ld: mm/kasan/shadow.o: in function `memset':
>> mm/kasan/shadow.c:49: multiple definition of `memset'; arch/x86/lib/memset_64.o:arch/x86/um/../lib/memset_64.S:29: first defined here
   ld: mm/kasan/shadow.o: in function `memmove':
>> mm/kasan/shadow.c:59: multiple definition of `memmove'; arch/x86/lib/memmove_64.o:arch/x86/um/../lib/memmove_64.S:31: first defined here
   ld: mm/kasan/shadow.o: in function `memcpy':
>> mm/kasan/shadow.c:70: multiple definition of `memcpy'; arch/x86/lib/memcpy_64.o:arch/x86/um/../lib/memcpy_64.S:32: first defined here


vim +49 mm/kasan/shadow.c

bb359dbcb70085 Andrey Konovalov 2020-12-22  40  
69d4c0d3218692 Peter Zijlstra   2023-01-12  41  #ifndef CONFIG_GENERIC_ENTRY
69d4c0d3218692 Peter Zijlstra   2023-01-12  42  /*
69d4c0d3218692 Peter Zijlstra   2023-01-12  43   * CONFIG_GENERIC_ENTRY relies on compiler emitted mem*() calls to not be
69d4c0d3218692 Peter Zijlstra   2023-01-12  44   * instrumented. KASAN enabled toolchains should emit __asan_mem*() functions
69d4c0d3218692 Peter Zijlstra   2023-01-12  45   * for the sites they want to instrument.
69d4c0d3218692 Peter Zijlstra   2023-01-12  46   */
bb359dbcb70085 Andrey Konovalov 2020-12-22  47  #undef memset
bb359dbcb70085 Andrey Konovalov 2020-12-22  48  void *memset(void *addr, int c, size_t len)
bb359dbcb70085 Andrey Konovalov 2020-12-22 @49  {
f00748bfa0246c Andrey Konovalov 2021-02-24  50  	if (!kasan_check_range((unsigned long)addr, len, true, _RET_IP_))
bb359dbcb70085 Andrey Konovalov 2020-12-22  51  		return NULL;
bb359dbcb70085 Andrey Konovalov 2020-12-22  52  
bb359dbcb70085 Andrey Konovalov 2020-12-22  53  	return __memset(addr, c, len);
bb359dbcb70085 Andrey Konovalov 2020-12-22  54  }
bb359dbcb70085 Andrey Konovalov 2020-12-22  55  
bb359dbcb70085 Andrey Konovalov 2020-12-22  56  #ifdef __HAVE_ARCH_MEMMOVE
bb359dbcb70085 Andrey Konovalov 2020-12-22  57  #undef memmove
bb359dbcb70085 Andrey Konovalov 2020-12-22  58  void *memmove(void *dest, const void *src, size_t len)
bb359dbcb70085 Andrey Konovalov 2020-12-22 @59  {
f00748bfa0246c Andrey Konovalov 2021-02-24  60  	if (!kasan_check_range((unsigned long)src, len, false, _RET_IP_) ||
f00748bfa0246c Andrey Konovalov 2021-02-24  61  	    !kasan_check_range((unsigned long)dest, len, true, _RET_IP_))
bb359dbcb70085 Andrey Konovalov 2020-12-22  62  		return NULL;
bb359dbcb70085 Andrey Konovalov 2020-12-22  63  
bb359dbcb70085 Andrey Konovalov 2020-12-22  64  	return __memmove(dest, src, len);
bb359dbcb70085 Andrey Konovalov 2020-12-22  65  }
bb359dbcb70085 Andrey Konovalov 2020-12-22  66  #endif
bb359dbcb70085 Andrey Konovalov 2020-12-22  67  
bb359dbcb70085 Andrey Konovalov 2020-12-22  68  #undef memcpy
bb359dbcb70085 Andrey Konovalov 2020-12-22  69  void *memcpy(void *dest, const void *src, size_t len)
bb359dbcb70085 Andrey Konovalov 2020-12-22 @70  {
f00748bfa0246c Andrey Konovalov 2021-02-24  71  	if (!kasan_check_range((unsigned long)src, len, false, _RET_IP_) ||
f00748bfa0246c Andrey Konovalov 2021-02-24  72  	    !kasan_check_range((unsigned long)dest, len, true, _RET_IP_))
bb359dbcb70085 Andrey Konovalov 2020-12-22  73  		return NULL;
bb359dbcb70085 Andrey Konovalov 2020-12-22  74  
bb359dbcb70085 Andrey Konovalov 2020-12-22  75  	return __memcpy(dest, src, len);
bb359dbcb70085 Andrey Konovalov 2020-12-22  76  }
69d4c0d3218692 Peter Zijlstra   2023-01-12  77  #endif
69d4c0d3218692 Peter Zijlstra   2023-01-12  78  

:::::: The code at line 49 was first introduced by commit
:::::: bb359dbcb70085a63e8bdbf14837a900750f0cf7 kasan: split out shadow.c from common.c

:::::: TO: Andrey Konovalov <andreyknvl@google.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

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

                 reply	other threads:[~2023-06-17  5:17 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=202306171302.fa4CDGXG-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=peterz@infradead.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