From 642a54919100eab4b0a7cdd96f59276de78b73e7 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Mon, 2 Mar 2009 19:57:27 +0000 Subject: [PATCH] - Add privileges check to SystemTimeAdjustmentInformation SSI routine. Spotted by Dmitry Chapyshev. svn path=/trunk/; revision=39847 --- reactos/ntoskrnl/ex/sysinfo.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/ex/sysinfo.c b/reactos/ntoskrnl/ex/sysinfo.c index ba0943c08f3..4036a5d8e6a 100644 --- a/reactos/ntoskrnl/ex/sysinfo.c +++ b/reactos/ntoskrnl/ex/sysinfo.c @@ -1440,6 +1440,7 @@ QSI_DEF(SystemTimeAdjustmentInformation) SSI_DEF(SystemTimeAdjustmentInformation) { + KPROCESSOR_MODE PreviousMode = KeGetPreviousMode(); /*PSYSTEM_SET_TIME_ADJUST_INFORMATION TimeInfo = (PSYSTEM_SET_TIME_ADJUST_INFORMATION)Buffer;*/ @@ -1447,7 +1448,15 @@ SSI_DEF(SystemTimeAdjustmentInformation) 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");