Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTFSD

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

Bug in Windows Sandbox? Blue screen crash

Doug_NDoug_N Member - All Emails Posts: 103
edited March 19 in NTFSD

I'm always suspicious when someone claims a bug in Windows, but as far as I can tell, this code meets all documented requirements. If I'm wrong, please show me.

This minifilter code has worked for many years, but as soon as a Windows 10 computer starts Windows Sandbox, a page fault happens.

PostOperationCallback(PFLT_CALLBACK_DATA Data...)
{
    switch(Data->Iopb->MajorFunction)
    {
    case IRP_MJ_CREATE:
        {
            PECP_LIST EcpList = NULL;
            if (KeGetCurrentIrql() <= APC_LEVEL)
            {
                NTSTATUS status = FltGetEcpListFromCallbackData(Filter, Data, &EcpList);
                if((STATUS_SUCCESS == status) && (NULL != EcpList))
                {
                    SRV_OPEN_ECP_CONTEXT* pEcpContext = NULL;
                    ULONG EcpContextSize = 0;
                    status = FltFindExtraCreateParameter(Filter, EcpList, &GUID_ECP_SRV_OPEN, (void*)&pEcpContext, &EcpContextSize);
                    if((STATUS_SUCCESS == status) && (NULL != pEcpContext))
                    {
                        if(NULL != pEcpContext->SocketAddress)
                        {
                            switch(pEcpContext->SocketAddress->ss_family)   <---- causes page fault

I'm assuming the SocketAddress is paged out in this specific case, but only when Windows Sandbox is running?

Post edited by Scott_Noone_(OSR) on

Comments

  • Scott_Noone_(OSR)Scott_Noone_(OSR) Administrator Posts: 3,450

    I edited your post to format the code properly...

    What does the !analyze -v say? Also, the output of:

    ?? pEcpContext

    Would be interesting.

    -scott
    OSR

  • Doug_NDoug_N Member - All Emails Posts: 103

    Thanks for the tip Scott.

    ?? pEcpContext
    struct _SRV_OPEN_ECP_CONTEXT * 0xffff818479791158 +0x000 ShareName : 0xffffa28ddeab5658 _UNICODE_STRING "VSMBShare"
    +0x008 SocketAddress : (null)
    +0x010 OplockBlockState : 0 ''
    +0x011 OplockAppState : 0 ''
    +0x012 OplockFinalState : 0 ''

    There is no way that code is crashing with this structure. The customer has to somehow be using the wrong driver because SocketAddress is checked for NULL (there was indeed an earlier bug where it wasn’t checked. Only in the Sandbox have we ever seen it to be null).

    Sorry for the false alarm ☹

    Doug

    P.S. How did you reformat the code? I couldn't see a way to do it (looked at the Markdown link)

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 8,560

    @Doug_N That link in the forum doesn’t provide much help, does it. Why do they point to something with almost no content? I don’t know.

    ANYhow... formatting code can be done in multiple ways, but most easily with what are called fenced code blocks.

    Hope that helps,

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Developing Minifilters 24 May 2021 Live, Online
Writing WDF Drivers 14 June 2021 Live, Online
Internals & Software Drivers 27 September 2021 Live, Online
Kernel Debugging 15 November 2021 Live, Online