|
@@ -368,7 +368,9 @@ static int yama_ptrace_access_check(struct task_struct *child,
|
|
|
break;
|
|
break;
|
|
|
case YAMA_SCOPE_RELATIONAL:
|
|
case YAMA_SCOPE_RELATIONAL:
|
|
|
rcu_read_lock();
|
|
rcu_read_lock();
|
|
|
- if (!task_is_descendant(current, child) &&
|
|
|
|
|
|
|
+ if (!pid_alive(child))
|
|
|
|
|
+ rc = -EPERM;
|
|
|
|
|
+ if (!rc && !task_is_descendant(current, child) &&
|
|
|
!ptracer_exception_found(current, child) &&
|
|
!ptracer_exception_found(current, child) &&
|
|
|
!ns_capable(__task_cred(child)->user_ns, CAP_SYS_PTRACE))
|
|
!ns_capable(__task_cred(child)->user_ns, CAP_SYS_PTRACE))
|
|
|
rc = -EPERM;
|
|
rc = -EPERM;
|