summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-08 22:47:21 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-08 22:47:21 +0200
commit1cddb1055f8e481eccc77a2ac0db4538e2812c1a (patch)
treed91bfeca8e375ce2e0b232ad4efa485c9544eb81 /Kernel
parent652b22ee9cee942632b1a7e91b5042c7178a10f4 (diff)
downloadserenity-1cddb1055f8e481eccc77a2ac0db4538e2812c1a.zip
Kernel: Only allow superuser to call sys$clock_settime()
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Process.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index 35fa98af12..c4231201a9 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -4362,6 +4362,9 @@ int Process::sys$clock_settime(clockid_t clock_id, timespec* user_ts)
{
REQUIRE_PROMISE(stdio);
+ if (!is_superuser())
+ return -EPERM;
+
timespec ts;
if (!validate_read_and_copy_typed(&ts, user_ts))
return -EFAULT;