Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-12-19 Thread Richard Guy Briggs
On 13/12/17, Peter Zijlstra wrote: > On Mon, Dec 16, 2013 at 05:20:51PM -0500, Richard Guy Briggs wrote: > > > static inline bool is_idle_task(const struct task_struct *p) > > { > > - return p->pid == 0; > > + return task_pid(p) == &init_struct_pid; > > } > > > I'll stick with task_pid_

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-12-17 Thread Peter Zijlstra
On Tue, Dec 17, 2013 at 10:34:42AM +0100, Peter Zijlstra wrote: > On Mon, Dec 16, 2013 at 05:20:51PM -0500, Richard Guy Briggs wrote: > > > static inline bool is_idle_task(const struct task_struct *p) > > { > > - return p->pid == 0; > > + return task_pid(p) == &init_struct_pid; > > } >

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-12-17 Thread Peter Zijlstra
On Mon, Dec 16, 2013 at 05:20:51PM -0500, Richard Guy Briggs wrote: > static inline bool is_idle_task(const struct task_struct *p) > { > -return p->pid == 0; > +return task_pid(p) == &init_struct_pid; > } > I'll stick with task_pid_nr(p) == 0. We're going to probably switch to:

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-12-16 Thread Richard Guy Briggs
On 13/12/16, Oleg Nesterov wrote: > Hi Richard, > > Sorry, I already forgot the context, not sure I understand your email > correctly. > > On 12/16, Richard Guy Briggs wrote: > > On 13/08/26, Richard Guy Briggs wrote: > > > On Thu, Aug 22, 2013 at 09:08:48PM +0200, Oleg Nesterov wrote: > > > > On

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-12-16 Thread Oleg Nesterov
Hi Richard, Sorry, I already forgot the context, not sure I understand your email correctly. On 12/16, Richard Guy Briggs wrote: > On 13/08/26, Richard Guy Briggs wrote: > > On Thu, Aug 22, 2013 at 09:08:48PM +0200, Oleg Nesterov wrote: > > > On 08/20, Richard Guy Briggs wrote: > > > > > > > > s

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-12-16 Thread Richard Guy Briggs
On 13/08/26, Richard Guy Briggs wrote: > On Thu, Aug 22, 2013 at 09:08:48PM +0200, Oleg Nesterov wrote: > > On 08/20, Richard Guy Briggs wrote: > > > > > > static inline int is_global_init(struct task_struct *tsk) > > > { > > > - return tsk->pid == 1; > > > + return task_pid_nr(tsk) == 1; > > >

Re: audit looks unmaintained? [was: Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid]

2013-09-14 Thread Oleg Nesterov
On 09/13, Steve Grubb wrote: > > On Tuesday, September 10, 2013 07:20:33 PM Oleg Nesterov wrote: > > > > So, Steve, do you still think that patch was wrong? Attached below > > just in case. > > I think this looks OK. If the task filter NACK's auditing the process, then > clearing the flag is probab

Re: audit looks unmaintained? [was: Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid]

2013-09-14 Thread Oleg Nesterov
On 09/13, Steve Grubb wrote: > > On Sunday, September 08, 2013 05:54:35 PM Oleg Nesterov wrote: > > > > Then why audit_alloc() doesn't set TIF_SYSCALL_AUDIT unconditionally? > > The code I'm looking at does right at the end of the function. The code I'm looking at does right at the end too ;) but

Re: audit looks unmaintained? [was: Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid]

2013-09-13 Thread Steve Grubb
On Sunday, September 08, 2013 05:54:35 PM Oleg Nesterov wrote: > Sorry for delay, vacation. > > First of all, I do not pretend I understand this code. This was mostly > the question, and in fact I mostly asked about audit_bprm() in 0/1. > > However, > > On 08/30, Steve Grubb wrote: > > On Friday

Re: audit looks unmaintained? [was: Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid]

2013-09-13 Thread Steve Grubb
On Tuesday, September 10, 2013 07:20:33 PM Oleg Nesterov wrote: > On 09/08, Oleg Nesterov wrote: > > First of all, I do not pretend I understand this code. This was mostly > > the question, and in fact I mostly asked about audit_bprm() in 0/1. > > > > However, > > > > On 08/30, Steve Grubb wrote:

Re: audit looks unmaintained? [was: Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid]

2013-09-10 Thread Oleg Nesterov
On 09/08, Oleg Nesterov wrote: > > First of all, I do not pretend I understand this code. This was mostly > the question, and in fact I mostly asked about audit_bprm() in 0/1. > > However, > > On 08/30, Steve Grubb wrote: > > On Friday, August 30, 2013 03:06:46 PM Richard Guy Briggs wrote: > > > On

Re: audit looks unmaintained? [was: Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid]

2013-09-08 Thread Oleg Nesterov
Sorry for delay, vacation. First of all, I do not pretend I understand this code. This was mostly the question, and in fact I mostly asked about audit_bprm() in 0/1. However, On 08/30, Steve Grubb wrote: > On Friday, August 30, 2013 03:06:46 PM Richard Guy Briggs wrote: > > On Tue, Aug 27, 2013

Re: audit looks unmaintained? [was: Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid]

2013-08-30 Thread Steve Grubb
On Friday, August 30, 2013 03:06:46 PM Richard Guy Briggs wrote: > On Tue, Aug 27, 2013 at 07:11:34PM +0200, Oleg Nesterov wrote: > > Btw. audit looks unmaintained... if you are going to take care of > > this code, perhaps you can look at > > > > http://marc.info/?l=linux-kernel&m=137589907108

audit looks unmaintained? [was: Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid]

2013-08-30 Thread Richard Guy Briggs
On Tue, Aug 27, 2013 at 07:11:34PM +0200, Oleg Nesterov wrote: > Btw. audit looks unmaintained... if you are going to take care of > this code, perhaps you can look at > > http://marc.info/?l=linux-kernel&m=137589907108485 > http://marc.info/?l=linux-kernel&m=137590271809664 (I don't

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-08-28 Thread Peter Zijlstra
On Tue, Aug 27, 2013 at 02:35:11PM -0700, Eric W. Biederman wrote: > Peter Zijlstra writes: > > > On Mon, Aug 26, 2013 at 10:37:22PM -0400, Richard Guy Briggs wrote: > >> On Fri, Aug 23, 2013 at 08:36:21AM +0200, Peter Zijlstra wrote: > >> > Except that's not the case, with namespaces there's a c

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-08-27 Thread Eric W. Biederman
Peter Zijlstra writes: > On Mon, Aug 26, 2013 at 10:37:22PM -0400, Richard Guy Briggs wrote: >> On Fri, Aug 23, 2013 at 08:36:21AM +0200, Peter Zijlstra wrote: >> > Except that's not the case, with namespaces there's a clear hierarchy >> > and the task_struct::pid is the one true value aka. root

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-08-27 Thread Oleg Nesterov
On 08/26, Richard Guy Briggs wrote: > > On Fri, Aug 23, 2013 at 09:28:07PM +0200, Oleg Nesterov wrote: > > > Or 3/12. > > That is a cleanup to make clear what parts are actually pid-related and > what isn't. You know, I decided to send another email about this patch. This cleanup doesn't look even

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-08-27 Thread Oleg Nesterov
On 08/26, Richard Guy Briggs wrote: > > On Thu, Aug 22, 2013 at 09:08:48PM +0200, Oleg Nesterov wrote: > > On 08/20, Richard Guy Briggs wrote: > > > > > > static inline int is_global_init(struct task_struct *tsk) > > > { > > > - return tsk->pid == 1; > > > + return task_pid_nr(tsk) == 1; > > > }

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-08-27 Thread Peter Zijlstra
On Mon, Aug 26, 2013 at 10:37:22PM -0400, Richard Guy Briggs wrote: > On Fri, Aug 23, 2013 at 08:36:21AM +0200, Peter Zijlstra wrote: > > Except that's not the case, with namespaces there's a clear hierarchy > > and the task_struct::pid is the one true value aka. root namespace. > > Peter, I agoni

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-08-26 Thread Richard Guy Briggs
On Fri, Aug 23, 2013 at 09:28:07PM +0200, Oleg Nesterov wrote: > On 08/22, Richard Guy Briggs wrote: > > > > On Thu, Aug 22, 2013 at 10:05:55PM +0200, Peter Zijlstra wrote: > > > > > > Why would you ever want to do this? It just makes these tests more > > > expensive for no gain what so ff'ing ever

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-08-26 Thread Richard Guy Briggs
On Fri, Aug 23, 2013 at 08:36:21AM +0200, Peter Zijlstra wrote: > On Thu, Aug 22, 2013 at 05:43:47PM -0400, Richard Guy Briggs wrote: > > On Thu, Aug 22, 2013 at 10:05:55PM +0200, Peter Zijlstra wrote: > > > On Tue, Aug 20, 2013 at 05:32:03PM -0400, Richard Guy Briggs wrote: > > > > This stops thes

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-08-26 Thread Richard Guy Briggs
On Thu, Aug 22, 2013 at 09:08:48PM +0200, Oleg Nesterov wrote: > On 08/20, Richard Guy Briggs wrote: > > > > static inline int is_global_init(struct task_struct *tsk) > > { > > - return tsk->pid == 1; > > + return task_pid_nr(tsk) == 1; > > } > > Probably it would be better to simply kill i

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-08-23 Thread Oleg Nesterov
On 08/22, Richard Guy Briggs wrote: > > On Thu, Aug 22, 2013 at 10:05:55PM +0200, Peter Zijlstra wrote: > > > > Why would you ever want to do this? It just makes these tests more > > expensive for no gain what so ff'ing ever. > > Backups are generally considered a good idea, but in this case, I'd >

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-08-22 Thread Peter Zijlstra
On Thu, Aug 22, 2013 at 05:43:47PM -0400, Richard Guy Briggs wrote: > On Thu, Aug 22, 2013 at 10:05:55PM +0200, Peter Zijlstra wrote: > > On Tue, Aug 20, 2013 at 05:32:03PM -0400, Richard Guy Briggs wrote: > > > This stops these four task helper functions from using the deprecated and > > > error-p

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-08-22 Thread Richard Guy Briggs
On Thu, Aug 22, 2013 at 10:05:55PM +0200, Peter Zijlstra wrote: > On Tue, Aug 20, 2013 at 05:32:03PM -0400, Richard Guy Briggs wrote: > > This stops these four task helper functions from using the deprecated and > > error-prone task->pid and task->tgid. > > > > (informed by ebiederman's ea5a4d01)

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-08-22 Thread Peter Zijlstra
On Tue, Aug 20, 2013 at 05:32:03PM -0400, Richard Guy Briggs wrote: > This stops these four task helper functions from using the deprecated and > error-prone task->pid and task->tgid. > > (informed by ebiederman's ea5a4d01) > Cc: "Eric W. Biederman" > Signed-off-by: Richard Guy Briggs > --- > i

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-08-22 Thread Oleg Nesterov
On 08/20, Richard Guy Briggs wrote: > > static inline int is_global_init(struct task_struct *tsk) > { > - return tsk->pid == 1; > + return task_pid_nr(tsk) == 1; > } Probably it would be better to simply kill it. Almost every usage is wrong. > static inline bool is_idle_task(const str

[PATCH 11/12] pid: rewrite task helper functions avoiding task->pid and task->tgid

2013-08-20 Thread Richard Guy Briggs
This stops these four task helper functions from using the deprecated and error-prone task->pid and task->tgid. (informed by ebiederman's ea5a4d01) Cc: "Eric W. Biederman" Signed-off-by: Richard Guy Briggs --- include/linux/sched.h |8 1 files changed, 4 insertions(+), 4 deletions(