函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\test_kasan.c Create Date:2022-07-27 07:26:48
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:copy_user_test

函数原型:static noinline void __init copy_user_test(void)

返回类型:void

参数:

479  __userusermem
480  size等于10
483  kmem等于kmalloc(size, GFP_KERNEL)
484  如果非kmem则返回
487  usermem等于vm_mmap(NULL, 0, PAGE_SIZE, page can be read | page can be written | page can be executed , don't use a file | Changes are private , 0)
490  如果是错误
491  打印错误信息("Failed to allocate user memory\n")
492  kfree(kmem)
493  返回
496  打印信息("out-of-bounds in copy_from_user()\n")
497  unused等于copy_from_user(kmem, usermem, size + 1)
499  打印信息("out-of-bounds in copy_to_user()\n")
500  unused等于copy_to_user(usermem, kmem, size + 1)
502  打印信息("out-of-bounds in __copy_from_user()\n")
503  unused等于__copy_from_user(kmem, usermem, size + 1)
505  打印信息("out-of-bounds in __copy_to_user()\n")
506  unused等于__copy_to_user(usermem, kmem, size + 1)
508  打印信息("out-of-bounds in __copy_from_user_inatomic()\n")
509  unused等于Architectures should provide two primitives (raw_copy_{to,from}_user())* and get rid of their private instances of copy_{to,from}_user() and* __copy_{to,from}_user{,_inatomic}().* raw_copy_{to,from}_user(to, from, size) should copy up to size bytes and
511  打印信息("out-of-bounds in __copy_to_user_inatomic()\n")
512  unused等于__copy_to_user_inatomic: - Copy a block of data into user space, with less checking.*@to: Destination address, in user space.*@from: Source address, in kernel space.*@n: Number of bytes to copy.* Context: User context only.
514  打印信息("out-of-bounds in strncpy_from_user()\n")
515  unused等于复制用户字符串
517  vm_munmap((unsignedlong)usermem, PAGE_SIZE)
518  kfree(kmem)
调用者
名称描述
kmalloc_tests_init