Re: [PATCH] mm: kmemleak: Ensure that the task stack is not freed during scanning

2016-10-20 Thread Catalin Marinas
Hi Andrew, On Wed, Oct 19, 2016 at 11:33:27AM -0700, Andrew Morton wrote: > On Wed, 12 Oct 2016 10:57:03 +0100 Catalin Marinas > wrote: > > Commit 68f24b08ee89 ("sched/core: Free the stack early if > > CONFIG_THREAD_INFO_IN_TASK") may cause the task->stack to be freed > > during kmemleak_scan()

Re: [PATCH] mm: kmemleak: Ensure that the task stack is not freed during scanning

2016-10-19 Thread Andrew Morton
On Wed, 12 Oct 2016 10:57:03 +0100 Catalin Marinas wrote: > Commit 68f24b08ee89 ("sched/core: Free the stack early if > CONFIG_THREAD_INFO_IN_TASK") may cause the task->stack to be freed > during kmemleak_scan() execution, leading to either a NULL pointer > fault (if task->stack is NULL) or kmem

Re: [PATCH] mm: kmemleak: Ensure that the task stack is not freed during scanning

2016-10-12 Thread CAI Qian
- Original Message - > From: "Catalin Marinas" > To: linux...@kvack.org > Cc: linux-kernel@vger.kernel.org, "Andrew Morton" > , "Andy Lutomirski" , > "CAI Qian" > Sent: Wednesday, October 12, 2016 5:57:03 AM > Subject:

Re: [PATCH] mm: kmemleak: Ensure that the task stack is not freed during scanning

2016-10-12 Thread Catalin Marinas
t; "CAI Qian" > > Sent: Wednesday, October 12, 2016 5:57:03 AM > > Subject: [PATCH] mm: kmemleak: Ensure that the task stack is not freed > > during scanning > > > > Commit 68f24b08ee89 ("sched/core: Free the stack early if > > CONFIG_THREAD_INFO_IN_T

Re: [PATCH] mm: kmemleak: Ensure that the task stack is not freed during scanning

2016-10-12 Thread Catalin Marinas
On Wed, Oct 12, 2016 at 06:16:46PM +0800, Hillf Danton wrote: > > @@ -1453,8 +1453,11 @@ static void kmemleak_scan(void) > > > > read_lock(&tasklist_lock); > > do_each_thread(g, p) { > > Take a look at this commit please. > 1da4db0cd5 ("oom_kill: change oom_kill.c to

Re: [PATCH] mm: kmemleak: Ensure that the task stack is not freed during scanning

2016-10-12 Thread Michal Hocko
On Wed 12-10-16 10:57:03, Catalin Marinas wrote: > Commit 68f24b08ee89 ("sched/core: Free the stack early if > CONFIG_THREAD_INFO_IN_TASK") may cause the task->stack to be freed > during kmemleak_scan() execution, leading to either a NULL pointer > fault (if task->stack is NULL) or kmemleak accessi

Re: [PATCH] mm: kmemleak: Ensure that the task stack is not freed during scanning

2016-10-12 Thread Hillf Danton
> @@ -1453,8 +1453,11 @@ static void kmemleak_scan(void) > > read_lock(&tasklist_lock); > do_each_thread(g, p) { Take a look at this commit please. 1da4db0cd5 ("oom_kill: change oom_kill.c to use for_each_thread()") > - scan_block(task_stac

[PATCH] mm: kmemleak: Ensure that the task stack is not freed during scanning

2016-10-12 Thread Catalin Marinas
Commit 68f24b08ee89 ("sched/core: Free the stack early if CONFIG_THREAD_INFO_IN_TASK") may cause the task->stack to be freed during kmemleak_scan() execution, leading to either a NULL pointer fault (if task->stack is NULL) or kmemleak accessing already freed memory. This patch uses the new try_get_