aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-usbgen
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2019-09-19 16:11:58 +0200
committerAndrey Konovalov <andreyknvl@gmail.com>2019-09-19 16:20:57 +0200
commit532aca508a1c9dd2529fdb0b1596e050a1b80045 (patch)
tree88911186d5e3818cd5104f4aada3cc84e8acbfad /tools/syz-usbgen
parent2dd371a3b14d0d8fe6afcd8bcda65d5575c0bf3d (diff)
tools/syz-usbgen: handle USB_DT_DEVICE_QUALIFIER in keyboard.c
Diffstat (limited to 'tools/syz-usbgen')
-rw-r--r--tools/syz-usbgen/keyboard.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/syz-usbgen/keyboard.c b/tools/syz-usbgen/keyboard.c
index 2a6015d4e..eed256c52 100644
--- a/tools/syz-usbgen/keyboard.c
+++ b/tools/syz-usbgen/keyboard.c
@@ -200,6 +200,18 @@ struct usb_device_descriptor usb_device = {
.bNumConfigurations = 1,
};
+struct usb_qualifier_descriptor usb_qualifier = {
+ .bLength = sizeof(struct usb_qualifier_descriptor),
+ .bDescriptorType = USB_DT_DEVICE_QUALIFIER,
+ .bcdUSB = __constant_cpu_to_le16(0x0200),
+ .bDeviceClass = 0,
+ .bDeviceSubClass = 0,
+ .bDeviceProtocol = 0,
+ .bMaxPacketSize0 = MAX_PACKET_SIZE,
+ .bNumConfigurations = 1,
+ .bRESERVED = 0,
+};
+
struct usb_config_descriptor usb_config = {
.bLength = USB_DT_CONFIG_SIZE,
.bDescriptorType = USB_DT_CONFIG,
@@ -540,6 +552,10 @@ int keyboard_connect(int fd) {
memcpy(&response.data[0], &usb_device, sizeof(usb_device));
response.inner.length = sizeof(usb_device);
goto reply;
+ case USB_DT_DEVICE_QUALIFIER:
+ memcpy(&response.data[0], &usb_qualifier, sizeof(usb_qualifier));
+ response.inner.length = sizeof(usb_qualifier);
+ goto reply;
case USB_DT_CONFIG:
config_length = build_config(&response.data[0], sizeof(response.data));
response.inner.length = config_length;