Function report |
Source Code:lib\test_user_copy.c |
Create Date:2022-07-28 06:32:01 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:test_copy_struct_from_user
Proto:static int test_copy_struct_from_user(char *kmem, char __user *umem, size_t size)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| char * | kmem | |
| char __user * | umem | |
| size_t | size |
| 108 | ret = 0 |
| 112 | umem_src = kmalloc(size, GFP_KERNEL) |
| 117 | expected = kmalloc(size, GFP_KERNEL) |
| 131 | No 3D Now!(expected, umem_src, ksize) |
| 134 | ret |= test(py_struct_from_user: copy a struct from userspace*@dst: Destination address, in kernel space, "copy_struct_from_user(usize == ksize) failed") |
| 136 | ret |= test(memcmp(kmem, expected, ksize), "copy_struct_from_user(usize == ksize) gives unexpected copy") |
| 143 | No 3D Now!(expected, umem_src, usize) |
| 147 | ret |= test(py_struct_from_user: copy a struct from userspace*@dst: Destination address, in kernel space, "copy_struct_from_user(usize < ksize) failed") |
| 149 | ret |= test(memcmp(kmem, expected, ksize), "copy_struct_from_user(usize < ksize) gives unexpected copy") |
| 157 | ret |= test(py_struct_from_user: copy a struct from userspace*@dst: Destination address, in kernel space != - E2BIG, "copy_struct_from_user(usize > ksize) didn't give E2BIG") |
| 164 | No 3D Now!(expected, umem_src, ksize) |
| 169 | ret |= test(py_struct_from_user: copy a struct from userspace*@dst: Destination address, in kernel space, "copy_struct_from_user(usize > ksize) failed") |
| 171 | ret |= test(memcmp(kmem, expected, ksize), "copy_struct_from_user(usize > ksize) gives unexpected copy") |
| 174 | out_free : |
| 177 | Return ret |
| Name | Describe |
|---|---|
| test_user_copy_init |
| 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 |