[NTOSKRNL] Disable LUID mapping until it's properly implemented

This commit is contained in:
Pierre Schweitzer 2019-06-01 14:40:24 +02:00
parent 931c72fde5
commit 7898b2eaa3
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B
4 changed files with 13 additions and 1 deletions

View file

@ -1445,6 +1445,7 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","ObjectDirectories",0x00
"\Windows", \
"\RPC Control"
HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","ProtectionMode", 0x00010003, 0x00000001
HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager","LUIDDeviceMapsDisabled", 0x00010003, 0x00000001
; DOS devices
HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices","AUX",0x00000002,"\DosDevices\COM1"

View file

@ -157,7 +157,7 @@ INIT_SECTION CM_SYSTEM_CONTROL_VECTOR CmControlVector[] =
{
L"Session Manager",
L"LUIDDeviceMapsDisabled",
&DummyData,
&ObpLUIDDeviceMapsDisabled,
NULL,
NULL
},

View file

@ -620,6 +620,7 @@ extern WCHAR ObpUnsecureGlobalNamesBuffer[128];
extern ULONG ObpUnsecureGlobalNamesLength;
extern ULONG ObpObjectSecurityMode;
extern ULONG ObpProtectionMode;
extern ULONG ObpLUIDDeviceMapsDisabled;
//
// Inlined Functions

View file

@ -32,6 +32,9 @@ UNICODE_STRING ObpDosDevicesShortName =
WCHAR ObpUnsecureGlobalNamesBuffer[128] = {0};
ULONG ObpUnsecureGlobalNamesLength = sizeof(ObpUnsecureGlobalNamesBuffer);
ULONG ObpLUIDDeviceMapsDisabled;
ULONG ObpLUIDDeviceMapsEnabled;
/* PRIVATE FUNCTIONS *********************************************************/
INIT_FUNCTION
@ -182,6 +185,13 @@ ObpCreateDosDevicesDirectory(VOID)
SECURITY_DESCRIPTOR DosDevicesSD;
NTSTATUS Status;
/*
* Enable LUID mappings only if not explicitely disabled
* and if protection mode is set
*/
if (ObpProtectionMode == 0 || ObpLUIDDeviceMapsDisabled != 0)
ObpLUIDDeviceMapsEnabled = 0;
/* Create a custom security descriptor for the global DosDevices directory */
Status = ObpGetDosDevicesProtection(&DosDevicesSD);
if (!NT_SUCCESS(Status))