Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1802233ybn; Thu, 26 Sep 2019 02:25:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyi3BD+dbFqMc6oGdqCBLTLaxXkyr9A9NXPDZbQE0RwgqIyp9FtmWV8QNThb9ULJmgwwdYG X-Received: by 2002:a17:906:c82d:: with SMTP id dd13mr2082064ejb.169.1569489904483; Thu, 26 Sep 2019 02:25:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569489904; cv=none; d=google.com; s=arc-20160816; b=iJCuTLCHm+JzKKApFdVJB21FOWvjnPQHY6LRJg6qmEej5/5o0Kg/wseDS/Nb7pVFOi yACkmX8NuYB45hVNA9M34ZrAnS9/9QM4mlIJpeHbWLWxS/EoGx1TsJycWFQ6VlpksVt2 rp8aFEEzp8+yGU8yBfJsF++kOFmSZBNmGiU6SUulSN8a7JPFiklQ1O6B+Ng7t4kg878V YVtfoUTqZKNUcoXQ/9fTXg1L9Ku2WAMx6Eb2ENK7/7YLQsNFgdpO3oePHgf2rvZHIFqz OoPl1Gr9PCGRLJjWdrQg8O6T2Uinz/VVvnpgw8keSvTBgcBI3F1pclPyyBzCPU7LIUks TDmw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Nhe7NUbWgud4/Y+EZ2OcAp6F8sA7viV5FJOT9ovpuNQ=; b=ayOuaF4gc64PLnva3IAspvesPZxuytn5RU73zO0YCBOsNOVU57VlAvxQZSoXD61FSz YhVhalqJXXAb/0KZma4VTzXoEO8KA795mDRj9euTKluTPmIOYj8Irb44EXndEiVGCaiS BE+OmhdF2ZgxFfvxIS2THJbjp+yzKyU2az07XW4mCX9+R5kwuUb548IYA9zqBzrrfbVy XViHrGtBVUm6G9/TsJBLWz+Glpw1BK5o35RYOllebYiJfehXaOSxlkDpRUHfKCqaBHMr 8+XilT8t26YjATHjY/qKvuCmUv+SY9r8VWi4x5yqLhjQ+6YDMBsvTsZJdX0XWgv1WzLh mCGg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g22si906036edf.398.2019.09.26.02.24.41; Thu, 26 Sep 2019 02:25:04 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727370AbfIYJlr (ORCPT + 99 others); Wed, 25 Sep 2019 05:41:47 -0400 Received: from relay.sw.ru ([185.231.240.75]:50350 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726816AbfIYJlr (ORCPT ); Wed, 25 Sep 2019 05:41:47 -0400 Received: from [172.16.25.5] by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iD3ne-0004yL-1n; Wed, 25 Sep 2019 12:41:30 +0300 Subject: Re: [PATCH] mm, debug, kasan: save and dump freeing stack trace for kasan To: Vlastimil Babka , Walter Wu Cc: Qian Cai , Alexander Potapenko , Dmitry Vyukov , Matthias Brugger , Andrew Morton , Martin Schwidefsky , Andrey Konovalov , Arnd Bergmann , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com References: <20190911083921.4158-1-walter-zh.wu@mediatek.com> <5E358F4B-552C-4542-9655-E01C7B754F14@lca.pw> <1568297308.19040.5.camel@mtksdccf07> <613f9f23-c7f0-871f-fe13-930c35ef3105@suse.cz> <79fede05-735b-8477-c273-f34db93fd72b@virtuozzo.com> <6d58ce86-b2a4-40af-bf40-c604b457d086@suse.cz> <4e76e7ce-1d61-524a-622b-663c01d19707@virtuozzo.com> From: Andrey Ryabinin Message-ID: <28e076ed-d4c2-c29d-f0cb-b976e8c0725a@virtuozzo.com> Date: Wed, 25 Sep 2019 12:41:18 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/23/19 11:20 AM, Vlastimil Babka wrote: > On 9/16/19 5:57 PM, Andrey Ryabinin wrote: >> I'd rather keep all logic in one place, i.e. "if (!page_owner_disabled && (IS_ENABLED(CONFIG_KASAN) || debug_pagealloc_enabled())" >> With this no changes in early_debug_pagealloc() required and CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT=y should also work correctly. > > OK. > > ----8<---- > > From 7437c43f02682fdde5680fa83e87029f7529e222 Mon Sep 17 00:00:00 2001 > From: Vlastimil Babka > Date: Mon, 16 Sep 2019 11:28:19 +0200 > Subject: [PATCH] mm, debug, kasan: save and dump freeing stack trace for kasan > > The commit "mm, page_owner, debug_pagealloc: save and dump freeing stack trace" > enhanced page_owner to also store freeing stack trace, when debug_pagealloc is > also enabled. KASAN would also like to do this [1] to improve error reports to > debug e.g. UAF issues. This patch therefore introduces a helper config option > PAGE_OWNER_FREE_STACK, which is enabled when PAGE_OWNER and either of > DEBUG_PAGEALLOC or KASAN is enabled. Boot-time, the free stack saving is > enabled when booting a KASAN kernel with page_owner=on, or non-KASAN kernel > with debug_pagealloc=on and page_owner=on. > > [1] https://bugzilla.kernel.org/show_bug.cgi?id=203967 > > Suggested-by: Dmitry Vyukov > Suggested-by: Walter Wu > Suggested-by: Andrey Ryabinin > Signed-off-by: Vlastimil Babka > --- Reviewed-by: Andrey Ryabinin