Commit Graph

3309 Commits

Author SHA1 Message Date
Dmitry Vyukov
ceaec61a83 prog: export Type.DefaultArg
It's effectively exported anyway.
So export it the proper way.
2018-12-06 18:55:46 +01:00
Dmitry Vyukov
f40330afce tools/syz-trace2syz: skip 2 more syscalls
These set_robust_list and set_tid_address are issued by glibc
for every process/thread start.
Normal programs don't use them and it's unlikely we build
something interesting with them (e.g. we won't get real robust list in memory).
Skip them.
2018-12-06 17:33:05 +01:00
Dmitry Vyukov
df8657a90f tools/syz-trace2syz: tidy up code
Lots of assorted changes mainly converting code to idiomatic Go
and replacing code with equivalent, but shorter code.
2018-12-06 17:28:09 +01:00
Dmitry Vyukov
c1641491e4 pkg/db: provide helper function for database creation
This is needed for both tools/syz-db and tools/syz-trace2syz.
Also, remove code to resolve SHA1 collisions.
Also, don't set db version as we actually want to minimize
and smash these programs like anything else
(not minimizing nor smashing them is only useful during tool testing).
2018-12-06 16:49:37 +01:00
Dmitry Vyukov
d68400a8d1 tools/syz-trace2syz: merge config package into proggen
Since we now have only single variable there,
it does not seem to deserve a separate package.
2018-12-06 16:30:14 +01:00
shankarapailoor
6a60a19530 tools/syz-trace2syz: add tool to convert strace output to programs
* fixing weird merge error

* fixing presubmit

* fixing presubmit

* removing parsing code because of -Xraw option

* fix presubmit

* update

* deleting vma_call_handlers as we are currently skipping most vma calls. This simplifies memory_tracker as we don't need to keep track of vma allocations

* removing custom handling of bpf_instruction union

* removing ifconf parsing

* update

* removed all expression types and replaced them with constant types. removing ipv6_addr parsing while -Xraw is getting fixed. Removing constants.go

* removing ipv6 parsing

* presubmit

* moving direction check from ipv4_addr out to genUnion

* removing code that parses kcov

* removing redundant test

* removing custom code in generate unions to fill ipv4_addr

* proggen: changing order of imports to make external packages import first

fixing presubmit

* changing log messages to lower case to be consistent with other packages.

* removing pointer type and simplifying memory_tracker

removing comment

* moving context and return_cache to seaparate files

* deleting default argument generation when we should probably throw an error
2018-12-06 16:25:37 +01:00
Dmitry Vyukov
3ab38479ab
Update syzbot.md
add newer clang compiler
2018-12-06 09:38:08 +01:00
Dmitry Vyukov
9858b52e7e
Update found_bugs.md 2018-12-06 07:45:08 +01:00
Dmitry Vyukov
764b42c46b pkg/csource: exclude linux/arm64 tests
I think I misinterpreted the error that episodically happens on ci:

collect2: error: ld terminated with signal 11 [Segmentation fault], core dumped
compiler invocation: aarch64-linux-gnu-gcc [-Wall -Werror -O1 -g -o /tmp/syz-executor570589071 -pthread -DGOOS_linux=1 -DGOARCH_arm64=1 -x c - -static]

as OOM, but they all involve aarch64-linux-gnu-gcc:

https://travis-ci.org/google/syzkaller/jobs/461827347
https://travis-ci.org/google/syzkaller/jobs/460226110
https://travis-ci.org/google/syzkaller/jobs/463564291

So I guess the problem can be with the arm64 toolchain that just crashes randomly.
2018-12-05 13:59:01 +01:00
Michael Tüxen
c64cb0567e sys/freebsd: remove linux specific include files for ICMP 2018-12-05 10:51:02 +00:00
Michael Tüxen
ac6c05788b sys/freebsd: improve TCP tests
* sys/freebsd: improve TCP tests

Add missing TCP socket options for FreeBSD.

* sys/freebsd: improve TCP tests

Add socket option description for TCP_FASTOPEN.
2018-12-05 06:57:20 +00:00
Michael Tuexen
f162ad97ac sys/freebsd: improve udp tests
Add support for the UDP_ENCAP. Add required includes and
remove the Linux specific ones.
2018-12-04 14:15:42 +00:00
Michael Tüxen
6ad0ae6171 sys: remove socketpair for AF_INET and AF_INET6
* OpebBSD: remove socketpair() for AF_INET and AF_INET6.

socketpair() is only supported on AF_UNIX.

* NetBSD: remove socketpair() for AF_INET and AF_INET6.

socketpair() is only supported for AF_UNIX.

* FreeBSD: remove socketpair() for AF_INET and AF_INET6.

socketpair() only supports AF_UNIX.

* Linux: remove socketpair for AF_INET and AF_INET6.

socketpair only supports AF_UNIX.

* Autogenerated files.

These are manually generated for all platforms you are not
running on. FreeBSD in this case.

* executor: rebase.

* sys/freebsd: rebase.

* sys/linux: use AF_UNIX based socketpair for nbd.

This was suggested by Dmitry.

Fixes #845
2018-12-04 08:58:22 +00:00
Greg Steuck
49e1764c75 tools/create-openbsd-vmm-worker.sh: shut off pagination in ddb 2018-12-04 08:55:04 +00:00
Michael Tüxen
03f94a4556 sys/freebsd: add UDP-Lite descriptions 2018-12-03 13:52:09 +00:00
Dmitry Vyukov
2192790481 pkg/csource: reduce short tests
pkg/csource test gets OOM-killed on travis:
https://travis-ci.org/google/syzkaller/jobs/461827347
https://travis-ci.org/google/syzkaller/jobs/460226110

Add several measures:
 - set GOMAXPROCS=1 to restrict parallel processes
 - remove -g from compiler invocation
 - reduce set of tests run in short mode to compensate for GOMAXPROCS=1
 - also reduce set of tests in full mode as they timeout now
2018-12-03 13:29:57 +01:00
Dmitry Vyukov
c3ff1810cf Makefile: constrain gometalinter memory usage
gometalinter gets OOM-killed on travis:
https://travis-ci.org/google/syzkaller/jobs/462546388

I've run 4 experiments locally and this combination
seems to make memory usage slightly better:

GOGC=50 GOMAXPROCS=1 TIME="%e %M" time gometalinter.v2 ./...
114.35 8274556
122.54 8293580
117.85 8349960

GOGC=50 GOMAXPROCS=1 TIME="%e %M" time gometalinter.v2 ./...
147.45 7512512
150.13 6820408
149.26 7909636

GOGC=100 GOMAXPROCS=2 TIME="%e %M" time gometalinter.v2 ./...
109.73 8332476
114.91 8563776
114.54 8478368

GOGC=50 GOMAXPROCS=2 TIME="%e %M" time gometalinter.v2 ./...
145.43 6726144
147.40 8247952
155.56 7815656
2018-12-03 13:29:57 +01:00
Dmitry Vyukov
819002b081
docs: update contributing.md
Clarify commit description guidelines.
2018-12-03 10:36:40 +01:00
Dmitry Vyukov
31677db602 sys/targets: use g++ as preprocessor on freebsd
As per:
https://github.com/google/syzkaller/pull/844#issuecomment-443509014
2018-12-03 10:02:43 +01:00
Dmitry Vyukov
7dcaeaf322 vm/gce: close old consolew in Run
Run can be executed several times on a VM.
2018-12-02 13:23:51 +00:00
Greg Steuck
7a0edfbe7c vm/gce: use openbsd console diagnostic code for both vmm and gce
* openbsd: use console diagnostic code for both vmm and gce.

* gometalinter wants less indentation and more stuff in scope

* Comment no longer applies
2018-12-02 13:22:10 +00:00
Anton Lindqvist
048d09b205 docs/openbsd: update found_bugs.md 2018-12-02 13:20:29 +00:00
Greg Steuck
88746fdf89 pkg/csource: use defines from sys/syscall.h on *bsd
Fixes #841
2018-12-02 13:18:07 +00:00
Greg Steuck
e0d8c853f6 tools: set openbsd hostname to instance name for serviceability
* openbsd images: set hostname to instance name for serviceability

* openbsd startup scripts insist on EOL characters
2018-12-02 09:53:06 +00:00
Michael Tüxen
5a58167323 executor: add support for tap interfaces on FreeBSD 2018-12-01 10:22:39 +00:00
Greg Steuck
d8988561c0 openbsd: repair pkg/csource_test 2018-11-30 19:55:51 +00:00
Dmitry Vyukov
f0d4c650a3 pkg/report: suppress another gvisor OOM 2018-11-30 19:17:05 +00:00
Michael Tüxen
271b354c51 vm/qemu: improve debug output
* vm/qemu: Improve debug output.

When running in debug mode, the number of VMs is reduced to 1.
State this in the debug output.

* vm/qemu: Don't start debug output with a capital letter.

As requested by Dimitry.

* vm: Provide debug message when reduing number of VMs.

Apply this change to all affected platforms for consistency.
Suggested by Dmitry.

* Add myself to AUTHORS/CONTRIBUTORS files.

* vm: Fix compilation issues missed in earlier commit.

* vm: Use logging to write debug message.
2018-11-30 17:12:03 +00:00
Shankara Pailoor
bc6b598a2d removing trace2syz constants and moving rand_addr as the first ipv4_addr option 2018-11-30 15:24:55 +00:00
Michael Tüxen
115a1379eb FreeBSD: Fix make extract
* FreeBSD: Fix make extract.

A header was missing...

* FreeBSD: Fix make extract

Changes in generated files.
2018-11-30 15:13:30 +00:00
Michael Tuexen
8b13c56200 executor: Use correct macros.
Suggested by Dmitry Vyukov.
2018-11-30 13:48:23 +00:00
Michael Tuexen
9656dc4c83 executor: Fix compilation on FreeBSD.
This is an autogenerated file, but it seem that changes to it
resulting from changes in executor/common_bsd.h must also be
committed.
e
2018-11-30 13:48:23 +00:00
Michael Tuexen
3d61cddf64 Whitespace change. 2018-11-30 13:48:23 +00:00
Michael Tuexen
9568070f6f executor: Fix compilation on FreeBSD
Fix the compilation on FreeBSD when not supporting the tun
interface.
2018-11-30 13:48:23 +00:00
Michael Tuexen
ade12e9162 vm/qemu: Allow empty qemu-args.
Allow setting qemu_args to "" in the config file. This is needed
when running qemu from the qemu-devel package on FreeBSD, which
does not support the -enable-kvm option.
Without this patch, an entry "" is added to the list of command
line parameters, which breaks the starting of the qemu instances.
2018-11-30 13:12:57 +00:00
Marco Vanotti
66071e276f sys/fuchsia: fix task syscalls.
This commit fixes two issues related to the task syscalls.

The zx_task_resume syscall has been recently removed from zircon[0]. It
has been deprecated for some time already. This commit removes the
syscall.

The `ZX_EXCEPTION_PORT_UNBIND_QUIETLY` option for the syscall
`zx_task_bind_exception_port` has been removed recently as well[1]. This
commit removes that option from tasks.txt.

To test this change, I followed the procedure for building syzkaller for
fuchsia:

```shell
$ make extract TARGETOS=fuchsia SOURCEDIR=${FUCHSIADIR}
$ make generate
$ make TARGETOS=fuchsia TARGETARCH=amd64 SOURCEDIR=${FUCHSIADIR}
```

I excluded the changes from make extract. This commit only has the
generated files from make generate.

[0]: https://fuchsia-review.googlesource.com/c/zircon/+/228712
[1]: https://fuchsia-review.googlesource.com/c/zircon/+/228658
2018-11-29 21:27:15 +00:00
Greg Steuck
4b6d14f266 tools/create-openbsd-gce-ci.sh: simplification due to workers on GCE 2018-11-27 13:16:46 +01:00
Greg Steuck
0b29b7f952 prog: prevent sandbox escaping files from entering s.files 2018-11-27 13:16:05 +01:00
Greg Steuck
6419afbb77 openbsd: run on gce
* build/openbsd: minor cleanup (use tuples instead of maps)

* Grammar nits in comments.

* Simplify openbsd.Create, will defer when there's more than one error exit.

* pkg/build: Support copying kernel into GCE image

* Simple test for openbsd image copy build.

* Cleanup in case something failed before.

* Support multi-processor VMs on GCE.

* More debug

* Reformat

* OpenBSD gce image needs to be raw.

* GC

* Force format to GNU directly on Go 1.10 or newer.

* Use vmType passed as a parameter inside openbsd.go

* gofmt

* more fmt

* Can't use GENERIC.mp just yet.

* capitalize

* Copyright
2018-11-27 13:14:06 +01:00
Dmitry Vyukov
ac912200b6
Update found_bugs.md 2018-11-26 09:32:50 +01:00
Shankara Pailoor
3d3ec9072b reordering unions for trace2syz 2018-11-25 08:18:59 +01:00
Shankara Pailoor
ecc7c87091 removing trace2syz constants 2018-11-24 08:08:32 +01:00
Dmitry Vyukov
eb9ed7316a dashboard/app: purge old repros
We have some bugs with insane amount of repros.
So many that new crashes don't show up on dashboard at all.
Purge old repros too. There is no need to keep more than 40.
2018-11-23 20:10:07 +01:00
Dmitry Vyukov
646afdf841 dashboard/app: enlarge stats value column for manager
When numbers become large, they may not fit into 100px.
2018-11-23 14:44:58 +01:00
Dmitry Vyukov
8eb18c0bbc
docs/linux: update recommended configs
Mention few more tricky kernel configs that cause problems.
2018-11-23 13:44:03 +01:00
msvoelker
0ab8db6467 executor: FreeBSD: fixed endian.h path
The include statement for endian.h failed on FreeBSD. Changed include statement to syz/endian.h for FreeBSD.
2018-11-23 11:50:41 +01:00
Andrey Konovalov
2b0dc848a0 ipc: fix ProgInfo usage better
Fix a bad fix for ProgInfo usage.
2018-11-23 07:17:29 +01:00
Andrey Konovalov
87815d9d32 ipc: fix ProgInfo usage
We used to use len([]CallInfo) to check both, whether the slice is nil or
whether its length is zero. Since ProgInfo is not a slice, we need a
separate check for nil.
2018-11-22 19:30:04 +01:00
Dmitry Vyukov
97aa259615 dashboard/app: show managers per namespaces
End users are interested for managers only for a single namespace.
So show them per-namespace.
2018-11-22 15:07:17 +01:00
Dmitry Vyukov
79d9c3191f dashboard/app: use sort.Slice
Now that GAE provides a newer Go toolchain,
we can use sort.Slice goodness.
2018-11-22 14:43:43 +01:00