summaryrefslogtreecommitdiff
path: root/security/yama
diff options
context:
space:
mode:
authorJames Morris <james.morris@microsoft.com>2019-01-22 14:33:10 -0800
committerJames Morris <james.morris@microsoft.com>2019-01-22 14:33:10 -0800
commit9624d5c9c7ff6836bbf9f9b230fd1fcf3d56f91a (patch)
treee9c1e5d2400ad20c5a9cd633b52a42a00d1d98cb /security/yama
parent3e8c73671244af16f1a6042f1c10d13b75cd1156 (diff)
parent49a57857aeea06ca831043acbb0fa5e0f50602fd (diff)
Merge tag 'v5.0-rc3' into next-general
Sync to Linux 5.0-rc3 to pull in the VFS changes which impacted a lot of the LSM code.
Diffstat (limited to 'security/yama')
-rw-r--r--security/yama/yama_lsm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c
index eb1da1303d2e..57cc60722dd3 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,
break;
case YAMA_SCOPE_RELATIONAL:
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) &&
!ns_capable(__task_cred(child)->user_ns, CAP_SYS_PTRACE))
rc = -EPERM;