Kernel: Use current process EUID in doing profiling access control

This commit is contained in:
Andreas Kling 2021-01-12 19:33:02 +01:00
parent 1a08ac72ad
commit 4fa8435310

View file

@ -41,7 +41,7 @@ int Process::sys$profiling_enable(pid_t pid)
return -ESRCH;
if (process->is_dead())
return -ESRCH;
if (!is_superuser() && process->uid() != m_uid)
if (!is_superuser() && process->uid() != m_euid)
return -EPERM;
process->ensure_perf_events();
process->set_profiling(true);
@ -54,7 +54,7 @@ int Process::sys$profiling_disable(pid_t pid)
auto process = Process::from_pid(pid);
if (!process)
return -ESRCH;
if (!is_superuser() && process->uid() != m_uid)
if (!is_superuser() && process->uid() != m_euid)
return -EPERM;
if (!process->is_profiling())
return -EINVAL;