Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\test_kasan.c Create Date:2022-07-28 06:29:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:kmem_cache_invalid_free

Proto:static noinline void __init kmem_cache_invalid_free(void)

Type:void

Parameter:Nothing

568  size = 200
571  cache = kmem_cache_create("test_cache", size, 0, Defer freeing slabs to RCU , NULL)
573  If Not cache Then
574  pr_err("Cache allocation failed\n")
575  Return
577  pr_info("invalid-free of heap object\n")
578  p = kmem_cache_alloc(cache, GFP_KERNEL)
579  If Not p Then
580  pr_err("Allocation failed\n")
581  kmem_cache_destroy(cache)
582  Return
586  kmem_cache_free(cache, p + 1)
592  kmem_cache_free(cache, p)
594  kmem_cache_destroy(cache)
Caller
NameDescribe
kmalloc_tests_init