diff options
Diffstat (limited to 'security')
-rw-r--r-- | security/yama/yama_lsm.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c index 23414b93771f..13c88fbcf037 100644 --- a/security/yama/yama_lsm.c +++ b/security/yama/yama_lsm.c | |||
@@ -347,10 +347,8 @@ int yama_ptrace_traceme(struct task_struct *parent) | |||
347 | /* Only disallow PTRACE_TRACEME on more aggressive settings. */ | 347 | /* Only disallow PTRACE_TRACEME on more aggressive settings. */ |
348 | switch (ptrace_scope) { | 348 | switch (ptrace_scope) { |
349 | case YAMA_SCOPE_CAPABILITY: | 349 | case YAMA_SCOPE_CAPABILITY: |
350 | rcu_read_lock(); | 350 | if (!has_ns_capability(parent, current_user_ns(), CAP_SYS_PTRACE)) |
351 | if (!ns_capable(__task_cred(parent)->user_ns, CAP_SYS_PTRACE)) | ||
352 | rc = -EPERM; | 351 | rc = -EPERM; |
353 | rcu_read_unlock(); | ||
354 | break; | 352 | break; |
355 | case YAMA_SCOPE_NO_ATTACH: | 353 | case YAMA_SCOPE_NO_ATTACH: |
356 | rc = -EPERM; | 354 | rc = -EPERM; |