Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757607AbZLKNqX (ORCPT ); Fri, 11 Dec 2009 08:46:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756112AbZLKNqT (ORCPT ); Fri, 11 Dec 2009 08:46:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:25427 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755907AbZLKNqS (ORCPT ); Fri, 11 Dec 2009 08:46:18 -0500 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20091210001308.247025548@linutronix.de> <20091210004703.029784964@linutronix.de> <20091210024324.GH6938@linux.vnet.ibm.com> <20091210142915.GB8226@redhat.com> To: Thomas Gleixner , Oleg Nesterov , "Paul E. McKenney" Cc: dhowells@redhat.com, LKML , Dipankar Sarma , Ingo Molnar , Peter Zijlstra , Al Viro , James Morris , Andrew Morton , Linus Torvalds , linux-security-module@vger.kernel.org Subject: Re: [patch 1/9] sys: Fix missing rcu protection for __task_cred() access Date: Fri, 11 Dec 2009 13:45:20 +0000 Message-ID: <13183.1260539120@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 874 Lines: 23 Thomas Gleixner wrote: > > > Or are there updates that are carried out without write-holding > > > tasklist_lock that I am missing? > > > > Yes, commit_creds() is called lockless. > > Right, and that's what the problem is. commit_creds(), which rcu frees > the old creds, does not take tasklist lock write lock. commit_creds() does not need to hold a write lock, because it is implicitly write-locked by only being permitted to run in the thread to which it is committing. I don't think commit_creds() needs to take the RCU read lock as no-one else can alter/delete the creds it is dealing with. David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/