Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S944266AbcJSSdh (ORCPT ); Wed, 19 Oct 2016 14:33:37 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59577 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941873AbcJSSdd (ORCPT ); Wed, 19 Oct 2016 14:33:33 -0400 Date: Wed, 19 Oct 2016 11:33:27 -0700 From: Andrew Morton To: Catalin Marinas Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andy Lutomirski , CAI Qian Subject: Re: [PATCH] mm: kmemleak: Ensure that the task stack is not freed during scanning Message-Id: <20161019113327.3e796893d89333f6ebe65d79@linux-foundation.org> In-Reply-To: <1476266223-14325-1-git-send-email-catalin.marinas@arm.com> References: <1476266223-14325-1-git-send-email-catalin.marinas@arm.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 859 Lines: 19 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 kmemleak accessing already freed > memory. This patch uses the new try_get_task_stack() API to ensure that > the task stack is not freed during kmemleak stack scanning. > > Fixes: 68f24b08ee89 ("sched/core: Free the stack early if CONFIG_THREAD_INFO_IN_TASK") > Cc: Andrew Morton > Cc: Andy Lutomirski > Cc: CAI Qian > Reported-by: CAI Qian > Signed-off-by: Catalin Marinas I'll add Cc: [4.8.x]