Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1988026imu; Fri, 14 Dec 2018 04:08:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/WECRyw1Khxls5l7/eNagzC8rYI9n7TVZ8EO3W/WLtyCuR7TWWA5nxMENg0dxu2+rHgUq3M X-Received: by 2002:a63:a611:: with SMTP id t17mr2441792pge.338.1544789281847; Fri, 14 Dec 2018 04:08:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544789281; cv=none; d=google.com; s=arc-20160816; b=Eu5tLK0DD3ZRHtSXxuCStBUO+2oSYDQ2JiDju1DrnK9UgAAjYrKMfSG1fttvkxTTKo qj5C21agHgFnkrSw3KMAaTEgUDxCRdDXnC6/PzGvqitLi4zKXysI0+8/OEn7PkjLaD3C UBYQdy2wleoBhYKwGzavvn3d+Ipp48+H2PvMkNMgevTORCO5RH2hcasIFbjSGcaAhmQA Hy7zcj+SopwTPPUWS7XKxmpxpG/IlfedZLi+RT7cqmltceTkM+8fq6qnPSMm6A54TH7j Vt9p5feGDVMIxZekasMCv8BzNsgiR2SkIfKtMz956h/+hm08HSo0B9Q3ZBCYzpmFvnlX dSfw== 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=CzkWW7njArBVtYShHDcJ6ogf5EdCx4gtJhuvP88fql0=; b=cvsVYyT9f5GRR5x6xUiTq+P/uQFMNJjOogng9MyYmC5xloSdTAGOUWnBxOFVkjVVWN rLHRzMOHWyKHKq4C7DtQt96Kk8sMStBvjHr5N7RIAhrLLkw5UuB/rXIbKJXvpYISZ/GV k3h4gp+8kGhN4ns31q9ZxbSaioRZGuDRoyF5DpuqSENl39DB0WCu8f9DPPciVSYi2IN0 8ndBoVAZzpMjMfADV2tdPlvM9tfvw/qFA9s36HkpOmKsDK5lIEZtzgd+/yopgsadWmrm 29mvzz7i1lLIdcanSavBNW8JrIJgM9TwvAe3R7VAiZNcNp/18IeiHI/Uv4mNMJVkfzYy ECeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h15vUTp9; 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 x74si4254071pfe.23.2018.12.14.04.07.47; Fri, 14 Dec 2018 04:08:01 -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=h15vUTp9; 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 S1730936AbeLNMGa (ORCPT + 99 others); Fri, 14 Dec 2018 07:06:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:51476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730904AbeLNMG1 (ORCPT ); Fri, 14 Dec 2018 07:06:27 -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 5AC4921479; Fri, 14 Dec 2018 12:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544789186; bh=Ma7Es06WzWBLXrWIHSe5rMlhZVwbgBxz0wCmSy3ijwg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h15vUTp9E9Cmt7bUH+P29BDzoP+AJxRY+LGo/87gRVYWKq9miGw6jKQBfM3gkyFY+ Qlbb+Y5HYlFLOq68q7reE7tK35jaypmaVs85k8wybs59HGdHpASd8FaWXqYgS4gHMO gQAc5hkLRDBHNkslfIpOd4MRPchoUfbTXtH2Ehzw= 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.19 128/142] debugobjects: avoid recursive calls with kmemleak Date: Fri, 14 Dec 2018 13:00:13 +0100 Message-Id: <20181214115752.161066970@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214115747.053633987@linuxfoundation.org> References: <20181214115747.053633987@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.19-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 70935ed91125..14afeeb7d6ef 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -135,7 +135,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++; @@ -1128,7 +1127,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); } @@ -1184,7 +1182,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