Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6077480ybe; Tue, 10 Sep 2019 13:10:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwBmdRj3FDEQAgwlhX+dmFVoA2ao8v/LiEju0a3d0Oy49NnISzXnVZ8oId3YZ6vAn03KGX X-Received: by 2002:a05:6402:2d0:: with SMTP id b16mr33929650edx.147.1568146218712; Tue, 10 Sep 2019 13:10:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568146218; cv=none; d=google.com; s=arc-20160816; b=u1j5IPy3OkQEmaDWWXmish3DLDp346Ey3o1GD5TidWJALIVAEdxwlABwT0RXWBkd2z JATO2S3I64dR5DwVaOFGlMXw4/VKxRHdVUhgJFkdHi5sdEvzxaBlbW0xEYjjFPIa+o66 2WI7VsMyOaV/hiaLOBD/NF9U0gVfhd/42Sqo0Lx9dyLtNkdChHAAi0PJgn8oop6xiBrx faGZavCkBNiCiES9Zt5xBTaKYuNjnH8OP8cPN6+ShkuN+kcNF88T/Jv/+0ySiTB+fbap SdO0vMX2YxLFwdF1Dfo9S9TI2+mQU/P6O+e/yNrf+jJrx2IK1q4nRvftmKMk/Dah+GLN f0wg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=PV1gSBJEuQAo0AkVFHlmmiU/qDCCVulJWTWljAY7zW4=; b=QTTakObR6/dWg3U5u/8YvTQRr8IGmTcEu7F6Vp1+qdVnfzJMVC3yeBC6SvCviWIp7b fG2d+0OmpjCXyEU3YGPwFzUu7m/idMOHpweCchNwDrrykYra/FqRgTkF1tG6yM7/9+z2 9jokzmpp8FqZFzp7INFcN8ArkL2VR4/Pq6k+NBwAPAb2ysBsrc85VUrJnTfxRoO7P2wU czbsqriCXbbkuQYnj5vCAvIXy4YamVpc4KkMfURZeRSnizW52ZVetClPdUEC9vlCjJwR Nn9wZh3ix0w/ZAD/uV5uz/JXzrB4YsYoMrcfc0wdZBx+JRdWohj5T6PJeQUoI0pVBzP7 dZhQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12si11507004edb.394.2019.09.10.13.09.54; Tue, 10 Sep 2019 13:10:18 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391148AbfIIM7Q (ORCPT + 99 others); Mon, 9 Sep 2019 08:59:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:35926 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726462AbfIIM7P (ORCPT ); Mon, 9 Sep 2019 08:59:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E08F0AFBA; Mon, 9 Sep 2019 12:59:13 +0000 (UTC) Subject: Re: [PATCH v2 1/2] mm/page_ext: support to record the last stack of page To: Walter Wu , 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: 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 References: <20190909085339.25350-1-walter-zh.wu@mediatek.com> From: Vlastimil Babka Message-ID: <0fd84c7b-a23b-0b09-519f-a006fade1b4f@suse.cz> Date: Mon, 9 Sep 2019 14:59:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190909085339.25350-1-walter-zh.wu@mediatek.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/9/19 10:53 AM, 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 There's no point in separating this from patch 2 (and as David pointed out, doesn't compile). > --- > 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; >