Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1992628imu; Fri, 14 Dec 2018 04:11:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/WDcj9QTSxx2XPTzKnaBSvRczvrQkFnV1it8CrnLVrZmqZOu0EhEVt+gBcmgdtZolwUy7bC X-Received: by 2002:a63:78cd:: with SMTP id t196mr2519950pgc.62.1544789504140; Fri, 14 Dec 2018 04:11:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544789504; cv=none; d=google.com; s=arc-20160816; b=oxQQwARIwuOqLCVc1j9/yjOy0PSoqtneNR7RT0WM1NvarMb12M47rTxNVsdCST9+7d 5wR8OSCn502mpIXyo8ssDGODbbfaCW3jrjkU2aVFabHCFNUXuMp8+dRiL0Q8ZIExG5uz nBhvgtGW0DdX2tg2TpZMySqDh7TtIfOCRGLPFFoiNeb4rfe7s/FnpBFXmDecDueKgL4B px4TWqtFNG4KiFBO0FCvnLrt7mq8/JTPv1Z/uhPoyhWSoACQiZ3t0I2xMmltV69SYvKj DVtcHqpSJVgCwOTdtjY/Uo6PTGXgWDPPW4h1oVhwyboQLw5ksn7/Qlrfis6vJyfgqOVm /xxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vde+JhRyplwlkClft/eiKFvN2Hh/8jF64gYOFk5xlOM=; b=jVT0oRG1JJ5+pUrQ8lDp0UmRW6fwOIN6K0uRzB7P3Pb2COu1L5UZ3W1lUudtVLiBHI HYOxJ5DMBnGlr/p/VTRJWb/0/IVV/95/oRrN2OZE5MjBwX+GJFEipNlDGGCe4IfP5mKN vSKyu5Yuiio/EhMnLMnwBywv2SUxGy8/cYpPJxMACf979xttVFJpg0GayLuCi05lDG2x ti5Usc7GlgISpw+tQTwX8z8uY3mwAwUhS+AGB3y+mx/JloGUxFwJjp6UVd/WthlHYabV svMSSkC6LYyot/vDZGm3TbmpxcvRnDFWvG/QO2QoB2u/B1CtgKP7cu/klnTIIzMWaKyf yKlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YYPEH6ya; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o32si3980535pld.407.2018.12.14.04.11.29; Fri, 14 Dec 2018 04:11:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YYPEH6ya; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731405AbeLNMK0 (ORCPT + 99 others); Fri, 14 Dec 2018 07:10:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:56260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731373AbeLNMKY (ORCPT ); Fri, 14 Dec 2018 07:10:24 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4AD24214D9; Fri, 14 Dec 2018 12:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544789423; bh=gmGAB9DFrtE9rUCRd96HLYIwHgcO5ij7LiYLnoYYSGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YYPEH6yacXG6xnCozeLDvEnUid87VJe7ieftnaLEvE5zncgoP2s+wSVbQ9dgH7HoS 5GAnye1poREZ2AsRT7v08VuGr67DmzZemtgHyTYeElWfMvk29YWTPorPgIUQWz+z2D ra1U8u5tdQenbjizWtC0tAuqjG82yFx+/Via71qA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qian Cai , Catalin Marinas , Waiman Long , Thomas Gleixner , Yang Shi , Arnd Bergmann , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 4.14 77/89] debugobjects: avoid recursive calls with kmemleak Date: Fri, 14 Dec 2018 13:00:30 +0100 Message-Id: <20181214115733.502311885@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214115729.658859279@linuxfoundation.org> References: <20181214115729.658859279@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 8de456cf87ba863e028c4dd01bae44255ce3d835 ] CONFIG_DEBUG_OBJECTS_RCU_HEAD does not play well with kmemleak due to recursive calls. fill_pool kmemleak_ignore make_black_object put_object __call_rcu (kernel/rcu/tree.c) debug_rcu_head_queue debug_object_activate debug_object_init fill_pool kmemleak_ignore make_black_object ... So add SLAB_NOLEAKTRACE to kmem_cache_create() to not register newly allocated debug objects at all. Link: http://lkml.kernel.org/r/20181126165343.2339-1-cai@gmx.us Signed-off-by: Qian Cai Suggested-by: Catalin Marinas Acked-by: Waiman Long Acked-by: Catalin Marinas Cc: Thomas Gleixner Cc: Yang Shi Cc: Arnd Bergmann Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- lib/debugobjects.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 99308479b1c8..bacb00a9cd9f 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -111,7 +111,6 @@ static void fill_pool(void) if (!new) return; - kmemleak_ignore(new); raw_spin_lock_irqsave(&pool_lock, flags); hlist_add_head(&new->node, &obj_pool); debug_objects_allocated++; @@ -1085,7 +1084,6 @@ static int __init debug_objects_replace_static_objects(void) obj = kmem_cache_zalloc(obj_cache, GFP_KERNEL); if (!obj) goto free; - kmemleak_ignore(obj); hlist_add_head(&obj->node, &objects); } @@ -1141,7 +1139,8 @@ void __init debug_objects_mem_init(void) obj_cache = kmem_cache_create("debug_objects_cache", sizeof (struct debug_obj), 0, - SLAB_DEBUG_OBJECTS, NULL); + SLAB_DEBUG_OBJECTS | SLAB_NOLEAKTRACE, + NULL); if (!obj_cache || debug_objects_replace_static_objects()) { debug_objects_enabled = 0; -- 2.19.1