diff options
-rw-r--r-- | security/yama/yama_lsm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c index ffda91a4a1aa..02514fe558b4 100644 --- a/security/yama/yama_lsm.c +++ b/security/yama/yama_lsm.c | |||
@@ -368,7 +368,9 @@ static int yama_ptrace_access_check(struct task_struct *child, | |||
368 | break; | 368 | break; |
369 | case YAMA_SCOPE_RELATIONAL: | 369 | case YAMA_SCOPE_RELATIONAL: |
370 | rcu_read_lock(); | 370 | rcu_read_lock(); |
371 | if (!task_is_descendant(current, child) && | 371 | if (!pid_alive(child)) |
372 | rc = -EPERM; | ||
373 | if (!rc && !task_is_descendant(current, child) && | ||
372 | !ptracer_exception_found(current, child) && | 374 | !ptracer_exception_found(current, child) && |
373 | !ns_capable(__task_cred(child)->user_ns, CAP_SYS_PTRACE)) | 375 | !ns_capable(__task_cred(child)->user_ns, CAP_SYS_PTRACE)) |
374 | rc = -EPERM; | 376 | rc = -EPERM; |