locked
WFP Callout crash with SYSTEM_SERVICE_EXCEPTION RRS feed

  • Question

  • Hi,

    I've written a WFP Callout Driver that Add Data to some packets by some of our logic.

    I've tested the driver on Win7 x64, and Winddk8.0 (CoInstaller 6.1 , KMDF, 1.9)

    In my VM everything run's smoothly, but when i test the driver on physical machine i have here, i get BugCheck 0x3b (SYSTEM_SERVICE_EXCEPTION). I couldn't understand why would i get such error, and couldn't find much info about it online.

    I hope you guys could help me understand what am i doing wrong.. 

    Explanation: 

    The EvtIoWrite function get's a buffer from a userspace program and add the buffer to a linked list of buffer's to be used by the CallOut-Driver.

    The bugcheck occur's on the ExInterlockedInsertTailList line.

    As i said before on VM, i dont get any error, but on a physical Windows 7 x64 i get a bugcheck.

    FileEvtIoWrite(
        IN WDFQUEUE         Queue,
        IN WDFREQUEST       Request,
        IN size_t            Length
        )
    /*++

    {
    PVOID currMem;
    NTSTATUS status = STATUS_SUCCESS;
    PMY_DATA newData;
    size_t DataSize;

    PAGED_CODE ();

    //WdfRequestGetParameters(Request,

    newData = (PMY_DATA)ExAllocatePool
    (NonPagedPool,sizeof(MY_DATA));

    status = WdfRequestRetrieveInputBuffer(Request,1,&currMem,&DataSize);
    if (NT_SUCCESS(status))
    {
    newData->DATA =(PUCHAR)ExAllocatePool(NonPagedPool,DataSize);
    RtlCopyMemory(newData->DATA,currMem,DataSize);
    newData->size=DataSize;

    ExInterlockedInsertTailList(&DataListHead,&(newData->ListEntry),&QueueLock);
    }

        WdfRequestComplete(Request, status);
    }


    Kind Regards, Yechiel Levi

    Wednesday, June 13, 2012 8:51 PM

All replies

  • Please provide a stack trace and a download location with a kernel dump.  There is not much we can do with just the information provided.  You can send the information to DHarper AT Microsoft DOT com.

    Every time you operate on DataListHead, are you using the ExInterlocked version of the API (ExInterlockedInsertTailList, ExInterlockedRemoveHeadList, etc.)

    My guess is this is pool corruption, and you should enable driver verifier on your driver.  (http://msdn.microsoft.com/en-us/library/windows/hardware/ff545448(v=vs.85).aspx)

    Thanks


    Dusty Harper [MSFT]
    Microsoft Corporation
    ------------------------------------------------------------
    This posting is provided "AS IS", with NO warranties and confers NO rights
    ------------------------------------------------------------

    Friday, June 15, 2012 3:09 PM
    Moderator