kasan: Add a prototype of task_struct to avoid warning
PATCH 1/1 kasan: Add a prototype of task_struct to avoid warning
From: Masami Hiramatsu <[email protected]>
Add a prototype of task_struct to fix below warning on arm64.
In file included from arch/arm64/kernel/probes/kprobes.c:19:0:include/linux/kasan.h:81:132: error: 'struct task_struct' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
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.
[arnd] A related warning was fixed before, but now appears in a different line in the same file in v4.11-rc2. The patch from Masami Hiramatsu still seems appropriate, so let's take his version.
--- include/linux/kasan.h | 1 + 1 file changed, 1 insertion(+)
include/linux/kasan.h +1 -0
@@ -6,6 +6,7 @@struct kmem_cache ;struct page ;struct vm_struct ; +struct task_struct ;#ifdef CONFIG_KASAN
Signature · 1 line
2.9.0
Quoted 15 lines · Arnd Bergmann
From: Masami Hiramatsu <[email protected]>
Add a prototype of
task_structto fix below warning on arm64.In file included from
arch/arm64/kernel/probes/kprobes.c:19:0:include/linux/kasan.h:81:132: error: 'structtask_struct' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
static inline voidkasan_unpoison_task_stack(struct task_struct *task){}As same as other types (
kmem_cache, page, andvm_struct) this adds a prototype oftask_structdata structure on top ofkasan.h.[arnd] A related warning was fixed before, but now appears in a different line in the same file in v4.11-rc2. The patch from Masami Hiramatsu still seems appropriate, so let's take his version.
Quoted 6 lines
Signed-off-by Masami Hiramatsu <[email protected]>Cc Andrey Ryabinin <[email protected]>Cc Alexander Potapenko <[email protected]>Cc Dmitry Vyukov <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Quoted 19 lines
--- include/linux/kasan.h | 1 + 1 file changed, 1 insertion(+)include/linux/kasan.h +1
-1@@ -6,6 +6,7 @@struct kmem_cache ;struct page ;struct vm_struct ; +struct task_struct ;#ifdef CONFIG_KASAN --2.9.0
Signature · 10 lines
Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Straße, 33 80636 München Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg
Quoted 15 lines · Arnd Bergmann
From: Masami Hiramatsu <[email protected]>
Add a prototype of
task_structto fix below warning on arm64.In file included from
arch/arm64/kernel/probes/kprobes.c:19:0:include/linux/kasan.h:81:132: error: 'structtask_struct' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
static inline voidkasan_unpoison_task_stack(struct task_struct *task){}As same as other types (
kmem_cache, page, andvm_struct) this adds a prototype oftask_structdata structure on top ofkasan.h.[arnd] A related warning was fixed before, but now appears in a different line in the same file in v4.11-rc2. The patch from Masami Hiramatsu still seems appropriate, so let's take his version.
Quoted 6 lines
Signed-off-by Masami Hiramatsu <[email protected]>Cc Andrey Ryabinin <[email protected]>Cc Alexander Potapenko <[email protected]>Cc Dmitry Vyukov <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Quoted 17 lines
--- include/linux/kasan.h | 1 + 1 file changed, 1 insertion(+)include/linux/kasan.h +1
-0@@ -6,6 +6,7 @@struct kmem_cache ;struct page ;struct vm_struct ; +struct task_struct ;#ifdef CONFIG_KASAN