Commit Graph

21 Commits

Author SHA1 Message Date
Dmitry Vyukov
2b084c9886 pkg/csource: use 0 for missing syscall args
We don't specify trailing unused args for some syscalls
(e.g. ioctl that does not use its arg).
Executor always filled tailing unsed args with 0's
but pkg/csource didn't. Some such syscalls actually
check that the unsed arg is 0 and as the result failed with C repro.

We could statically check and eliminate all such cases,
but it turns out the warning fires in 1500+ cases:
a3ace5a63f/gistfile1.txt

So instead fill such args with 0's in pkg/csource too.
2018-12-27 13:11:57 +01:00
Dmitry Vyukov
ecb386fe6f sys: check that target consts are defined
Currently when we get target consts with target.ConstMap["name"]
during target initialization, we just get 0 for missing consts.
This is error-prone as we can mis-type a const, or a const may
be undefined only on some archs (as we have common unix code
shared between several OSes).
Check that all the consts are actually defined.
The check detects several violations, to fix them:
1. move mremap to linux as it's only defined on linux
2. move S_IFMT to openbsd, as it's only defined and used on openbsd
3. define missing MAP_ANONYMOUS for freebsd and netbsd
4. fix extract for netbsd
2018-10-19 19:11:22 +01:00
Dmitry Vyukov
a4718693a3 sys/linux: add syz_execute_func
The function executes random code.

Update #310
2018-08-30 21:45:04 -07:00
Dmitry Vyukov
2763e04c22 tools/syz-runtest: add tool for program unit testing
The tool is run as:

$ syz-runtest -config manager.config

This runs all programs from sys/*/test/* in different modes
on actual VMs and checks results.

Fixes #603
2018-08-03 21:08:02 +02:00
Dmitry Vyukov
5b7e23bb61 sys/akaros: remove /dev/cons
Presumably it causes corrupted console output.
2018-08-02 19:47:32 +02:00
Dmitry Vyukov
d9a893a554 Makefile: don't compile all targets into target binaries
Currently target binaries contain support for all OS/arch combinations.
However, obviously a fuchsia target binary won't test windows.
For target binaries we need support only for a single target
(with the exception of 386/arm target in amd64/arm64 binaries).
So compile in only _the_ target into target binaries.
This reduces akaros/amd64 fuzzer binary from 33 to 7 MB
and execprog from 28 to 2 MB.
2018-08-02 19:07:22 +02:00
Dmitry Vyukov
1376136672 sys/akaros: add a bunch of global files for akaros 2018-07-16 20:30:09 +02:00
Dmitry Vyukov
40cb0c9aa6 sys/akaros: fix signatures of file syscalls
Most of them differ and accept path length and/or pid.
2018-07-16 17:39:58 +02:00
Dmitry Vyukov
df5ae5f537 sys/akaros: don't call provision(-1)
It causes kernel debug splat,
which has high chances of corrupting kernel crashes.
2018-07-16 17:02:02 +02:00
Dmitry Vyukov
7cfcfa6a73 sys/akaros: disable init_arsc syscall
It unconditionally crashes kernel now.
2018-07-16 16:57:35 +02:00
Dmitry Vyukov
3439016dc2 sys/akaros: add all syscalls 2018-07-06 20:19:03 +02:00
Dmitry Vyukov
5012ddc8eb prog: detect when flags are a bitmask 2018-06-30 13:27:24 +02:00
Dmitry Vyukov
920b18be87 sys: mark output resources as opt
Mark output resources as opt in preparation for more
precise constructor calculation.
2018-06-18 19:45:47 +02:00
Dmitry Vyukov
cda1fcb742 sys: dedup mmap code across OSes
Update #538
2018-05-06 16:58:38 +02:00
Dmitry Vyukov
31ea20ce83 sys: move generate files to separate packages
Move generated files to gen subdir. This allows to:
1. Rebuild init.go without rebuilding generated code.
2. Excluding generated files from gometalinter checking.
This makes faster and consume less memory.

Update #538
2018-05-05 15:40:10 +02:00
Dmitry Vyukov
4c24e4a467 gometalinter: enable package comment checking
Update #538
2018-05-03 13:53:01 +02:00
Dmitry Vyukov
1f4ae3f413 pkg/compiler: don't assign call IDs statically
IDs change whenever a call is added or removed,
this leads to large diffs unnecessarly.
Assign IDs dynamically.
2018-02-25 14:31:40 +01:00
Dmitry Vyukov
75a7c5e2d1 prog: rework address allocation
1. mmap all memory always, without explicit mmap calls in the program.
This makes lots of things much easier and removes lots of code.
Makes mmap not a special syscall and allows to fuzz without mmap enabled.

2. Change address assignment algorithm.
Current algorithm allocates unmapped addresses too frequently
and allows collisions between arguments of a single syscall.
The new algorithm analyzes actual allocations in the program
and places new arguments at unused locations.
2018-02-19 21:48:20 +01:00
Dmitry Vyukov
5585946e22 pkg/compiler: support void type
"void": type with static size 0
	mostly useful inside of templates and varlen unions
	can't be syscall argument
2018-01-13 12:52:09 +01:00
Dmitry Vyukov
bb146866c0 executor: improvements for akaros
1. remove workaround for pthread attrs (was fixed in akaros)
2. remove workaround for dup2 (was fixed in akaros)
3. check that we receive a program
4. implement timeout for test processes
2017-10-17 10:57:38 +02:00
Dmitry Vyukov
2647772874 sys/akaros: add akaros support 2017-10-16 14:21:54 +02:00