Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752540Ab0HSUfK (ORCPT ); Thu, 19 Aug 2010 16:35:10 -0400 Received: from smtp-out.google.com ([74.125.121.35]:1250 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750994Ab0HSUfI (ORCPT ); Thu, 19 Aug 2010 16:35:08 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id: references:user-agent:mime-version:content-type:x-system-of-record; b=PLKFz7WkyL/Gq1OtmmLDeANFwfMVSnSA2bsbNw0o+/FZGIKjXRwfMjmfs8H1+bbZe i/F5v0SREjSrq+BMLavsw== Date: Thu, 19 Aug 2010 13:34:51 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: David Howells cc: torvalds@osdl.org, akpm@linux-foundation.org, paulmck@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kamezawa.hiroyu@jp.fujitsu.com, KOSAKI Motohiro Subject: Re: [PATCH] oom: __task_cred() need rcu_read_lock() In-Reply-To: <20100819152618.21246.68223.stgit@warthog.procyon.org.uk> Message-ID: References: <20100819152618.21246.68223.stgit@warthog.procyon.org.uk> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1642 Lines: 41 On Thu, 19 Aug 2010, David Howells wrote: > From: KOSAKI Motohiro > > dump_tasks() needs to hold the RCU read lock around its access of the target > task's UID. To this end it should use task_uid() as it only needs that one > thing from the creds. > > The fact that dump_tasks() holds tasklist_lock is insufficient to prevent the > target process replacing its credentials on another CPU. > > Then, this patch change to call rcu_read_lock() explicitly. > > > =================================================== > [ INFO: suspicious rcu_dereference_check() usage. ] > --------------------------------------------------- > mm/oom_kill.c:410 invoked rcu_dereference_check() without protection! > > other info that might help us debug this: > > rcu_scheduler_active = 1, debug_locks = 1 > 4 locks held by kworker/1:2/651: > #0: (events){+.+.+.}, at: [] > process_one_work+0x137/0x4a0 > #1: (moom_work){+.+...}, at: [] > process_one_work+0x137/0x4a0 > #2: (tasklist_lock){.+.+..}, at: [] > out_of_memory+0x164/0x3f0 > #3: (&(&p->alloc_lock)->rlock){+.+...}, at: [] > find_lock_task_mm+0x2e/0x70 > > Signed-off-by: KOSAKI Motohiro > Signed-off-by: David Howells Acked-by: David Rientjes -- 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/