VirtualBox

Changeset 6948 in vbox


Ignore:
Timestamp:
Feb 14, 2008 1:16:01 PM (17 years ago)
Author:
vboxsync
Message:

Additions/Linux: fixed a copy_to_user/copy_from_user mixmatch in VBOXGUEST_IOCTL_CTL_FILTER_MASK and cleaned up slightly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/module/vboxmod.c

    r6780 r6948  
    321321static int vboxadd_control_filter_mask(VBoxGuestFilterMaskInfo *pInfo)
    322322{
    323     VMMDevCtlGuestFilterMask *pReq;
     323    VMMDevCtlGuestFilterMask *pReq = NULL;
    324324    int rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(*pReq), VMMDevReq_CtlGuestFilterMask);
     325
     326    LogFlow(("VBoxGuestCommonIOCtl: CTL_FILTER_MASK: request received, u32OrMask=0x%x, u32NotMask=0x%x\n", pInfo->u32OrMask, pInfo->u32NotMask));
    325327    if (RT_FAILURE(rc))
    326     {
    327         Log(("VBoxGuestCommonIOCtl: CTL_FILTER_MASK: failed to allocate %u (%#x) bytes to cache the request. rc=%d!!\n",
    328              sizeof(*pReq), sizeof(*pReq), rc));
    329         return rc;
    330     }
    331 
    332     pReq->u32OrMask = pInfo->u32OrMask;
    333     pReq->u32NotMask = pInfo->u32NotMask;
    334 
    335     rc = VbglGRPerform(&pReq->header);
     328        Log(("VBoxGuestCommonIOCtl: CTL_FILTER_MASK: failed to allocate %u (%#x) bytes to cache the request. rc=%d!!\n", sizeof(*pReq), sizeof(*pReq), rc));
     329    else
     330    {
     331        pReq->u32OrMask = pInfo->u32OrMask;
     332        pReq->u32NotMask = pInfo->u32NotMask;
     333        rc = VbglGRPerform(&pReq->header);
     334    }
    336335    if (RT_FAILURE(rc))
    337336        Log(("VBoxGuestCommonIOCtl: CTL_FILTER_MASK: VbglGRPerform failed, rc=%Rrc!\n", rc));
     
    341340        rc = pReq->header.rc;
    342341    }
    343 
    344     VbglGRFree(&pReq->header);
     342    if (pReq)
     343        VbglGRFree(&pReq->header);
    345344    return rc;
    346345}
     
    483482        {
    484483                VBoxGuestFilterMaskInfo info;
    485                 if (copy_to_user((void*)arg, (void*)&info, sizeof(info)))
     484                if (copy_from_user((void*)&info, (void*)arg, sizeof(info)))
    486485                {
    487486                    LogRelFunc(("VBOXGUEST_IOCTL_CTL_FILTER_MASK: error getting parameters from user space!\n"));
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