Commit Graph

4775 Commits

Author SHA1 Message Date
Dmitry Vyukov
365fba2440 executor: surround the data mapping with PROT_NONE pages
Surround the main data mapping with PROT_NONE pages to make virtual address layout more consistent
across different configurations (static/non-static build) and C repros.
One observed case before: executor had a mapping above the data mapping (output region),
while C repros did not have that mapping above, as the result in one case VMA had next link,
while in the other it didn't and it caused a bug to not reproduce with the C repro.

The bug that reproduces only with the mapping above:
https://lkml.org/lkml/2020/4/17/819
2020-04-18 14:43:29 +02:00
Dmitry Vyukov
6fe0f49646 executor: remove more code if ENABLE_NAPI_FRAGS is not set
In some configurations tun_frags_enabled ends up being unused
with a compiler warning and failed build.
Remove mode code if ENABLE_NAPI_FRAGS is not enabled.
2020-04-18 14:37:48 +02:00
Dmitry Vyukov
9b95008878 Makefile: don't do go install
We did it for caching purposes, but now
(1) go command caches everything anyway,
(2) we use custom tags and flags, so result
    of go install is not reused anyway.
2020-04-18 14:36:05 +02:00
Dmitry Vyukov
67234372ef prog: refactor target.MakeMmap
Make MakeMmap return more than 1 call.
This is a preparation for future changes.
Also remove addr/size as they are effectively
always the same and can be inferred from the target
(will also conflict with the future changes).
Also rename to MakeDataMmap to better represent
the new purpose: it's just some arbitrary mmap,
but rather mapping of the data segment.
2020-04-18 14:35:45 +02:00
Dmitry Vyukov
ea36da8271 sys/linux: use PROT_EXEC for the data section mmap
Turns out the mmap protection get out of sync
between executor and C reproducers.
C reproducers missed PROT_EXEC.
Add PROT_EXEC for linux, freebsd and akaros.
2020-04-18 10:33:03 +02:00
Dmitry Vyukov
435c6d5388 pkg/host: support wrapping of executor binary
pkg/ipc has this logic for executor binary as well.
Allows to run e.g. executor under strace as:

syz-execprog -executor "/bin/strace -o /tmp/log /bin/syz-executor" prog
2020-04-17 17:53:08 +02:00
Greg Steuck
1839757871 tools/create-openbsd*: update to 6.7 2020-04-17 07:27:39 +02:00
ais2397@gmail.com
c743fcb3e0 sys/netbsd: add minherit(2) 2020-04-16 07:02:15 +02:00
Dmitry Vyukov
3f3c557402 sys/linux: add some more ipv4/6 addresses
Add few private ipv4/6 addresses that may affect kernel behavior.
2020-04-14 09:11:27 +02:00
Dmitry Vyukov
ffe85af864 sys/linux: regenerate consts
On the current linux-next:
f19bb13a0eaf0034a603e3b54a7c3a50faf6821e (next-20200414)

EXT4_EOFBLOCKS_FL was removed by 4337ecd1fe997d2b2135b4434caaccdb47c10c06

ARM does not support KVM anymore, removed by 541ad0150ca4 ("arm: Remove 32bit KVM host support").

Fixes #1676
2020-04-14 07:37:58 +02:00
Mark Johnston
7c54686a26 pkg/build: enable extra TCP stacks on FreeBSD
syzkaller already knows about TCP_FUNCTION_BLK, used to set the TCP
stack for a given socket.
2020-04-13 21:22:08 +02:00
Mark Johnston
dc4b93e773 pkg/build: fix loader.conf modification in FreeBSD image build script
The loader.conf we want to modify is in the mount rooted at $tmpdir.
2020-04-13 21:22:08 +02:00
ais2397@gmail.com
a517e13956 sys/netbsd: fix struct stat 2020-04-13 21:20:21 +02:00
Paul Chaignon
17a986e54c sys/linux: add link_create and link_update commands
Signed-off-by: Paul Chaignon <paul@cilium.io>
2020-04-12 17:03:47 +02:00
Paul Chaignon
95536f1d7b bpf: update BPF constants
Signed-off-by: Paul Chaignon <paul@cilium.io>
2020-04-12 17:03:47 +02:00
Anton Lindqvist
36b0b05078 pkg/report: make uvm_fault parsing more strict on OpenBSD
In order to avoid treating the following diagnostic printf as a panic[1]:

	vmx_mprotect_ept: uvm_fault returns 14, GPA=0x200000

