Skip to contentSkip to conversation

include/linux/kasan.h:202:43: error: use of undeclared identifier '_RET_IP_'

PATCH kernel test robot 1 participant 1 message Nov 27

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace trace/for-next
head:   1e443753bfddcd9d34bfb672be26245c4deca2d0
commit: 4b9cae768eff5f92c9383738e8bff21fd3cc3eb6 [4/15] tracing: Remove trace_printk.h from kernel.h
config: arm64-randconfig-r2309-20261126 (https://download.01.org/0day-ci/archive/20261127/[email protected]/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 3a9f981aab0cc32f74ffac36a87891cda8889c37)
rustc: rustc 1.96.0 (ac68faa20 2026-05-25)
sparse: v0.6.5-rc1-21-g84ec0658
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261127/[email protected]/reproduce)

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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from kernel/scs.c:9:

>> include/linux/kasan.h:202:43: error: use of undeclared identifier '_RET_IP_'
     202 |                 return __kasan_slab_pre_free(s, object, _RET_IP_,
         |                                                         ^~~~~~~~
   include/linux/kasan.h:248:28: error: use of undeclared identifier '_RET_IP_'
     248 |                 __kasan_kfree_large(ptr, _RET_IP_);
         |                                          ^~~~~~~~
   include/linux/kasan.h:313:52: error: use of undeclared identifier '_RET_IP_'
     313 |                 return __kasan_mempool_poison_pages(page, order, _RET_IP_);
         |                                                                  ^~~~~~~~
   include/linux/kasan.h:335:47: error: use of undeclared identifier '_RET_IP_'
     335 |                 __kasan_mempool_unpoison_pages(page, order, _RET_IP_);
         |                                                             ^~~~~~~~
   include/linux/kasan.h:367:45: error: use of undeclared identifier '_RET_IP_'
     367 |                 return __kasan_mempool_poison_object(ptr, _RET_IP_);
         |                                                           ^~~~~~~~
   include/linux/kasan.h:395:46: error: use of undeclared identifier '_RET_IP_'
     395 |                 __kasan_mempool_unpoison_object(ptr, size, _RET_IP_);
         |                                                            ^~~~~~~~
   include/linux/kasan.h:406:35: error: use of undeclared identifier '_RET_IP_'
     406 |                 return __kasan_check_byte(addr, _RET_IP_);
         |                                                 ^~~~~~~~
   In file included from kernel/scs.c:10:
   In file included from include/linux/mm.h:36:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:7:
   include/linux/signal.h:98:11: warning: array index 3 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
      98 |                 return (set->sig[3] | set->sig[2] |
         |                         ^        ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from kernel/scs.c:10:
   In file included from include/linux/mm.h:36:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:7:
   include/linux/signal.h:98:25: warning: array index 2 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
      98 |                 return (set->sig[3] | set->sig[2] |
         |                                       ^        ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from kernel/scs.c:10:
   In file included from include/linux/mm.h:36:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:7:
   include/linux/signal.h:99:4: warning: array index 1 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
      99 |                         set->sig[1] | set->sig[0]) == 0;
         |                         ^        ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from kernel/scs.c:10:
   In file included from include/linux/mm.h:36:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:7:
   include/linux/signal.h:101:11: warning: array index 1 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
     101 |                 return (set->sig[1] | set->sig[0]) == 0;
         |                         ^        ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from kernel/scs.c:10:
   In file included from include/linux/mm.h:36:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:7:
   include/linux/signal.h:114:11: warning: array index 3 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     114 |                 return  (set1->sig[3] == set2->sig[3]) &&
         |                          ^         ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from kernel/scs.c:10:
   In file included from include/linux/mm.h:36:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:7:
   include/linux/signal.h:114:27: warning: array index 3 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     114 |                 return  (set1->sig[3] == set2->sig[3]) &&
         |                                          ^         ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from kernel/scs.c:10:
   In file included from include/linux/mm.h:36:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:7:
   include/linux/signal.h:115:5: warning: array index 2 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     115 |                         (set1->sig[2] == set2->sig[2]) &&
         |                          ^         ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from kernel/scs.c:10:
   In file included from include/linux/mm.h:36:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:7:
   include/linux/signal.h:115:21: warning: array index 2 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     115 |                         (set1->sig[2] == set2->sig[2]) &&
         |                                          ^         ~
   include/uapi/asm-generic/signal.h:62:2: note: array 'sig' declared here
      62 |         unsigned long sig[_NSIG_WORDS];
         |         ^

vim +/_RET_IP_ +202 include/linux/kasan.h

34303244f2615ad Andrey Konovalov  2020-12-22  181  
b3c34245756adad Jann Horn         2024-08-09  182  bool __kasan_slab_pre_free(struct kmem_cache *s, void *object,
e212c463eee96b2 Kuniyuki Iwashima 2026-10-28  183  			   unsigned long ip, bool after_rcu_delay);
b3c34245756adad Jann Horn         2024-08-09  184  /**
b3c34245756adad Jann Horn         2024-08-09  185   * kasan_slab_pre_free - Check whether freeing a slab object is safe.
e212c463eee96b2 Kuniyuki Iwashima 2026-10-28  186   * @s: Cache the object belongs to.
b3c34245756adad Jann Horn         2024-08-09  187   * @object: Object to be freed.
e212c463eee96b2 Kuniyuki Iwashima 2026-10-28  188   * @after_rcu_delay: Whether the free follows an RCU grace period.
b3c34245756adad Jann Horn         2024-08-09  189   *
b3c34245756adad Jann Horn         2024-08-09  190   * This function checks whether freeing the given object is safe. It may
b3c34245756adad Jann Horn         2024-08-09  191   * check for double-free and invalid-free bugs and report them.
b3c34245756adad Jann Horn         2024-08-09  192   *
b3c34245756adad Jann Horn         2024-08-09  193   * This function is intended only for use by the slab allocator.
b3c34245756adad Jann Horn         2024-08-09  194   *
b3c34245756adad Jann Horn         2024-08-09  195   * @Return true if freeing the object is unsafe; false otherwise.
b3c34245756adad Jann Horn         2024-08-09  196   */
b3c34245756adad Jann Horn         2024-08-09  197  static __always_inline bool kasan_slab_pre_free(struct kmem_cache *s,
e212c463eee96b2 Kuniyuki Iwashima 2026-10-28  198  						void *object,
e212c463eee96b2 Kuniyuki Iwashima 2026-10-28  199  						bool after_rcu_delay)
b3c34245756adad Jann Horn         2024-08-09  200  {
b3c34245756adad Jann Horn         2024-08-09  201  	if (kasan_enabled())
e212c463eee96b2 Kuniyuki Iwashima 2026-10-28 @202  		return __kasan_slab_pre_free(s, object, _RET_IP_,
e212c463eee96b2 Kuniyuki Iwashima 2026-10-28  203  					     after_rcu_delay);
b3c34245756adad Jann Horn         2024-08-09  204  	return false;
b3c34245756adad Jann Horn         2024-08-09  205  }

b3c34245756adad Jann Horn 2024-08-09 206

:::::: The code at line 202 was first introduced by commit
:::::: e212c463eee96b2568d8c85ca4ee63049dbb18f2 mm/kasan: detect double-free involving kfree_rcu_sheaf()

:::::: TO: Kuniyuki Iwashima <[email protected]> :::::: CC: Andrew Morton <[email protected]>

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