From 4dc46dd6c9fe46bd03530157aa1998dd76260890 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Wed, 18 Sep 2019 13:39:44 +0200 Subject: docs: fix USB Raspberry Pi instructions --- docs/linux/external_fuzzing_usb.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'docs/linux/external_fuzzing_usb.md') diff --git a/docs/linux/external_fuzzing_usb.md b/docs/linux/external_fuzzing_usb.md index f82061691..1ed9ce8cd 100644 --- a/docs/linux/external_fuzzing_usb.md +++ b/docs/linux/external_fuzzing_usb.md @@ -241,11 +241,30 @@ These instructions describe how to set this up on a Raspberry Pi Zero W, but any ``` bash # Connect the board to some USB host. wget https://raw.githubusercontent.com/google/syzkaller/up-usb-docs/tools/syz-usbgen/keyboard.c + # Apply the patch below. gcc keyboard.c -o keyboard sudo ./keyboard # Make sure you see the letter 'x' being entered on the host. ``` + ``` c + diff --git a/tools/syz-usbgen/keyboard.c b/tools/syz-usbgen/keyboard.c + index 2a6015d4..3ebd1e03 100644 + --- a/tools/syz-usbgen/keyboard.c + +++ b/tools/syz-usbgen/keyboard.c + @@ -95,8 +95,8 @@ int usb_fuzzer_open() { + void usb_fuzzer_init(int fd, enum usb_device_speed speed) { + struct usb_fuzzer_init arg; + arg.speed = speed; + - arg.driver_name = "dummy_udc"; + - arg.device_name = "dummy_udc.0"; + + arg.driver_name = "20980000.usb"; + + arg.device_name = "20980000.usb"; + int rv = ioctl(fd, USB_FUZZER_IOCTL_INIT, &arg); + if (rv != 0) { + perror("ioctl(USB_FUZZER_IOCTL_INIT)"); + ``` + 17. You should now be able to execute syzkaller USB programs: ``` bash -- cgit mrf-deployment