Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757849AbZLKNmg (ORCPT ); Fri, 11 Dec 2009 08:42:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757973AbZLKNmY (ORCPT ); Fri, 11 Dec 2009 08:42:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56820 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757466AbZLKNmS (ORCPT ); Fri, 11 Dec 2009 08:42: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: <20091210004703.029784964@linutronix.de> References: <20091210004703.029784964@linutronix.de> <20091210001308.247025548@linutronix.de> To: Thomas Gleixner Cc: dhowells@redhat.com, LKML , "Paul E. McKenney" , Dipankar Sarma , Ingo Molnar , Peter Zijlstra , Oleg Nesterov , 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:41:19 +0000 Message-ID: <13109.1260538879@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1331 Lines: 33 Thomas Gleixner wrote: > commit c69e8d9 (CRED: Use RCU to access another task's creds and to > release a task's own creds) added non rcu_read_lock() protected access > to task creds of the target task in set_prio_one(). > > The comment above the function says: > * - the caller must hold the RCU read lock > > The calling code in sys_setpriority does read_lock(&tasklist_lock) but > not rcu_read_lock(). This works only when CONFIG_TREE_PREEMPT_RCU=n. > With CONFIG_TREE_PREEMPT_RCU=y the rcu_callbacks can run in the tick > interrupt when they see no read side critical section. > > There is another instance of __task_cred() in sys_setpriority() itself > which is equally unprotected. > > Wrap the whole code section into a rcu read side critical section to > fix this quick and dirty. > > Will be revisited in course of the read_lock(&tasklist_lock) -> rcu > crusade. > > Signed-off-by: Thomas Gleixner > Cc: James Morris > Cc: linux-security-module@vger.kernel.org Acked-by: David Howells -- 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/