mirror of
https://github.com/reactos/reactos.git
synced 2025-05-22 02:25:18 +00:00
[NTOSKRNL]
- In case of AssignSecurityDescriptor operation in IopGetSetSecurityObject(), put the security descriptor in cache before attempting the assignement - In IopUnloadDevice(), don't attempt to free the security descriptor, let this to Ob by just derefencing it. Spotted & fixed by Thomas. This unregresses VMware Tools installation. CORE-7991 svn path=/trunk/; revision=65862
This commit is contained in:
parent
3b73052bf8
commit
1c36df367b
2 changed files with 21 additions and 6 deletions
|
@ -396,8 +396,8 @@ IopUnloadDevice(IN PDEVICE_OBJECT DeviceObject)
|
||||||
/* Check if we have a Security Descriptor */
|
/* Check if we have a Security Descriptor */
|
||||||
if (DeviceObject->SecurityDescriptor)
|
if (DeviceObject->SecurityDescriptor)
|
||||||
{
|
{
|
||||||
/* Free it */
|
/* Dereference it */
|
||||||
ExFreePoolWithTag(DeviceObject->SecurityDescriptor, TAG_SD);
|
ObDereferenceSecurityDescriptor(DeviceObject->SecurityDescriptor, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove the device from the list */
|
/* Remove the device from the list */
|
||||||
|
|
|
@ -1551,15 +1551,30 @@ IopGetSetSecurityObject(IN PVOID ObjectBody,
|
||||||
}
|
}
|
||||||
else if (OperationCode == AssignSecurityDescriptor)
|
else if (OperationCode == AssignSecurityDescriptor)
|
||||||
{
|
{
|
||||||
|
Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
/* Make absolutely sure this is a device object */
|
/* Make absolutely sure this is a device object */
|
||||||
if (!(FileObject) || !(FileObject->Flags & FO_STREAM_FILE))
|
if (!(FileObject) || !(FileObject->Flags & FO_STREAM_FILE))
|
||||||
{
|
{
|
||||||
/* Assign the Security Descriptor */
|
PSECURITY_DESCRIPTOR CachedSecurityDescriptor;
|
||||||
DeviceObject->SecurityDescriptor = SecurityDescriptor;
|
|
||||||
|
/* Add the security descriptor in cache */
|
||||||
|
Status = ObLogSecurityDescriptor(SecurityDescriptor, &CachedSecurityDescriptor, 1);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
KeEnterCriticalRegion();
|
||||||
|
ExAcquireResourceExclusiveLite(&IopSecurityResource, TRUE);
|
||||||
|
|
||||||
|
/* Assign the Security Descriptor */
|
||||||
|
DeviceObject->SecurityDescriptor = CachedSecurityDescriptor;
|
||||||
|
|
||||||
|
ExReleaseResourceLite(&IopSecurityResource);
|
||||||
|
KeLeaveCriticalRegion();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return success */
|
/* Return status */
|
||||||
return STATUS_SUCCESS;
|
return Status;
|
||||||
}
|
}
|
||||||
else if (OperationCode == SetSecurityDescriptor)
|
else if (OperationCode == SetSecurityDescriptor)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue