Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp778917ybe; Wed, 4 Sep 2019 07:38:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1bmrXixT208C0Mqo+4xpUosMlEsZmL0R8DL9g01/4dzfH88DB9J0prQxJHqWsoodYisAP X-Received: by 2002:a17:902:7685:: with SMTP id m5mr7355195pll.218.1567607913063; Wed, 04 Sep 2019 07:38:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567607913; cv=none; d=google.com; s=arc-20160816; b=MoKrBBCnCsfAlyvhl8LszO6SwnoX2w4dJzmcWotbUaOjzLvOYVt0Pb1IVHWqxFeXJE 96A/86h0VKb0BnuFwvDXSq/3r7ysyblnYqXpMOaA0uhhq2jwlxBzwyNs7iVN8c49YSHD 52JPIzUYbrDxSZ1wASj6RF84RVkqOf21UL4Rm958mSmv02KXuHX7n4SS9mMByAwwBUca 0lJlXGyyKAs6ZIE0X+WOSm471lf1h8ZWZp4F1g+lnXlSA0Iq0Cq0p9CuH7WnKBNvsf1y e5ekV/Ctav9ohChAoTQlJrN4m1DRq6XgflZuUcqHFC/bYxh8oz8EGDQ4KdoABdIqoNvN lDxg== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=d0VTPW60ciEzDbSTuQuRbRvDT6v3yNxk5P0Eu/d/VEY=; b=m9r8gGFvs1UUTs4yxYyWWQggCVZ3Xy7tYN3xVElcUPXrvNaehDoKecpKxXs/Q2Ml84 Oos9WKExIV0x45btDsF2BpdpLE531TI/KOpt7Lju+/qtGqhbKDTNcmw2FDmdhzM/E0Ty 3WaPJGX3gAqpgu7OARA60MjAEyMM4pKipp2fwWoAHPb+Rs2j9nTQ+Mu5KlIbS+oiqRE7 Na0gamhn0aHaK1UOFoLom8nm4MhDaRjqVwAzjAZIInP1xWoz+hmZRtD69+qsSjWkt5MZ ZNt5UZvduVDhZGFUcgo4eUSomAc6i4AEB3YE72uYZG3abamAeeQ/2fUliXHP98EtO/ot OZgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=hiesufd9; 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 v17si2450671pju.18.2019.09.04.07.38.16; Wed, 04 Sep 2019 07:38:33 -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; dkim=pass header.i=@lca.pw header.s=google header.b=hiesufd9; 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 S1730986AbfIDOhI (ORCPT + 99 others); Wed, 4 Sep 2019 10:37:08 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:38079 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727083AbfIDOhI (ORCPT ); Wed, 4 Sep 2019 10:37:08 -0400 Received: by mail-qt1-f196.google.com with SMTP id b2so21132113qtq.5 for ; Wed, 04 Sep 2019 07:37:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=d0VTPW60ciEzDbSTuQuRbRvDT6v3yNxk5P0Eu/d/VEY=; b=hiesufd9dof37ty41zVV23FsDbb6EdAGKoci12L+sx2fwRtB7zuTMNJNGKxb5jCwz9 DHzP8baEkLMKZv0R+vOxPlQHHayCkkRabTRxE9tGv8GBrtCggPbrv9ZneGvLVdciye0W oKJ2yS/yMcGJtYnDMEcxkcx3yEjhGETyZ9MZu7+djjYmUlzMqVrfPpacFQSd9195K0Yk mzKwBohACfM1r3cNGvit0KpTACzAZaRlCp8vck6+4Czvy9UzZGxwoDAUW1UE9QTSacTp 1v9NfrdGanfNnPILfIvtEzagXy8O4LjEy7mQ3Bfk9PNhEOIwk3xsV5QiVUDi0i3zAIKi FSkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=d0VTPW60ciEzDbSTuQuRbRvDT6v3yNxk5P0Eu/d/VEY=; b=TGp/qBUJcaxd2R1n5gSKRytSiKS+ijziWc+HzaGxcnz09/pD6moOsUeTd0FNVxng7q BDonWstGVIULR/qO6jspXs7A7vbt9udkUtUKeZoLobEgqgq/YP6Bs3rDemc10lNF47Lp U0UarAu3dvQMhJw2K0FWH5VmagYZXMvHpU5InO9G0NYFnU5uZbrASjVDzCtVUVBgf6AM /0m6ZYwctb174lpj9Reh0ocZjHFLbA6AgLn1ub4zJBvI5xF080+21696hm7nJqYYBkXV JR8CoyWbCyL7dV61kRe+nXKFDADwTiuU2M3I8YIrEsgC8XusgbvAnJXDwnPdrb/P/MTF 3lUw== X-Gm-Message-State: APjAAAVg17RsXj0AuSHccyn17zh0hKPJgscQt4CTiGRP5kn5KAlLKDCr onWoU1jXIAOGMn1PmYujouaEsw== X-Received: by 2002:a0c:c15d:: with SMTP id i29mr18468496qvh.5.1567607826937; Wed, 04 Sep 2019 07:37:06 -0700 (PDT) Received: from dhcp-41-57.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id x5sm4919859qkn.102.2019.09.04.07.37.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Sep 2019 07:37:06 -0700 (PDT) Message-ID: <1567607824.5576.77.camel@lca.pw> Subject: Re: [PATCH 1/2] mm/kasan: dump alloc/free stack for page allocator From: Qian Cai To: Walter Wu , Andrey Konovalov Cc: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Matthias Brugger , Andrew Morton , Martin Schwidefsky , Arnd Bergmann , kasan-dev , Linux Memory Management List , LKML , Linux ARM , linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com Date: Wed, 04 Sep 2019 10:37:04 -0400 In-Reply-To: <1567606591.32522.21.camel@mtksdccf07> References: <20190904065133.20268-1-walter-zh.wu@mediatek.com> <1567606591.32522.21.camel@mtksdccf07> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-09-04 at 22:16 +0800, Walter Wu wrote: > On Wed, 2019-09-04 at 15:44 +0200, Andrey Konovalov wrote: > > On Wed, Sep 4, 2019 at 8:51 AM Walter Wu wrote: > > > +config KASAN_DUMP_PAGE > > > +       bool "Dump the page last stack information" > > > +       depends on KASAN && PAGE_OWNER > > > +       help > > > +         By default, KASAN doesn't record alloc/free stack for page > > > allocator. > > > +         It is difficult to fix up page use-after-free issue. > > > +         This feature depends on page owner to record the last stack of > > > page. > > > +         It is very helpful for solving the page use-after-free or out- > > > of-bound. > > > > I'm not sure if we need a separate config for this. Is there any > > reason to not have this enabled by default? > > PAGE_OWNER need some memory usage, it is not allowed to enable by > default in low RAM device. so I create new feature option and the person > who wants to use it to enable it. Or you can try to look into reducing the memory footprint of PAGE_OWNER to fit your needs. It does not always need to be that way.