Re: [PATCH 02/12] kasan, mm: optimize kmalloc poisoning

2021-02-02 Thread Marco Elver
On Tue, 2 Feb 2021 at 18:16, Andrey Konovalov wrote: > > On Tue, Feb 2, 2021 at 5:25 PM Marco Elver wrote: > > > > > +#ifdef CONFIG_KASAN_GENERIC > > > + > > > +/** > > > + * kasan_poison_last_granule - mark the last granule of the memory range > > > as > > > + * unaccessible > > > + * @addr - r

Re: [PATCH 02/12] kasan, mm: optimize kmalloc poisoning

2021-02-02 Thread Andrey Konovalov
On Tue, Feb 2, 2021 at 5:25 PM Marco Elver wrote: > > > +#ifdef CONFIG_KASAN_GENERIC > > + > > +/** > > + * kasan_poison_last_granule - mark the last granule of the memory range as > > + * unaccessible > > + * @addr - range start address, must be aligned to KASAN_GRANULE_SIZE > > + * @size - range

Re: [PATCH 02/12] kasan, mm: optimize kmalloc poisoning

2021-02-02 Thread Marco Elver
On Mon, Feb 01, 2021 at 08:43PM +0100, Andrey Konovalov wrote: > For allocations from kmalloc caches, kasan_kmalloc() always follows > kasan_slab_alloc(). Currenly, both of them unpoison the whole object, > which is unnecessary. > > This patch provides separate implementations for both annotations