Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:kasan_strings

Proto:static noinline void __init kasan_strings(void)

Type:void

Parameter:Nothing

630  size = 24
632  pr_info("use-after-free in strchr\n")
633  ptr = kmalloc(size, GFP_KERNEL | __GFP_ZERO)
634  If Not ptr Then Return
637  kfree(ptr)
645  ptr += 16
646  strchr(ptr, '1')
648  pr_info("use-after-free in strrchr\n")
649  strrchr - Find the last occurrence of a character in a string*@s: The string to be searched*@c: The character to search for
651  pr_info("use-after-free in strcmp\n")
652  strcmp(ptr, "2")
654  pr_info("use-after-free in strncmp\n")
655  strncmp(ptr, "2", 1)
657  pr_info("use-after-free in strlen\n")
658  strlen(ptr)
660  pr_info("use-after-free in strnlen\n")
661  strnlen(ptr, 1)
Caller
NameDescribe
kmalloc_tests_init