/* Determine whether a process may access another, returning 0 if permission granted, -ve if denied.  */
int cap_ptrace_access_check(struct task_struct *child, unsigned int mode)
/* Determine whether a process may access another, returning 0 if permission granted, -ve if denied.  */
int cap_ptrace_access_check(struct task_struct *child, unsigned int mode)
{
	int ret = 0;
	rcu_read_lock();
	if (!cap_issubset(__task_cred(child)->cap_permitted,
			  current_cred()->cap_permitted) &&
	    !capable(CAP_SYS_PTRACE))
		ret = -EPERM;
	rcu_read_unlock();
	return ret;
}