[NTOS:CM] Do not acquire a KCB lock twice when deleting a key object

This prevents a deadlock in DelistKeyBodyFromKCB when we delete a key
object because of an access check failure during a open procedure of a
registry key, as we are already holding a lock against the target KCB of
the key body.
This commit is contained in:
George Bișoc
2023-10-01 20:06:02 +02:00
parent 697a52aa33
commit 7fd6f86803
+1 -1
View File
@@ -138,7 +138,7 @@ CmpDeleteKeyObject(PVOID DeletedObject)
if (Kcb)
{
/* Delist the key */
DelistKeyBodyFromKCB(KeyBody, FALSE);
DelistKeyBodyFromKCB(KeyBody, KeyBody->KcbLocked);
/* Dereference the KCB */
CmpDelayDerefKeyControlBlock(Kcb);