Skip to contentSkip to conversation

kasan: include <linux/instruction_pointer.h> for _RET_IP_

PATCH In review Tao Cui 3 participants 3 messages Jul 1 KASAN

lore
Share & tools
lore

Tao Cui

author
#0 lore raw

PATCH 1/1 kasan: include <linux/instruction_pointer.h> for _RET_IP_

From: Tao Cui <[email protected]>

kasan.h uses _RET_IP_ but relied on <linux/trace_printk.h>, included via <linux/kernel.h>, to provide it. Commit 9cbc3d9806d3 ("tracing: Remove trace_printk.h from kernel.h") dropped that transitive include, so files that don't otherwise get instruction_pointer.h no longer build, e.g. kernel/scs.c on arm64 KASAN:

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

Include <linux/instruction_pointer.h> directly to make the dependency explicit.

Fixes 9cbc3d9806d3 ("tracing: Remove trace_printk.h from kernel.h")
---
 include/linux/kasan.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/kasan.h +1 -0
index bf233bde68c7..d5159c8033e8 100644
@@ -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>
Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Tao Cui

From: Tao Cui <[email protected]>

kasan.h uses _RET_IP_ but relied on <linux/trace_printk.h>, included via <linux/kernel.h>, to provide it. Commit 9cbc3d9806d3 ("tracing: Remove trace_printk.h from kernel.h") dropped that transitive include, so files that don't otherwise get instruction_pointer.h no longer build, e.g. kernel/scs.c on arm64 KASAN:

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

Quoted 7 lines

Include <linux/instruction_pointer.h> directly to make the dependency explicit.

Fixes 9cbc3d9806d3 ("tracing: Remove trace_printk.h from kernel.h")
reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Tao Cui
Quoted 10 lines · Tao Cui

From: Tao Cui <[email protected]>

kasan.h uses _RET_IP_ but relied on <linux/trace_printk.h>, included via <linux/kernel.h>, to provide it. Commit 9cbc3d9806d3 ("tracing: Remove trace_printk.h from kernel.h") dropped that transitive include, so files that don't otherwise get instruction_pointer.h no longer build, e.g. kernel/scs.c on arm64 KASAN:

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

Quoted 7 lines

Include <linux/instruction_pointer.h> directly to make the dependency explicit.

Fixes 9cbc3d9806d3 ("tracing: Remove trace_printk.h from kernel.h")
Quoted 16 lines
---
 include/linux/kasan.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/kasan.h +1 -0
index bf233bde68c7..d5159c8033e8 100644
@@ -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>
Signature · 2 lines
Regards,
Vincenzo