• Home
  • Raw
  • Download

Lines Matching refs:task

173 static bool looks_like_a_spurious_pid(struct task_struct *task)  in looks_like_a_spurious_pid()  argument
175 if (task->exit_code != ((PTRACE_EVENT_EXEC << 8) | SIGTRAP)) in looks_like_a_spurious_pid()
178 if (task_pid_vnr(task) == task->ptrace_message) in looks_like_a_spurious_pid()
194 static bool ptrace_freeze_traced(struct task_struct *task) in ptrace_freeze_traced() argument
199 if (task->jobctl & JOBCTL_LISTENING) in ptrace_freeze_traced()
202 spin_lock_irq(&task->sighand->siglock); in ptrace_freeze_traced()
203 if (task_is_traced(task) && !looks_like_a_spurious_pid(task) && in ptrace_freeze_traced()
204 !__fatal_signal_pending(task)) { in ptrace_freeze_traced()
205 task->jobctl |= JOBCTL_PTRACE_FROZEN; in ptrace_freeze_traced()
208 spin_unlock_irq(&task->sighand->siglock); in ptrace_freeze_traced()
213 static void ptrace_unfreeze_traced(struct task_struct *task) in ptrace_unfreeze_traced() argument
222 if (lock_task_sighand(task, &flags)) { in ptrace_unfreeze_traced()
223 task->jobctl &= ~JOBCTL_PTRACE_FROZEN; in ptrace_unfreeze_traced()
224 if (__fatal_signal_pending(task)) { in ptrace_unfreeze_traced()
225 task->jobctl &= ~JOBCTL_TRACED; in ptrace_unfreeze_traced()
226 wake_up_state(task, __TASK_TRACED); in ptrace_unfreeze_traced()
228 unlock_task_sighand(task, &flags); in ptrace_unfreeze_traced()
286 static int __ptrace_may_access(struct task_struct *task, unsigned int mode) in __ptrace_may_access() argument
308 if (same_thread_group(task, current)) in __ptrace_may_access()
326 tcred = __task_cred(task); in __ptrace_may_access()
350 mm = task->mm; in __ptrace_may_access()
356 return security_ptrace_access_check(task, mode); in __ptrace_may_access()
359 bool ptrace_may_access(struct task_struct *task, unsigned int mode) in ptrace_may_access() argument
362 task_lock(task); in ptrace_may_access()
363 err = __ptrace_may_access(task, mode); in ptrace_may_access()
364 task_unlock(task); in ptrace_may_access()
388 static int ptrace_attach(struct task_struct *task, long request, in ptrace_attach() argument
414 audit_ptrace(task); in ptrace_attach()
417 if (unlikely(task->flags & PF_KTHREAD)) in ptrace_attach()
419 if (same_thread_group(task, current)) in ptrace_attach()
428 if (mutex_lock_interruptible(&task->signal->cred_guard_mutex)) in ptrace_attach()
431 task_lock(task); in ptrace_attach()
432 retval = __ptrace_may_access(task, PTRACE_MODE_ATTACH_REALCREDS); in ptrace_attach()
433 task_unlock(task); in ptrace_attach()
439 if (unlikely(task->exit_state)) in ptrace_attach()
441 if (task->ptrace) in ptrace_attach()
444 task->ptrace = flags; in ptrace_attach()
446 ptrace_link(task, current); in ptrace_attach()
450 send_sig_info(SIGSTOP, SEND_SIG_PRIV, task); in ptrace_attach()
452 spin_lock(&task->sighand->siglock); in ptrace_attach()
471 if (task_is_stopped(task) && in ptrace_attach()
472 task_set_jobctl_pending(task, JOBCTL_TRAP_STOP | JOBCTL_TRAPPING)) { in ptrace_attach()
473 task->jobctl &= ~JOBCTL_STOPPED; in ptrace_attach()
474 signal_wake_up_state(task, __TASK_STOPPED); in ptrace_attach()
477 spin_unlock(&task->sighand->siglock); in ptrace_attach()
483 mutex_unlock(&task->signal->cred_guard_mutex); in ptrace_attach()
493 wait_on_bit(&task->jobctl, JOBCTL_TRAPPING_BIT, TASK_KILLABLE); in ptrace_attach()
494 proc_ptrace_connector(task, PTRACE_ATTACH); in ptrace_attach()
811 static long ptrace_get_rseq_configuration(struct task_struct *task, in ptrace_get_rseq_configuration() argument
815 .rseq_abi_pointer = (u64)(uintptr_t)task->rseq, in ptrace_get_rseq_configuration()
816 .rseq_abi_size = sizeof(*task->rseq), in ptrace_get_rseq_configuration()
817 .signature = task->rseq_sig, in ptrace_get_rseq_configuration()
907 static int ptrace_regset(struct task_struct *task, int req, unsigned int type, in ptrace_regset() argument
910 const struct user_regset_view *view = task_user_regset_view(task); in ptrace_regset()
922 return copy_regset_to_user(task, view, regset_no, 0, in ptrace_regset()
925 return copy_regset_from_user(task, view, regset_no, 0, in ptrace_regset()