Commit Graph

4994 Commits

Author SHA1 Message Date
Andrey Konovalov
fabe518e91 dashboard/config: update usb config generation script 2020-04-23 16:47:51 +02:00
Ayushi Sharma
2e44d63e40
sys/netbsd: add lchmod(2) (#1687) 2020-04-21 13:22:03 +02:00
Siddharth M
f20434a845
pkg/build: Remove all the build dirs for NetBSD (#1688) 2020-04-21 10:38:02 +00:00
Ayushi Sharma
98a9f9e692
dashboard/config: update NetBSD configs (#1685) 2020-04-20 20:33:50 +02:00
Siddharth M
f85457bbf0
pkg/build: remove '-u' option for NetBSD build and increase timeout (#1686) 2020-04-20 20:33:00 +02:00
Greg Steuck
347a5dc3c7 executor: remove unidentified file
It was committed as the following and doesn't make sense.

commit e06d2ea701
Author: R3x <siddharth.muralee@gmail.com>
Date:   Sat Jul 6 14:01:06 2019 +0000

    sys/netbsd: Added posix_spawn and fork syscalls
2020-04-20 07:25:10 +02:00
Dmitry Vyukov
9f7c6d1294 Revert "syz-manager: if running on GCE use GCE public IP address"
This reverts commit 273e386b71.
The error handling in the function is somewhat unusual,
and the code was correct. GCE address took precedence.
2020-04-19 22:06:23 +02:00
Dmitry Vyukov
6dfd45e1d0 sys/syz-sysgen: better formatting for syscall descriptions
We don't really need clang-format for auto-generated code.
We can do better ourselves!
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
20ed497b52 pkg/report: add compat ioctl stall anchor frames
Add new __ia32_compat_sys_ioctl anchor frame
(something seems to have been changed in compat ioctl's).
Also skip all compat_ioctl frames, it's pretty common naming
convention and it may help to avoid some dups across
compat/non-compat paths.
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
5602faa9ba .github/workflows: disable OSS-Fuzz action for now
It's broken:
https://github.com/google/oss-fuzz/issues/3670
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
2152cfbcb2 all: fix liner errors
pkg/compiler/compiler.go:182: line is 125 characters
func (comp *compiler) parseAttrs(descs map[string]*attrDesc, parent ast.Node, attrs []*ast.Type) (res map[*attrDesc]uint64) {
sys/targets/common.go:47:21: unnecessary conversion
				makeMmap(^uint64(target.PageSize)+1, target.PageSize, 0),
				                ^
sys/targets/common.go:61: File is not `gofmt`-ed with `-s`
			&prog.Call{
sys/windows/init.go:35: File is not `gofmt`-ed with `-s`
		&prog.Call{
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
815daeab0f pkg/compiler: error on duplicate attributes 2020-04-19 10:26:57 +02:00
Dmitry Vyukov
91db3ed8ce prog: add ignore_return and breaks_returns call attribtues
We had these hard-coded for fuchsia and linux accordingly.
Replace with call attributes.
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
273e386b71 syz-manager: if running on GCE use GCE public IP address
Host is not necessary full public address.
So if we are running on GCE, prefer GCE public IP.
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
1155a0d1d6 sys/linux: sync call timeouts with executor
Timeouts in executor and sys/linux get out of sync. Sync them.
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
cc8708904d sys/linux: add timeout call attributes
Move additional call/prog timeouts to descriptions.

Due to this logic duplication executor used 50ms
for syz_mount_image, while pkg/csource used 100ms.
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
90d17ab898 prog: introduce call attributes
Add common infrastructure for syscall attributes.
Add few attributes we want, but they are not implemented for now
(don't affect behavior, this will follow).
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
0781895e0f pkg/compiler: refactor attribute handling
Introduce common infrastructure for describing and parsing attribute
instead of custom per-attribute code scattered across several locations.

Change align attribute syntax from the weird align_N to align[N].
This also allows to use literal constants as N.

Introduce notion of builtin constants.
Currently we have only PTR_SIZE, which is needed to replace
align_ptr with align[PTR_SIZE].
2020-04-19 10:26:57 +02:00
Dmitry Vyukov
a116470dc3 pkg/ast: add call attributes 2020-04-19 10:26:57 +02:00
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