[for-next][PATCH] kasan: Include linux/instruction_pointer.h for _RET_IP_

From: Steven Rostedt

Date: Thu Dec 03 2026 - 14:15:47 EST



git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace/for-next

Head SHA1: aee1deaaf7bca2f1bb8c48cbda2d5127449c6895


Arnd Bergmann (1):
kasan: Include linux/instruction_pointer.h for _RET_IP_

----
include/linux/kasan.h | 1 +
1 file changed, 1 insertion(+)
---------------------------
commit aee1deaaf7bca2f1bb8c48cbda2d5127449c6895
Author: Arnd Bergmann <arnd@xxxxxxxx>
Date: Tue Dec 1 12:03:30 2026 +0100

kasan: Include linux/instruction_pointer.h for _RET_IP_

A side-effect of removing trace_printk.h is that the instruction_pointer.h
header is now missing in kasan:

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_);
| ^~~~~~~~

Add an explicit #include for this.

Link: https://patch.msgid.link/<20261201110338.3808493-1-arnd@xxxxxxxxxx>
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Fixes: 4b9cae768eff ("tracing: Remove trace_printk.h from kernel.h")
Closes: https://lore.kernel.org/oe-kbuild-all/20261127050911.yRUv13dj-lkp@xxxxxxxxx/
Reviewed-by: Yury Norov <ynorov@xxxxxxxxxx>
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>

diff --git a/include/linux/kasan.h b/include/linux/kasan.h
index c1ac7971601e..b441c857b231 100644
--- a/include/linux/kasan.h
+++ b/include/linux/kasan.h
@@ -3,6 +3,7 @@
#define _LINUX_KASAN_H

#include <linux/bug.h>
+#include <linux/instruction_pointer.h>
#include <linux/kasan-enabled.h>
#include <linux/kasan-tags.h>
#include <linux/kernel.h>