Re: [PATCH] pid: change task_struct::pid to read-only

2014-01-23 Thread Richard Guy Briggs
On 13/12/22, Oleg Nesterov wrote: > On 12/20, Peter Zijlstra wrote: > > > > On Fri, Dec 20, 2013 at 08:01:57PM +0100, Oleg Nesterov wrote: > > > The only problem is that > > > > > > #define ASSIGN_CONST(l, r) (*(typeof(r) *)&(l) = (r)) > > > > > > obviously can't work in this case ;) We need

Re: [PATCH] pid: change task_struct::pid to read-only

2013-12-22 Thread Oleg Nesterov
On 12/20, Peter Zijlstra wrote: > > On Fri, Dec 20, 2013 at 08:01:57PM +0100, Oleg Nesterov wrote: > > The only problem is that > > > > #define ASSIGN_CONST(l, r) (*(typeof(r) *)&(l) = (r)) > > > > obviously can't work in this case ;) We need something more clever. > > Hmm indeed, C++ has

Re: [PATCH] pid: change task_struct::pid to read-only

2013-12-20 Thread Peter Zijlstra
On Fri, Dec 20, 2013 at 08:01:57PM +0100, Oleg Nesterov wrote: > The only problem is that > > #define ASSIGN_CONST(l, r) (*(typeof(r) *)&(l) = (r)) > > obviously can't work in this case ;) We need something more clever. Hmm indeed, C++ has both the const_cast<>() thingy and the templa

Re: [PATCH] pid: change task_struct::pid to read-only

2013-12-20 Thread Richard Guy Briggs
On 13/12/20, Oleg Nesterov wrote: > Richard, Peter, Oleg, > sorry I deleted your emails by accident, so I am replying to my email. That's ok, you could send yourself a new copy from the "forward" link here: https://lkml.org/lkml/2013/12/20/277 > Sure, ASSIGN_CONST() looks "dange

Re: [PATCH] pid: change task_struct::pid to read-only

2013-12-20 Thread Oleg Nesterov
Richard, Peter, sorry I deleted your emails by accident, so I am replying to my email. Sure, ASSIGN_CONST() looks "dangerous". Still to me it is safer than "(pid_t*)&(tsk->pid)" done by hand. And yes, it is visible to grep. But the main point, it is much more readable. Just look at the change be

Re: [PATCH] pid: change task_struct::pid to read-only

2013-12-20 Thread Richard Guy Briggs
On 13/12/20, Peter Zijlstra wrote: > On Thu, Dec 19, 2013 at 11:48:26PM -0500, Richard Guy Briggs wrote: > > On 13/12/17, Peter Zijlstra wrote: > > > On Mon, Dec 16, 2013 at 04:03:38PM -0500, Richard Guy Briggs wrote: > > > > task->pid is only ever assigned once (well ok, twice). For system > > >

Re: [PATCH] pid: change task_struct::pid to read-only

2013-12-20 Thread Peter Zijlstra
On Thu, Dec 19, 2013 at 11:48:26PM -0500, Richard Guy Briggs wrote: > On 13/12/17, Peter Zijlstra wrote: > > On Mon, Dec 16, 2013 at 04:03:38PM -0500, Richard Guy Briggs wrote: > > > task->pid is only ever assigned once (well ok, twice). For system health > > > and > > > secure logging confidence

Re: [PATCH] pid: change task_struct::pid to read-only

2013-12-19 Thread Richard Guy Briggs
On 13/12/17, Peter Zijlstra wrote: > On Mon, Dec 16, 2013 at 04:03:38PM -0500, Richard Guy Briggs wrote: > > task->pid is only ever assigned once (well ok, twice). For system health > > and > > secure logging confidence, make it const to make it much more intentional > > when > > it is being cha

Re: [PATCH] pid: change task_struct::pid to read-only

2013-12-17 Thread Oleg Nesterov
On 12/17, Oleg Nesterov wrote: > > On 12/16, Richard Guy Briggs wrote: > > > > task->pid is only ever assigned once (well ok, twice). For system health > > and > > secure logging confidence, make it const to make it much more intentional > > when > > it is being changed. > > Hmm. I am a bit supr

Re: [PATCH] pid: change task_struct::pid to read-only

2013-12-17 Thread Oleg Nesterov
On 12/16, Richard Guy Briggs wrote: > > task->pid is only ever assigned once (well ok, twice). For system health and > secure logging confidence, make it const to make it much more intentional when > it is being changed. Hmm. I am a bit suprized you decided to constify task->pid, but OK. And we

Re: [PATCH] pid: change task_struct::pid to read-only

2013-12-17 Thread Peter Zijlstra
On Mon, Dec 16, 2013 at 04:03:38PM -0500, Richard Guy Briggs wrote: Cc: linux-au...@redhat.com, linux-kernel@vger.kernel.org Could you not cross-post to a moderated list please? I keep getting endless bounces. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the bod

Re: [PATCH] pid: change task_struct::pid to read-only

2013-12-17 Thread Peter Zijlstra
On Mon, Dec 16, 2013 at 04:03:38PM -0500, Richard Guy Briggs wrote: > task->pid is only ever assigned once (well ok, twice). For system health and > secure logging confidence, make it const to make it much more intentional when > it is being changed. > --- > > Peter, as you had suggested, does th