[PATCH 01/12] kasan, mm: don't save alloc stacks twice

Marco Elver elver at google.com
Tue Feb 2 13:40:56 EST 2021


On Tue, 2 Feb 2021 at 19:01, 'Andrey Konovalov' via kasan-dev
<kasan-dev at googlegroups.com> wrote:
[...]
> > > @@ -83,6 +83,7 @@ static inline void kasan_disable_current(void) {}
> > >  struct kasan_cache {
> > >       int alloc_meta_offset;
> > >       int free_meta_offset;
> > > +     bool is_kmalloc;
[...]
> > >       if (kasan_stack_collection_enabled())
> > > -             set_alloc_info(cache, (void *)object, flags);
> > > +             set_alloc_info(cache, (void *)object, flags, kmalloc);
> >
> > It doesn't bother me too much, but: 'bool kmalloc' shadows function
> > 'kmalloc' so this is technically fine, but using 'kmalloc' as the
> > variable name here might be confusing and there is a small chance it
> > might cause problems in a future refactor.
>
> Good point. Does "is_kmalloc" sound good?

Sure, that's also consistent with the new struct field.

Thanks,
-- Marco



More information about the linux-arm-kernel mailing list