Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5900014ybp; Tue, 8 Oct 2019 09:53:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZMN3cmoAaL0e3YlVIkYdTY65sLJ79kex11Ky1NpfxyVVAYdx1NooxEvXb7ssPCC2nGfw9 X-Received: by 2002:a17:906:3281:: with SMTP id 1mr30076964ejw.181.1570553616610; Tue, 08 Oct 2019 09:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570553616; cv=none; d=google.com; s=arc-20160816; b=kAm16f84/8Y1REYl/F7a2HnvuBSH1sL0kFDjQxSqec1FXWWIrJgsB1mbcn3WEEwZ6A 5QROTOFiY2g/pD5A1+iB9IhZo7CguYsrXX5IQtg36pIJSkq1xewn/Xr9Td8VG1LeuXtc cGrOu85aK4C27TywM4jZgsev4T5ezmf4oCJksHdg9uuQAZudi+/+FvvN9hnJm5WWNTBw gqO9WaGru5HppaJ6DQzSeI30fAmTGQUUMBJTkgoz4tTMN0lv1OapblFWEYJkJoj2mEw2 Cn+Pw+coZUVeZtRITGiwt+7uVl1RZ+3f9b2CUxGtTEc2/jOE7w7o0OG7PTwjSf74ilYg Vq1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=A7drPBgiUTdRCsXeLlXJIEzQDazKPHfjoDhV3Qu5WIc=; b=YnWhkclW2phUqDe2sJ770QWwD1/ST9WSiVggdJEbks7GhWCRrQxyuXXUbMPkkpotNM QWjE/wOBSoQqutvQFabAlVEPZRxSIh5mVgIHfH1yjRKyQw76GMYRxLj9A5GXz/5X0fhV S5yinLXJj/bSZuyK4ctEw8heKXl7x4jhz/bU6OmznUTSh3Ip7vhbQBu6I8PyNatBTCh/ aFF4OC+akIQRRRq5UcUBFrkGY3PzU/sMmJl9KGn+u3jRsw09Fn19y1vVf4PRvxpatf6n Y9YOGDjBip339RezzzPHdKKskL/d6Ft+c5C5rLRmEpdS/eRHZeLKWzmSl/ns+GjgGY4O IHbg== ARC-Authentication-Results: i=1; mx.google.com; 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 p22si9582638ejf.278.2019.10.08.09.53.12; Tue, 08 Oct 2019 09:53:36 -0700 (PDT) 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; 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 S1727865AbfJHQvD (ORCPT + 99 others); Tue, 8 Oct 2019 12:51:03 -0400 Received: from foss.arm.com ([217.140.110.172]:41268 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726239AbfJHQvD (ORCPT ); Tue, 8 Oct 2019 12:51:03 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 03AC31570; Tue, 8 Oct 2019 09:51:03 -0700 (PDT) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6CA553F6C4; Tue, 8 Oct 2019 09:51:02 -0700 (PDT) Date: Tue, 8 Oct 2019 17:51:00 +0100 From: Catalin Marinas To: Murphy Zhou Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/kmemleak: skip late_init if not skip disable Message-ID: <20191008165100.GC5694@arrakis.emea.arm.com> References: <20190929095659.jzy3gtcj6vgd35j6@XZHOUW.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190929095659.jzy3gtcj6vgd35j6@XZHOUW.usersys.redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Murphy, On Sun, Sep 29, 2019 at 05:56:59PM +0800, Murphy Zhou wrote: > Now if DEFAULT_OFF set to y, kmemleak_init will start the cleanup_work > workqueue. Then late_init call will set kmemleak_initialized to 1, the > cleaup workqueue will try to do cleanup, triggering: > > [24.738773] ================================================================== > [24.742784] BUG: KASAN: global-out-of-bounds in __kmemleak_do_cleanup+0x166/0x180 I don't think the invocation of kmemleak_do_cleanup() is the issue here. It should be safe schedule the clean-up thread in case kmemleak was disabled from boot. What you probably hit was a bug in __kmemleak_do_cleanup() itself, fixed here: http://lkml.kernel.org/r/20191004134624.46216-1-catalin.marinas@arm.com With the above patch, I can no longer trigger the KASan warning. -- Catalin