Skip to contentSkip to conversation

kmsan: add KMSAN runtime core

PATCH Alexander Potapenko 1 participant 1 message May 16, 2022 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 4 lines · kernel test robot

Hi Alexander,

I love your patch! Yet something to improve:

Hi kbuild maintainers,

This error report log (as well as the other one in this thread) seems completely irrelevant to my patch :(

Quoted 132 lines

[auto build test ERROR on tip/x86/core]
[also build test ERROR on tip/x86/mm linus/master v5.18-rc4 next-20220426] [cannot apply to hnaz-mm/master]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Alexander-Potapenko/Add-KernelMemorySanitizer-infrastructure/20220427-004851
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 203d8919a9eda5d1bc68ac3cd7637588334c9dc1
config: arm64-randconfig-r014-20220425 (https://download.01.org/0day-ci/archive/20220427/202204271028.eREzWfuw-lkp(a)intel.com/config)
compiler: aarch64-linux-gcc (GCC) 11.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://github.com/intel-lab-lkp/linux/commit/e646a4336193785fdd3120ed4a6b60ffb8860b1d
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Alexander-Potapenko/Add-KernelMemorySanitizer-infrastructure/20220427-004851 git checkout e646a4336193785fdd3120ed4a6b60ffb8860b1d
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arm64 prepare

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

In file included from include/linux/build_bug.h:5,

                    from include/linux/bits.h:22,
                    from include/linux/ioport.h:13,
                    from include/linux/acpi.h:12,
                    from include/acpi/apei.h:9,
                    from include/acpi/ghes.h:5,
                    from include/linux/arm_sdei.h:8,
                    from arch/arm64/kernel/asm-offsets.c:10:

arch/arm64/include/asm/mte.h: In function 'mte_disable_tco_entry':

Quoted 1 line
Quoted 1 line

arch/arm64/include/asm/mte.h:107:18: error: invalid use of undefined type 'struct task_struct'

     107 |             (task->thread.sctlr_user & (1UL << SCTLR_EL1_TCF0_SHIFT)))
         |                  ^~
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                    ^~~~
   arch/arm64/include/asm/mte.h:106:9: note: in expansion of macro 'if'
     106 |         if (kasan_hw_tags_enabled() ||
         |         ^~
Quoted 1 line
Quoted 1 line

arch/arm64/include/asm/mte.h:107:18: error: invalid use of undefined type 'struct task_struct'

     107 |             (task->thread.sctlr_user & (1UL << SCTLR_EL1_TCF0_SHIFT)))
         |                  ^~
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                             ^~~~
   arch/arm64/include/asm/mte.h:106:9: note: in expansion of macro 'if'
     106 |         if (kasan_hw_tags_enabled() ||
         |         ^~
Quoted 1 line
Quoted 1 line

arch/arm64/include/asm/mte.h:107:18: error: invalid use of undefined type 'struct task_struct'

     107 |             (task->thread.sctlr_user & (1UL << SCTLR_EL1_TCF0_SHIFT)))
         |                  ^~
   include/linux/compiler.h:69:10: note: in definition of macro '__trace_if_value'
      69 |         (cond) ?                                        \
         |          ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
      56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
         |                            ^~~~~~~~~~~~~~
   arch/arm64/include/asm/mte.h:106:9: note: in expansion of macro 'if'
     106 |         if (kasan_hw_tags_enabled() ||
         |         ^~

arch/arm64/include/asm/pgtable.h: In function '__check_racy_pte_update':

Quoted 1 line
Quoted 1 line

arch/arm64/include/asm/pgtable.h:299:26: error: invalid use of undefined type 'struct task_struct'

     299 |         if (mm != current->active_mm && atomic_read(&mm->mm_users) <= 1)
         |                          ^~
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                    ^~~~
   arch/arm64/include/asm/pgtable.h:299:9: note: in expansion of macro 'if'
     299 |         if (mm != current->active_mm && atomic_read(&mm->mm_users) <= 1)
         |         ^~
Quoted 1 line
Quoted 1 line

arch/arm64/include/asm/pgtable.h:299:26: error: invalid use of undefined type 'struct task_struct'

     299 |         if (mm != current->active_mm && atomic_read(&mm->mm_users) <= 1)
         |                          ^~
   include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
      58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
         |                                                             ^~~~
   arch/arm64/include/asm/pgtable.h:299:9: note: in expansion of macro 'if'
     299 |         if (mm != current->active_mm && atomic_read(&mm->mm_users) <= 1)
         |         ^~
Quoted 1 line
Quoted 1 line

arch/arm64/include/asm/pgtable.h:299:26: error: invalid use of undefined type 'struct task_struct'

     299 |         if (mm != current->active_mm && atomic_read(&mm->mm_users) <= 1)
         |                          ^~
   include/linux/compiler.h:69:10: note: in definition of macro '__trace_if_value'
      69 |         (cond) ?                                        \
         |          ^~~~
   include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
      56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
         |                            ^~~~~~~~~~~~~~
   arch/arm64/include/asm/pgtable.h:299:9: note: in expansion of macro 'if'
     299 |         if (mm != current->active_mm && atomic_read(&mm->mm_users) <= 1)
         |         ^~

make[2]: *** [scripts/Makefile.build:120: arch/arm64/kernel/asm-offsets.s] Error 1 make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1195: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:219: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.

vim +107 arch/arm64/include/asm/mte.h

637ec831ea4f09 Vincenzo Frascino   2019-09-16   90
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18   91  static inline void mte_disable_tco_entry(struct task_struct *task)
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18   92  {
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18   93      if (!system_supports_mte())
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18   94              return;
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18   95
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18   96      /*
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18   97       * Re-enable tag checking (TCO set on exception entry). This is only
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18   98       * necessary if MTE is enabled in either the kernel or the userspace
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18   99       * task in synchronous or asymmetric mode (SCTLR_EL1.TCF0 bit 0 is set
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18  100       * for both). With MTE disabled in the kernel and disabled or
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18  101       * asynchronous in userspace, tag check faults (including in uaccesses)
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18  102       * are not reported, therefore there is no need to re-enable checking.
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18  103       * This is beneficial on microarchitectures where re-enabling TCO is
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18  104       * expensive.
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18  105       */
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18  106      if (kasan_hw_tags_enabled() ||
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18 @107          (task->thread.sctlr_user & (1UL << SCTLR_EL1_TCF0_SHIFT)))
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18  108              asm volatile(SET_PSTATE_TCO(0));
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18  109  }
38ddf7dafaeaf3 Peter Collingbourne 2022-02-18  110

--
0-DAY CI Kernel Test Service
https://01.org/lkp

Signature · 21 lines
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

Diese E-Mail ist vertraulich. Falls Sie diese fälschlicherweise
erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes
weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich
bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.


This e-mail is confidential. If you received this communication by
mistake, please don't forward it to anyone else, please erase all
copies and attachments, and please let me know that it has gone to the
wrong person.