From mboxrd@z Thu Jan 1 00:00:00 1970 From: Walter Wu Subject: Re: [PATCH 1/2] mm/kasan: dump alloc/free stack for page allocator Date: Thu, 5 Sep 2019 09:54:36 +0800 Message-ID: <1567648476.32522.36.camel@mtksdccf07> References: <20190904065133.20268-1-walter-zh.wu@mediatek.com> <1567606591.32522.21.camel@mtksdccf07> <1567607824.5576.77.camel@lca.pw> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1567607824.5576.77.camel@lca.pw> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Qian Cai Cc: wsd_upstream@mediatek.com, Arnd Bergmann , Linux Memory Management List , LKML , kasan-dev , Martin Schwidefsky , linux-mediatek@lists.infradead.org, Linux ARM , Andrey Ryabinin , Matthias Brugger , Alexander Potapenko , Andrew Morton , Dmitry Vyukov List-Id: linux-mediatek@lists.infradead.org On Wed, 2019-09-04 at 10:37 -0400, Qian Cai wrote: > On Wed, 2019-09-04 at 22:16 +0800, Walter Wu wrote: > > On Wed, 2019-09-04 at 15:44 +0200, Andrey Konovalov wrote: > > > On Wed, Sep 4, 2019 at 8:51 AM Walter Wu wrote: > > > > +config KASAN_DUMP_PAGE > > > > + bool "Dump the page last stack information" > > > > + depends on KASAN && PAGE_OWNER > > > > + help > > > > + By default, KASAN doesn't record alloc/free stack for page > > > > allocator. > > > > + It is difficult to fix up page use-after-free issue. > > > > + This feature depends on page owner to record the last stack of > > > > page. > > > > + It is very helpful for solving the page use-after-free or out- > > > > of-bound. > > > > > > I'm not sure if we need a separate config for this. Is there any > > > reason to not have this enabled by default? > > > > PAGE_OWNER need some memory usage, it is not allowed to enable by > > default in low RAM device. so I create new feature option and the person > > who wants to use it to enable it. > > Or you can try to look into reducing the memory footprint of PAGE_OWNER to fit > your needs. It does not always need to be that way. Thanks your suggestion. We can try to think what can be slimmed. Thanks. Walter