Lines Matching refs:task
56 int ptrace_attach(struct task_struct *task) in ptrace_attach() argument
58 task_lock(task); in ptrace_attach()
59 if (task->pid <= 1) in ptrace_attach()
61 if (task->tgid == current->tgid) in ptrace_attach()
63 if (!task->mm) in ptrace_attach()
65 if(((current->uid != task->euid) || in ptrace_attach()
66 (current->uid != task->suid) || in ptrace_attach()
67 (current->uid != task->uid) || in ptrace_attach()
68 (current->gid != task->egid) || in ptrace_attach()
69 (current->gid != task->sgid) || in ptrace_attach()
70 (!cap_issubset(task->cap_permitted, current->cap_permitted)) || in ptrace_attach()
71 (current->gid != task->gid)) && !capable(CAP_SYS_PTRACE)) in ptrace_attach()
74 if (!is_dumpable(task) && !capable(CAP_SYS_PTRACE)) in ptrace_attach()
77 if (task->ptrace & PT_PTRACED) in ptrace_attach()
81 task->ptrace |= PT_PTRACED; in ptrace_attach()
83 task->ptrace |= PT_PTRACE_CAP; in ptrace_attach()
84 task_unlock(task); in ptrace_attach()
87 if (task->p_pptr != current) { in ptrace_attach()
88 REMOVE_LINKS(task); in ptrace_attach()
89 task->p_pptr = current; in ptrace_attach()
90 SET_LINKS(task); in ptrace_attach()
94 send_sig(SIGSTOP, task, 1); in ptrace_attach()
98 task_unlock(task); in ptrace_attach()