/* Determine whether the nominated task is permitted to trace the current process, returning 0 if permission is granted, -ve if denied.  */
int cap_ptrace_traceme(struct task_struct *parent)
/* Determine whether the nominated task is permitted to trace the current process, returning 0 if permission is granted, -ve if denied.  */
int cap_ptrace_traceme(struct task_struct *parent)
{
	int ret = 0;
	rcu_read_lock();
	if (!cap_issubset(current_cred()->cap_permitted,
			  __task_cred(parent)->cap_permitted) &&
	    !has_capability(parent, CAP_SYS_PTRACE))
		ret = -EPERM;
	rcu_read_unlock();
	return ret;
}