Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\signal.c Create Date:2022-07-28 09:16:38
Last Modify:2020-03-17 13:28:47 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:This must be called with current->sighand->siglock held.* This should be the path for all ptrace stops.* We always set current->last_siginfo while stopped here.* That makes it a way to test a stopped process for

Proto:static void ptrace_stop(int exit_code, int why, int clear_code, kernel_siginfo_t *info)__releases(&get_current()->sighand->siglock) __acquires(&get_current()->sighand->siglock)

Type:void

Parameter:

TypeParameterName
intexit_code
intwhy
intclear_code
kernel_siginfo_t *info
2119  bool gstop_done = false
2121  If When hitting ptrace_stop(), we cannot return using SYSRET because* that does not restore the full CPU state, only a minimal set(exit_code, info) Then
2133  spin_unlock_irq( & siglock)
2134  arch_ptrace_stop - Do machine-specific work before stopping for ptrace*@code: current->exit_code value ptrace will stop with*@info: siginfo_t pointer (or %NULL) for signal ptrace will stop with* This is called with no locks held when (exit_code, info)
2135  spin_lock_irq( & siglock)
2136  If Return non-zero if there is a SIGKILL that should be waking us up.* Called with the siglock held. Then Return
2140  set_special_state() should be used for those states when the blocking task* can not use the regular condition based wait-loop. In that case we must* serialize against wakeups such that any possible in-flight TASK_RUNNING stores(TASK_TRACED)
2160  smp_wmb()
2162  last_siginfo = info
2163  exit_code = exit_code
2172  If why == child has stopped && jobctl & JOBCTL_STOP_PENDING Then gstop_done = ask_participate_group_stop - participate in a group stop*@task: task participating in a group stop*@task has %JOBCTL_STOP_PENDING set and is participating in a group stop.* Group stop states are cleared and the group stop count is consumed if
2176  ask_clear_jobctl_pending - clear jobctl pending bits*@task: target task*@mask: pending bits to clear* Clear @mask from @task->jobctl. @mask must be subset of* %JOBCTL_PENDING_MASK. If %JOBCTL_STOP_PENDING is being cleared, other
2177  If info && si_code >> 8 == Extended result codes which enabled by means other than options. Then ask_clear_jobctl_pending - clear jobctl pending bits*@task: target task*@mask: pending bits to clear* Clear @mask from @task->jobctl. @mask must be subset of* %JOBCTL_PENDING_MASK. If %JOBCTL_STOP_PENDING is being cleared, other
2181  ask_clear_jobctl_trapping - clear jobctl trapping bit*@task: target task* If JOBCTL_TRAPPING is set, a ptracer is waiting for us to enter TRACED.* Clear it and wake up the ptracer. Note that we don't need any further* locking
2183  spin_unlock_irq( & siglock)
2184  read_lock( & tasklist_lock)
2185  If may_ptrace_stop() Then
2196  do_notify_parent_cldstop - notify parent of stopped/continued state change*@tsk: task reporting the state change*@for_ptracer: the notification is for ptracer*@why: CLD_{CONTINUED|STOPPED|TRAPPED} to report
2197  If gstop_done && ptrace_reparented(current process) Then do_notify_parent_cldstop - notify parent of stopped/continued state change*@tsk: task reporting the state change*@for_ptracer: the notification is for ptracer*@why: CLD_{CONTINUED|STOPPED|TRAPPED} to report
2206  Even if we don't have any preemption, we need preempt disable/enable* to be barriers, so that we don't have things like get_user/put_user* that can cause faults and scheduling migrate into our preempt-protected* region.()
2207  read_unlock( & tasklist_lock)
2208  cgroup_enter_frozen()
2209  preempt_enable_no_resched()
2210  freezable_schedule()
2211  cgroup_leave_frozen(true)
2212  Else
2223  If gstop_done Then do_notify_parent_cldstop - notify parent of stopped/continued state change*@tsk: task reporting the state change*@for_ptracer: the notification is for ptracer*@why: CLD_{CONTINUED|STOPPED|TRAPPED} to report
2227  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;* (Used in tsk->state: )
2228  If clear_code Then exit_code = 0
2230  read_unlock( & tasklist_lock)
2238  spin_lock_irq( & siglock)
2239  last_siginfo = NULL
2242  jobctl &= ~JOBCTL_LISTENING
2249  recalc_sigpending_tsk(current process)
Caller
NameDescribe
ptrace_do_notify
do_jobctl_trapdo_jobctl_trap - take care of ptrace jobctl traps* When PT_SEIZED, it's used for both group stop and explicit* SEIZE/INTERRUPT traps. Both generate PTRACE_EVENT_STOP trap with* accompanying siginfo. If stopped, lower eight bits of exit_code contain
ptrace_signal