diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-05-19 12:36:04 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-05-19 12:52:04 +0200 |
| commit | 6d882fd26c01d118a584b2a3aecd5f08fa5e11e1 (patch) | |
| tree | daa277cb6ebeb1f3093920262a25e87629fd5fd2 | |
| parent | ac61eb2b125ee9891ae3290f770e6ee36c07535d (diff) | |
tools/check_links.py: detect absolute links
Detect absolute links to our repo.
These are not checked and long and inconsistent with majority of links.
| -rw-r--r-- | docs/headerparser_usage.md | 4 | ||||
| -rw-r--r-- | docs/linux/setup_ubuntu-host_odroid-c2-board_arm64-kernel.md | 2 | ||||
| -rw-r--r-- | docs/syscall_descriptions.md | 2 | ||||
| -rw-r--r-- | docs/syzbot.md | 12 | ||||
| -rwxr-xr-x | tools/check_links.py | 19 |
5 files changed, 25 insertions, 14 deletions
diff --git a/docs/headerparser_usage.md b/docs/headerparser_usage.md index 384775801..378bccc7a 100644 --- a/docs/headerparser_usage.md +++ b/docs/headerparser_usage.md @@ -8,7 +8,9 @@ information about the ioctl argument struct types it expects. However, in certain cases the number of argument struct types might be high, increasing the amount of manual effort that goes into writing the description files for the struct types. -In order to ease the effort of writing ioctl argument type description files, headerlib does a best-effort job at generating them for you. You will still need to manually select the appropriate syzkaller data type from the list of types [here](https://github.com/google/syzkaller/blob/master/docs/syscall_descriptions_syntax.md). +In order to ease the effort of writing ioctl argument type description files, headerlib does a best-effort job at +generating them for you. You will still need to manually select the appropriate syzkaller data type from the list +of types [here](/docs/syscall_descriptions_syntax.md). ## Dependencies Headerlib uses pycparser. You can install pycparser using pip. 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 99de2e450..a5238207a 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 @@ -25,7 +25,7 @@ The particular setup described below requires the following hardware: 7. USB hub with [Per Port Power Switching support](http://www.gniibe.org/development/ac-power-control-by-USB-hub/index.html) (like D-Link DUB H7, **silver** edition). 8. [USB-DC Plug Cable](http://www.hardkernel.com/main/products/prdt_info.php?g_code=G141637559827) -If you decide to use a different setup, you will need to update [Odroid-related code](https://github.com/google/syzkaller/blob/master/vm/odroid/odroid.go) in syzkaller manager. +If you decide to use a different setup, you will need to update [Odroid-related code](/vm/odroid/odroid.go) in syzkaller manager. ### Setup Odroid diff --git a/docs/syscall_descriptions.md b/docs/syscall_descriptions.md index 36f99527b..c33912509 100644 --- a/docs/syscall_descriptions.md +++ b/docs/syscall_descriptions.md @@ -37,7 +37,7 @@ For actual manipulations `syzkaller` uses in-memory AST-like representation cons The in-memory representation can be [transformed](/prog/encoding.go) to/from textual form to store in on-disk corpus, show to humans, etc. -There is also another [binary representation](https://github.com/google/syzkaller/blob/master/prog/decodeexec.go) +There is also another [binary representation](/prog/decodeexec.go) of the programs (called `exec`), that is much simpler, does not contains rich type information (irreversible) and is used for actual execution (interpretation) of programs by [executor](/executor/executor.cc). diff --git a/docs/syzbot.md b/docs/syzbot.md index 49d33567a..f54214477 100644 --- a/docs/syzbot.md +++ b/docs/syzbot.md @@ -200,14 +200,16 @@ reply with a `#syz fix: commit-title` so that syzbot can close the bug report. However, sometimes it can't extract a reproducer at all, or can only extract a syzkaller reproducer. syzkaller reproducers are programs in a special syzkaller notation and they can be executed on the target system with a little bit more -effort. See [this](https://github.com/google/syzkaller/blob/master/docs/executing_syzkaller_programs.md) -for instructions. +effort. See [this](/docs/executing_syzkaller_programs.md) for instructions. A syskaller program can also give you an idea as to what syscalls with what arguments were executed (note that some calls can actually be executed in parallel). -A syzkaller program can be converted to an almost equivalent C source using `syz-prog2c` utility. `syz-prog2c` has lots of flags in common with [syz-execprog](https://github.com/google/syzkaller/blob/master/docs/executing_syzkaller_programs.md), e.g. `-threaded`/`-collide` which control if the syscalls are executed sequentially or in parallel. An example invocation: +A syzkaller program can be converted to an almost equivalent C source using `syz-prog2c` utility. `syz-prog2c` +has lots of flags in common with [syz-execprog](/docs/executing_syzkaller_programs.md), +e.g. `-threaded`/`-collide` which control if the syscalls are executed sequentially or in parallel. +An example invocation: ``` syz-prog2c -prog repro.syz.txt -enable=all -threaded -collide -repeat -procs=8 -sandbox=namespace -segv -tmpdir -waitrepeat @@ -249,7 +251,7 @@ qemu-system-x86_64 -smp 2 -m 4G -enable-kvm -cpu host \ -device scsi-hd,bus=scsi.0,drive=d0 \ -drive file=stretch.img,format=raw,if=none,id=d0 \ -append "root=/dev/sda console=ttyS0 earlyprintk=serial rodata=n \ - oops=panic panic_on_warn=1 panic=86400 kvm-intel.nested=1 \ + oops=panic panic_on_warn=1 panic=86400 kvm-intel.nested=1 \ security=apparmor ima_policy=tcb workqueue.watchdog_thresh=140 \ nf-conntrack-ftp.ports=20000 nf-conntrack-tftp.ports=20000 \ nf-conntrack-sip.ports=20000 nf-conntrack-irc.ports=20000 \ @@ -409,4 +411,4 @@ Kernel configs, sysctls and command line arguments that `syzbot` uses are availa ## Is syzbot code available? -Yes, it is [here](https://github.com/google/syzkaller/tree/master/dashboard/app). +Yes, it is [here](/dashboard/app). diff --git a/tools/check_links.py b/tools/check_links.py index 848329e04..aea62a5ae 100755 --- a/tools/check_links.py +++ b/tools/check_links.py @@ -24,6 +24,14 @@ for doc in docs: for match in link_re.finditer(line): links += [(doc, match.group(1), i + 1, match.start(1))] +errors = [] + +for link in links: + (doc, link, line, col) = link + for prefix in ['https://github.com/google/syzkaller/blob/master', 'https://github.com/google/syzkaller/tree/master']: + if link.startswith(prefix): + errors += ['%s:%d:%d: Replace absolute link with %s.' % (doc, line, col, link[len(prefix):])] + def filter_link(args): (doc, link, line, col) = args if link.startswith('http'): @@ -44,8 +52,6 @@ def fix_link(args): links = list(map(fix_link, links)) -errors = [] - def check_link(args): (doc, link, line, col) = args path = os.path.dirname(doc) @@ -61,13 +67,14 @@ def check_link(args): for link in links: if not check_link(link): - errors += [link] + (doc, link, line, col) = link + errors += ['%s:%d:%d: Broken link %s.' % (doc, line, col, link)] if len(errors) == 0: - print('%d links checked: OK' % (len(links),)) + print('%d links checked: OK' % len(links)) sys.exit(0) -for (doc, link, line, col) in errors: - print('%s:%d:%d: Broken link %s.' % (doc, line, col, link)) +for error in errors: + print(error) sys.exit(2) |
