| Function report | 
| Source Code: fs\exec.c | Create Date:2022-07-28 20:03:54 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:'copy_strings()' copies argument/environment strings from the old* processes's memory to the new process's stack. The call to get_user_pages()* ensures the destination page is created and not swapped out.
Proto:static int copy_strings(int argc, struct user_arg_ptr argv, struct linux_binprm *bprm)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| int | argc | |
| struct user_arg_ptr | argv | |
| struct linux_binprm * | bprm | 
| 502 | struct page * kmapped_page = NULL | 
| 503 | char * kaddr = NULL | 
| 504 | kpos = 0 | 
| 513 | str = get_user_arg_ptr(argv, argc) | 
| 522 | If Not valid_arg_len(bprm, len) Then Go to out | 
| 537 | If fatal_signal_pending(current process) Then | 
| 538 | ret = -start if no handler.. | 
| 539 | Go to out | 
| 541 | cond_resched() | 
| 547 | bytes_to_copy = offset | 
| 548 | If bytes_to_copy > len Then bytes_to_copy = len | 
| 551 | offset -= bytes_to_copy | 
| 552 | pos -= bytes_to_copy | 
| 553 | str -= bytes_to_copy | 
| 554 | len -= bytes_to_copy | 
| 556 | If Not kmapped_page || kpos != (pos & PAGE_MASK) Then | 
| 559 | page = get_arg_page(bprm, pos, 1) | 
| 560 | If Not page Then | 
| 565 | If kmapped_page Then | 
| 570 | kmapped_page = page | 
| 571 | kaddr = kmap(kmapped_page) | 
| 573 | flush_arg_page(bprm, kpos, kmapped_page) | 
| 575 | If copy_from_user(kaddr + offset, str, bytes_to_copy) Then | 
| 581 | ret = 0 | 
| 582 | out : | 
| 583 | If kmapped_page Then | 
| 588 | Return ret | 
| Name | Describe | 
|---|---|
| copy_strings_kernel | Like copy_strings, but get argv and its values from kernel memory. | 
| __do_execve_file | sys_execve() executes a new program. | 
| 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 |