VirtualBox

Ignore:
Timestamp:
Sep 3, 2014 7:36:27 AM (10 years ago)
Author:
vboxsync
Message:

SUPDrv: Several fixes, thanks to Mathias Krause.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r52192 r52575  
    719719        return -E2BIG;
    720720    }
    721     if (RT_UNLIKELY(cbBuf != _IOC_SIZE(uCmd) && _IOC_SIZE(uCmd)))
     721    if (RT_UNLIKELY(_IOC_SIZE(uCmd) ? cbBuf != _IOC_SIZE(uCmd) : Hdr.cbIn < sizeof(Hdr)))
    722722    {
    723723        Log(("VBoxDrvLinuxIOCtl: bad ioctl cbBuf=%#x _IOC_SIZE=%#x; uCmd=%#x.\n", cbBuf, _IOC_SIZE(uCmd), uCmd));
     
    736736        return -EFAULT;
    737737    }
     738    if (Hdr.cbIn < cbBuf)
     739        RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbBuf - Hdr.cbIn)
    738740
    739741    /*
    740742     * Process the IOCtl.
    741743     */
    742     rc = supdrvIOCtl(uCmd, &g_DevExt, pSession, pHdr);
     744    rc = supdrvIOCtl(uCmd, &g_DevExt, pSession, pHdr, cbBuf);
    743745
    744746    /*
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