Forráskód Böngészése

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

Andreas Kling 5 éve
szülő
commit
1cddb1055f
1 módosított fájl, 3 hozzáadás és 0 törlés
  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);
     REQUIRE_PROMISE(stdio);
 
 
+    if (!is_superuser())
+        return -EPERM;
+
     timespec ts;
     timespec ts;
     if (!validate_read_and_copy_typed(&ts, user_ts))
     if (!validate_read_and_copy_typed(&ts, user_ts))
         return -EFAULT;
         return -EFAULT;