mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
[NTOSKRNL]: hubris [ˈhjuːbrɪs], hybris n.
1. Belief that Ob is perfect. Fix a major bug which allowed user-mode applications to get kernel handles if they so requested -- of course, they woudl then be completely unable to use such handles. This pattern is seen in Rtl code which we share, and where the intent is to give kernel kernel handles, and user user handles, so OBJ_KERNEL_HANDLE is unconditionally used, which in NT had the right effect. For us though, it gave unusable user-handles. This had the direct effect of completely breaking RtlQueryRegistryValues from user-mode if the TOPKEY or SUBKEY flags were used. svn path=/trunk/; revision=55318
This commit is contained in:
@@ -559,6 +559,7 @@ NTAPI
|
||||
ObpCaptureObjectCreateInformation(
|
||||
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||
IN KPROCESSOR_MODE AccessMode,
|
||||
IN KPROCESSOR_MODE CreatorMode,
|
||||
IN BOOLEAN AllocateFromLookaside,
|
||||
IN POBJECT_CREATE_INFORMATION ObjectCreateInfo,
|
||||
OUT PUNICODE_STRING ObjectName
|
||||
|
||||
@@ -2456,6 +2456,7 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||
|
||||
/* Capture all the info */
|
||||
Status = ObpCaptureObjectCreateInformation(ObjectAttributes,
|
||||
AccessMode,
|
||||
AccessMode,
|
||||
TRUE,
|
||||
&TempBuffer->ObjectCreateInfo,
|
||||
|
||||
@@ -442,10 +442,11 @@ ObpCaptureObjectName(IN OUT PUNICODE_STRING CapturedName,
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
ObpCaptureObjectCreateInformation(IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||
IN KPROCESSOR_MODE AccessMode,
|
||||
IN BOOLEAN AllocateFromLookaside,
|
||||
IN POBJECT_CREATE_INFORMATION ObjectCreateInfo,
|
||||
OUT PUNICODE_STRING ObjectName)
|
||||
IN KPROCESSOR_MODE AccessMode,
|
||||
IN KPROCESSOR_MODE CreatorMode,
|
||||
IN BOOLEAN AllocateFromLookaside,
|
||||
IN POBJECT_CREATE_INFORMATION ObjectCreateInfo,
|
||||
OUT PUNICODE_STRING ObjectName)
|
||||
{
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
PSECURITY_DESCRIPTOR SecurityDescriptor;
|
||||
@@ -479,9 +480,10 @@ ObpCaptureObjectCreateInformation(IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||
_SEH2_YIELD(return STATUS_INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
/* Set some Create Info */
|
||||
/* Set some Create Info and do not allow user-mode kernel handles */
|
||||
ObjectCreateInfo->RootDirectory = ObjectAttributes->RootDirectory;
|
||||
ObjectCreateInfo->Attributes = ObjectAttributes->Attributes;
|
||||
ObjectCreateInfo->Attributes = ObjectAttributes->Attributes & OBJ_VALID_ATTRIBUTES;
|
||||
if (CreatorMode != KernelMode) ObjectCreateInfo->Attributes &= ~OBJ_KERNEL_HANDLE;
|
||||
LocalObjectName = ObjectAttributes->ObjectName;
|
||||
SecurityDescriptor = ObjectAttributes->SecurityDescriptor;
|
||||
SecurityQos = ObjectAttributes->SecurityQualityOfService;
|
||||
@@ -942,6 +944,7 @@ ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL,
|
||||
/* Capture all the info */
|
||||
Status = ObpCaptureObjectCreateInformation(ObjectAttributes,
|
||||
ProbeMode,
|
||||
AccessMode,
|
||||
FALSE,
|
||||
ObjectCreateInfo,
|
||||
&ObjectName);
|
||||
|
||||
Reference in New Issue
Block a user