diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-09-13 19:30:55 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-09-14 09:55:45 +0200 |
| commit | fab7609913c9787bdb79602ff716f5e0d1598c98 (patch) | |
| tree | 7bd1cebde179e383cbbf5868e5b664c7d0f7e88f /docs | |
| parent | 3f1d02b23f99beaf2bf3b06c11642e56578b12ee (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')
| -rw-r--r-- | docs/linux/external_fuzzing_usb.md | 82 | ||||
| -rw-r--r-- | docs/linux/setup_linux-host_android-device_arm-kernel.md | 2 | ||||
| -rw-r--r-- | docs/linux/setup_linux-host_qemu-vm_arm-kernel.md | 4 | ||||
| -rw-r--r-- | docs/linux/setup_linux-host_qemu-vm_arm64-kernel.md | 2 | ||||
| -rw-r--r-- | docs/linux/setup_linux-host_qemu-vm_s390x-kernel.md | 2 | ||||
| -rw-r--r-- | docs/linux/setup_ubuntu-host_odroid-c2-board_arm64-kernel.md | 14 | ||||
| -rw-r--r-- | docs/linux/setup_ubuntu-host_qemu-vm_x86-64-kernel.md | 2 | ||||
| -rw-r--r-- | docs/pseudo_syscalls.md | 2 | ||||
| -rw-r--r-- | docs/syscall_descriptions.md | 2 | ||||
| -rw-r--r-- | docs/syscall_descriptions_syntax.md | 2 | ||||
| -rw-r--r-- | docs/syzbot.md | 6 | ||||
| -rw-r--r-- | docs/trusty/README.md | 2 |
12 files changed, 61 insertions, 61 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. diff --git a/docs/linux/setup_linux-host_android-device_arm-kernel.md b/docs/linux/setup_linux-host_android-device_arm-kernel.md index a4859fdf5..90996637a 100644 --- a/docs/linux/setup_linux-host_android-device_arm-kernel.md +++ b/docs/linux/setup_linux-host_android-device_arm-kernel.md @@ -5,7 +5,7 @@ This document details the steps involved in setting up a syzkaller instance fuzzing an `arm32/64` linux kernel on an Android device. Some features of syzkaller may not yet work properly on `arm32`. For example, not all debugging and test coverage features are available in the Linux kernel for `arm32`, limiting the efficacy of syskaller in finding bugs fast. - + These were tested on an NXP Pico-Pi-IMX7D following the instructions [here](https://developer.android.com/things/hardware/developer-kits.html). You may find additional details in syzkaller's `adb` vm implementation [here](/vm/adb/adb.go). diff --git a/docs/linux/setup_linux-host_qemu-vm_arm-kernel.md b/docs/linux/setup_linux-host_qemu-vm_arm-kernel.md index c88d9a8f6..3745cbcc1 100644 --- a/docs/linux/setup_linux-host_qemu-vm_arm-kernel.md +++ b/docs/linux/setup_linux-host_qemu-vm_arm-kernel.md @@ -5,7 +5,7 @@ Obtain a fresh `arm-linux-gnueabihf-gcc`. Latest Debian distributions provide version 7.2.0, which should be enough. Otherwise you can download Linaro compiler [here](https://www.linaro.org/downloads). - + # Kernel The instructions are tested with `v4.16.1`. Check that you have/backport @@ -77,7 +77,7 @@ debugfs /sys/kernel/debug debugfs defaults 0 0 ``` Then replace `output/target/etc/ssh/sshd_config` with the following contents: - + ``` PermitRootLogin yes PasswordAuthentication yes diff --git a/docs/linux/setup_linux-host_qemu-vm_arm64-kernel.md b/docs/linux/setup_linux-host_qemu-vm_arm64-kernel.md index d4eab5b43..a5148916d 100644 --- a/docs/linux/setup_linux-host_qemu-vm_arm64-kernel.md +++ b/docs/linux/setup_linux-host_qemu-vm_arm64-kernel.md @@ -109,7 +109,7 @@ At the top of /etc/init.d/S50sshd add the following lines: mount -t debugfs none /sys/kernel/debug chmod 777 /sys/kernel/debug/kcov -Comment out the line +Comment out the line /usr/bin/ssh-keygen -A diff --git a/docs/linux/setup_linux-host_qemu-vm_s390x-kernel.md b/docs/linux/setup_linux-host_qemu-vm_s390x-kernel.md index 162016c62..adcb63c75 100644 --- a/docs/linux/setup_linux-host_qemu-vm_s390x-kernel.md +++ b/docs/linux/setup_linux-host_qemu-vm_s390x-kernel.md @@ -75,7 +75,7 @@ Now you should have `vmlinux` (kernel binary) and `bzImage` (packed kernel image ``` bash $ ls $KERNEL/vmlinux $KERNEL/vmlinux -$ ls $KERNEL/arch/s390/boot/bzImage +$ ls $KERNEL/arch/s390/boot/bzImage $KERNEL/arch/s390/boot/bzImage ``` diff --git a/docs/linux/setup_ubuntu-host_odroid-c2-board_arm64-kernel.md b/docs/linux/setup_ubuntu-host_odroid-c2-board_arm64-kernel.md index dfcd2eaa4..6ecf5a894 100644 --- a/docs/linux/setup_ubuntu-host_odroid-c2-board_arm64-kernel.md +++ b/docs/linux/setup_ubuntu-host_odroid-c2-board_arm64-kernel.md @@ -80,7 +80,7 @@ Some message ``` bash $ ssh root@172.16.0.31 - root@172.16.0.31's password: + root@172.16.0.31's password: ... Last login: Thu Feb 11 11:30:51 2016 root@odroid64:~# @@ -93,7 +93,7 @@ This hub has support for a feature called [Per Port Power Switching](http://www. [To be able to open the hub device entry](http://www.janosgyerik.com/adding-udev-rules-for-usb-debugging-android-devices/) under `/dev/` without being root, add the following file to `/etc/udev/rules.d/` on the host machine: ``` bash -$ cat /etc/udev/rules.d/10-local.rules +$ cat /etc/udev/rules.d/10-local.rules SUBSYSTEM=="usb", ATTR{idVendor}=="2001", ATTR{idProduct}=="f103", MODE="0664", GROUP="plugdev" ``` @@ -101,7 +101,7 @@ SUBSYSTEM=="usb", ATTR{idVendor}=="2001", ATTR{idProduct}=="f103", MODE="0664", Don't forget to replug the hub after you add this file. ``` bash -$ lsusb +$ lsusb ... Bus 003 Device 026: ID 2001:f103 D-Link Corp. DUB-H7 7-port USB 2.0 hub ... @@ -159,14 +159,14 @@ index 165cf9783a5d..ff8b40dca9e2 100644 @@ -653,6 +653,11 @@ KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \ # Tell gcc to never replace conditional load with a non-conditional one KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) - + +# Stop gcc from converting switches into a form that defeats dead code +# elimination and can subsequently lead to calls to intentionally +# undefined functions appearing in the final link. +KBUILD_CFLAGS += $(call cc-option,--param=max-fsm-thread-path-insns=1) + include scripts/Makefile.gcc-plugins - + ifdef CONFIG_READABLE_ASM ``` @@ -177,12 +177,12 @@ index 9576775a86f6..8bc4eb36fc1b 100644 --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan @@ -11,7 +11,6 @@ CFLAGS_KASAN_MINIMAL := -fsanitize=kernel-address - + CFLAGS_KASAN := $(call cc-option, -fsanitize=kernel-address \ -fasan-shadow-offset=$(KASAN_SHADOW_OFFSET) \ - --param asan-stack=1 --param asan-globals=1 \ --param asan-instrumentation-with-call-threshold=$(call_threshold)) - + ifeq ($(call cc-option, $(CFLAGS_KASAN_MINIMAL) -Werror),) ``` diff --git a/docs/linux/setup_ubuntu-host_qemu-vm_x86-64-kernel.md b/docs/linux/setup_ubuntu-host_qemu-vm_x86-64-kernel.md index 0efc42196..faa087c60 100644 --- a/docs/linux/setup_ubuntu-host_qemu-vm_x86-64-kernel.md +++ b/docs/linux/setup_ubuntu-host_qemu-vm_x86-64-kernel.md @@ -70,7 +70,7 @@ Now you should have `vmlinux` (kernel binary) and `bzImage` (packed kernel image ``` bash $ ls $KERNEL/vmlinux $KERNEL/vmlinux -$ ls $KERNEL/arch/x86/boot/bzImage +$ ls $KERNEL/arch/x86/boot/bzImage $KERNEL/arch/x86/boot/bzImage ``` diff --git a/docs/pseudo_syscalls.md b/docs/pseudo_syscalls.md index 82c2bfeb8..5247dd6b3 100644 --- a/docs/pseudo_syscalls.md +++ b/docs/pseudo_syscalls.md @@ -4,7 +4,7 @@ Besides regular system calls, a [syscall description](syscall_descriptions.md) file can also contain pseudo-syscalls. These are C functions defined in the executor. When a test program uses a pseudo-syscall, the executor -will generate the pseudo-syscall function code in the resulting C program. +will generate the pseudo-syscall function code in the resulting C program. This allows a test program to have specific code blocks to perform certain actions, they may also be used as more test-friendly wrappers diff --git a/docs/syscall_descriptions.md b/docs/syscall_descriptions.md index a69932e27..fbb9f67fa 100644 --- a/docs/syscall_descriptions.md +++ b/docs/syscall_descriptions.md @@ -170,7 +170,7 @@ close(r0) Syscall arguments are always `in`, return values are `out` and pointer indirections have explicit direction as `ptr` type attribute. Also, it is possible to specify -direction attribute individually for struct fields to account for more complex +direction attribute individually for struct fields to account for more complex producer/consumer scenarious with structs that include both input/output resources. <div id="values"/> diff --git a/docs/syscall_descriptions_syntax.md b/docs/syscall_descriptions_syntax.md index 5af302de8..76cdc90b1 100644 --- a/docs/syscall_descriptions_syntax.md +++ b/docs/syscall_descriptions_syntax.md @@ -365,7 +365,7 @@ define MY_PATH_MAX PATH_MAX + 2 ## Misc Description files also contain `include` directives that refer to Linux kernel header files, -`incdir` directives that refer to custom Linux kernel header directories +`incdir` directives that refer to custom Linux kernel header directories and `define` directives that define symbolic constant values. The syzkaller executor defines some [pseudo system calls](./pseudo_syscalls.md) diff --git a/docs/syzbot.md b/docs/syzbot.md index fbeb0e070..bffd6994b 100644 --- a/docs/syzbot.md +++ b/docs/syzbot.md @@ -176,7 +176,7 @@ Suggestions and patches that improve bisection quality for common cases are `syzbot` supports cause bisection (find the commit that introduces a bug) and fix bisection (find the commit that fixes a bug). -The web UI for a specific kernel +The web UI for a specific kernel (say [upstream linux](https://syzkaller.appspot.com/upstream)) shows the `Bisected` status for all bugs. @@ -227,7 +227,7 @@ the provided crash report on the provided reproducer on a freshly-booted machine, so the reproducer worked for it somehow. Note: if the report contains `userspace arch: i386`, -then the program needs to be built with `-m32` flag. +then the program needs to be built with `-m32` flag. `syzbot` uses GCE VMs for testing, but *usually* it is not important. @@ -405,7 +405,7 @@ ask tree maintainers for priority handling. However, syzbot kernel config always includes `CONFIG_DEBUG_AID_FOR_SYZBOT=y` setting, which is not normally present in kernel. What was used for particularly elusive bugs in the past is temporary merging some additional debugging code into `linux-next` under this config setting -(e.g. more debug checks and/or debug output) and waiting for new crash reports from syzbot. +(e.g. more debug checks and/or debug output) and waiting for new crash reports from syzbot. ## Kernel configs diff --git a/docs/trusty/README.md b/docs/trusty/README.md index cad54ae76..5013dc5db 100644 --- a/docs/trusty/README.md +++ b/docs/trusty/README.md @@ -151,7 +151,7 @@ using config along the lines of (substitute actual values for `$KERNEL`, `$SYZKA "ppoll", "dup3", "tkill", - "gettid", + "gettid", "close" ] } |
