函数逻辑报告 | 
Source Code:lib\test_user_copy.c | 
Create Date:2022-07-27 07:29:34 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| 首页 | 函数Tree | 
| 注解内核,赢得工具 | 下载SCCT | English | 
函数名称:test_user_copy_init
函数原型:static int __init test_user_copy_init(void)
返回类型:int
参数:无
| 182 | ret等于0 | 
| 194 | kmem等于kmalloc(PAGE_SIZE * 2, GFP_KERNEL) | 
| 198 | user_addr等于vm_mmap(NULL, 0, PAGE_SIZE * 2, page can be read | page can be written | page can be executed , don't use a file | Changes are private , 0) | 
| 208 | bad_usermem等于user_addr | 
| 219 | ret或等于test(memcmp(kmem, kmem + PAGE_SIZE, PAGE_SIZE), "legitimate usercopy failed to copy data") | 
| 240 | Legitimate usage: none of these copies should fail.(u16, 0x5a5b) | 
| 241 | Legitimate usage: none of these copies should fail.(u32, 0x5a5b5c5d) | 
| 243 | Legitimate usage: none of these copies should fail.(u64, 0x5a5b5c5d6a6b6c6d) | 
| 248 | ret或等于test_check_nonzero_user(kmem, usermem, 2 * PAGE_SIZE) | 
| 250 | ret或等于test_copy_struct_from_user(kmem, usermem, 2 * PAGE_SIZE) | 
| 261 | ret或等于test(!copy_from_user(kmem, (char__user * )(kmem + PAGE_SIZE), PAGE_SIZE), "illegal all-kernel copy_from_user passed") | 
| 266 | ret或等于test(memcmp(kmem + PAGE_SIZE, kmem, PAGE_SIZE), "zeroing failure for illegal all-kernel copy_from_user") | 
| 280 | ret或等于test(!copy_to_user((char__user * )kmem, kmem + PAGE_SIZE, PAGE_SIZE), "illegal all-kernel copy_to_user passed") | 
| 283 | ret或等于test(!copy_to_user((char__user * )kmem, bad_usermem, PAGE_SIZE), "illegal reversed copy_to_user passed") | 
| 303 | Reject kernel-to-kernel copies through copy_from_user(). (u16, 0x5a5b) | 
| 304 | Reject kernel-to-kernel copies through copy_from_user(). (u32, 0x5a5b5c5d) | 
| 306 | Reject kernel-to-kernel copies through copy_from_user(). (u64, 0x5a5b5c5d6a6b6c6d) | 
| 313 | 如果ret恒等于0则 | 
| 314 | 打印信息("tests passed.\n") | 
| 315 | 返回:0 | 
| 318 | 返回:负EINVAL | 
| 源代码转换工具 开放的插件接口  | X | 
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码  |