sys: FspBufferUserBuffer: special case Irp->UserBuffer kernel address

This commit is contained in:
Bill Zissimopoulos 2020-10-30 15:39:56 -07:00
parent 90bc12132e
commit 912703cd77
No known key found for this signature in database
GPG Key ID: 3D4F95D52C7B3EA3

View File

@ -608,6 +608,13 @@ NTSTATUS FspBufferUserBuffer(PIRP Irp, ULONG Length, LOCK_OPERATION Operation)
if (0 == Length || 0 != Irp->AssociatedIrp.SystemBuffer)
return STATUS_SUCCESS;
if (KernelMode == Irp->RequestorMode &&
(PUINT8)MM_SYSTEM_RANGE_START <= (PUINT8)Irp->UserBuffer)
{
Irp->AssociatedIrp.SystemBuffer = Irp->UserBuffer;
return STATUS_SUCCESS;
}
PVOID SystemBuffer = FspAllocNonPagedExternal(Length);
if (0 == SystemBuffer)
return STATUS_INSUFFICIENT_RESOURCES;