| Function report | 
| Source Code: fs\coredump.c | Create Date:2022-07-28 20:30:54 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:do_coredump
Proto:void do_coredump(const kernel_siginfo_t *siginfo)
Type:void
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| const kernel_siginfo_t * | siginfo | 
| 573 | retval = 0 | 
| 575 | size_t * argv = NULL | 
| 576 | argc = 0 | 
| 579 | bool need_suid_safe = false | 
| 580 | bool core_dumped = false | 
| 581 | core_dump_count = Atomic operations that C can't guarantee us. Useful for* resource counting etc..(0) | 
| 594 | audit_core_dumps(si_signo) | 
| 602 | cred = prepare_creds - Prepare a new set of credentials for modification* Prepare a new set of task credentials for modification | 
| 614 | need_suid_safe = true | 
| 617 | retval = coredump_wait(si_signo, & core_state) | 
| 618 | If retval < 0 Then Go to fail_creds | 
| 623 | ispipe = rmat_corename will inspect the pattern parameter, and output a* name into corename, which must have space for at least* CORENAME_MAX_SIZE bytes plus one byte for the zero terminator. | 
| 625 | If ispipe Then | 
| 631 | If ispipe < 0 Then | 
| 634 | Go to fail_unlock | 
| 637 | If limit == 1 Then | 
| 657 | Go to fail_unlock | 
| 659 | limit = RLIM_INFINITY | 
| 661 | dump_count = atomic_inc_return( & core_dump_count) | 
| 662 | If core_pipe_limit && core_pipe_limit < dump_count Then | 
| 666 | Go to fail_dropcount | 
| 669 | helper_argv = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc). | 
| 671 | If Not helper_argv Then | 
| 674 | Go to fail_dropcount | 
| 678 | helper_argv[argi] = NULL | 
| 688 | kfree(helper_argv) | 
| 689 | If retval Then | 
| 694 | Else | 
| 696 | open_flags = O_CREAT | O_RDWR | O_NOFOLLOW | O_LARGEFILE | O_EXCL | 
| 699 | If limit < minimal dump size Then Go to fail_unlock | 
| 702 | If need_suid_safe && corename[0] != '/' Then | 
| 707 | Go to fail_unlock | 
| 715 | If Not need_suid_safe Then | 
| 731 | If need_suid_safe Then | 
| 744 | get_fs_root( Filesystem information: , & root) | 
| 745 | task_unlock( & Set up the first task table, touch at your own risk!. Base=0,* limit=0x1fffff (=2MB)) | 
| 746 | file = file_open_root(dentry, mnt, corename, open_flags, 0600) | 
| 749 | Else | 
| 752 | If IS_ERR(file) Then Go to fail_unlock | 
| 755 | inode = file_inode(file) | 
| 756 | If i_nlink > 1 Then Go to close_fail | 
| 758 | If d_unhashed - is dentry hashed*@dentry: entry to check* Returns true if the dentry passed is not currently hashed. Then Go to close_fail | 
| 764 | If Not S_ISREG(i_mode) Then Go to close_fail | 
| 772 | If Not uid_eq(i_uid, current_fsuid()) Then Go to close_fail | 
| 774 | If (i_mode & 0677) != 0600 Then Go to close_fail | 
| 776 | If Not (f_mode & Has write method(s) ) Then Go to close_fail | 
| 778 | If do_truncate(dentry, 0, 0, file) Then Go to close_fail | 
| 783 | retval = Helper to unshare the files of the current task.* We don't want to expose copy_files internals to* the exec layer of the kernel. | 
| 784 | If retval Then Go to close_fail | 
| 786 | If displaced Then put_files_struct(displaced) | 
| 788 | If Not dump_interrupted() Then | 
| 793 | If ispipe && core_pipe_limit Then wait_for_dump_helpers(file) | 
| 795 | close_fail : | 
| 798 | fail_dropcount : | 
| 799 | If ispipe Then atomic_dec( & core_dump_count) | 
| 801 | fail_unlock : | 
| 804 | coredump_finish(mm, core_dumped) | 
| 806 | fail_creds : | 
| 808 | fail : | 
| 809 | Return | 
| Name | Describe | 
|---|---|
| get_signal | 
| 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 |