diff options
| author | Vlastimil Babka <vbabka@suse.cz> | 2023-12-28 19:19:50 +0100 |
|---|---|---|
| committer | Vlastimil Babka <vbabka@suse.cz> | 2024-01-04 12:32:19 +0100 |
| commit | 61d7e367f8bcc8083f02dcc5ce89b98b1480929d (patch) | |
| tree | 3252503bb4edf51ca281f20d50836743e065b563 /mm/kasan/common.c | |
| parent | slub: Update frozen slabs documentations in the source (diff) | |
| parent | mm/slub: free KFENCE objects in slab_free_hook() (diff) | |
| download | linux-61d7e367f8bcc8083f02dcc5ce89b98b1480929d.tar.gz linux-61d7e367f8bcc8083f02dcc5ce89b98b1480929d.zip | |
Merge branch 'slab/for-6.8/slub-hook-cleanups' into slab/for-next
Merge the SLAB allocator removal and a number of subsequent SLUB
cleanups and optimizations.
Diffstat (limited to 'mm/kasan/common.c')
| -rw-r--r-- | mm/kasan/common.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/mm/kasan/common.c b/mm/kasan/common.c index 256930da578a..5d95219e69d7 100644 --- a/mm/kasan/common.c +++ b/mm/kasan/common.c @@ -153,10 +153,6 @@ void __kasan_poison_object_data(struct kmem_cache *cache, void *object) * 2. A cache might be SLAB_TYPESAFE_BY_RCU, which means objects can be * accessed after being freed. We preassign tags for objects in these * caches as well. - * 3. For SLAB allocator we can't preassign tags randomly since the freelist - * is stored as an array of indexes instead of a linked list. Assign tags - * based on objects indexes, so that objects that are next to each other - * get different tags. */ static inline u8 assign_tag(struct kmem_cache *cache, const void *object, bool init) @@ -171,17 +167,12 @@ static inline u8 assign_tag(struct kmem_cache *cache, if (!cache->ctor && !(cache->flags & SLAB_TYPESAFE_BY_RCU)) return init ? KASAN_TAG_KERNEL : kasan_random_tag(); - /* For caches that either have a constructor or SLAB_TYPESAFE_BY_RCU: */ -#ifdef CONFIG_SLAB - /* For SLAB assign tags based on the object index in the freelist. */ - return (u8)obj_to_index(cache, virt_to_slab(object), (void *)object); -#else /* - * For SLUB assign a random tag during slab creation, otherwise reuse + * For caches that either have a constructor or SLAB_TYPESAFE_BY_RCU, + * assign a random tag during slab creation, otherwise reuse * the already assigned tag. */ return init ? kasan_random_tag() : get_tag(object); -#endif } void * __must_check __kasan_init_slab_obj(struct kmem_cache *cache, |
