Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754697Ab0AZR6F (ORCPT ); Tue, 26 Jan 2010 12:58:05 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753474Ab0AZR6E (ORCPT ); Tue, 26 Jan 2010 12:58:04 -0500 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:41823 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753029Ab0AZR6B (ORCPT ); Tue, 26 Jan 2010 12:58:01 -0500 Subject: [PATCH] kmemleak: Do not enable KMEMCHECK_PARTIAL_OK if DEBUG_KMEMLEAK To: linux-kernel@vger.kernel.org From: Catalin Marinas Cc: Andrew Morton , Pekka Enberg , Christian Casteyde Date: Tue, 26 Jan 2010 17:57:19 +0000 Message-ID: <20100126175719.7820.74641.stgit@pc1117.cambridge.arm.com> User-Agent: StGit/0.15-36-g53e3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 26 Jan 2010 17:57:20.0267 (UTC) FILETIME=[015BBDB0:01CA9EB1] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1399 Lines: 35 This is a fix for bug #14845 (bugzilla.kernel.org). The update_checksum() function in mm/kmemleak.c calls kmemcheck_is_obj_initialised() before scanning an object. When KMEMCHECK_PARTIAL_OK is enabled, this function returns true. However, the crc32_le() reads smaller intervals (32-bit) for which kmemleak_is_obj_initialised() is may be false leading to a kmemcheck warning. Signed-off-by: Catalin Marinas Cc: Andrew Morton Cc: Christian Casteyde Cc: Pekka Enberg --- lib/Kconfig.kmemcheck | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/Kconfig.kmemcheck b/lib/Kconfig.kmemcheck index 846e039..80660e9 100644 --- a/lib/Kconfig.kmemcheck +++ b/lib/Kconfig.kmemcheck @@ -75,7 +75,7 @@ config KMEMCHECK_SHADOW_COPY_SHIFT config KMEMCHECK_PARTIAL_OK bool "kmemcheck: allow partially uninitialized memory" depends on KMEMCHECK - default y + default y if !DEBUG_KMEMLEAK help This option works around certain GCC optimizations that produce 32-bit reads from 16-bit variables where the upper 16 bits are -- 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/