Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop USB enumeration in case a malformed descriptor is found (microso…
…ft#410) ## Description When parsing interface descriptors for an attached USB device, the USB bus driver correctly handles cases where a device has a malformed interface . `UsbParseInterfaceDesc` returns `NULL` in such cases. `UsbParseConfigDesc` which parses interface descriptors, stops parsing in case `UsbParseInterfaceDesc` returns NULL but still returns `EFI_SUCCESS` along with a partially filled `USB_CONFIG_DESC` structure. This causes access exceptions when attempts are made subsequently to communicate with the downstream device (for e.g. during endpoint configuration) as the driver does not have valid interface descriptor structures associated with the device. To fix this, `UsbParseConfigDesc` should take the error path in cases where `UsbParseInterfaceDesc` returns NULL and abandon enumerating the device. This will allow a platform to boot instead of crashing when a buggy USB device is attached to it. - [x] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? ## How This Was Tested Tested on a platform with a USB keyboard that returns a malformed USB interface descriptor. The platform fails to boot with an access violation exception without this fix. ## Integration Instructions Updating to the latest MU_BASECORE will automatically include this fix if the UsbBus DXE driver is included in the fdf/dscs.
- Loading branch information