From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: Re: PATCH [1/1]: audit: acquire creds selectively to reduce atomic op overhead Date: Tue, 15 Mar 2011 20:04:47 +0000 Message-ID: <21411.1300219487@redhat.com> References: <20110315173810.GA12775@suse.de> <20110310202516.GA16122@suse.de> <20110307210656.GA1750@suse.de> <18893.1299607373@redhat.com> <29980.1299861232@redhat.com> Return-path: In-Reply-To: <20110315173810.GA12775@suse.de> Sender: linux-kernel-owner@vger.kernel.org To: Tony Jones Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org, linux-audit@redhat.com, Eric Paris , Al Viro List-Id: linux-audit@redhat.com Tony Jones 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