Re: [PATCH RFC v3 11/36] kmsan: stackdepot: don't allocate KMSAN metadata for stackdepot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 29, 2019 at 3:52 PM Andrey Konovalov <andreyknvl@xxxxxxxxxx> wrote:
>
> On Fri, Nov 22, 2019 at 12:27 PM <glider@xxxxxxxxxx> wrote:
> >
> > We assume nothing interesting could happen in stackdepot, and save some
> > memory by not tracking stackdepot allocations with KMSAN.
>
> I think it makes sense to clarify here that "nothing interesting"
> means no uninitialized memory can come from stackdepot or something
> like that.
Agreed. Will update the patch description.
I've also noticed this patch does nothing to ensure the allocations
are performed with __GFP_NO_KMSAN_SHADOW.
> >
> > Signed-off-by: Alexander Potapenko <glider@xxxxxxxxxx>
> > Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx>
> > Cc: Jens Axboe <axboe@xxxxxxxxx>
> > Cc: Andy Lutomirski <luto@xxxxxxxxxx>
> > Cc: Vegard Nossum <vegard.nossum@xxxxxxxxxx>
> > Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
> > Cc: Christoph Hellwig <hch@xxxxxx>
> > Cc: linux-mm@xxxxxxxxx
> > ---
> >
> > Change-Id: Ic3ec9b3dff3fff2732d874508a3582fb26ff0b1f
> > ---
> >  lib/stackdepot.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/stackdepot.c b/lib/stackdepot.c
> > index e2f000a9fad8..2b053c429454 100644
> > --- a/lib/stackdepot.c
> > +++ b/lib/stackdepot.c
> > @@ -294,7 +294,8 @@ depot_stack_handle_t stack_depot_save(unsigned long *entries,
> >                  * contexts and I/O.
> >                  */
> >                 alloc_flags &= ~GFP_ZONEMASK;
> > -               alloc_flags &= (GFP_ATOMIC | GFP_KERNEL);
> > +               alloc_flags &= (GFP_ATOMIC | GFP_KERNEL |
> > +                               __GFP_NO_KMSAN_SHADOW);
> >                 alloc_flags |= __GFP_NOWARN;
Should have added __GFP_NO_KMSAN_SHADOW here.
> >                 page = alloc_pages(alloc_flags, STACK_ALLOC_ORDER);
> >                 if (page)
> > --
> > 2.24.0.432.g9d3f5f5b63-goog
> >



-- 
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux