mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [TRIVIAL] kasan: Add a prototype of task_struct to avoid warning
@ 2017-02-13 14:28 Masami Hiramatsu
  2017-02-13 15:06 ` Andrey Ryabinin
  0 siblings, 1 reply; 3+ messages in thread
From: Masami Hiramatsu @ 2017-02-13 14:28 UTC (permalink / raw)
  To: Andrey Ryabinin
  Cc: linux-kernel, kasan-dev, Alexander Potapenko, Dmitry Vyukov

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.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
---
 include/linux/kasan.h |    1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/kasan.h b/include/linux/kasan.h
index 820c0ad..c9df9e1 100644
--- a/include/linux/kasan.h
+++ b/include/linux/kasan.h
@@ -7,6 +7,7 @@
 struct kmem_cache;
 struct page;
 struct vm_struct;
+struct task_struct;
 
 #ifdef CONFIG_KASAN
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [TRIVIAL] kasan: Add a prototype of task_struct to avoid warning
  2017-02-13 14:28 [PATCH] [TRIVIAL] kasan: Add a prototype of task_struct to avoid warning Masami Hiramatsu
@ 2017-02-13 15:06 ` Andrey Ryabinin
  2017-02-14  0:27   ` Masami Hiramatsu
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Ryabinin @ 2017-02-13 15:06 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: linux-kernel, kasan-dev, Alexander Potapenko, Dmitry Vyukov



On 02/13/2017 05:28 PM, Masami Hiramatsu wrote:
> 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) {}
>                                                      ^~~~~~~~~~~


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")
    

> 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.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
> Cc: Alexander Potapenko <glider@google.com>
> Cc: Dmitry Vyukov <dvyukov@google.com>
> ---
>  include/linux/kasan.h |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/linux/kasan.h b/include/linux/kasan.h
> index 820c0ad..c9df9e1 100644
> --- a/include/linux/kasan.h
> +++ b/include/linux/kasan.h
> @@ -7,6 +7,7 @@
>  struct kmem_cache;
>  struct page;
>  struct vm_struct;
> +struct task_struct;
>  
>  #ifdef CONFIG_KASAN
>  
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [TRIVIAL] kasan: Add a prototype of task_struct to avoid warning
  2017-02-13 15:06 ` Andrey Ryabinin
@ 2017-02-14  0:27   ` Masami Hiramatsu
  0 siblings, 0 replies; 3+ messages in thread
From: Masami Hiramatsu @ 2017-02-14  0:27 UTC (permalink / raw)
  To: Andrey Ryabinin
  Cc: linux-kernel, kasan-dev, Alexander Potapenko, Dmitry Vyukov

On Mon, 13 Feb 2017 18:06:34 +0300
Andrey Ryabinin <aryabinin@virtuozzo.com> wrote:

> 
> 
> On 02/13/2017 05:28 PM, Masami Hiramatsu wrote:
> > 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) {}
> >                                                      ^~~~~~~~~~~
> 
> 
> 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.

Ah, sorry, I used a bit older -tip tree. I confirmed it was solved.

> 
> BTW, arch/arm64/kernel/probes/kprobes.c no longer needs <linux/kasan.h> since
> commit ad05711cec12131e1277ce749a99d08ecf233aa7 ("arm64: Remove stack duplicating code from jprobes")

OK, thank you for checking. Please drop this.

>     
> 
> > 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.
> > 
> > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> > Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
> > Cc: Alexander Potapenko <glider@google.com>
> > Cc: Dmitry Vyukov <dvyukov@google.com>
> > ---
> >  include/linux/kasan.h |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/include/linux/kasan.h b/include/linux/kasan.h
> > index 820c0ad..c9df9e1 100644
> > --- a/include/linux/kasan.h
> > +++ b/include/linux/kasan.h
> > @@ -7,6 +7,7 @@
> >  struct kmem_cache;
> >  struct page;
> >  struct vm_struct;
> > +struct task_struct;
> >  
> >  #ifdef CONFIG_KASAN
> >  
> > 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-14  0:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-13 14:28 [PATCH] [TRIVIAL] kasan: Add a prototype of task_struct to avoid warning Masami Hiramatsu
2017-02-13 15:06 ` Andrey Ryabinin
2017-02-14  0:27   ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome