Function report |
Source Code:lib\test_kasan.c |
Create Date:2022-07-28 06:29:24 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:copy_user_test
Proto:static noinline void __init copy_user_test(void)
Type:void
Parameter:Nothing
| 480 | size = 10 |
| 483 | kmem = kmalloc(size, GFP_KERNEL) |
| 484 | If Not kmem Then Return |
| 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) |
| 496 | pr_info("out-of-bounds in copy_from_user()\n") |
| 497 | unused = copy_from_user(kmem, usermem, size + 1) |
| 499 | pr_info("out-of-bounds in copy_to_user()\n") |
| 500 | unused = copy_to_user(usermem, kmem, size + 1) |
| 502 | pr_info("out-of-bounds in __copy_from_user()\n") |
| 503 | unused = __copy_from_user(kmem, usermem, size + 1) |
| 505 | pr_info("out-of-bounds in __copy_to_user()\n") |
| 506 | unused = __copy_to_user(usermem, kmem, size + 1) |
| 508 | pr_info("out-of-bounds in __copy_from_user_inatomic()\n") |
| 511 | pr_info("out-of-bounds in __copy_to_user_inatomic()\n") |
| 514 | pr_info("out-of-bounds in strncpy_from_user()\n") |
| Name | Describe |
|---|---|
| kmalloc_tests_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 |