lkml.org 
[lkml]   [2011]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: PATCH [1/1]: audit: acquire creds selectively to reduce atomic op overhead
Date
Tony Jones <tonyj@suse.de> wrote:

> Agree. Also I believe it is safe to use tsk->cred directly as tsk == current
> or tsk is being created by copy_process.

You can't quite access it like that without sparse throwing a warning. The
pointer is marked with an __rcu attribute, so you need to use something like
this:

cred = rcu_dereference_check(tsk->cred, (tsk == current ||
called_from_copy_process());

David


\
 
 \ /
  Last update: 2011-03-15 21:07    [W:0.904 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site