From patchwork Mon Sep 9 08:53:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Walter Wu X-Patchwork-Id: 11137465 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 56F0616C1 for ; Mon, 9 Sep 2019 08:53:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2DC3A2086D for ; Mon, 9 Sep 2019 08:53:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DC3A2086D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 59FBD6B0005; Mon, 9 Sep 2019 04:53:52 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 528FC6B0007; Mon, 9 Sep 2019 04:53:52 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3F0736B0008; Mon, 9 Sep 2019 04:53:52 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0138.hostedemail.com [216.40.44.138]) by kanga.kvack.org (Postfix) with ESMTP id 165436B0005 for ; Mon, 9 Sep 2019 04:53:52 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id A8B98180AD7C3 for ; Mon, 9 Sep 2019 08:53:51 +0000 (UTC) X-FDA: 75914769462.24.roof08_218791bdebe13 X-Spam-Summary: 2,0,0,805073a224085603,d41d8cd98f00b204,walter-zh.wu@mediatek.com,:aryabinin@virtuozzo.com:glider@google.com:dvyukov@google.com:matthias.bgg@gmail.com:akpm@linux-foundation.org:schwidefsky@de.ibm.com:will@kernel.org:andreyknvl@google.com:arnd@arndb.de:tglx@linutronix.de:mhocko@kernel.org:cai@lca.pw:linux-kernel@vger.kernel.org:kasan-dev@googlegroups.com::linux-arm-kernel@lists.infradead.org:linux-mediatek@lists.infradead.org:wsd_upstream@mediatek.com:walter-zh.wu@mediatek.com,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1277:1313:1314:1345:1437:1516:1518:1534:1540:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2553:2559:2562:2693:2731:2907:3138:3139:3140:3141:3142:3352:3866:3867:3868:3870:3871:3872:4385:5007:6261:6737:7903:10004:10400:11026:11473:11658:11914:12043:12048:12296:12297:12438:12521:12555:12895:13069:13311:13357:14181:14394:14721:21080:21451:21627:30054:30090,0,RBL:210.61.82.183:@mediatek.com:.lbl8.mailshell.net-62.2.12.100 64.100.201.20 1,CacheI X-HE-Tag: roof08_218791bdebe13 X-Filterd-Recvd-Size: 2777 Received: from mailgw01.mediatek.com (unknown [210.61.82.183]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Mon, 9 Sep 2019 08:53:50 +0000 (UTC) X-UUID: 0052279582b546f0bf7107861527c82a-20190909 X-UUID: 0052279582b546f0bf7107861527c82a-20190909 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1143796525; Mon, 09 Sep 2019 16:53:42 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 9 Sep 2019 16:53:40 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 9 Sep 2019 16:53:40 +0800 From: Walter Wu To: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Matthias Brugger , Andrew Morton , Martin Schwidefsky , Will Deacon , Andrey Konovalov , Arnd Bergmann , Thomas Gleixner , Michal Hocko , Qian Cai CC: , , , , , , Walter Wu Subject: [PATCH v2 1/2] mm/page_ext: support to record the last stack of page Date: Mon, 9 Sep 2019 16:53:39 +0800 Message-ID: <20190909085339.25350-1-walter-zh.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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;