VirtualBox

Changeset 100517 in vbox for trunk/src/VBox/Devices/USB


Ignore:
Timestamp:
Jul 11, 2023 2:54:11 PM (17 months ago)
Author:
vboxsync
Message:

VUSB: Explicitly ignore any high bits of a USB address which is a 7-bit quantity (see bugref:10433).

Location:
trunk/src/VBox/Devices/USB
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/VUSBDevice.cpp

    r99739 r100517  
    513513        LogFlow(("vusbDevStdReqSetAddress: error: %s: invalid device state %d !!!\n", pDev->pUsbIns->pszName, enmState));
    514514        return false;
     515    }
     516
     517    /*
     518     * If wValue has any bits set beyond 0-6, throw them away.
     519     */
     520    if ((pSetup->wValue & VUSB_ADDRESS_MASK) != pSetup->wValue) {
     521        LogRelMax(10, ("VUSB: %s: Warning: Ignoring high bits of requested address (wLength=0x%X), using only lower 7 bits.\n",
     522                       pDev->pUsbIns->pszName, pSetup->wValue));
     523
     524        pSetup->wValue &= VUSB_ADDRESS_MASK;
    515525    }
    516526
     
    10301040    }
    10311041
     1042    /* Paranoia. */
     1043    Assert((u8Address & VUSB_ADDRESS_MASK) == u8Address);
     1044    u8Address &= VUSB_ADDRESS_MASK;
     1045
    10321046    /*
    10331047     * Ok, get on with it.
  • trunk/src/VBox/Devices/USB/VUSBInternal.h

    r99739 r100517  
    7878#define VUSB_DEFAULT_ADDRESS        0
    7979#define VUSB_INVALID_ADDRESS        UINT8_C(0xff)
     80#define VUSB_ADDRESS_MASK           UINT8_C(0x7f)
    8081/** @} */
    8182
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