[ros-diffs] [fireball] 39847: - Add privileges check to SystemTimeAdjustmentInformation SSI routine. Spotted by Dmitry Chapyshev.

fireball at svn.reactos.org fireball at svn.reactos.org
Mon Mar 2 20:57:28 CET 2009


Author: fireball
Date: Mon Mar  2 22:57:27 2009
New Revision: 39847

URL: http://svn.reactos.org/svn/reactos?rev=39847&view=rev
Log:
- Add privileges check to SystemTimeAdjustmentInformation SSI routine. Spotted by Dmitry Chapyshev.

Modified:
    trunk/reactos/ntoskrnl/ex/sysinfo.c

Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=39847&r1=39846&r2=39847&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Mon Mar  2 22:57:27 2009
@@ -1440,6 +1440,7 @@
 
 SSI_DEF(SystemTimeAdjustmentInformation)
 {
+    KPROCESSOR_MODE PreviousMode = KeGetPreviousMode();
     /*PSYSTEM_SET_TIME_ADJUST_INFORMATION TimeInfo =
         (PSYSTEM_SET_TIME_ADJUST_INFORMATION)Buffer;*/
 
@@ -1447,7 +1448,15 @@
     if (sizeof(SYSTEM_SET_TIME_ADJUST_INFORMATION) != Size)
         return STATUS_INFO_LENGTH_MISMATCH;
 
-    /* TODO: Check privileges */
+    /* Check who is calling */
+    if (PreviousMode != KernelMode)
+    {
+        /* Check access rights */
+        if (!SeSinglePrivilegeCheck(SeSystemtimePrivilege, PreviousMode))
+        {
+            return STATUS_PRIVILEGE_NOT_HELD;
+        }
+    }
 
     /* TODO: Set time adjustment information */
     DPRINT1("Setting of SystemTimeAdjustmentInformation is not implemented yet!\n");



More information about the Ros-diffs mailing list