Skip to content

Commit 796aa0f

Browse files
committed
[NTOSKRNL]
Fix lock/unlock order in SeLockSubjectContext/SeUnlockSubjectContext. Patch by Volodymyr Shcherbyna. CORE-11966 #resolve #comment Thanks a lot! svn path=/trunk/; revision=72644
1 parent e44c624 commit 796aa0f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

reactos/ntoskrnl/se/access.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,14 @@ SeUnlockSubjectContext(IN PSECURITY_SUBJECT_CONTEXT SubjectContext)
338338
PrimaryToken = SubjectContext->PrimaryToken;
339339
ClientToken = SubjectContext->ClientToken;
340340

341+
/* Unlock the impersonation one if it's there */
342+
if (ClientToken)
343+
{
344+
SepReleaseTokenLock(ClientToken);
345+
}
346+
341347
/* Always unlock the primary one */
342348
SepReleaseTokenLock(PrimaryToken);
343-
344-
/* Unlock the impersonation one if it's there */
345-
if (!ClientToken) return;
346-
SepReleaseTokenLock(ClientToken);
347349
}
348350

349351
/*

0 commit comments

Comments
 (0)