Skip to content

Commit

Permalink
Kernel: Don't allow profiling a dead process
Browse files Browse the repository at this point in the history
Work towards SerenityOS#1313.
  • Loading branch information
awesomekling committed Feb 27, 2020
1 parent 79e79ad commit 0c14978
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Kernel/Process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4511,6 +4511,8 @@ int Process::sys$profiling_enable(pid_t pid)
auto* process = Process::from_pid(pid);
if (!process)
return -ESRCH;
if (process->is_dead())
return -ESRCH;
if (!is_superuser() && process->uid() != m_uid)
return -EPERM;
Profiling::start(*process);
Expand Down

0 comments on commit 0c14978

Please sign in to comment.