Pārlūkot izejas kodu

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

Andreas Kling 5 gadi atpakaļ
vecāks
revīzija
1cddb1055f
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  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;