Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:kmalloc_oob_krealloc_more

Proto:static noinline void __init kmalloc_oob_krealloc_more(void)

Type:void

Parameter:Nothing

152  size1 = 17
153  size2 = 19
155  pr_info("out-of-bounds after krealloc more\n")
156  ptr1 = kmalloc(size1, GFP_KERNEL)
157  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
158  If Not ptr1 || Not ptr2 Then
159  pr_err("Allocation failed\n")
160  kfree(ptr1)
161  kfree(ptr2)
162  Return
165  ptr2[size2] = 'x'
166  kfree(ptr2)
Caller
NameDescribe
kmalloc_tests_init