[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-03-03 21:21:05 +01:00
parent 697a52aa33
commit 7fd6f86803
No known key found for this signature in database
GPG key ID: 688C4FBE25D7DEF6

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);