[NTOS:CM]

- Do not allow the creation of keys in the master hive. Fixes boot with the VMware sound driver from rapps installed (and it works, too).
CORE-5381 #resolve

svn path=/trunk/; revision=66905
This commit is contained in:
Thomas Faber 2015-03-26 17:02:31 +00:00
parent 1b8371f95e
commit d4956b9c39
3 changed files with 13 additions and 1 deletions

View file

@ -1266,6 +1266,11 @@ CmpParseKey(IN PVOID ParseObject,
ParentKcb,
Object);
}
else if (Hive == &CmiVolatileHive->Hive && CmpNoVolatileCreates)
{
/* Creating keys in the master hive is not allowed */
Status = STATUS_INVALID_PARAMETER;
}
else
{
/* Do the create */

View file

@ -29,6 +29,7 @@ BOOLEAN CmpSpecialBootCondition;
BOOLEAN CmpNoWrite;
BOOLEAN CmpWasSetupBoot;
BOOLEAN CmpProfileLoaded;
BOOLEAN CmpNoVolatileCreates;
ULONG CmpTraceLevel = 0;
extern LONG CmpFlushStarveWriters;
@ -1470,8 +1471,10 @@ CmpInitializeHiveList(IN USHORT Flag)
L"\\Registry\\Machine\\SAM\\SAM");
/* Link S-1-5-18 to .Default */
CmpNoVolatileCreates = FALSE;
CmpLinkKeyToHive(L"\\Registry\\User\\S-1-5-18",
L"\\Registry\\User\\.Default");
CmpNoVolatileCreates = TRUE;
}
BOOLEAN
@ -1530,7 +1533,7 @@ CmInitSystem1(VOID)
}
/* Build the master hive */
Status = CmpInitializeHive((PCMHIVE*)&CmiVolatileHive,
Status = CmpInitializeHive(&CmiVolatileHive,
HINIT_CREATE,
HIVE_VOLATILE,
HFILE_TYPE_PRIMARY,
@ -1602,6 +1605,9 @@ CmInitSystem1(VOID)
/* Close the handle */
NtClose(KeyHandle);
/* After this point, do not allow creating keys in the master hive */
CmpNoVolatileCreates = TRUE;
/* Initialize the system hive */
if (!CmpInitializeSystemHive(KeLoaderBlock))
{

View file

@ -1659,6 +1659,7 @@ extern BOOLEAN CmpSpecialBootCondition;
extern BOOLEAN CmpFlushOnLockRelease;
extern BOOLEAN CmpShareSystemHives;
extern BOOLEAN CmpMiniNTBoot;
extern BOOLEAN CmpNoVolatileCreates;
extern EX_PUSH_LOCK CmpHiveListHeadLock, CmpLoadHiveLock;
extern LIST_ENTRY CmpHiveListHead;
extern POBJECT_TYPE CmpKeyObjectType;