Mdl buffer data getting changed before irp completion

I have a disk lower filter driver, In Read completion, prepare irp to write data to different device.
I am facing some data mismatch issue with vdbench. When I checked the source buffer, the source itself
getting changed. I’m hitting the assert in step 4.

Kindly let me know by any chance the IRP buffer will get modified before completion.

NTSTATUS ReadIrpCompletion (IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PVOID Context)
{

SrcBuffer = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority)

//1. RtlCopyMemory(SrcCopy1, SrcBuffer, length);

//2. Code to copy data to Temp buffer
//3. Prepare IRP to send to different drive in different worker

//4. ASSERT(RtlEqualMemory(SrcCopy1, SrcBuffer, length);

//update io status and info
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return status;

}

How do you know the source changed and not your copy? Run CRC on both before and after.

Probably because of Dummy Pages. See the following article:

https://msdn.microsoft.com/en-us/library/windows/hardware/Dn614012(v=vs.85).aspx

-scott
OSR
@OSRDrivers

Thanks Scott!

Didnt looked into older post regarding MDL dummy pages.
Earlier code we are doing in same method specified in link. We just try to do the same in completion.

Looks like we have to revert back to old approach.

Thanks