Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:kmalloc_oob_krealloc_less

Proto:static noinline void __init kmalloc_oob_krealloc_less(void)

Type:void

Parameter:Nothing

172  size1 = 17
173  size2 = 15
175  pr_info("out-of-bounds after krealloc less\n")
176  ptr1 = kmalloc(size1, GFP_KERNEL)
177  ptr2 = krealloc - reallocate memory. The contents will remain unchanged.*@p: object to reallocate memory for.*@new_size: how many bytes of memory are required.*@flags: the type of memory to allocate.* The contents of the object pointed to are preserved up to the
178  If Not ptr1 || Not ptr2 Then
179  pr_err("Allocation failed\n")
180  kfree(ptr1)
181  Return
183  ptr2[size2] = 'x'
184  kfree(ptr2)
Caller
NameDescribe
kmalloc_tests_init