[NTOS:OB] Acquire the lock before setting directory's session ID

This commit is contained in:
George Bișoc 2021-09-23 18:11:02 +02:00
parent 0b4763f1b1
commit 19cdb521d2
No known key found for this signature in database
GPG key ID: 688C4FBE25D7DEF6

View file

@ -1849,9 +1849,17 @@ NtSetInformationObject(IN HANDLE ObjectHandle,
NULL); NULL);
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
/* FIXME: Missng locks */ /* Setup a lookup context */
OBP_LOOKUP_CONTEXT LookupContext;
ObpInitializeLookupContext(&LookupContext);
/* Set its session ID */ /* Set its session ID */
ObpAcquireDirectoryLockExclusive(Directory, &LookupContext);
Directory->SessionId = PsGetCurrentProcessSessionId(); Directory->SessionId = PsGetCurrentProcessSessionId();
ObpReleaseDirectoryLock(Directory, &LookupContext);
/* We're done, release the context and dereference the directory */
ObpReleaseLookupContext(&LookupContext);
ObDereferenceObject(Directory); ObDereferenceObject(Directory);
} }
} }