函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\coredump.c Create Date:2022-07-29 11:06:14
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:do_coredump

函数原型:void do_coredump(const kernel_siginfo_t *siginfo)

返回类型:void

参数:

类型参数名称
const kernel_siginfo_t *siginfo
569  mm等于mm
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)
582  struct coredump_params cprm = {siginfo = siginfo, regs = unlike current_pt_regs(), this one is equal to task_pt_regs(current)* on *all* architectures; the only reason to have a per-arch definition* is optimisation.(), limit = rlimit(RLIMIT_CORE), mm_flags = Must use atomic bitops to access , }
594  audit_core_dumps(si_signo)
596  binfmt等于可执行文件的格式
597  如果非binfmt或非core_dump则转到:fail
599  如果非This returns the actual value of the suid_dumpable flag. For things* that are using this for checking for privilege transitions, it must* test against SUID_DUMP_USER rather than treating it as a boolean* value.则转到:fail
602  cred等于prepare_creds - Prepare a new set of credentials for modification* Prepare a new set of task credentials for modification
603  如果非cred则转到:fail
611  如果This returns the actual value of the suid_dumpable flag. For things* that are using this for checking for privilege transitions, it must* test against SUID_DUMP_USER rather than treating it as a boolean* value.恒等于Dump as root
613  UID for VFS ops 等于GLOBAL_ROOT_UID
614  need_suid_safe = true
617  retval等于coredump_wait(si_signo, & core_state)
618  如果retval小于0则转到:fail_creds
621  old_cred等于verride_creds - Override the current process's subjective credentials*@new: The credentials to be assigned* Install a set of temporary override subjective credentials on the current* process, returning the old set for later reversion.
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  如果ispipe
631  如果ispipe小于0则
634  转到:fail_unlock
637  如果limit恒等于1则
657  转到:fail_unlock
659  limit等于RLIM_INFINITY
661  dump_count等于atomic_inc_return( & core_dump_count)
666  转到:fail_dropcount
669  helper_argv等于分配数组内存
671  如果非helper_argv
674  转到:fail_dropcount
676 argi小于argc循环helper_argv[argi]等于corenameargv[argi]
678  helper_argv[argi] = NULL
680  retval等于负ENOMEM
681  sub_info等于all_usermodehelper_setup - prepare to call a usermode helper*@path: path to usermode executable*@argv: arg vector for process*@envp: environment for process*@gfp_mask: gfp mask for memory allocation*@cleanup: a cleanup function*@init: an init
684  如果sub_inforetval等于all_usermodehelper_exec - start a usermode application*@sub_info: information about the subprocessa*@wait: wait for the application to finish and return status.* when UMH_NO_WAIT don't wait at all, but you get no useful error back
688  释放内存
689  如果retval
692  转到:close_fail
694  否则
696  open_flags等于O_CREAT按位或O_RDWR按位或O_NOFOLLOW按位或O_LARGEFILE按位或O_EXCL
699  如果limit小于minimal dump size 则转到:fail_unlock
702  如果need_suid_safecorename[0]不等于'/'则
707  转到:fail_unlock
715  如果非need_suid_safe
731  如果need_suid_safe
749  否则
752  如果是错误则转到:fail_unlock
755  inode等于file_inode(file)
756  如果i_nlink大于1则转到:close_fail
758  如果目录项存在于哈希中则转到:close_fail
764  如果非S_ISREG(i_mode)则转到:close_fail
772  如果非uid_eq(i_uid, current_fsuid())则转到:close_fail
774  如果i_mode按位与0677的值不等于0600则转到:close_fail
776  如果非f_mode按位与Has write method(s) 的值则转到:close_fail
778  如果do_truncate(dentry, 0, 0, file)则转到: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  如果retval则转到:close_fail
786  如果displacedput_files_struct(displaced)
788  如果非dump_interrupted()则
789  file_start_write(file)
790  core_dumped等于core_dump( & cprm)
791  file_end_write(file)
793  如果ispipecore_pipe_limitwait_for_dump_helpers(file)
795  close_fail :
796  如果file"id" is the POSIX thread ID. We use the* files pointer for this..
798  fail_dropcount :
799  如果ispipeatomic_dec( & core_dump_count)
801  fail_unlock :
802  释放内存
803  释放内存
804  coredump_finish(mm, core_dumped)
805  vert_creds - Revert a temporary subjective credentials override*@old: The credentials to be restored* Revert a temporary set of override subjective credentials to an old set,* discarding the override set.
806  fail_creds :
807  put_cred - Release a reference to a set of credentials*@cred: The credentials to release* Release a reference to a set of credentials, deleting them when the last ref* is released
808  fail :
809  返回
调用者
名称描述
get_signal