Commit Graph

100 Commits

Author SHA1 Message Date
Dmitry Vyukov
c05b619dab Makefile: print uname in install_prerequisites
Travis is still broken with:

E: Unable to locate package gcc-aarch64-linux-gnu
E: Unable to locate package gcc-arm-linux-gnueabihf
E: Unable to locate package gcc-powerpc64le-linux-gnu

https://travis-ci.org/google/syzkaller/jobs/378034948

Let's at least see what's OS is there and what gcc packages present.
2018-05-13 11:36:13 +02:00
Dmitry Vyukov
e726f42b64 Makefile: don't fail on unknown packages
Travis CI started failing with:

E: Unable to locate package gcc-aarch64-linux-gnu
E: Unable to locate package gcc-arm-linux-gnueabihf
E: Unable to locate package gcc-powerpc64le-linux-gnu
make: *** [install_prerequisites] Error 100

https://travis-ci.org/google/syzkaller/jobs/377740347

Let's try to ignore these packages.
2018-05-12 10:10:02 +02:00
Dmitry Vyukov
08a0ef9cb0 Makefile: fix deps
syz-sysgen depends on prog which depends on pkg/ifuzz.
Currently we concurrently regenerate pkg/ifuzz and build
syz-sysgen, which can cause failures.
Make pkg/ifuzz dependent on syz-sysgen, so that it is
built before we regenerate ifuzz.
2018-05-05 14:27:27 +02:00
Dmitry Vyukov
b438ff2328 Makefile: parallelize
Use -j by default and parallelize targets as much as possible.
2018-05-04 20:07:51 +02:00
Theodore Ts'o
06db3cec94 Makefile: fix build in an i386 debian chroot
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-04-30 09:20:55 +02:00
Dmitry Vyukov
729f261057 Makefile: fix install_prerequisites
apt-get complains if all these packages are installed at once.
2018-04-02 20:09:30 +02:00
Dmitry Vyukov
d5473a248e Makefile: remove obsolete package
This package is not present on latest debian versions.
2018-03-31 16:31:48 +02:00
Julia Hansbrough
f63eeee99f fuchsia: Update syzkaller to build with current Fuchsia API. (#543)
* fuchsia: Fix the `extractor` tool.

The include path in Zircon has changed; updated syz-extract/fuchsia.go
to include this, and re-ran extract to get updated *.const files.

* fuchsia: Update syzkaller to build with current Fuchsia API.

Fuchsia doesn't have a stable API right now, so alas, this will probably
continue to change until that's nailed down.

But, useful to get this up-to-date at least.

Relevant notes:
* zx_channel_call_finish and _retry aren't technically public; leave
them out until we have a less-cludgy way to expose them
* musl supports setjmp/longjmp but not _setjmp/_longjump
* remove some unsupported syscalls
* update the build invocation
2018-03-21 10:26:33 +01:00
Dmitry Vyukov
e20831f6ce
Makefile: enable gometalinter on travis (#537) 2018-03-20 13:26:51 +01:00
Julia Hansbrough
c8b3f7c1d1 Makefile: Enable CGO and set ZIRCON_BUILD_DIR for Fuchsia targets.
While CGO should be disabled by default, it is necessary when building
FUCHSIA.

Additionally, the Fuchsia Go toolchain expects ZIRCON_BUILD_DIR to be
set (
https://github.com/fuchsia-mirror/third_party-go/blob/master/misc/fuchsia/gccwrap.sh
), so we set it here.
2018-02-15 07:43:44 +01:00
Dmitry Vyukov
e67d44e011 executor: compile with -O2
We don't frequently debug it and it does some intensive computations
on coverage, so no reason to not compile with -O2.
2018-02-10 12:14:13 +01:00
Julia Hansbrough
a1bc9d40ad syz/syz-extract: Update Fuchsia extractor with current Fuchsia paths.
A change in Zircon a while back moved around where sysroots are located
in Fuchsia; this update will allow for proper extraction.
2018-02-04 12:21:23 +01:00
Dmitry Vyukov
4198e58824 vm/vmimpl: unbreak freebsd build
Also add freebsd/netbsd host build to presubmit.
2018-01-16 06:41:23 +01:00
Ed Maste
81fe66b42a Makefile: fix git "modified tree" test
Makefile falsely detected a modified git tree when the first ifeq
argument was unquoted. Also switch to the $(shell ... style for
consistency.

As requested, add myself to AUTHORS and CONTRIBUTORS.
2017-12-21 13:53:39 +01:00
Dmitry Vyukov
90a46995a8 Makefile: fix Android builds
There are 2 known problems with current Android support:
1. It does not work with newer NDK
(happens on every NDK update).
2. Dynamic Go binaries do not start on Android emulator.

Drop special Android support and just build static linux binaries.

For context see:
https://groups.google.com/forum/#!msg/syzkaller/etg1ZJmTMzg/NYE-yjxxAQAJ
https://groups.google.com/d/msg/syzkaller/8KjCYWslTFY/1oTXn5tTAgAJ

Fixes #478
2017-12-20 10:52:19 +01:00
Dmitry Vyukov
019cf5f235 sys: move test syscalls to a separate target
We have them in linux solely for historical reasons.

Fixes #462
2017-12-17 11:39:14 +01:00
Dmitry Vyukov
5e7b20cfc3 prog: fix a data race
The race initially showed up on the new benchmark (see race report below).
The race indicated a wrong call passed to replaceArg,
as the result we sanitized the wrong call and left the new call un-sanitized.

Fix this.
Add test that exposes this.
Run benchmarks in race mode during presubmit
(benchmarks have higher chances of uncovering races than tests).

WARNING: DATA RACE
Write at 0x00c42000d3f0 by goroutine 18:
  github.com/google/syzkaller/sys/linux.(*arch).sanitizeCall()
      sys/linux/init.go:155 +0x256
  github.com/google/syzkaller/sys/linux.(*arch).(github.com/google/syzkaller/sys/linux.sanitizeCall)-fm()
      sys/linux/init.go:42 +0x4b
  github.com/google/syzkaller/prog.(*Prog).replaceArg()
      prog/prog.go:357 +0x239
  github.com/google/syzkaller/prog.generateHints.func2()
      prog/hints.go:105 +0x124
  github.com/google/syzkaller/prog.checkConstArg()
      prog/hints.go:128 +0xf3
  github.com/google/syzkaller/prog.generateHints()
      prog/hints.go:120 +0x495
  github.com/google/syzkaller/prog.(*Prog).MutateWithHints.func1()
      prog/hints.go:72 +0x67
  github.com/google/syzkaller/prog.foreachSubargImpl.func1()
      prog/analysis.go:86 +0x9f
  github.com/google/syzkaller/prog.foreachSubargImpl()
      prog/analysis.go:104 +0xc8
  github.com/google/syzkaller/prog.foreachArgArray()
      prog/analysis.go:113 +0x89
  github.com/google/syzkaller/prog.foreachArg()
      prog/analysis.go:121 +0x50
  github.com/google/syzkaller/prog.(*Prog).MutateWithHints()
      prog/hints.go:71 +0x18e
  github.com/google/syzkaller/prog.BenchmarkHints.func1()
      prog/hints_test.go:477 +0x77
  testing.(*B).RunParallel.func1()
      testing/benchmark.go:626 +0x156

Previous read at 0x00c42000d3f0 by goroutine 17:
  github.com/google/syzkaller/prog.clone()
      prog/clone.go:38 +0xbaa
  github.com/google/syzkaller/prog.(*Prog).cloneImpl()
      prog/clone.go:21 +0x17f
  github.com/google/syzkaller/prog.generateHints()
      prog/hints.go:95 +0xd0
  github.com/google/syzkaller/prog.(*Prog).MutateWithHints.func1()
      prog/hints.go:72 +0x67
  github.com/google/syzkaller/prog.foreachSubargImpl.func1()
      prog/analysis.go:86 +0x9f
  github.com/google/syzkaller/prog.foreachSubargImpl()
      prog/analysis.go:104 +0xc8
  github.com/google/syzkaller/prog.foreachArgArray()
      prog/analysis.go:113 +0x89
  github.com/google/syzkaller/prog.foreachArg()
      prog/analysis.go:121 +0x50
  github.com/google/syzkaller/prog.(*Prog).MutateWithHints()
      prog/hints.go:71 +0x18e
  github.com/google/syzkaller/prog.BenchmarkHints.func1()
      prog/hints_test.go:477 +0x77
  testing.(*B).RunParallel.func1()
      testing/benchmark.go:626 +0x156
2017-12-08 11:33:30 +01:00
Andrey Konovalov
6834199b8c pkg/report: various corrupted report detection improvements 2017-11-23 16:17:40 +01:00
Andrey Konovalov
eff27f330a makefile: move diff check to makefile from travis script 2017-11-20 18:22:40 +01:00
Andrey Konovalov
26d265c811 docs, tools: add local link checker
This commit adds tools/check_links.py script, that checks that all local
links from documentation files are valid; fixes some of the invalid links
that we had; and makes travis buildbot check them as well.
2017-10-27 10:04:34 +02:00
Utkarsh Anand
3b95a1e305 Added 4 files containing syscall descriptions (#396)
* Added 4 files containing syscall descriptions
- Initial additions for peer review.

* Removed a flag:
- Because it was failing to compile.
2017-10-24 11:54:37 +02:00
Dmitry Vyukov
f6a5463e58 Makefile: build netbsd binaries so that we don't regress 2017-10-23 10:19:56 +02:00
Dmitry Vyukov
766bfcfdd0 Makefile: format akaros descriptions 2017-10-17 11:02:27 +02:00
Dmitry Vyukov
22279cf815 Makefile: don't string executor
This fails on bots with:

strip --strip-debug ./bin/linux_arm64/syz-executor
strip: Unable to recognise the format of the input file `./bin/linux_arm64/syz-executor'
2017-10-16 20:25:19 +02:00
Dmitry Vyukov
8793f74c6c sys/fuchsia: more descriptions 2017-10-16 19:23:13 +02:00
Dmitry Vyukov
17f8d6a03d Makefile: strip executor
We don't generate debug info for Go binaries to reduce their size.
Don't generate debug info for executor as well.
For akaros this reduces binary size from 4.5MB to 800KB.
2017-10-16 14:21:54 +02:00
Dmitry Vyukov
85b1f93f8d executor, pkg/ipc: unify ipc protocol between linux and other OSes
We currently use more complex and functional protocol on linux,
and a simple ad-hoc protocol on other OSes.
This leads to code duplication in both ipc and executor.
Linux supports coverage, shared memory communication and fork server,
which would also be useful for most other OSes.

Unify communication protocol and parametrize it by
(1) use of shmem or only pipes, (2) use of fork server.

This reduces duplication in ipc and executor and will
allow to support the useful features for other OSes easily.

Finally, this fixes akaros support as it currently uses
syz-stress running on host (linux) and executor running on akaros.
2017-10-16 14:21:54 +02:00
Dmitry Vyukov
d158fb9d3b executor: add akaros support
Does not work yet, also needs ipc changes.
2017-10-16 14:21:54 +02:00
Dmitry Vyukov
179a860885 all: basic freebsd support
For now we just make Go part build for freebsd.
2017-10-02 14:17:32 +02:00
Dmitry Vyukov
2f204f6b96 Makefile: per-install packages during arch build
We currently build fuzzer+stress+execprog per target,
since packages are not installed we build everything 3 times.
This takes time. Install packages before building binaries.
2017-10-02 13:57:04 +02:00
Dmitry Vyukov
64b6c0724d sys/windows: add more descriptions 2017-09-27 20:17:09 +02:00
Dmitry Vyukov
4b83c85945 Makefile: name windows executables with .exe suffix 2017-09-27 18:59:50 +02:00
Dmitry Vyukov
646d96d95a Makefile, sys/syz-extract: fix android 2017-09-27 08:46:03 +02:00
Dmitry Vyukov
e2f1c7ed36 Makefile: add fuchsia support 2017-09-25 15:40:58 +02:00
Dmitry Vyukov
dd56309863 sys/fuchsia: describe more syscalls 2017-09-25 08:47:48 +02:00
Dmitry Vyukov
e9c477a5b3 sys/syz-extract: support fuchsia 2017-09-25 08:47:48 +02:00
Dmitry Vyukov
f9d1a2783f Makefile: don't build 386 executor on travis
Build fails now and I don't know how to fix it.

"x86_64-linux-gnu-gcc" -o ./bin/linux_386/syz-executor executor/executor_linux.cc \
		-pthread -Wall -Wframe-larger-than=8192 -Wparentheses -Werror -O1 -g \
		"-m32" -static  -DGIT_REVISION=\"8cb7d3dcfcbe11a6d5682743816409d1c8e8f6a0+\"
In file included from /usr/include/bits/errno.h:24:0,
                 from /usr/include/errno.h:35,
                 from executor/executor_linux.cc:7:
/usr/include/linux/errno.h:1:23: fatal error: asm/errno.h: No such file or directory
 #include <asm/errno.h>
2017-09-21 10:25:59 +02:00
Dmitry Vyukov
d606e60dfe executor: split source per-OS
Update #191
2017-09-20 21:19:29 +02:00
Dmitry Vyukov
9cd52ccb43 Makefile: respect target os/arch in individual targets
Currently we set GOOS/GOARCH only in host/target targets.
This makes "make fuzzer TARGETARCH=arm64" do a wrong thing,
it still builds for the default value of GOARCH.
Set GOOS/GOARCH for each target individually.
2017-09-20 21:19:29 +02:00
Dmitry Vyukov
62114d6064 Makefile: build target binaries into separate dirs
We currently build binaries for all targets into bin.
This makes mess in bin/ and does not allow testing of different archs.
Build target binaries into bin/OS_ARCH/ subdirs.

Host binaries are still built into bin/.

Update #333
Update #324
Update #191
2017-09-19 16:44:54 +02:00
Dmitry Vyukov
539e603206 syz-manager, syz-fuzzer, executor: ensure that binaries are consistent
Check that manager/fuzzer/executor are build on the same git revision,
use the same syscall descriptions and the same target arch.

Update #336
2017-09-15 16:02:37 +02:00
Dmitry Vyukov
f7eb58493b sys/syz-extract: use consolidated target info
Move knowledge about targets from extract.sh to syz-extract,
and make it use target into from sys.
2017-09-15 16:02:37 +02:00
Dmitry Vyukov
2119c28968 sys: move extract.sh to sys/linux 2017-09-15 16:02:37 +02:00
Dmitry Vyukov
f238fbd42d all: support i386 arch
Update #191
2017-08-19 19:17:27 +02:00
Dmitry Vyukov
6aad5879f7 sys: support arm arch
Not tested, but const extraction and build works.

Update #324
Update #191
2017-08-19 10:41:24 +02:00
Dmitry Vyukov
41bbf437e1 Makefile: enforce formatting of sys files in presubmit 2017-08-18 11:26:50 +02:00
Dmitry Vyukov
5766dbe796 syz-dash, syz-gce: remove
This is now superseded by dashboard/app and syz-ci.
2017-08-02 19:50:48 +02:00
Andrey Konovalov
3eefb3bce6 makefile: cleanup
- fix and reorder .PHONY targets
- `make all` now builds everything, to build only essentials run `make main`
- `make all-tools` rename to `make tools`
2017-07-28 12:56:20 +02:00
Dmitry Vyukov
c5b6fcddca syz-hub: split client name and manager name
This allows to reduce number of hub clients by grouping managers
and creating one client per such group.
2017-06-29 17:50:44 +02:00
Zach Riggle
43f0f8f079 Add 'make android' target and document it (#255) 2017-06-26 15:55:20 +02:00