Windows Driver: Protect captured subject context during processing of user access token.

This commit is contained in:
Mounir IDRASSI 2015-08-29 23:25:34 +02:00
parent 2f2cb6b7ae
commit dc6c279339

View File

@ -2653,6 +2653,7 @@ NTSTATUS MountDevice (PDEVICE_OBJECT DeviceObject, MOUNT_STRUCT *mount)
PACCESS_TOKEN accessToken;
SeCaptureSubjectContext (&subContext);
SeLockSubjectContext(&subContext);
accessToken = SeQuerySubjectContextToken (&subContext);
if (!accessToken)
@ -2678,6 +2679,7 @@ NTSTATUS MountDevice (PDEVICE_OBJECT DeviceObject, MOUNT_STRUCT *mount)
}
}
SeUnlockSubjectContext(&subContext);
SeReleaseSubjectContext (&subContext);
if (NT_SUCCESS (ntStatus))