Commit Graph

182 Commits

Author SHA1 Message Date
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
Dmitry Vyukov
9e2843cdfd Makefile: actually cross-compile during presubmit 2017-06-26 15:45:51 +02:00
Zach Riggle
2420edb02e Port console to Darwin (#253)
* Port console to Darwin

* Get syz-executor to build correctly

* Do not export unix and syscall constants

* Add presubmit test

* Add myself to contributors
2017-06-26 15:32:38 +02:00
Dmitry Vyukov
6573032fff syz-ci: add continuous integration system 2017-06-20 19:59:55 +02:00
Dmitry Vyukov
c9ee712bc8 sys/syz-extract: move from syz-extract 2017-06-17 14:41:15 +02:00
Dmitry Vyukov
6828dc3a61 sys/syz-sysgen: from from sysgen 2017-06-17 14:41:15 +02:00
Dmitry Vyukov
2007005ac3 sys/sysparser: move from sysparser 2017-06-17 14:41:15 +02:00
Dmitry Vyukov
baad3b4b02 pkg/csource: move from csource 2017-06-17 14:41:15 +02:00
Dmitry Vyukov
263579827a executor: fix compiler warnings in test 2017-06-14 13:06:03 +02:00
Andrey Konovalov
0f784d778d makefile: list generated packages 2017-06-14 13:05:05 +02:00
Andrey Konovalov
a59133e503 makefile: add db target to build syz-db 2017-06-14 12:56:16 +02:00
Andrey Konovalov
0ff787f888 makefile: generate: do go generate && format 2017-06-14 12:56:16 +02:00
Dmitry Vyukov
47be383ea0 executor: fix clang-tidy warnings
A single check is enabled for now (misc-definitions-in-headers).
But it's always fixable and found 2 bugs in csource.
2017-06-13 17:21:33 +02:00
Dmitry Vyukov
3751542e1e sys: check in generated files
We used to have all generated files checked in.
Later we removed them (now users are supposed to
run make to generate them). This causes several
problems:

 - go get does not work as it tries to build everything
   straight away (go get -d works, but users are confused)
 - users don't run make and complain that build is broken
 - users don't re-run make after updates and complain that
   build is broken
 - hard to integrate into other build system (even if they
   support building Go, they don't support running sysgen
   out-of-the-box)

Fixes #216
2017-06-13 15:55:31 +02:00
Dmitry Vyukov
7ab352e19d executor: limit stack frame size
Stack usage warning currently breaks our internal build (with 16K frame limit).
Executor uses stacks of limited size, that's another reason to not
allow frames of arbitrary size.

Limit stack frame size to 8K.
Reduce tun packet size. We don't need to read out whole packet.
2017-05-31 20:24:45 +02:00
Dmitry Vyukov
108115666b Makefile: don't generate DWARF for Go binaries
Reduces build time and binary sizes considerably.
2017-05-29 13:15:17 +02:00
Andrey Konovalov
e7e90813b4 makefile: fix syz-extract dependencies 2017-01-23 17:27:59 +01:00
Dmitry Vyukov
3db67897de tools/kcovtrace: add KCOV-based tracing utility
kcovtrace is like strace but show kernel coverage collected with KCOV.
It is very simplistic at this point and does not support multithreaded processes, etc.
It can be used to understand, for example, exact location where kernel bails out
with an error for a particular syscall.
2017-01-20 14:56:20 +01:00
Date Huang
d536a20ed5 Fix make report failed 2016-12-12 19:19:09 +08:00
Dmitry Vyukov
59f7c210d0 repro: factor out of syz-repro tool
Factor out repro logic from syz-repro tool,
so that it can be used in syz-manager.
Also, support sandboxes in code generated by
csoure. This is required to reproduce crashes
that require e.g. namespace sandbox.
2016-11-19 10:00:36 +01:00
Dmitry Vyukov
a1e31d54b4 Makefile: don't change source files in default action
Default make action invokes 'go generate'. That's not necessary.
File produced by 'go generate' are checked in. Do it in presubmit instead.

Default make action reformats source files. This is bad for users who
do not actually work on source code, but just use syzkaller:
1. requires clang-format to be installed
2. can change some source files (if they were checked in unformatted)
Don't reformat in 'make', instead do it in presubmit.

Also don't invoke 'go install ./...' as it can install too much
(e.g. all tools). Install just minimally necessary packages.
2016-10-07 19:07:05 +02:00
Andrey Konovalov
b537661a8f makefile: syz-sysgen depends on sysparser/*.go 2016-09-19 16:26:39 +02:00
Dmitry Vyukov
004cfce354 Makefile: run generate in 'all'
Now that we removed autogenerated files,
people complain that 'make' does not work.
2016-09-05 12:52:02 +02:00
Dmitry Vyukov
5a6ebade95 Makefile: format after generate 2016-09-02 18:50:58 +02:00
Dmitry Vyukov
8278953eb4 csource: teach how to execute pseudo syz_ syscalls
Update #59
2016-08-28 16:33:32 +02:00
Dmitry Vyukov
9b91ede860 executor, csource: share some common code between executor and csource 2016-08-28 14:59:48 +02:00
Dmitry Vyukov
0d0fbbe73f overhaul syscall description generation process
This splits generation process into two phases:
1. Extract values of constants from linux kernel sources.
2. Generate Go code.

Constant values are checked in.
The advantage is that the second phase is now completely independent
from linux source files, kernel version, presence of headers for
particular drivers, etc. This allows to change what Go code we generate
any time without access to all kernel headers (which in future won't be
limited to only upstream headers).

Constant extraction process does require proper kernel sources,
but this can be done only once by the person who added the driver
and has access to the required sources. Then the constant values
are checked in for others to use.
Consant extraction process is per-file/per-arch. That is,
if I am adding a driver that is not present upstream and that
works only on a single arch, I will check in constants only for
that driver and for that arch.
2016-08-26 07:09:25 +02:00
Baozeng Ding
1dbfdcf757 sys: support kcm and netrom 2016-06-13 09:28:38 +08:00
David Drysdale
064e1a65a5 sysgen: Cope with non-inline kernel build
When regenerating system call tables, cope with a local kernel tree where
the kernel has been built into a separate directory (with `make O=...`) rather
than inline.

So:
 - LINUX makefile var / -linux command line option give location of source tree
 - LINUXBLD makefile var / -linuxbld command line option gives location of
   built kernel
2016-03-10 14:33:32 +00:00
David Drysdale
98cd0cc66d Makefile: Split generate: target
Make it easier to re-run without recompiling.
2016-03-10 14:32:49 +00:00
Dmitry Vyukov
22fda1e655 Merge pull request #14 from sploving/master
sys: support /dev/random and /dev/net/tun
2016-01-26 16:42:23 +01:00
Baozeng Ding
4bbea2300f sys: support /dev/random and /dev/net/tun 2016-01-26 00:45:49 +08:00
Dmitry Vyukov
71c8a60fee Makefile: use -pthread instead of -lpthread
The latter does not work on android.
2016-01-25 11:06:30 +01:00
Dmitry Vyukov
1000609a2c Makefile: allow to build executor without -static
-static is not supported on some platforms
2016-01-25 11:06:30 +01:00
Dmitry Vyukov
f5311fac95 sys: add basic netlink support for real 2016-01-23 21:27:57 +01:00
Dmitry Vyukov
b217dcb509 sys: support /dev/input/{mouse,mice,event} 2016-01-13 20:45:35 +01:00
Dmitry Vyukov
91630fe39d sys: add support for /dev/snd/control 2016-01-13 16:54:29 +01:00
Dmitry Vyukov
bca57831a5 sys: add support for /dev/snd/timer 2016-01-12 20:14:56 +01:00
Dmitry Vyukov
15128d47bd sys: support /dev/snd/seq 2016-01-11 22:26:09 +01:00
Dmitry Vyukov
bb47c6540d sys: add kvm support 2016-01-08 22:41:36 +01:00
Dmitry Vyukov
33950d306a executor: fix some bugs found by clang 2015-12-31 17:52:26 +01:00
Dmitry Vyukov
28b3d1e1ab sys: add sctp support 2015-12-30 13:04:00 +01:00
Dmitry Vyukov
bd768c8f40 sys: move more subsystems into separate files 2015-12-28 16:11:15 +01:00
Dmitry Vyukov
eef80b3d76 sys: split syscall description into several files 2015-12-28 15:53:32 +01:00
Dmitry Vyukov
9f9ae3fcc3 tools/syz-upgrade: helper tool for corpus format upgrades 2015-12-28 12:49:19 +01:00
Dmitry Vyukov
af4e0c0b7a sysgen: pull in syscall numbers from kernel headers
Syscall numbers for different architectures are now pulled in
from kernel headers. This solves 2 problems:
 - we don't need to hardcode numbers for new syscalls (that don't present in typical distro headers)
 - we have correct number for different archs (previously hardcoded numbers were for x86_64)
This also makes syscall numbers available for Go code, which can be useful.
2015-12-24 19:13:08 +01:00
Dmitry Vyukov
d4180ca5c7 tools/syz-repro: add reproduction tool 2015-12-23 19:19:45 +01:00
David Drysdale
27e09c9145 Add 'all-tools' target to build tools
Also remove leftover mention of 'master'
2015-12-21 13:29:09 +00:00
Dmitry Vyukov
8e7ca7c5ff remove master and naming overhaul
Remove master process entirely, it is not useful in its current form.
We first need to understand what we want from it, and them re-implement it.

Prefix all binaries with syz- to avoid name clashes.
2015-12-17 16:06:33 +01:00
Dmitry Vyukov
3716eb3830 format go files simpler 2015-11-10 20:32:03 +01:00
Andrey Konovalov
87a42c4dc3 Add Makefile 2015-10-13 15:31:56 +02:00