VirtualBox

Changeset 33141 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 14, 2010 4:35:21 PM (14 years ago)
Author:
vboxsync
Message:

VBoxNetFlt/solaris: fix panic with using fastmutex with preemption disabled.

Location:
trunk/src/VBox/HostDrivers/VBoxNetFlt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFltInternal.h

    r30119 r33141  
    208208            RTMAC MacAddr;
    209209            /** Mutex protection used for loopback. */
    210             RTSEMFASTMUTEX hFastMtx;
     210            kmutex_t hMtx;
    211211            /** Mutex protection used for dynamic IPv6 attaches. */
    212212            RTSEMFASTMUTEX hPollMtx;
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c

    r32773 r33141  
    909909        vboxnetflt_promisc_stream_t *pPromiscStream = (vboxnetflt_promisc_stream_t *)pStream;
    910910
    911         int rc = RTSemFastMutexRequest(pStream->pThis->u.s.hFastMtx);
    912         AssertRCReturn(rc, rc);
     911        mutex_enter(&pStream->pThis->u.s.hMtx);
    913912
    914913        /*
     
    938937#endif
    939938
    940         RTSemFastMutexRelease(pStream->pThis->u.s.hFastMtx);
     939        mutex_exit(&pStream->pThis->u.s.hMtx);
    941940    }
    942941
     
    30643063        return VERR_NET_MSG_SIZE;
    30653064
    3066     int rc = RTSemFastMutexRequest(pThis->u.s.hFastMtx);
    3067     AssertRCReturn(rc, rc);
     3065    int rc = VINF_SUCCESS;
     3066    mutex_enter(&pThis->u.s.hMtx);
    30683067
    30693068    PVBOXNETFLTPACKETID pCur = NULL;
     
    31563155    }
    31573156
    3158     RTSemFastMutexRelease(pThis->u.s.hFastMtx);
     3157    mutex_exit(&pThis->u.s.hMtx);
    31593158
    31603159    return rc;
     
    31893188        return false;
    31903189
    3191     int rc = RTSemFastMutexRequest(pThis->u.s.hFastMtx);
    3192     AssertRCReturn(rc, rc);
     3190    mutex_enter(&pThis->u.s.hMtx);
    31933191
    31943192    PVBOXNETFLTPACKETID pPrev = NULL;
     
    32473245
    32483246    LogFlow((DEVICE_NAME ":vboxNetFltSolarisIsOurMBlk returns %d.\n", fIsOurPacket));
    3249     RTSemFastMutexRelease(pThis->u.s.hFastMtx);
     3247    mutex_exit(&pThis->u.s.hMtx);
    32503248    return fIsOurPacket;
    32513249}
     
    36973695    vboxNetFltSolarisDetachFromInterface(pThis);
    36983696
    3699     if (pThis->u.s.hFastMtx != NIL_RTSEMFASTMUTEX)
    3700     {
    3701         RTSemFastMutexDestroy(pThis->u.s.hFastMtx);
    3702         pThis->u.s.hFastMtx = NIL_RTSEMFASTMUTEX;
    3703     }
     3697    return VINF_SUCCESS;
     3698}
     3699
     3700
     3701int  vboxNetFltOsConnectIt(PVBOXNETFLTINS pThis)
     3702{
     3703    /* Nothing to do here. */
     3704    return VINF_SUCCESS;
     3705}
     3706
     3707
     3708void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis)
     3709{
     3710    LogFlowFunc((DEVICE_NAME ":vboxNetFltOsDeleteInstance pThis=%p\n", pThis));
     3711
     3712    mutex_destroy(&pThis->u.s.hMtx);
    37043713
    37053714#ifdef VBOXNETFLT_SOLARIS_IPV6_POLLING
     
    37113720#endif
    37123721
    3713     return VINF_SUCCESS;
    3714 }
    3715 
    3716 
    3717 int  vboxNetFltOsConnectIt(PVBOXNETFLTINS pThis)
    3718 {
    3719     /* Nothing to do here. */
    3720     return VINF_SUCCESS;
    3721 }
    3722 
    3723 
    3724 void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis)
    3725 {
    3726     LogFlowFunc((DEVICE_NAME ":vboxNetFltOsDeleteInstance pThis=%p\n", pThis));
    3727     /* Nothing to do here. */
    37283722}
    37293723
     
    37363730     * Mutex used for loopback lockouts.
    37373731     */
    3738     int rc = RTSemFastMutexCreate(&pThis->u.s.hFastMtx);
     3732    int rc = VINF_SUCCESS;
     3733    mutex_init(&pThis->u.s.hMtx, NULL /* name */, MUTEX_DRIVER, NULL /* cookie */);
     3734#ifdef VBOXNETFLT_SOLARIS_IPV6_POLLING
     3735    rc = RTSemFastMutexCreate(&pThis->u.s.hPollMtx);
    37393736    if (RT_SUCCESS(rc))
    37403737    {
     3738#endif
     3739        rc = vboxNetFltSolarisAttachToInterface(pThis);
     3740        if (RT_SUCCESS(rc))
     3741            return rc;
     3742
     3743        LogRel((DEVICE_NAME ":vboxNetFltSolarisAttachToInterface failed. rc=%Rrc\n", rc));
     3744
    37413745#ifdef VBOXNETFLT_SOLARIS_IPV6_POLLING
    3742         rc = RTSemFastMutexCreate(&pThis->u.s.hPollMtx);
    3743         if (RT_SUCCESS(rc))
    3744         {
     3746        RTSemFastMutexDestroy(pThis->u.s.hPollMtx);
     3747        pThis->u.s.hPollMtx = NIL_RTSEMFASTMUTEX;
     3748    }
     3749    else
     3750        LogRel((DEVICE_NAME ":vboxNetFltOsInitInstance failed to create poll mutex. rc=%Rrc\n", rc));
    37453751#endif
    3746             rc = vboxNetFltSolarisAttachToInterface(pThis);
    3747             if (RT_SUCCESS(rc))
    3748                 return rc;
    3749 
    3750             LogRel((DEVICE_NAME ":vboxNetFltSolarisAttachToInterface failed. rc=%Rrc\n", rc));
    3751 
    3752 #ifdef VBOXNETFLT_SOLARIS_IPV6_POLLING
    3753             RTSemFastMutexDestroy(pThis->u.s.hPollMtx);
    3754             pThis->u.s.hPollMtx = NIL_RTSEMFASTMUTEX;
    3755         }
    3756         else
    3757             LogRel((DEVICE_NAME ":vboxNetFltOsInitInstance failed to create poll mutex. rc=%Rrc\n", rc));
    3758 #endif
    3759 
    3760         RTSemFastMutexDestroy(pThis->u.s.hFastMtx);
    3761         pThis->u.s.hFastMtx = NIL_RTSEMFASTMUTEX;
    3762     }
    3763     else
    3764         LogRel((DEVICE_NAME ":vboxNetFltOsInitInstance failed to create mutex. rc=%Rrc\n", rc));
     3752
     3753    mutex_destroy(&pThis->u.s.hMtx);
    37653754
    37663755    NOREF(pvContext);
     
    37813770    pThis->u.s.fAttaching = false;
    37823771    pThis->u.s.fVLAN = false;
    3783     pThis->u.s.hFastMtx = NIL_RTSEMFASTMUTEX;
    37843772#ifdef VBOXNETFLT_SOLARIS_IPV6_POLLING
    37853773    pThis->u.s.hPollMtx = NIL_RTSEMFASTMUTEX;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette