lkml.org 
[lkml]   [2013]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] pid: change task_struct::pid to read-only
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 this approach work for you in terms of making
> task_struct::pid a lot more difficult to accidentally change to try to preserve
> its integrity?

Yeah, looks good to me.

> Is the use of memcpy() significantly different from *p = *q ?

You'd have to look at the asm, but I suspect gcc knows to do full struct
copies using mempcy.


\
 
 \ /
  Last update: 2013-12-17 11:41    [W:0.130 / U:0.944 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site