From 5ec502e031c3ca7cad5ac0aa468469b7b9b85d1d Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Sun, 17 Aug 2025 14:53:44 +0000 Subject: tools/usbgen: extract driver names Change the kernel patch and the syz-usbgen tool to split the extracted USB IDs by the driver they belong to. This will allow for a more precise patching of class/driver-specific USB descriptors. Also update USB IDs with Linux kernel 6.16. --- sys/linux/init_vusb.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/linux/init_vusb.go') diff --git a/sys/linux/init_vusb.go b/sys/linux/init_vusb.go index ca645bf45..0c1906819 100644 --- a/sys/linux/init_vusb.go +++ b/sys/linux/init_vusb.go @@ -92,9 +92,9 @@ func (arch *arch) generateUsbDeviceDescriptor(g *prog.Gen, typ0 prog.Type, dir p } func randUsbDeviceID(g *prog.Gen) UsbDeviceID { - totalIds := len(usbIds) / BytesPerUsbID + totalIds := len(usbIdsAll) / BytesPerUsbID idNum := g.Rand().Intn(totalIds) - base := usbIds[idNum*BytesPerUsbID : (idNum+1)*BytesPerUsbID] + base := usbIdsAll[idNum*BytesPerUsbID : (idNum+1)*BytesPerUsbID] p := strings.NewReader(base) var id UsbDeviceID @@ -151,9 +151,9 @@ func (arch *arch) generateUsbHidDeviceDescriptor(g *prog.Gen, typ0 prog.Type, di return } - totalIds := len(hidIds) / BytesPerHidID + totalIds := len(hidIdsAll) / BytesPerHidID idNum := g.Rand().Intn(totalIds) - base := hidIds[idNum*BytesPerHidID : (idNum+1)*BytesPerHidID] + base := hidIdsAll[idNum*BytesPerHidID : (idNum+1)*BytesPerHidID] p := strings.NewReader(base) var id HidDeviceID -- cgit mrf-deployment