Re: [PATCH] lib/stackdepot: fix global out-of-bounds in stack_slabs

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

 



> > -             stack_slabs[depot_index + 1] = *prealloc;
> > +             /* If this is the last depot slab, do not touch the next one. */
> > +             if (depot_index + 1 < STACK_ALLOC_MAX_SLABS)
> > +                     stack_slabs[depot_index + 1] = *prealloc;
>
> What prevents memory leak (caused by "*prealloc = NULL;")
> when we hit depot_index + 1 >= STACK_ALLOC_MAX_SLABS condition?
>

Nice catch!
We must return from this function instead of setting *prealloc to NULL.


-- 
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