kasan: optimize poisoning in kmalloc and krealloc
Since kasan_kmalloc() always follows kasan_slab_alloc(), there's no need to reunpoison the object data, only to poison the redzone. This requires changing kasan annotation for early SLUB cache to kasan_slab_alloc(). Otherwise kasan_kmalloc() doesn't untag the object. This doesn't do any functional changes, as kmem_cache_node->object_size is equal to sizeof(struct kmem_cache_node). Similarly for kasan_krealloc(), as it's called after ksize(), which already unpoisoned the object, there's no need to do it again. Signed-off-by:Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by:
Andrey Konovalov <andreyknvl@google.com> Link: https://linux-review.googlesource.com/id/I4083d3b55605f70fef79bca9b90843c4390296f2
Loading
Please register or sign in to comment