File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -11689,15 +11689,15 @@ SYSCALL_DEFINE5(perf_event_open,
11689
11689
goto err_task ;
11690
11690
11691
11691
/*
11692
- * Reuse ptrace permission checks for now .
11692
+ * Preserve ptrace permission check for backwards compatibility .
11693
11693
*
11694
11694
* We must hold exec_update_mutex across this and any potential
11695
11695
* perf_install_in_context() call for this new event to
11696
11696
* serialize against exec() altering our credentials (and the
11697
11697
* perf_event_exit_task() that could imply).
11698
11698
*/
11699
11699
err = - EACCES ;
11700
- if (!ptrace_may_access (task , PTRACE_MODE_READ_REALCREDS ))
11700
+ if (!perfmon_capable () && ! ptrace_may_access (task , PTRACE_MODE_READ_REALCREDS ))
11701
11701
goto err_cred ;
11702
11702
}
11703
11703
You can’t perform that action at this time.
0 commit comments