函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:This function makes sure the current process has its own signal table,* so that flush_signal_handlers can later reset the handlers without* disturbing other processes. (Other processes might share the signal* table via the CLONE_SIGHAND option to clone().)

函数原型:static int de_thread(struct task_struct *tsk)

返回类型:int

参数:

类型参数名称
struct task_struct *tsk
1062  sig等于signal
1063  oldsighand等于sighand
1064  lock等于siglock
1066  如果thread_group_empty(tsk)则转到:no_thread_group
1072  spin_lock_irq(lock)
1073  如果If true, all threads except ->group_exit_task have pending SIGKILL
1078  spin_unlock_irq(lock)
1079  返回:负EAGAIN
1082  group_exit_task等于tsk
1083  verloaded:* - notify group_exit_task when ->count is equal to notify_count* - everyone except group_exit_task is stopped during signal delivery* of fatal signals, group_exit_task processes the signal.等于Nuke all other threads in the group.
1084  如果非thread_group_leader(tsk)则verloaded:* - notify group_exit_task when ->count is equal to notify_count* - everyone except group_exit_task is stopped during signal delivery* of fatal signals, group_exit_task processes the signal.自减
1087 verloaded:* - notify group_exit_task when ->count is equal to notify_count* - everyone except group_exit_task is stopped during signal delivery* of fatal signals, group_exit_task processes the signal.循环
1088  set_current_state() includes a barrier so that the write of current->state* is correctly serialised wrt the caller's subsequent test of whether to* actually sleep:* for (;;) {* set_current_state(TASK_UNINTERRUPTIBLE);* if (!need_sleep)* break;* (Convenience macros for the sake of set_current_state: )
1089  spin_unlock_irq(lock)
1090  进程调度
1091  如果__fatal_signal_pending(tsk)则转到:killed
1093  spin_lock_irq(lock)
1095  spin_unlock_irq(lock)
1102  如果非thread_group_leader(tsk)则
1103  leader等于group_leader
1105  循环
1118  进程调度
1119  如果__fatal_signal_pending(tsk)则转到:killed
1133  start_time等于start_time
1134  start_boottime等于start_boottime
1136  BUG_ON(!same_thread_group(leader, tsk))
1137  BUG_ON(Do to the insanities of de_thread it is possible for a process* to have the pid of the thread group leader without actually being* the thread group leader)
1150  pid等于pid
1151  change_pid(tsk, PIDTYPE_PID, task_pid(leader))
1152  ransfer_pid is an optimization of attach_pid(new), detach_pid(old)
1153  ransfer_pid is an optimization of attach_pid(new), detach_pid(old)
1154  ransfer_pid is an optimization of attach_pid(new), detach_pid(old)
1156  更新RCU锁项
1157  list_replace_init( & sibling, & sibling)
1159  group_leader等于tsk
1160  group_leader等于tsk
1162  exit_signal等于SIGCHLD
1163  exit_signal等于负1
1165  BUG_ON(exit_state != EXIT_ZOMBIE)
1166  exit_state等于Used in tsk->exit_state:
1173  如果此条件成立可能性小(为编译器优化)(ptrace)则__wake_up_parent(leader, parent)
1175  write_unlock_irq( & tasklist_lock)
1176  摘除线程组完成
1178  release_task(leader)
1181  group_exit_task = NULL
1182  verloaded:* - notify group_exit_task when ->count is equal to notify_count* - everyone except group_exit_task is stopped during signal delivery* of fatal signals, group_exit_task processes the signal.等于0
1184  no_thread_group :
1186  exit_signal等于SIGCHLD
1193  如果_read - get a refcount's value*@r: the refcount* Return: the refcount's value不等于1则
1199  newsighand等于分配高速缓存区
1200  如果非newsighand则返回:负ENOMEM
1203  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
1204  memcpy(action, action, action的长度)
1207  write_lock_irq( & tasklist_lock)
1208  加自旋锁
1209  cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization(sighand, newsighand)
1210  自旋锁解锁
1211  write_unlock_irq( & tasklist_lock)
1213  __cleanup_sighand(oldsighand)
1216  BUG_ON(!thread_group_leader(tsk))
1217  返回:0
1219  killed :
1221  read_lock( & tasklist_lock)
1222  group_exit_task = NULL
1223  verloaded:* - notify group_exit_task when ->count is equal to notify_count* - everyone except group_exit_task is stopped during signal delivery* of fatal signals, group_exit_task processes the signal.等于0
1224  read_unlock( & tasklist_lock)
1225  返回:负EAGAIN
调用者
名称描述
flush_old_execCalling this is the point of no return. None of the failures will be* seen by userspace since either the process is already taking a fatal* signal (via de_thread() or coredump), or will have SEGV raised