Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kasan: inline HW_TAGS helper functions

Mark all static functions in common.c and kasan.h that are used for
hardware tag-based KASAN as inline to avoid unnecessary function calls.

Link: https://lkml.kernel.org/r/2c94a2af0657f2b95b9337232339ff5ffa643ab5.1612546384.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Branislav Rankov <Branislav.Rankov@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andrey Konovalov and committed by
Linus Torvalds
c80a0366 2cb34276

+7 -6
+7 -6
mm/kasan/common.c
··· 279 279 * based on objects indexes, so that objects that are next to each other 280 280 * get different tags. 281 281 */ 282 - static u8 assign_tag(struct kmem_cache *cache, const void *object, bool init) 282 + static inline u8 assign_tag(struct kmem_cache *cache, 283 + const void *object, bool init) 283 284 { 284 285 if (IS_ENABLED(CONFIG_KASAN_GENERIC)) 285 286 return 0xff; ··· 322 321 return (void *)object; 323 322 } 324 323 325 - static bool ____kasan_slab_free(struct kmem_cache *cache, void *object, 326 - unsigned long ip, bool quarantine) 324 + static inline bool ____kasan_slab_free(struct kmem_cache *cache, 325 + void *object, unsigned long ip, bool quarantine) 327 326 { 328 327 u8 tag; 329 328 void *tagged_object; ··· 367 366 return ____kasan_slab_free(cache, object, ip, true); 368 367 } 369 368 370 - static bool ____kasan_kfree_large(void *ptr, unsigned long ip) 369 + static inline bool ____kasan_kfree_large(void *ptr, unsigned long ip) 371 370 { 372 371 if (ptr != page_address(virt_to_head_page(ptr))) { 373 372 kasan_report_invalid_free(ptr, ip); ··· 462 461 return tagged_object; 463 462 } 464 463 465 - static void *____kasan_kmalloc(struct kmem_cache *cache, const void *object, 466 - size_t size, gfp_t flags) 464 + static inline void *____kasan_kmalloc(struct kmem_cache *cache, 465 + const void *object, size_t size, gfp_t flags) 467 466 { 468 467 unsigned long redzone_start; 469 468 unsigned long redzone_end;