Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5985583ybe; Tue, 10 Sep 2019 11:45:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxpF9kRHNwumkBotwCIZ+G0l3W1SWOjhsf77Wg1FIxe/e09vk6625FiuaAz9NsrNCzWI1/ X-Received: by 2002:a50:f782:: with SMTP id h2mr31601992edn.225.1568141136115; Tue, 10 Sep 2019 11:45:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568141136; cv=none; d=google.com; s=arc-20160816; b=LAo0NABKvr3/5vW+F5XZgSyd8gotKmr9e5nFDV2ppGjeOoCZIivpIsOIe9r7TXKkdY 2K4DxIsBiT1CvFqbyJ6AqGsoPPrN30y+vZMqFH/5fSAXnuT11N2bVSUmBd/nlPGOHFrT 5JMDUbVwIcxI+ud1tbS5tsGqYx97kc6CaHyoB1iAtqy3grSLQ7s1UjSzTQwcFmQdU08x 9u9qoXaSgAIfmnJShcydczMQyxTF759mzKDBgjFmcv0eyaTBHevxmTjLafo3+V8xyEWW 31zwqxbeG8gpU8YQ8Sf2TQGZzxyWEW0gXv/SJIwakh4hfCJN4AZb19h3Gdvfz7klTLOz 7fRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=HpkXJVsSQY4+CyX4GWsni62ZtKoO3xWySGTQdLp5Vp4=; b=EqzRrBTwIeQWCuWxMRn9hTeO+s82tODFkLjsS/GgMC7kAwt74rjOtD5AVl3yYcH/Hk 6Enk6+yN9Yp8FgKJmXgncvtwttSVsNxGh0oqE2Ah/B6inVJKfw/2YtHYIzxUNgddO9dV eLF9uFWMlwxmcm3JsEjcAhNNIuwmqmk2SXUzUaygeJaiY1LvIzLe4+qTTIO8so07Tl6i EeR2oDGcXL5wV149MswjLdD+RUt/cMakaJ4x8G4DO21i70R4x1L97Anv1BGydm1te3ub YEmgEnE/yCzImigVzvXj/G6lx/jCXmfS4TBDBWnbvuP4FL4KEMm1jLtyCD4CGvnPXrtg UN7w== 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=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b50si11258372ede.28.2019.09.10.11.45.12; Tue, 10 Sep 2019 11:45: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390992AbfIJBH7 (ORCPT + 99 others); Mon, 9 Sep 2019 21:07:59 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:40958 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727115AbfIJBH7 (ORCPT ); Mon, 9 Sep 2019 21:07:59 -0400 X-UUID: 36793eb043954315b23be36aa610228e-20190910 X-UUID: 36793eb043954315b23be36aa610228e-20190910 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 831663314; Tue, 10 Sep 2019 09:07:51 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 10 Sep 2019 09:07:49 +0800 Received: from [172.21.84.99] (172.21.84.99) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 10 Sep 2019 09:07:49 +0800 Message-ID: <1568077669.24886.3.camel@mtksdccf07> Subject: Re: [PATCH v2 1/2] mm/page_ext: support to record the last stack of page From: Walter Wu To: David Hildenbrand CC: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Matthias Brugger , Andrew Morton , "Martin Schwidefsky" , Will Deacon , "Andrey Konovalov" , Arnd Bergmann , "Thomas Gleixner" , Michal Hocko , Qian Cai , , , , , , Date: Tue, 10 Sep 2019 09:07:49 +0800 In-Reply-To: <36b5a8e0-2783-4c0e-4fc7-78ea652ba475@redhat.com> References: <20190909085339.25350-1-walter-zh.wu@mediatek.com> <36b5a8e0-2783-4c0e-4fc7-78ea652ba475@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.