Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\kasan\common.c Create Date:2022-07-28 15:51:04
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__kasan_slab_free

Proto:static bool __kasan_slab_free(struct kmem_cache *cache, void *object, unsigned long ip, bool quarantine)

Type:bool

Parameter:

TypeParameterName
struct kmem_cache *cache
void *object
unsigned longip
boolquarantine
447  tag = get_tag(object)
448  tagged_object = object
449  object = reset_tag(object)
451  If Value for the false possibility is greater at compile time(nearest_obj(cache, virt_to_head_page(object), object) != object) Then
453  kasan_report_invalid_free(tagged_object, ip)
454  Return true
458  If Value for the false possibility is greater at compile time(Used for retrieving partial slabs, etc. & Defer freeing slabs to RCU ) Then Return false
461  shadow_byte = READ_ONCE( * (s8 * )kasan_mem_to_shadow(object))
462  If shadow_invalid(tag, shadow_byte) Then
463  kasan_report_invalid_free(tagged_object, ip)
464  Return true
467  rounded_up_size = und_up - round up to next specified power of 2*@x: the value to round*@y: multiple to round up to (must be a power of 2)* Rounds @x up to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding up, use roundup() below.(The size of an object without metadata , KASAN_SHADOW_SCALE_SIZE)
468  Poisons the shadow memory for 'size' bytes starting from 'addr'.* Memory addresses should be aligned to KASAN_SHADOW_SCALE_SIZE.
470  If IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_KASAN_GENERIC) && Not quarantine || Value for the false possibility is greater at compile time(!(Used for retrieving partial slabs, etc. & SLAB_KASAN)) Then Return false
474  kasan_set_free_info(cache, object, tag)
476  quarantine_put(get_free_info(cache, object), cache)
478  Return IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_KASAN_GENERIC)
Caller
NameDescribe
kasan_slab_free
kasan_poison_kfree