Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\test_overflow.c Create Date:2022-07-28 06:31:07
Last Modify:2022-05-18 10:03:51 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Allocator uses a trailing node argument --------+ (e.g. kmalloc_node())* Allocator uses the gfp_t argument -----------+ | (e.g. kmalloc())* Allocator uses a special leading argument + | | (e.g. devm_kmalloc())* | | |

Proto:static int __attribute__((__section__(".init.text"))) __attribute__((__cold__))test_vmalloc(void *arg)

Type:int

Parameter:

TypeParameterName
void *arg
551  a = 5 * 4096
551  b = ~0 / 5 * 4096 + 1
551  ptr = vmalloc(1)
551  If Not ptr Then
551  printk("\0014"KBUILD_MODNAME": vmalloc failed regular allocation?!\n", )
551  Return 1
551  Do
551  If (ptr != NULL) Then kfree(ptr)
551  When 0 cycle
551  ptr = vmalloc(a * b)
551  If Not ptr Then
551  printk("\0014"KBUILD_MODNAME": vmalloc unexpectedly failed bad wrapping?!\n", )
551  Return 1
551  Do
551  If (ptr != NULL) Then kfree(ptr)
551  When 0 cycle
551  ptr = vmalloc(array_size() - Calculate size of 2-dimensional array.*@a: dimension one*@b: dimension two* Calculates size of 2-dimensional array: @a *@b.* Returns: number of bytes needed to represent the array or SIZE_MAX on* overflow.)
551  If ptr Then
551  printk("\0014"KBUILD_MODNAME": vmalloc missed saturation!\n", )
551  Do
551  If (ptr != NULL) Then kfree(ptr)
551  When 0 cycle
551  Return 1
551  printk("\0016"KBUILD_MODNAME": vmalloc detected saturation\n", )
551  Return 0
Caller
NameDescribe
test_overflow_allocationAllocator uses a trailing node argument --------+ (e.g. kmalloc_node())* Allocator uses the gfp_t argument -----------+ | (e.g. kmalloc())* Allocator uses a special leading argument + | | (e.g. devm_kmalloc())* | | |