aboutsummaryrefslogtreecommitdiffstats
path: root/docs/linux/external_fuzzing_usb.md
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-09-13 19:30:55 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-09-14 09:55:45 +0200
commitfab7609913c9787bdb79602ff716f5e0d1598c98 (patch)
tree7bd1cebde179e383cbbf5868e5b664c7d0f7e88f /docs/linux/external_fuzzing_usb.md
parent3f1d02b23f99beaf2bf3b06c11642e56578b12ee (diff)
tools/check-whitespace.sh: check for trailing whitespaces
File types that we don't format automatically can end up with such basic untidiness as trailing whitespaces. Check for these. Remove all existing precedents.
Diffstat (limited to 'docs/linux/external_fuzzing_usb.md')
-rw-r--r--docs/linux/external_fuzzing_usb.md82
1 files changed, 41 insertions, 41 deletions
diff --git a/docs/linux/external_fuzzing_usb.md b/docs/linux/external_fuzzing_usb.md
index 226576ec1..1309bf5ba 100644
--- a/docs/linux/external_fuzzing_usb.md
+++ b/docs/linux/external_fuzzing_usb.md
@@ -151,48 +151,48 @@ These instructions describe how to set this up on a Raspberry Pi Zero W, but any
9. Download syzkaller, apply the patch below and build `syz-executor`:
- ``` c
- diff --git a/executor/common_usb.h b/executor/common_usb.h
- index e342d808..278c2f4e 100644
- --- a/executor/common_usb.h
- +++ b/executor/common_usb.h
- @@ -269,9 +269,7 @@ static volatile long syz_usb_connect(volatile long a0, volatile long a1, volatil
-
- // TODO: consider creating two dummy_udc's per proc to increace the chance of
- // triggering interaction between multiple USB devices within the same program.
- - char device[32];
- - sprintf(&device[0], "dummy_udc.%llu", procid);
- - rv = usb_raw_init(fd, speed, "dummy_udc", &device[0]);
- + rv = usb_raw_init(fd, speed, "20980000.usb", "20980000.usb");
- if (rv < 0) {
- debug("syz_usb_connect: usb_raw_init failed with %d\n", rv);
- return rv;
- diff --git a/executor/executor.cc b/executor/executor.cc
- index 34949a01..1afcb288 100644
- --- a/executor/executor.cc
- +++ b/executor/executor.cc
- @@ -604,8 +604,8 @@ retry:
- call_extra_cover = true;
- }
- if (strncmp(syscalls[call_num].name, "syz_usb_connect", strlen("syz_usb_connect")) == 0) {
- - prog_extra_timeout = 2000;
- - call_extra_timeout = 2000;
- + prog_extra_timeout = 5000;
- + call_extra_timeout = 5000;
- }
- if (strncmp(syscalls[call_num].name, "syz_usb_control_io", strlen("syz_usb_control_io")) == 0)
- call_extra_timeout = 300;
- ```
+``` c
+diff --git a/executor/common_usb.h b/executor/common_usb.h
+index e342d808..278c2f4e 100644
+--- a/executor/common_usb.h
++++ b/executor/common_usb.h
+@@ -269,9 +269,7 @@ static volatile long syz_usb_connect(volatile long a0, volatile long a1, volatil
+
+ // TODO: consider creating two dummy_udc's per proc to increace the chance of
+ // triggering interaction between multiple USB devices within the same program.
+- char device[32];
+- sprintf(&device[0], "dummy_udc.%llu", procid);
+- rv = usb_raw_init(fd, speed, "dummy_udc", &device[0]);
++ rv = usb_raw_init(fd, speed, "20980000.usb", "20980000.usb");
+ if (rv < 0) {
+ debug("syz_usb_connect: usb_raw_init failed with %d\n", rv);
+ return rv;
+diff --git a/executor/executor.cc b/executor/executor.cc
+index 34949a01..1afcb288 100644
+--- a/executor/executor.cc
++++ b/executor/executor.cc
+@@ -604,8 +604,8 @@ retry:
+ call_extra_cover = true;
+ }
+ if (strncmp(syscalls[call_num].name, "syz_usb_connect", strlen("syz_usb_connect")) == 0) {
+- prog_extra_timeout = 2000;
+- call_extra_timeout = 2000;
++ prog_extra_timeout = 5000;
++ call_extra_timeout = 5000;
+ }
+ if (strncmp(syscalls[call_num].name, "syz_usb_control_io", strlen("syz_usb_control_io")) == 0)
+ call_extra_timeout = 300;
+```
- ``` bash
- go get -u -d github.com/google/syzkaller/prog
- cd ~/gopath/src/github.com/google/syzkaller
- # Put the patch above into ./syzkaller.patch
- git apply ./syzkaller.patch
- make executor
- mkdir ~/syz-bin
- cp bin/linux_arm/syz-executor ~/syz-bin/
- ```
+``` bash
+go get -u -d github.com/google/syzkaller/prog
+cd ~/gopath/src/github.com/google/syzkaller
+# Put the patch above into ./syzkaller.patch
+git apply ./syzkaller.patch
+make executor
+mkdir ~/syz-bin
+cp bin/linux_arm/syz-executor ~/syz-bin/
+```
10. Build `syz-execprog` on your host machine for arm32 with `make TARGETARCH=arm execprog` and copy to `~/syz-bin` onto the SD card. You may try building syz-execprog on the Raspberry Pi itself, but that worked poorly for me due to large memory consumption during the compilation process.