浏览代码

Kernel: Only allow superuser to call sys$clock_settime()

Andreas Kling 5 年之前
父节点
当前提交
1cddb1055f
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Kernel/Process.cpp

+ 3 - 0
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;