From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932197AbbFHO3j (ORCPT ); Mon, 8 Jun 2015 10:29:39 -0400 Received: from foss.arm.com ([217.140.101.70]:48544 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752786AbbFHO3a (ORCPT ); Mon, 8 Jun 2015 10:29:30 -0400 From: Catalin Marinas To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Andrew Morton , vigneshr@codeaurora.org Subject: [PATCH v2 0/4] Fix kmemleak races on the disable/error path Date: Mon, 8 Jun 2015 15:29:14 +0100 Message-Id: <1433773758-21994-1-git-send-email-catalin.marinas@arm.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a follow-up to the initial patch fixing the kmemleak_scan page fault during kmemleak disabling: http://article.gmane.org/gmane.linux.kernel.mm/133707 The first patch is pretty much the same, apart from a clearer (hopefully) commit log and code comment regarding the ordering of kmemleak_free_enabled with the scanning thread. The race between kmemleak_free() and kmemleak_do_cleanup() is fixed in the second patch. The third patch fixes a potential deadlock on scan_mutex between the kmemleak_scan_thread and kmemleak_do_cleanup(). The fourth patch is more of a theoretical scenario but worth fixing the lock acquiring order. Catalin Marinas (4): mm: kmemleak: Allow safe memory scanning during kmemleak disabling mm: kmemleak: Fix delete_object_*() race when called on the same memory block mm: kmemleak: Do not acquire scan_mutex in kmemleak_do_cleanup() mm: kmemleak: Avoid deadlock on the kmemleak object insertion error path mm/kmemleak.c | 75 +++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 22 deletions(-)