Function report |
Source Code:lib\test_overflow.c |
Create Date:2022-07-28 06:31:16 |
Last Modify:2022-05-18 10:03:51 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
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_devm_kzalloc(void *arg)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
void * | arg |
560 | a = 5 * 4096 |
560 | b = ~0 / 5 * 4096 + 1 |
560 | ptr = devm_kzalloc(arg, 1, ((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)) | ((gfp_t)0x2000u))) |
560 | If Not ptr Then |
560 | printk("\0014"KBUILD_MODNAME": devm_kzalloc failed regular allocation?!\n", ) |
560 | Return 1 |
560 | devm_kfree(arg, ptr) |
560 | ptr = devm_kzalloc(arg, a * b, ((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)) | ((gfp_t)0x2000u))) |
560 | If Not ptr Then |
560 | printk("\0014"KBUILD_MODNAME": devm_kzalloc unexpectedly failed bad wrapping?!\n", ) |
560 | Return 1 |
560 | devm_kfree(arg, ptr) |
560 | ptr = devm_kzalloc(arg, 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., ((((gfp_t)(0x400u | 0x800u)) | ((gfp_t)0x40u) | ((gfp_t)0x80u)) | ((gfp_t)0x2000u))) |
560 | If ptr Then |
560 | printk("\0014"KBUILD_MODNAME": devm_kzalloc missed saturation!\n", ) |
560 | devm_kfree(arg, ptr) |
560 | Return 1 |
560 | printk("\0016"KBUILD_MODNAME": devm_kzalloc detected saturation\n", ) |
560 | Return 0 |
Name | Describe |
---|---|
test_overflow_allocation | 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())* | | | |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |