mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[NTOS] Add TAG_DACL in tag.h and use it.
This commit is contained in:
parent
33e0a69dad
commit
ab5fdac922
4 changed files with 21 additions and 20 deletions
|
@ -165,6 +165,7 @@
|
||||||
#define TAG_SID_AND_ATTRIBUTES 'aSeS'
|
#define TAG_SID_AND_ATTRIBUTES 'aSeS'
|
||||||
#define TAG_SID_VALIDATE 'vSeS'
|
#define TAG_SID_VALIDATE 'vSeS'
|
||||||
#define TAG_ACCESS_CHECK_RIGHT 'rCeS'
|
#define TAG_ACCESS_CHECK_RIGHT 'rCeS'
|
||||||
|
#define TAG_DACL 'lcaD'
|
||||||
|
|
||||||
/* LPC Tags */
|
/* LPC Tags */
|
||||||
#define TAG_LPC_MESSAGE 'McpL'
|
#define TAG_LPC_MESSAGE 'McpL'
|
||||||
|
|
|
@ -1264,7 +1264,7 @@ MiCreateMemoryEvent(IN PUNICODE_STRING Name,
|
||||||
RtlLengthSid(SeWorldSid);
|
RtlLengthSid(SeWorldSid);
|
||||||
|
|
||||||
/* Allocate space for the DACL */
|
/* Allocate space for the DACL */
|
||||||
Dacl = ExAllocatePoolWithTag(PagedPool, DaclLength, 'lcaD');
|
Dacl = ExAllocatePoolWithTag(PagedPool, DaclLength, TAG_DACL);
|
||||||
if (!Dacl) return STATUS_INSUFFICIENT_RESOURCES;
|
if (!Dacl) return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
|
||||||
/* Setup the ACL inside it */
|
/* Setup the ACL inside it */
|
||||||
|
@ -1314,7 +1314,7 @@ MiCreateMemoryEvent(IN PUNICODE_STRING Name,
|
||||||
FALSE);
|
FALSE);
|
||||||
CleanUp:
|
CleanUp:
|
||||||
/* Free the DACL */
|
/* Free the DACL */
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
|
|
||||||
/* Check if this is the success path */
|
/* Check if this is the success path */
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
|
|
|
@ -476,7 +476,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
/* Create the DACL: we will only allow two SIDs */
|
/* Create the DACL: we will only allow two SIDs */
|
||||||
Count = sizeof(ACL) + (sizeof(ACE) + RtlLengthSid(SeLocalSystemSid)) +
|
Count = sizeof(ACL) + (sizeof(ACE) + RtlLengthSid(SeLocalSystemSid)) +
|
||||||
(sizeof(ACE) + RtlLengthSid(SeAliasAdminsSid));
|
(sizeof(ACE) + RtlLengthSid(SeAliasAdminsSid));
|
||||||
Dacl = ExAllocatePoolWithTag(PagedPool, Count, 'lcaD');
|
Dacl = ExAllocatePoolWithTag(PagedPool, Count, TAG_DACL);
|
||||||
if (Dacl == NULL)
|
if (Dacl == NULL)
|
||||||
{
|
{
|
||||||
ExFreePoolWithTag(Buffer, TAG_MM);
|
ExFreePoolWithTag(Buffer, TAG_MM);
|
||||||
|
@ -487,7 +487,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
Status = RtlCreateAcl(Dacl, Count, ACL_REVISION);
|
Status = RtlCreateAcl(Dacl, Count, ACL_REVISION);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
ExFreePoolWithTag(Buffer, TAG_MM);
|
ExFreePoolWithTag(Buffer, TAG_MM);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -496,7 +496,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
Status = RtlAddAccessAllowedAce(Dacl, ACL_REVISION, FILE_ALL_ACCESS, SeAliasAdminsSid);
|
Status = RtlAddAccessAllowedAce(Dacl, ACL_REVISION, FILE_ALL_ACCESS, SeAliasAdminsSid);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
ExFreePoolWithTag(Buffer, TAG_MM);
|
ExFreePoolWithTag(Buffer, TAG_MM);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -505,7 +505,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
Status = RtlAddAccessAllowedAce(Dacl, ACL_REVISION, FILE_ALL_ACCESS, SeLocalSystemSid);
|
Status = RtlAddAccessAllowedAce(Dacl, ACL_REVISION, FILE_ALL_ACCESS, SeLocalSystemSid);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
ExFreePoolWithTag(Buffer, TAG_MM);
|
ExFreePoolWithTag(Buffer, TAG_MM);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -514,7 +514,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
Status = RtlSetDaclSecurityDescriptor(&SecurityDescriptor, TRUE, Dacl, FALSE);
|
Status = RtlSetDaclSecurityDescriptor(&SecurityDescriptor, TRUE, Dacl, FALSE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
ExFreePoolWithTag(Buffer, TAG_MM);
|
ExFreePoolWithTag(Buffer, TAG_MM);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -573,7 +573,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
SL_OPEN_PAGING_FILE | IO_NO_PARAMETER_CHECKING);
|
SL_OPEN_PAGING_FILE | IO_NO_PARAMETER_CHECKING);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
ExFreePoolWithTag(Buffer, TAG_MM);
|
ExFreePoolWithTag(Buffer, TAG_MM);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -590,7 +590,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ZwClose(FileHandle);
|
ZwClose(FileHandle);
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
ExFreePoolWithTag(Buffer, TAG_MM);
|
ExFreePoolWithTag(Buffer, TAG_MM);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -625,7 +625,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
KeReleaseGuardedMutex(&MmPageFileCreationLock);
|
KeReleaseGuardedMutex(&MmPageFileCreationLock);
|
||||||
ObDereferenceObject(FileObject);
|
ObDereferenceObject(FileObject);
|
||||||
ZwClose(FileHandle);
|
ZwClose(FileHandle);
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
ExFreePoolWithTag(Buffer, TAG_MM);
|
ExFreePoolWithTag(Buffer, TAG_MM);
|
||||||
return STATUS_NOT_FOUND;
|
return STATUS_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
@ -636,7 +636,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
KeReleaseGuardedMutex(&MmPageFileCreationLock);
|
KeReleaseGuardedMutex(&MmPageFileCreationLock);
|
||||||
ObDereferenceObject(FileObject);
|
ObDereferenceObject(FileObject);
|
||||||
ZwClose(FileHandle);
|
ZwClose(FileHandle);
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
ExFreePoolWithTag(Buffer, TAG_MM);
|
ExFreePoolWithTag(Buffer, TAG_MM);
|
||||||
return STATUS_INVALID_PARAMETER_2;
|
return STATUS_INVALID_PARAMETER_2;
|
||||||
}
|
}
|
||||||
|
@ -646,7 +646,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
KeReleaseGuardedMutex(&MmPageFileCreationLock);
|
KeReleaseGuardedMutex(&MmPageFileCreationLock);
|
||||||
ObDereferenceObject(FileObject);
|
ObDereferenceObject(FileObject);
|
||||||
ZwClose(FileHandle);
|
ZwClose(FileHandle);
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
ExFreePoolWithTag(Buffer, TAG_MM);
|
ExFreePoolWithTag(Buffer, TAG_MM);
|
||||||
return STATUS_INVALID_PARAMETER_3;
|
return STATUS_INVALID_PARAMETER_3;
|
||||||
}
|
}
|
||||||
|
@ -657,7 +657,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
KeReleaseGuardedMutex(&MmPageFileCreationLock);
|
KeReleaseGuardedMutex(&MmPageFileCreationLock);
|
||||||
ObDereferenceObject(FileObject);
|
ObDereferenceObject(FileObject);
|
||||||
ZwClose(FileHandle);
|
ZwClose(FileHandle);
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
ExFreePoolWithTag(Buffer, TAG_MM);
|
ExFreePoolWithTag(Buffer, TAG_MM);
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
@ -665,7 +665,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed creating page file: %lx\n", Status);
|
DPRINT1("Failed creating page file: %lx\n", Status);
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
ExFreePoolWithTag(Buffer, TAG_MM);
|
ExFreePoolWithTag(Buffer, TAG_MM);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -676,17 +676,17 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
Status = ZwSetSecurityObject(FileHandle, DACL_SECURITY_INFORMATION, &SecurityDescriptor);
|
Status = ZwSetSecurityObject(FileHandle, DACL_SECURITY_INFORMATION, &SecurityDescriptor);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
|
||||||
ZwClose(FileHandle);
|
ZwClose(FileHandle);
|
||||||
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
ExFreePoolWithTag(Buffer, TAG_MM);
|
ExFreePoolWithTag(Buffer, TAG_MM);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DACL is no longer needed, free it */
|
/* DACL is no longer needed, free it */
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
|
|
||||||
/* FIXME: To enable once page file managment is moved to ARM3 */
|
/* FIXME: To enable once page file management is moved to ARM3 */
|
||||||
#if 0
|
#if 0
|
||||||
/* Check we won't overflow commit limit with the page file */
|
/* Check we won't overflow commit limit with the page file */
|
||||||
if (MmTotalCommitLimitMaximum + (SafeMaximumSize.QuadPart >> PAGE_SHIFT) <= MmTotalCommitLimitMaximum)
|
if (MmTotalCommitLimitMaximum + (SafeMaximumSize.QuadPart >> PAGE_SHIFT) <= MmTotalCommitLimitMaximum)
|
||||||
|
|
|
@ -58,7 +58,7 @@ ObpGetDosDevicesProtection(OUT PSECURITY_DESCRIPTOR SecurityDescriptor)
|
||||||
sizeof(ACE) + RtlLengthSid(SeCreatorOwnerSid);
|
sizeof(ACE) + RtlLengthSid(SeCreatorOwnerSid);
|
||||||
|
|
||||||
/* Allocate the ACL */
|
/* Allocate the ACL */
|
||||||
Dacl = ExAllocatePoolWithTag(PagedPool, AclSize, 'lcaD');
|
Dacl = ExAllocatePoolWithTag(PagedPool, AclSize, TAG_DACL);
|
||||||
if (Dacl == NULL)
|
if (Dacl == NULL)
|
||||||
{
|
{
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
@ -117,7 +117,7 @@ ObpGetDosDevicesProtection(OUT PSECURITY_DESCRIPTOR SecurityDescriptor)
|
||||||
sizeof(ACE) + RtlLengthSid(SeLocalSystemSid);
|
sizeof(ACE) + RtlLengthSid(SeLocalSystemSid);
|
||||||
|
|
||||||
/* Allocate the ACL */
|
/* Allocate the ACL */
|
||||||
Dacl = ExAllocatePoolWithTag(PagedPool, AclSize, 'lcaD');
|
Dacl = ExAllocatePoolWithTag(PagedPool, AclSize, TAG_DACL);
|
||||||
if (Dacl == NULL)
|
if (Dacl == NULL)
|
||||||
{
|
{
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
@ -168,7 +168,7 @@ ObpFreeDosDevicesProtection(OUT PSECURITY_DESCRIPTOR SecurityDescriptor)
|
||||||
ASSERT(NT_SUCCESS(Status));
|
ASSERT(NT_SUCCESS(Status));
|
||||||
ASSERT(DaclPresent);
|
ASSERT(DaclPresent);
|
||||||
ASSERT(Dacl != NULL);
|
ASSERT(Dacl != NULL);
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
ExFreePoolWithTag(Dacl, TAG_DACL);
|
||||||
}
|
}
|
||||||
|
|
||||||
CODE_SEG("INIT")
|
CODE_SEG("INIT")
|
||||||
|
|
Loading…
Reference in a new issue