Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5518232ybe; Tue, 10 Sep 2019 05:07:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7aa/9U2W+rrrMza4lSwP22MnhB2z/PKO+j59J5XaQUUsatg9fsyR5fdklI6H19JHAK3Sn X-Received: by 2002:a50:d68a:: with SMTP id r10mr30357128edi.151.1568117278955; Tue, 10 Sep 2019 05:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568117278; cv=none; d=google.com; s=arc-20160816; b=ghUXRkdQS5zxGFEmQmjiMjVfnLD/gibwV+4CMTbi7NpLiV0LuqbFvb+gCAL8pMPokx Wur3gYqB0yA3RXfrAr8Xpgv7D0+JBRpoNymVjjYLQBwikUeJtFQwz+2EXSxdHWXfVGWz h4PyufeG4MjlVURSvqN989DUXQHBZdRrxn7udv4s1fVYgxygq6GPLcx0n/Xm5SnHkvo1 HR6DNVaTJD2NAq8l+2+OuxKyZjQBFONaooxoqcRd20B94M3JGOgl3xQPZhQEMxVRWrNb ohs1F3aKfI9dQ2czZcIsKqmMoMDpXQWyvEmMZI6Mij0swFoEiupimrLkPHDJhbs7Jszv 6LTw== 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:dkim-signature; bh=nPUEYX1NKslohD2E+roi3GND2/I3OUXfvQ3XAcK+/GA=; b=w1Ax39WdE3Li+3eHTHEWYAKxlYx2j1zNcKkFchOELAJbkie5qbLQQ80hInV+xUnAjP Kd7zGw33fPICCpZNlSWUZReESyZ2HzBvPRrA50huu1rst26VdgO0uGYQ7lJgKnE6+Ss9 yjF6qp03Uy05x/iv8YmSfMhA2A6/G55R3mB3wWSj5DBe/w3lXf/3WTjpu1Xx4PaPc5f/ WwF5HbRjcflTCm00RHbHZZJ0q5it7HC1aJ+VhZox+O6RXTttUkjO9hyxAtevAY7RK11j 8R21RYFtV6V5Fdx1TuWEj2uDTnq9Snt2ATi8i7jwRaxWQwSROLWKlXhvBZt+DKo/xofA WNXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=SSNNjgPQ; 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 q46si10337515eda.44.2019.09.10.05.07.34; Tue, 10 Sep 2019 05:07:58 -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=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=SSNNjgPQ; 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 S2389875AbfIJJbH (ORCPT + 99 others); Tue, 10 Sep 2019 05:31:07 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:42902 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387801AbfIJJbG (ORCPT ); Tue, 10 Sep 2019 05:31:06 -0400 Received: by mail-ed1-f68.google.com with SMTP id y91so16384339ede.9 for ; Tue, 10 Sep 2019 02:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=nPUEYX1NKslohD2E+roi3GND2/I3OUXfvQ3XAcK+/GA=; b=SSNNjgPQ1LSHIFhAfZd4y0wYr0+CC4ozBTywesC/p7SttOr6N2R7mXpSTeUG7e5Asp r8Y/5rQ+0c4hRlG2zqaksGhlUOxOHvFvcWaPcfWbBQRLfk9F4xEpKsfnIlW6rWvwKohN RNGw0IM/rKcv+cvba+nXEbQz0fbZXP6AHWb68cHXdh8ePHUYqx+2OqRBCekHgvlyW+Sw P8Vkg+ZokeeLku2jJcT4X/bYAzCp+7R5R7yHqtsOA3sn6/NIShlu4GVTrZyZ9adTF5QC J0N4aHa7o44cenXBoTu5Me3EkOwY3YbZwKPp5kN8YgRpX8rQ34t4N+SuVkQb/4NR5Mgv w3HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=nPUEYX1NKslohD2E+roi3GND2/I3OUXfvQ3XAcK+/GA=; b=rTLUfxEOp/1X1sW3iMo8ypTSR74ZAx4tgMbnEHzuQLl6Vm17uiiXCezksFnO/ka2EH 3YMDDDvheG3zBF0d6YTTxuRRF69Fj+Hq+YGt1x2Y1P739doZEVCrxYD0zBjAE1Mw1zA2 evDuM4gLsFN9AKTUok7PWh9Ogw6jqVwWIC/kTk1uanM/71uWqaSQ59ecA6Ef9DwVxYFh LZiQlIpEsHB93301iXifapUmJ0rXu7nqaeBUKJkJ6xp89XbTA5gGODlSBMqPe84Lc9md E+RpmcKR5nYAS9N9WwQrbu8qWB2RvAjKw+tVOv19gjEggfGzYhVocoXXdI4SefpefVTE HmCw== X-Gm-Message-State: APjAAAXlNLTvZxLmO4YeRTtR0QZYrWj5YdT/Hb+Yk1FR/hnMxcZoho+Q LgPeM7zFCO88jStJVWPkkMMhVw== X-Received: by 2002:a17:906:4f04:: with SMTP id t4mr23891798eju.190.1568107863856; Tue, 10 Sep 2019 02:31:03 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id u27sm3463898edb.48.2019.09.10.02.31.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Sep 2019 02:31:03 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id 9F3511009F6; Tue, 10 Sep 2019 12:31:03 +0300 (+03) Date: Tue, 10 Sep 2019 12:31:03 +0300 From: "Kirill A. Shutemov" To: Walter Wu Cc: David Hildenbrand , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Matthias Brugger , Andrew Morton , Martin Schwidefsky , Will Deacon , Andrey Konovalov , Arnd Bergmann , Thomas Gleixner , Michal Hocko , Qian Cai , 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 Subject: Re: [PATCH v2 1/2] mm/page_ext: support to record the last stack of page Message-ID: <20190910093103.4cmqk4semlhgpmle@box.shutemov.name> References: <20190909085339.25350-1-walter-zh.wu@mediatek.com> <36b5a8e0-2783-4c0e-4fc7-78ea652ba475@redhat.com> <1568077669.24886.3.camel@mtksdccf07> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1568077669.24886.3.camel@mtksdccf07> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 10, 2019 at 09:07:49AM +0800, Walter Wu wrote: > On Mon, 2019-09-09 at 12:57 +0200, David Hildenbrand wrote: > > On 09.09.19 10:53, Walter Wu wrote: > > > KASAN will record last stack of page in order to help programmer > > > to see memory corruption caused by page. > > > > > > What is difference between page_owner and our patch? > > > page_owner records alloc stack of page, but our patch is to record > > > last stack(it may be alloc or free stack of page). > > > > > > Signed-off-by: Walter Wu > > > --- > > > mm/page_ext.c | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/mm/page_ext.c b/mm/page_ext.c > > > index 5f5769c7db3b..7ca33dcd9ffa 100644 > > > --- a/mm/page_ext.c > > > +++ b/mm/page_ext.c > > > @@ -65,6 +65,9 @@ static struct page_ext_operations *page_ext_ops[] = { > > > #if defined(CONFIG_IDLE_PAGE_TRACKING) && !defined(CONFIG_64BIT) > > > &page_idle_ops, > > > #endif > > > +#ifdef CONFIG_KASAN > > > + &page_stack_ops, > > > +#endif > > > }; > > > > > > static unsigned long total_usage; > > > > > > > Are you sure this patch compiles? > > > This is patchsets, it need another patch2. > We have verified it by running KASAN UT on Qemu. Any patchset must be bisectable: do not break anything in the middle of patchset. -- Kirill A. Shutemov