mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[NTOS:OB] Validate ACCESS_SYSTEM_SECURITY in ObpIncrementHandleCount
Validate ACCESS_SYSTEM_SECURITY access requests when creating a new handle in ObpIncrementHandleCount. - Check for SeSecurityPrivilege (with SeSinglePrivilegeCheck) when a caller requests ACCESS_SYSTEM_SECURITY on handle creation. - Take away ACCESS_SYSTEM_SECURITY from RemainingDesiredAccess / PreviouslyGrantedAccess if the privilege isn't held.
This commit is contained in:
committed by
George Bișoc
parent
8dc41c663d
commit
c9780d9095
+11
-2
@@ -954,8 +954,17 @@ ObpIncrementHandleCount(IN PVOID Object,
|
||||
/* Check if the caller is trying to access system security */
|
||||
if (AccessState->RemainingDesiredAccess & ACCESS_SYSTEM_SECURITY)
|
||||
{
|
||||
/* FIXME: TODO */
|
||||
DPRINT1("ACCESS_SYSTEM_SECURITY not validated!\n");
|
||||
/* Client must be warranted SeSecurityPrivilege to touch SACLs */
|
||||
if (!SeSinglePrivilegeCheck(SeSecurityPrivilege, ProbeMode))
|
||||
{
|
||||
/* FIXME: Generate an audit alarm, security manager must be alerted */
|
||||
Status = STATUS_PRIVILEGE_NOT_HELD;
|
||||
goto Quickie;
|
||||
}
|
||||
|
||||
/* Privilege held, grant it so the access state reflects reality */
|
||||
AccessState->PreviouslyGrantedAccess |= ACCESS_SYSTEM_SECURITY;
|
||||
AccessState->RemainingDesiredAccess &= ~ACCESS_SYSTEM_SECURITY;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user