Re: [PATCH 1/2] mm/kasan: dump alloc/free stack for page allocator

From: Qian Cai
Date: Wed Sep 04 2019 - 10:37:09 EST


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 <walter-zh.wu@xxxxxxxxxxxx> 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.