ecryptfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [trace:ftrace/core 1/3] include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared
       [not found] <53a1e7ba.ZIiv6DbOB78b9RzY%fengguang.wu@intel.com>
@ 2014-06-19  1:15 ` Steven Rostedt
  2014-06-19  1:17   ` Steven Rostedt
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Steven Rostedt @ 2014-06-19  1:15 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Oleg Nesterov, kbuild-all, LKML, Michael Halcrow, Tyler Hicks,
	ecryptfs

On Thu, 19 Jun 2014 03:25:46 +0800
kbuild test robot <fengguang.wu@intel.com> wrote:

> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
> head:   72fa1a896d8ef355e81270667803ceb16a3dd13f
> commit: 32def52ce8faec72c353b6304ca98176687e18f1 [1/3] tracing: Fix syscall_*regfunc() vs copy_process() race
> config: make ARCH=xtensa allyesconfig
> 
> All error/warnings:
> 
>    In file included from include/linux/syscalls.h:80:0,
>                     from fs/ecryptfs/keystore.c:29:
>    include/trace/syscall.h: In function 'syscall_tracepoint_update':
> >> include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared (first use in this function)
>    include/trace/syscall.h:39:6: note: each undeclared identifier is reported only once for each function it appears in
> 
> vim +/TIF_SYSCALL_TRACEPOINT +39 include/trace/syscall.h
> 
>     33		struct ftrace_event_call *exit_event;
>     34	};
>     35	
>     36	#ifdef CONFIG_TRACEPOINTS
>     37	static inline void syscall_tracepoint_update(struct task_struct *p)
>     38	{
>   > 39		if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
>     40			set_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
>     41		else
>     42			clear_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> 
> ---
> 0-DAY kernel build testing backend              Open Source Technology Center
> http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation

My allyesconfig build passed with flying colors. Although we should
probably still add the include of thread_info.h into trace/syscalls.h,
there's no reason that ecryptfs/keystore.c includes linux/syscalls.h.

I suggest adding the patch below.

-- Steve

From 58029546c4acf896b9ce01a820e0093e37bb98be Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
Date: Wed, 18 Jun 2014 21:12:38 -0400
Subject: [PATCH] ecryptfs: Remove unnecessary include of syscall.h in
 keystore.c

There's no reason to include syscalls.h in keystore.c. Remove it.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/ecryptfs/keystore.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
index 4725a07f003c..831c5f8529be 100644
--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -26,7 +26,6 @@
  */
 
 #include <linux/string.h>
-#include <linux/syscalls.h>
 #include <linux/pagemap.h>
 #include <linux/key.h>
 #include <linux/random.h>
-- 
2.0.0.rc2

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

* Re: [trace:ftrace/core 1/3] include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared
  2014-06-19  1:15 ` [trace:ftrace/core 1/3] include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared Steven Rostedt
@ 2014-06-19  1:17   ` Steven Rostedt
  2014-06-19  1:38     ` Steven Rostedt
  2014-06-19 14:10   ` Steven Rostedt
  2014-07-03 21:34   ` Tyler Hicks
  2 siblings, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2014-06-19  1:17 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: kbuild test robot, Oleg Nesterov, kbuild-all, LKML,
	Michael Halcrow, Tyler Hicks, ecryptfs

On Wed, 18 Jun 2014 21:15:59 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Thu, 19 Jun 2014 03:25:46 +0800
> kbuild test robot <fengguang.wu@intel.com> wrote:
> 
> > tree:   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
> > head:   72fa1a896d8ef355e81270667803ceb16a3dd13f
> > commit: 32def52ce8faec72c353b6304ca98176687e18f1 [1/3] tracing: Fix syscall_*regfunc() vs copy_process() race
> > config: make ARCH=xtensa allyesconfig
> > 
> > All error/warnings:
> > 
> >    In file included from include/linux/syscalls.h:80:0,
> >                     from fs/ecryptfs/keystore.c:29:
> >    include/trace/syscall.h: In function 'syscall_tracepoint_update':
> > >> include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared (first use in this function)
> >    include/trace/syscall.h:39:6: note: each undeclared identifier is reported only once for each function it appears in
> > 
> > vim +/TIF_SYSCALL_TRACEPOINT +39 include/trace/syscall.h
> > 
> >     33		struct ftrace_event_call *exit_event;
> >     34	};
> >     35	
> >     36	#ifdef CONFIG_TRACEPOINTS
> >     37	static inline void syscall_tracepoint_update(struct task_struct *p)
> >     38	{
> >   > 39		if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
> >     40			set_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> >     41		else
> >     42			clear_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> > 
> > ---
> > 0-DAY kernel build testing backend              Open Source Technology Center
> > http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
> 
> My allyesconfig build passed with flying colors. Although we should

I should elaborate. I was building against mainline, I noticed that the
kbuild test included linux-next.

-- Steve

> probably still add the include of thread_info.h into trace/syscalls.h,
> there's no reason that ecryptfs/keystore.c includes linux/syscalls.h.
> 
> I suggest adding the patch below.
> 
> -- Steve
> 
> From 58029546c4acf896b9ce01a820e0093e37bb98be Mon Sep 17 00:00:00 2001
> From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
> Date: Wed, 18 Jun 2014 21:12:38 -0400
> Subject: [PATCH] ecryptfs: Remove unnecessary include of syscall.h in
>  keystore.c
> 
> There's no reason to include syscalls.h in keystore.c. Remove it.
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
>  fs/ecryptfs/keystore.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
> index 4725a07f003c..831c5f8529be 100644
> --- a/fs/ecryptfs/keystore.c
> +++ b/fs/ecryptfs/keystore.c
> @@ -26,7 +26,6 @@
>   */
>  
>  #include <linux/string.h>
> -#include <linux/syscalls.h>
>  #include <linux/pagemap.h>
>  #include <linux/key.h>
>  #include <linux/random.h>

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

* Re: [trace:ftrace/core 1/3] include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared
  2014-06-19  1:17   ` Steven Rostedt
@ 2014-06-19  1:38     ` Steven Rostedt
  2014-06-19 15:03       ` Oleg Nesterov
  0 siblings, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2014-06-19  1:38 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: kbuild test robot, kbuild-all, LKML, Tyler Hicks, ecryptfs


Hmm, removed Michael Halcrow as I'm guessing he no longer works for IBM.

On Wed, 18 Jun 2014 21:17:37 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Wed, 18 Jun 2014 21:15:59 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
> 
> > On Thu, 19 Jun 2014 03:25:46 +0800
> > kbuild test robot <fengguang.wu@intel.com> wrote:
> > 
> > > tree:   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
> > > head:   72fa1a896d8ef355e81270667803ceb16a3dd13f
> > > commit: 32def52ce8faec72c353b6304ca98176687e18f1 [1/3] tracing: Fix syscall_*regfunc() vs copy_process() race
> > > config: make ARCH=xtensa allyesconfig
> > > 
> > > All error/warnings:
> > > 
> > >    In file included from include/linux/syscalls.h:80:0,
> > >                     from fs/ecryptfs/keystore.c:29:
> > >    include/trace/syscall.h: In function 'syscall_tracepoint_update':
> > > >> include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared (first use in this function)
> > >    include/trace/syscall.h:39:6: note: each undeclared identifier is reported only once for each function it appears in
> > > 
> > > vim +/TIF_SYSCALL_TRACEPOINT +39 include/trace/syscall.h
> > > 
> > >     33		struct ftrace_event_call *exit_event;
> > >     34	};
> > >     35	
> > >     36	#ifdef CONFIG_TRACEPOINTS
> > >     37	static inline void syscall_tracepoint_update(struct task_struct *p)
> > >     38	{
> > >   > 39		if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
> > >     40			set_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> > >     41		else
> > >     42			clear_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> > > 
> > > ---
> > > 0-DAY kernel build testing backend              Open Source Technology Center
> > > http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
> > 
> > My allyesconfig build passed with flying colors. Although we should
> 
> I should elaborate. I was building against mainline, I noticed that the
> kbuild test included linux-next.

My entire test suite passed. I'm not going to bother with adding the
header now, as it shouldn't affect mainline. I'm going to push my
changes up to linux-next tonight and push to Linus tomorrow.

The keystore.c shouldn't have included the syscall.h file, so if it
needs to be fixed before we get the thread_info.h in, they can just
remove it (my patch was attached to the previous email).

-- Steve

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

* Re: [trace:ftrace/core 1/3] include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared
  2014-06-19  1:15 ` [trace:ftrace/core 1/3] include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared Steven Rostedt
  2014-06-19  1:17   ` Steven Rostedt
@ 2014-06-19 14:10   ` Steven Rostedt
  2014-06-19 15:06     ` Oleg Nesterov
  2014-07-03 21:34   ` Tyler Hicks
  2 siblings, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2014-06-19 14:10 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: kbuild test robot, Oleg Nesterov, kbuild-all, LKML,
	Michael Halcrow, Tyler Hicks, ecryptfs

On Wed, 18 Jun 2014 21:15:59 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Thu, 19 Jun 2014 03:25:46 +0800
> kbuild test robot <fengguang.wu@intel.com> wrote:
> 
> > tree:   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
> > head:   72fa1a896d8ef355e81270667803ceb16a3dd13f
> > commit: 32def52ce8faec72c353b6304ca98176687e18f1 [1/3] tracing: Fix syscall_*regfunc() vs copy_process() race
> > config: make ARCH=xtensa allyesconfig

I got a bit confused because I just noticed that the patch does include
thread_info.h. But then I noticed that TIF_SYSCALL_TRACEPOINT is
defined in arch/x86/include/asm/thread_info.h, and this is generic
code. and the error here is for ARCH=xtensa. We can not be using this. 

Crap, I just sent a pull request to Linus, I'll have to tell him not to
pull it.

I'll look for other solutions.

Thanks!

-- Steve



> > 
> > All error/warnings:
> > 
> >    In file included from include/linux/syscalls.h:80:0,
> >                     from fs/ecryptfs/keystore.c:29:
> >    include/trace/syscall.h: In function 'syscall_tracepoint_update':
> > >> include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared (first use in this function)
> >    include/trace/syscall.h:39:6: note: each undeclared identifier is reported only once for each function it appears in
> > 
> > vim +/TIF_SYSCALL_TRACEPOINT +39 include/trace/syscall.h
> > 
> >     33		struct ftrace_event_call *exit_event;
> >     34	};
> >     35	
> >     36	#ifdef CONFIG_TRACEPOINTS
> >     37	static inline void syscall_tracepoint_update(struct task_struct *p)
> >     38	{
> >   > 39		if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
> >     40			set_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> >     41		else
> >     42			clear_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> > 
> > ---
> > 0-DAY kernel build testing backend              Open Source Technology Center
> > http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
> 
> My allyesconfig build passed with flying colors. Although we should
> probably still add the include of thread_info.h into trace/syscalls.h,
> there's no reason that ecryptfs/keystore.c includes linux/syscalls.h.
> 
> I suggest adding the patch below.
> 
> -- Steve
> 
> From 58029546c4acf896b9ce01a820e0093e37bb98be Mon Sep 17 00:00:00 2001
> From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
> Date: Wed, 18 Jun 2014 21:12:38 -0400
> Subject: [PATCH] ecryptfs: Remove unnecessary include of syscall.h in
>  keystore.c
> 
> There's no reason to include syscalls.h in keystore.c. Remove it.
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
>  fs/ecryptfs/keystore.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
> index 4725a07f003c..831c5f8529be 100644
> --- a/fs/ecryptfs/keystore.c
> +++ b/fs/ecryptfs/keystore.c
> @@ -26,7 +26,6 @@
>   */
>  
>  #include <linux/string.h>
> -#include <linux/syscalls.h>
>  #include <linux/pagemap.h>
>  #include <linux/key.h>
>  #include <linux/random.h>

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

* Re: [trace:ftrace/core 1/3] include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared
  2014-06-19  1:38     ` Steven Rostedt
@ 2014-06-19 15:03       ` Oleg Nesterov
  2014-06-19 15:26         ` Steven Rostedt
  0 siblings, 1 reply; 10+ messages in thread
From: Oleg Nesterov @ 2014-06-19 15:03 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: kbuild test robot, kbuild-all, LKML, Tyler Hicks, ecryptfs

On 06/18, Steven Rostedt wrote:
>
> On Wed, 18 Jun 2014 21:17:37 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > On Wed, 18 Jun 2014 21:15:59 -0400
> > Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > > On Thu, 19 Jun 2014 03:25:46 +0800
> > > kbuild test robot <fengguang.wu@intel.com> wrote:
> > >
> > > > tree:   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
> > > > head:   72fa1a896d8ef355e81270667803ceb16a3dd13f
> > > > commit: 32def52ce8faec72c353b6304ca98176687e18f1 [1/3] tracing: Fix syscall_*regfunc() vs copy_process() race
> > > > config: make ARCH=xtensa allyesconfig
> > > >
> > > > All error/warnings:
> > > >
> > > >    In file included from include/linux/syscalls.h:80:0,
> > > >                     from fs/ecryptfs/keystore.c:29:
> > > >    include/trace/syscall.h: In function 'syscall_tracepoint_update':
> > > > >> include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared (first use in this function)
> > > >    include/trace/syscall.h:39:6: note: each undeclared identifier is reported only once for each function it appears in
> > > >
> > > > vim +/TIF_SYSCALL_TRACEPOINT +39 include/trace/syscall.h
> > > >
> > > >     33		struct ftrace_event_call *exit_event;
> > > >     34	};
> > > >     35
> > > >     36	#ifdef CONFIG_TRACEPOINTS
> > > >     37	static inline void syscall_tracepoint_update(struct task_struct *p)
> > > >     38	{
> > > >   > 39		if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
> > > >     40			set_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> > > >     41		else
> > > >     42			clear_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> > > >
> > > > ---
> > > > 0-DAY kernel build testing backend              Open Source Technology Center
> > > > http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
> > >
> > > My allyesconfig build passed with flying colors. Although we should
> >
> > I should elaborate. I was building against mainline, I noticed that the
> > kbuild test included linux-next.
>
> My entire test suite passed. I'm not going to bother with adding the
> header now, as it shouldn't affect mainline. I'm going to push my
> changes up to linux-next tonight and push to Linus tomorrow.

Argh... but it seems that that patch really needs a fix?

	- #ifdef CONFIG_TRACEPOINTS
	+ #ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS

or even
	- #ifdef CONFIG_TRACEPOINTS
	+ #if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)

or I am totally confused?

Oleg.

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

* Re: [trace:ftrace/core 1/3] include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared
  2014-06-19 14:10   ` Steven Rostedt
@ 2014-06-19 15:06     ` Oleg Nesterov
  0 siblings, 0 replies; 10+ messages in thread
From: Oleg Nesterov @ 2014-06-19 15:06 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: kbuild test robot, kbuild-all, LKML, Michael Halcrow, Tyler Hicks,
	ecryptfs

On 06/19, Steven Rostedt wrote:
>
> On Wed, 18 Jun 2014 21:15:59 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > On Thu, 19 Jun 2014 03:25:46 +0800
> > kbuild test robot <fengguang.wu@intel.com> wrote:
> >
> > > tree:   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
> > > head:   72fa1a896d8ef355e81270667803ceb16a3dd13f
> > > commit: 32def52ce8faec72c353b6304ca98176687e18f1 [1/3] tracing: Fix syscall_*regfunc() vs copy_process() race
> > > config: make ARCH=xtensa allyesconfig
>
> I got a bit confused because I just noticed that the patch does include
> thread_info.h. But then I noticed that TIF_SYSCALL_TRACEPOINT is
> defined in arch/x86/include/asm/thread_info.h, and this is generic
> code. and the error here is for ARCH=xtensa. We can not be using this.

Yes, I was confused the same way.

> Crap, I just sent a pull request to Linus, I'll have to tell him not to
> pull it.
>
> I'll look for other solutions.

Sorry. Please see another email I sent, we probably need
CONFIG_HAVE_SYSCALL_TRACEPOINTS.

Oleg.

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

* Re: [trace:ftrace/core 1/3] include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared
  2014-06-19 15:03       ` Oleg Nesterov
@ 2014-06-19 15:26         ` Steven Rostedt
  2014-06-19 15:51           ` Oleg Nesterov
  0 siblings, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2014-06-19 15:26 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: kbuild test robot, kbuild-all, LKML, Tyler Hicks, ecryptfs

On Thu, 19 Jun 2014 17:03:00 +0200
Oleg Nesterov <oleg@redhat.com> wrote:

> On 06/18, Steven Rostedt wrote:
> >
> > On Wed, 18 Jun 2014 21:17:37 -0400
> > Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > > On Wed, 18 Jun 2014 21:15:59 -0400
> > > Steven Rostedt <rostedt@goodmis.org> wrote:
> > >
> > > > On Thu, 19 Jun 2014 03:25:46 +0800
> > > > kbuild test robot <fengguang.wu@intel.com> wrote:
> > > >
> > > > > tree:   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
> > > > > head:   72fa1a896d8ef355e81270667803ceb16a3dd13f
> > > > > commit: 32def52ce8faec72c353b6304ca98176687e18f1 [1/3] tracing: Fix syscall_*regfunc() vs copy_process() race
> > > > > config: make ARCH=xtensa allyesconfig
> > > > >
> > > > > All error/warnings:
> > > > >
> > > > >    In file included from include/linux/syscalls.h:80:0,
> > > > >                     from fs/ecryptfs/keystore.c:29:
> > > > >    include/trace/syscall.h: In function 'syscall_tracepoint_update':
> > > > > >> include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared (first use in this function)
> > > > >    include/trace/syscall.h:39:6: note: each undeclared identifier is reported only once for each function it appears in
> > > > >
> > > > > vim +/TIF_SYSCALL_TRACEPOINT +39 include/trace/syscall.h
> > > > >
> > > > >     33		struct ftrace_event_call *exit_event;
> > > > >     34	};
> > > > >     35
> > > > >     36	#ifdef CONFIG_TRACEPOINTS
> > > > >     37	static inline void syscall_tracepoint_update(struct task_struct *p)
> > > > >     38	{
> > > > >   > 39		if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
> > > > >     40			set_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> > > > >     41		else
> > > > >     42			clear_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> > > > >
> > > > > ---
> > > > > 0-DAY kernel build testing backend              Open Source Technology Center
> > > > > http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
> > > >
> > > > My allyesconfig build passed with flying colors. Although we should
> > >
> > > I should elaborate. I was building against mainline, I noticed that the
> > > kbuild test included linux-next.
> >
> > My entire test suite passed. I'm not going to bother with adding the
> > header now, as it shouldn't affect mainline. I'm going to push my
> > changes up to linux-next tonight and push to Linus tomorrow.
> 
> Argh... but it seems that that patch really needs a fix?
> 
> 	- #ifdef CONFIG_TRACEPOINTS
> 	+ #ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
> 
> or even
> 	- #ifdef CONFIG_TRACEPOINTS
> 	+ #if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
> 
> or I am totally confused?

I think the second one is needed.

-- Steve

> 
> Oleg.

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

* Re: [trace:ftrace/core 1/3] include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared
  2014-06-19 15:26         ` Steven Rostedt
@ 2014-06-19 15:51           ` Oleg Nesterov
  2014-06-19 16:08             ` Steven Rostedt
  0 siblings, 1 reply; 10+ messages in thread
From: Oleg Nesterov @ 2014-06-19 15:51 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: kbuild test robot, kbuild-all, LKML, Tyler Hicks, ecryptfs

On 06/19, Steven Rostedt wrote:
>
> On Thu, 19 Jun 2014 17:03:00 +0200
> Oleg Nesterov <oleg@redhat.com> wrote:
>
> > Argh... but it seems that that patch really needs a fix?
> >
> > 	- #ifdef CONFIG_TRACEPOINTS
> > 	+ #ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
> >
> > or even
> > 	- #ifdef CONFIG_TRACEPOINTS
> > 	+ #if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
> >
> > or I am totally confused?
>
> I think the second one is needed.

Agreed... see the updated patch below.

Please tell me if I should another "[PATCH]" email or resend 2-3 as well.
Sorry for inconvenience.

-------------------------------------------------------------------------------
Subject: [PATCH] tracing: Fix syscall_*regfunc() vs copy_process() race

syscall_regfunc() and syscall_unregfunc() should set/clear
TIF_SYSCALL_TRACEPOINT system-wide, but do_each_thread() can race
with copy_process() and miss the new child which was not added to
the process/thread lists yet.

Change copy_process() to update the child's TIF_SYSCALL_TRACEPOINT
under tasklist.

Link: http://lkml.kernel.org/p/20140413185854.GB20668@redhat.com

Cc: stable@vger.kernel.org # 2.6.33
Fixes: a871bd33a6c0 "tracing: Add syscall tracepoints"
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 include/trace/syscall.h |   15 +++++++++++++++
 kernel/fork.c           |    2 ++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/include/trace/syscall.h b/include/trace/syscall.h
index fed853f..9674145 100644
--- a/include/trace/syscall.h
+++ b/include/trace/syscall.h
@@ -4,6 +4,7 @@
 #include <linux/tracepoint.h>
 #include <linux/unistd.h>
 #include <linux/ftrace_event.h>
+#include <linux/thread_info.h>
 
 #include <asm/ptrace.h>
 
@@ -32,4 +33,18 @@ struct syscall_metadata {
 	struct ftrace_event_call *exit_event;
 };
 
+#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
+static inline void syscall_tracepoint_update(struct task_struct *p)
+{
+	if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
+		set_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
+	else
+		clear_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
+}
+#else
+static inline void syscall_tracepoint_update(struct task_struct *p)
+{
+}
+#endif
+
 #endif /* _TRACE_SYSCALL_H */
diff --git a/kernel/fork.c b/kernel/fork.c
index cafea61..f7417f5 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1485,7 +1485,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
 
 	total_forks++;
 	spin_unlock(&current->sighand->siglock);
+	syscall_tracepoint_update(p);
 	write_unlock_irq(&tasklist_lock);
+
 	proc_fork_connector(p);
 	cgroup_post_fork(p);
 	if (clone_flags & CLONE_THREAD)
-- 
1.5.5.1


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

* Re: [trace:ftrace/core 1/3] include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared
  2014-06-19 15:51           ` Oleg Nesterov
@ 2014-06-19 16:08             ` Steven Rostedt
  0 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2014-06-19 16:08 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: kbuild test robot, kbuild-all, LKML, Tyler Hicks, ecryptfs

On Thu, 19 Jun 2014 17:51:08 +0200
Oleg Nesterov <oleg@redhat.com> wrote:

> Please tell me if I should another "[PATCH]" email or resend 2-3 as well.
> Sorry for inconvenience.

This is fine. I'm going to do what I seldom do and rebase my for-next
branch with this one instead.

But first I'll run this through my cross-compile tests. I should have
done that the fist time :-/

-- Steve

> 
> -------------------------------------------------------------------------------
> Subject: [PATCH] tracing: Fix syscall_*regfunc() vs copy_process() race
> 
> syscall_regfunc() and syscall_unregfunc() should set/clear
> TIF_SYSCALL_TRACEPOINT system-wide, but do_each_thread() can race
> with copy_process() and miss the new child which was not added to
> the process/thread lists yet.
> 
> Change copy_process() to update the child's TIF_SYSCALL_TRACEPOINT
> under tasklist.
> 
> Link: http://lkml.kernel.org/p/20140413185854.GB20668@redhat.com
> 
> Cc: stable@vger.kernel.org # 2.6.33
> Fixes: a871bd33a6c0 "tracing: Add syscall tracepoints"
> Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
> ---
>  include/trace/syscall.h |   15 +++++++++++++++
>  kernel/fork.c           |    2 ++
>  2 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/include/trace/syscall.h b/include/trace/syscall.h
> index fed853f..9674145 100644
> --- a/include/trace/syscall.h
> +++ b/include/trace/syscall.h
> @@ -4,6 +4,7 @@
>  #include <linux/tracepoint.h>
>  #include <linux/unistd.h>
>  #include <linux/ftrace_event.h>
> +#include <linux/thread_info.h>
>  
>  #include <asm/ptrace.h>
>  
> @@ -32,4 +33,18 @@ struct syscall_metadata {
>  	struct ftrace_event_call *exit_event;
>  };
>  
> +#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
> +static inline void syscall_tracepoint_update(struct task_struct *p)
> +{
> +	if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
> +		set_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> +	else
> +		clear_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> +}
> +#else
> +static inline void syscall_tracepoint_update(struct task_struct *p)
> +{
> +}
> +#endif
> +
>  #endif /* _TRACE_SYSCALL_H */
> diff --git a/kernel/fork.c b/kernel/fork.c
> index cafea61..f7417f5 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1485,7 +1485,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
>  
>  	total_forks++;
>  	spin_unlock(&current->sighand->siglock);
> +	syscall_tracepoint_update(p);
>  	write_unlock_irq(&tasklist_lock);
> +
>  	proc_fork_connector(p);
>  	cgroup_post_fork(p);
>  	if (clone_flags & CLONE_THREAD)

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

* Re: [trace:ftrace/core 1/3] include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared
  2014-06-19  1:15 ` [trace:ftrace/core 1/3] include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared Steven Rostedt
  2014-06-19  1:17   ` Steven Rostedt
  2014-06-19 14:10   ` Steven Rostedt
@ 2014-07-03 21:34   ` Tyler Hicks
  2 siblings, 0 replies; 10+ messages in thread
From: Tyler Hicks @ 2014-07-03 21:34 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: kbuild test robot, Oleg Nesterov, kbuild-all, LKML,
	Michael Halcrow, ecryptfs

[-- Attachment #1: Type: text/plain, Size: 3147 bytes --]

On 2014-06-18 21:15:59, Steven Rostedt wrote:
> On Thu, 19 Jun 2014 03:25:46 +0800
> kbuild test robot <fengguang.wu@intel.com> wrote:
> 
> > tree:   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
> > head:   72fa1a896d8ef355e81270667803ceb16a3dd13f
> > commit: 32def52ce8faec72c353b6304ca98176687e18f1 [1/3] tracing: Fix syscall_*regfunc() vs copy_process() race
> > config: make ARCH=xtensa allyesconfig
> > 
> > All error/warnings:
> > 
> >    In file included from include/linux/syscalls.h:80:0,
> >                     from fs/ecryptfs/keystore.c:29:
> >    include/trace/syscall.h: In function 'syscall_tracepoint_update':
> > >> include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared (first use in this function)
> >    include/trace/syscall.h:39:6: note: each undeclared identifier is reported only once for each function it appears in
> > 
> > vim +/TIF_SYSCALL_TRACEPOINT +39 include/trace/syscall.h
> > 
> >     33		struct ftrace_event_call *exit_event;
> >     34	};
> >     35	
> >     36	#ifdef CONFIG_TRACEPOINTS
> >     37	static inline void syscall_tracepoint_update(struct task_struct *p)
> >     38	{
> >   > 39		if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
> >     40			set_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> >     41		else
> >     42			clear_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
> > 
> > ---
> > 0-DAY kernel build testing backend              Open Source Technology Center
> > http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
> 
> My allyesconfig build passed with flying colors. Although we should
> probably still add the include of thread_info.h into trace/syscalls.h,
> there's no reason that ecryptfs/keystore.c includes linux/syscalls.h.
> 
> I suggest adding the patch below.
> 
> -- Steve
> 
> From 58029546c4acf896b9ce01a820e0093e37bb98be Mon Sep 17 00:00:00 2001
> From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
> Date: Wed, 18 Jun 2014 21:12:38 -0400
> Subject: [PATCH] ecryptfs: Remove unnecessary include of syscall.h in
>  keystore.c
> 
> There's no reason to include syscalls.h in keystore.c. Remove it.
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---

Hello! Sorry for not being active in this thread.

I don't see a reason for keystore.c to include linux/syscalls.h. I'll
get this patch applied to my next tree and push it during the next merge
window. Thanks!

Tyler

>  fs/ecryptfs/keystore.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
> index 4725a07f003c..831c5f8529be 100644
> --- a/fs/ecryptfs/keystore.c
> +++ b/fs/ecryptfs/keystore.c
> @@ -26,7 +26,6 @@
>   */
>  
>  #include <linux/string.h>
> -#include <linux/syscalls.h>
>  #include <linux/pagemap.h>
>  #include <linux/key.h>
>  #include <linux/random.h>
> -- 
> 2.0.0.rc2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe ecryptfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2014-07-03 21:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <53a1e7ba.ZIiv6DbOB78b9RzY%fengguang.wu@intel.com>
2014-06-19  1:15 ` [trace:ftrace/core 1/3] include/trace/syscall.h:39:6: error: 'TIF_SYSCALL_TRACEPOINT' undeclared Steven Rostedt
2014-06-19  1:17   ` Steven Rostedt
2014-06-19  1:38     ` Steven Rostedt
2014-06-19 15:03       ` Oleg Nesterov
2014-06-19 15:26         ` Steven Rostedt
2014-06-19 15:51           ` Oleg Nesterov
2014-06-19 16:08             ` Steven Rostedt
2014-06-19 14:10   ` Steven Rostedt
2014-06-19 15:06     ` Oleg Nesterov
2014-07-03 21:34   ` Tyler Hicks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).