mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
Kernel: Use current process EUID in doing profiling access control
This commit is contained in:
parent
1a08ac72ad
commit
4fa8435310
1 changed files with 2 additions and 2 deletions
|
@ -41,7 +41,7 @@ int Process::sys$profiling_enable(pid_t pid)
|
||||||
return -ESRCH;
|
return -ESRCH;
|
||||||
if (process->is_dead())
|
if (process->is_dead())
|
||||||
return -ESRCH;
|
return -ESRCH;
|
||||||
if (!is_superuser() && process->uid() != m_uid)
|
if (!is_superuser() && process->uid() != m_euid)
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
process->ensure_perf_events();
|
process->ensure_perf_events();
|
||||||
process->set_profiling(true);
|
process->set_profiling(true);
|
||||||
|
@ -54,7 +54,7 @@ int Process::sys$profiling_disable(pid_t pid)
|
||||||
auto process = Process::from_pid(pid);
|
auto process = Process::from_pid(pid);
|
||||||
if (!process)
|
if (!process)
|
||||||
return -ESRCH;
|
return -ESRCH;
|
||||||
if (!is_superuser() && process->uid() != m_uid)
|
if (!is_superuser() && process->uid() != m_euid)
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
if (!process->is_profiling())
|
if (!process->is_profiling())
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue