kasan: Add a prototype of task_struct to avoid warning
PATCH 1/1 kasan: Add a prototype of task_struct to avoid warning
Add a prototype of task_struct to fix below warning on arm64.
CC arch/arm64/kernel/probes/kprobes.o
In file included from /tmp/linux/arch/arm64/kernel/probes/kprobes.c:19:0:/tmp/linux/include/linux/kasan.h:81:53: warning: 'struct task_struct' declared inside parameter list will not be visible outside of this definition or declaration
static inline void kasan_unpoison_task_stack(struct task_struct *task) {}
^~~~~~~~~~~
As same as other types (kmem_cache, page, and vm_struct) this adds a prototype of task_struct data structure on top of kasan.h.
--- include/linux/kasan.h | 1 + 1 file changed, 1 insertion(+)
include/linux/kasan.h +1 -0
@@ -7,6 +7,7 @@struct kmem_cache ;struct page ;struct vm_struct ; +struct task_struct ;#ifdef CONFIG_KASAN
Quoted 7 lines · Masami Hiramatsu
Add a prototype of
task_structto fix below warning on arm64.CC
arch/arm64/kernel/probes/kprobes.o
In file included from/tmp/linux/arch/arm64/kernel/probes/kprobes.c:19:0:/tmp/linux/include/linux/kasan.h:81:53: warning: 'structtask_struct' declared inside parameter list will not be visible outside of this definition or declaration
static inline voidkasan_unpoison_task_stack(struct task_struct *task){}^~~~~~~~~~~
What tree is that?
I can't see how is this possible on upstream or -next. kasan.h includes linux/sched.h so it supposed to know about task_struct. Also <linux/kasan.h> is the first include in kprobes, so it can't be a header recursion.
BTW, arch/arm64/kernel/probes/kprobes.c no longer needs <linux/kasan.h> since
commit ad05711cec12131e1277ce749a99d08ecf233aa7 ("arm64: Remove stack duplicating code from jprobes")
Quoted 25 lines
As same as other types (
kmem_cache, page, andvm_struct) this adds a prototype oftask_structdata structure on top ofkasan.h.Signed-off-by Masami Hiramatsu <[email protected]>Cc Andrey Ryabinin <[email protected]>Cc Alexander Potapenko <[email protected]>Cc Dmitry Vyukov <[email protected]>--- include/linux/kasan.h | 1 + 1 file changed, 1 insertion(+)include/linux/kasan.h +1
-0@@ -7,6 +7,7 @@struct kmem_cache ;struct page ;struct vm_struct ; +struct task_struct ;#ifdef CONFIG_KASAN
Quoted 12 lines · On Mon, 13 Feb 2017 18:06:34 +0300 Andrey Ryabinin <[email protected]>…
Quoted 7 lines · Masami Hiramatsu
Add a prototype of
task_structto fix below warning on arm64.CC
arch/arm64/kernel/probes/kprobes.o
In file included from/tmp/linux/arch/arm64/kernel/probes/kprobes.c:19:0:/tmp/linux/include/linux/kasan.h:81:53: warning: 'structtask_struct' declared inside parameter list will not be visible outside of this definition or declaration
static inline voidkasan_unpoison_task_stack(struct task_struct *task){}^~~~~~~~~~~
Quoted 3 lines
What tree is that?
I can't see how is this possible on upstream or -next.kasan.hincludeslinux/sched.hso it supposed to know abouttask_struct. Also <linux/kasan.h> is the first include in kprobes, so it can't be a header recursion.
Ah, sorry, I used a bit older -tip tree. I confirmed it was solved.
Quoted 3 lines
BTW,
arch/arm64/kernel/probes/kprobes.cno longer needs <linux/kasan.h> since
commitad05711cec12131e1277ce749a99d08ecf233aa7("arm64: Remove stack duplicating code from jprobes")
OK, thank you for checking. Please drop this.
Quoted 27 lines
Quoted 27 lines
As same as other types (
kmem_cache, page, andvm_struct) this adds a prototype oftask_structdata structure on top ofkasan.h.Signed-off-by Masami Hiramatsu <[email protected]>Cc Andrey Ryabinin <[email protected]>Cc Alexander Potapenko <[email protected]>Cc Dmitry Vyukov <[email protected]>--- include/linux/kasan.h | 1 + 1 file changed, 1 insertion(+)include/linux/kasan.h +1
-0@@ -7,6 +7,7 @@struct kmem_cache ;struct page ;struct vm_struct ; +struct task_struct ;#ifdef CONFIG_KASAN
Signature · 1 line
Masami Hiramatsu <[email protected]>