From 4fa843531062032244070beb68f9694b2b481a6a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 12 Jan 2021 19:33:02 +0100 Subject: [PATCH] Kernel: Use current process EUID in doing profiling access control --- Kernel/Syscalls/profiling.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/Syscalls/profiling.cpp b/Kernel/Syscalls/profiling.cpp index 7d69f6ba22..679a76e422 100644 --- a/Kernel/Syscalls/profiling.cpp +++ b/Kernel/Syscalls/profiling.cpp @@ -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;