函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:test_check_nonzero_user

函数原型:static int test_check_nonzero_user(char *kmem, char __user *umem, size_t size)

返回类型:int

参数:

类型参数名称
char *kmem
char __user *umem
size_tsize
49  ret等于0
52  如果test(size < 2 * PAGE_SIZE, "buffer too small")则返回:负EINVAL
61  size等于1024
62  start等于PAGE_SIZEsize除2
64  kmem加等于start
65  umem加等于start
67  zero_start等于size除4
68  zero_end等于sizezero_start
81  memset(kmem, 0x0, size)
82 i小于zero_start循环kmem[i]等于0xff
84 i小于size循环kmem[i]等于0xff
87  ret或等于test(copy_to_user(umem, kmem, size), "legitimate copy_to_user failed")
90 start小于等于size循环
91 end小于等于size循环
92  len等于endstart
94  expected等于is_zeroed(kmem + start, len)
96  ret或等于test(retval != expected, "check_nonzero_user(=%d) != memchr_inv(=%d) mismatch (start=%zu, end=%zu)", retval, expected, start, end)
102  返回:ret
调用者
名称描述
test_user_copy_init