Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4355360ybe; Mon, 9 Sep 2019 08:09:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxst6R0zcS254vzdj4M/xu5sq5o8Zl0NmnpYxWwituk5FMyfWAf4N9Hcx5f77ciIHn2jLLe X-Received: by 2002:a17:906:bc2:: with SMTP id y2mr20251125ejg.148.1568041777411; Mon, 09 Sep 2019 08:09:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568041777; cv=none; d=google.com; s=arc-20160816; b=eD/6dyG3XnZqJAu8vmoaNJD67biSykLX8BNqCwF0DXV6MiF3G8QQ72C4PBHFkTZhUq 8D3hg0IQqA6L97Sg4g7+dK9N4Wm5fKlxr7zxiEyppmS1VZOVH0cnMk2c782P86RkA3hl eLdNdqF3khzrPzZvO4xVJce8lfaVTPPYWHB7Z52xT6nZ4pqRfW3BFePPmjWDV0D0n5OT QOX8HXLWYnkgYwIbNWzvKGT6zhAVLVH2cajcNaJwBSqCa6HnUZLo12wTvnta4Xe/2BlA 2oILzAEkA2X0qUDiT2XFOBRD4aLX/JbkV8WpCMBgJA6MAjl0iYhXRrXISfQtZ7+t5bYL iSLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=k+lfAhDHubC1nf1vwT8gJqdGJYjrbwQvEPaTcYAlgTc=; b=dvfmM8kbA15ztygEYTI4l6pB9ZyveKky3XZZH7s5kfHf5X/z28n3tdC1tvzgOnPNaB oXbG/pp3oVdKY1HX2I+q0I2K6OoLY8Bz4sG0w6dmF747krdunJEzYQNSH1nr93dYA9Re dCGRgYwNfh0v41QLNqDX/8girEBdKiSYqmZi6+v5FrUwT4ZZWsF6mqw/gaX1VvzPaatD VlQ5GihilECm37JnXvnVgAjp4QjRzC27kLg6RQsv8FH9Mw1tP8t0v1F0z4gaYVg4xkCk cMOdgyJxeGKhihZu+h651/4BaUb5fd+fFuJZ9Vc6NPk7NNyW6CR5JuJWRv8eeyF2E/++ 9N1Q== 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 ot7si7732309ejb.87.2019.09.09.08.09.12; Mon, 09 Sep 2019 08:09:37 -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 S2389550AbfIIIxv (ORCPT + 99 others); Mon, 9 Sep 2019 04:53:51 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:64173 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2389047AbfIIIxu (ORCPT ); Mon, 9 Sep 2019 04:53:50 -0400 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 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.18.0