[1] https://syzkaller.appspot.com/bug?id=25f3ef919bf9f5d8a89e13b1ba5fec8ca56334be
2020-04-12 13:10:26 +02:00
Andrey Konovalov
a8c6a3f8da
Update external_fuzzing_usb.md 2020-04-09 02:54:51 +02:00
Andrey Konovalov
db9bcd4b9f executor/usb: don't fail when ath9k is not enabled 2020-04-07 18:21:37 +02:00
Andrey Konovalov
99a9604483 syz-fuzzer: simplify checkMachine() 2020-04-06 17:24:51 +02:00
Dmitry Vyukov
2f886fb32c executor: regenerate files 2020-04-06 09:02:47 +02:00
Dmitry Vyukov
3455154b93 dashboard/config/distro: add ChromeOS Crostini VM config 2020-04-06 08:40:06 +02:00
Paul Chaignon
34833561f1 syz-fuzzer: Fix cyclo. complexity error
syz-fuzzer/testing.go:104:1: cyclomatic complexity 27 of func `checkMachine` is high (> 24)
    func checkMachine(args *checkArgs) (*rpctype.CheckArgs, error) {
    ^

Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
2020-04-06 08:39:56 +02:00
Paul Chaignon
b4280ab91f pkg/vcs: Fix golangci-lint formatting error
pkg/vcs/vcs.go:186:2: var `gitSshRepoRe` should be `gitSSHRepoRe`
    gitSshRepoRe = regexp.MustCompile(`^(git|ssh|http|https|ftp|ftps)@[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)+(:[a-zA-Z0-9-_]+)?(/[a-zA-Z0-9-_./]+)?(/)?$`)
       ^

Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
2020-04-06 08:39:56 +02:00
Ayushi Sharma
d9ed075d1a
sys/netbsd: adding chflags(2) syscalls (#1661) 2020-04-04 00:07:51 +02:00
Jukka Kaartinen
ef26b61025 pkg/vcs: Support ssh git repos
Signed-off-by: Jukka Kaartinen <jukka.kaartinen@unikie.com>
2020-04-03 15:33:08 +02:00
Andrey Konovalov
84da034b1e sys/linux: run usb runtests with namespace/setuid sandbox 2020-04-03 12:42:06 +02:00
Andrey Konovalov
81c5026f57 runtest: fix using configs with namespace/setuid sandbox 2020-04-03 12:42:06 +02:00
Andrey Konovalov
09ff5abc02 csource, executor: add usb emulation feature
The feature gets enabled when /dev/raw-gadget is present and accessible.
With this feature enabled, executor will do chmod 0666 /dev/raw-gadget on
startup, which makes it possible to do USB fuzzing in setuid and namespace
sandboxes. There should be no backwards compatibility issues with syz
reproducers that don't explicitly enable this feature, as they currently only
work in none sandbox.
2020-04-03 12:42:06 +02:00
Andrey Konovalov
ca1beb07f0 tools/create-image.sh: make sure filesystem root has correct permissions 2020-04-03 12:42:06 +02:00
Jouni Högander
5ed396e666 tools/syz-symbolize: Store crash report if outdir is given
We want to check if the original crash reproducer was generated is
reproduced. We need to generate syzkaller style crash report on
reproducer log and check if hash matches with the original hash.
This patch adds outdir flags to syz-symbolize and stores crashes found
from given log into it.
2020-04-03 11:01:08 +02:00
Dmitry Vyukov
9a5264054c
dashboard/app: add instructions on how to update the scheme 2020-04-03 10:49:59 +02:00
Jukka Kaartinen
490e527b51 docs: Add map of the syzbot setup
Add mind map image of the syzbot setup to show how
peaces are connected.

Signed-off-by: Jukka Kaartinen <jukka.kaartinen@unikie.com>
2020-04-03 10:42:34 +02:00
Andrey Konovalov
a34e2c3324 dashboard/config: update USB config to 5.6 2020-03-31 19:15:37 +02:00
Andrey Konovalov
4093d25cc9 dashboard/config: enable usb configs on android-5.4 2020-03-31 19:15:37 +02:00
Andrey Konovalov
283f3ca630 dashboard/config: update android-5.4 config 2020-03-31 19:15:37 +02:00
Dmitry Vyukov
1c52742ffc executor: re-run make generate 2020-03-31 15:32:08 +02:00
Dmitry Vyukov
8950ec3f51 prog: add MaxArgs const
Move the const from the compiler.
In preparation for future changes.
2020-03-31 15:28:17 +02:00
Dmitry Vyukov
22968402ee tools/create-gce-image.sh: fix sysctl.kernel.hung_task_all_cpu_backtrace=1
Turns out this is not a sysctl, even though it's prefixed with sysctl:
https://groups.google.com/d/msg/syzkaller/EJP7uvY4O-c/XLrhrBqGAQAJ
2020-03-31 15:28:17 +02:00
Ayushi Sharma
46105100bf
sys/netbsd: adding lwp syscalls (#1654) 2020-03-31 14:14:00 +02:00
Dmitry Vyukov
c8d1cc20df tools/create-gce-image.sh: enable sysctl.kernel.hung_task_all_cpu_backtrace=1
The format of this knob has changed again:
https://groups.google.com/d/msg/syzkaller/EJP7uvY4O-c/XLrhrBqGAQAJ
2020-03-30 10:55:36 +02:00
Andrey Konovalov
05736b290d tools, dashboard: run make generate 2020-03-28 14:48:40 +01:00
Andrey Konovalov
fd6a38e1fc tools, dashboard: move net.ifnames=0 to create-gce-image.sh
Looks like it affects not only android-5.4.
2020-03-28 12:29:27 +01:00
Andrey Konovalov
f1ebdfba7d executor: add some comments to USB helper functions 2020-03-28 11:53:20 +01:00
Andrey Konovalov
47232600c3 executor: split out Linux specific USB code 2020-03-28 11:53:20 +01:00
Dmitry Vyukov
831e9a81a6 dashboard/app: update docs 2020-03-27 10:43:05 +01:00
Dmitry Vyukov
9b6ecd9356 dashboard/app: fix tests hang
This is ugly but without this go test hangs with:

panic: Metadata fetch failed for 'instance/attributes/gae_backend_version':
	Get http://metadata/computeMetadata/v1/instance/attributes/gae_backend_version:
	dial tcp: lookup metadata on 127.0.0.1:53: no such host

It's unclear what's the proper fix for this.

It used to work for me for ridiculous reasons only:
somebody provided metadata host which returned errors,
but since nobody cares what's in the returned response
and no error checking whatsoever, it somehow did not crash...
2020-03-27 10:43:05 +01:00
Andrey Konovalov
9af8b4b30b dashboard/config: disable network interface renaming on android-5.4
Using Debian Stretch image in combination with android-5.4 kernel results
in eth0 being renamed to e.g. enp0s4 by virtio_net driver, which breaks
our startup scripts. Disable network interface renaming via a kernel
commandline argument.
2020-03-27 06:58:53 +01:00
Andrey Konovalov
ff9f28fce0 dashboard/config: enable e1000 driver in bits-syzbot.config
QEMU vm currently uses e1000 as the network model. Update android-5.4
config, the rest already has CONFIG_E1000 enabled.
2020-03-27 06:58:53 +01:00
Dmitry Vyukov
0bbbd25447 pkg/report: fix detection of questionable frames
The previous commit "pkg/report: handle cases when whole stack is questionable"
mishandles frames that start with [PC] prefix before " ? ".
Restore that part.
2020-03-27 06:23:11 +01:00
Mark Johnston
7d95711b32 sys/freebsd: add Capsicum system calls 2020-03-27 05:51:58 +01:00