lkml.org 
[lkml]   [2012]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Yama: access current->comm directly
On Mon, 30 Jul 2012 14:21:33 -0700
John Johansen <john.johansen@canonical.com> wrote:

> On 07/30/2012 09:58 AM, Kees Cook wrote:
> > The core ptrace access checking routine already holds the task lock,
> > so there is no need to use get_task_comm() which just tries to take the
> > lock again. Drop its use and access current->comm directly.
> >
> > Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> > Suggested-by: Oleg Nesterov <oleg@redhat.com>
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Kees Cook <keescook@chromium.org>
> yep, looks good
>
> Acked-by: John Johansen <john.johansen@canonical.com>


Code looks correct but having a weird cornercase direct reference is
asking for an accident later. For maintainability I'd rather see that as
__get_task_comm() or get_task_commu_unlocked() which does the job, deals
with all the edge cases and contains a WARN_ON check on the lock.

Alan


\
 
 \ /
  Last update: 2012-07-31 00:21    [W:0.041 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site