[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1008191334340.18994@chino.kir.corp.google.com>
Date: Thu, 19 Aug 2010 13:34:51 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: David Howells <dhowells@...hat.com>
cc: torvalds@...l.org, akpm@...ux-foundation.org,
paulmck@...ux.vnet.ibm.com, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, kamezawa.hiroyu@...fujitsu.com,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Subject: Re: [PATCH] oom: __task_cred() need rcu_read_lock()
On Thu, 19 Aug 2010, David Howells wrote:
> From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
>
> 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: [<ffffffff8106aae7>]
> process_one_work+0x137/0x4a0
> #1: (moom_work){+.+...}, at: [<ffffffff8106aae7>]
> process_one_work+0x137/0x4a0
> #2: (tasklist_lock){.+.+..}, at: [<ffffffff810fafd4>]
> out_of_memory+0x164/0x3f0
> #3: (&(&p->alloc_lock)->rlock){+.+...}, at: [<ffffffff810fa48e>]
> find_lock_task_mm+0x2e/0x70
>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
> Signed-off-by: David Howells <dhowells@...hat.com>
Acked-by: David Rientjes <rientjes@...gle.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists