Commit Graph

621 Commits

Author SHA1 Message Date
Dmitry Vyukov
77e79ca08e sys/linux: add userio descriptions
Update #533
2018-08-26 04:54:54 +02:00
Dmitry Vyukov
76e7c3dfb4 sys/netbsd: use posix helper instead of copy-pasted code
We now have this common logic in sys/targets,
so use it instread of copy-pasted code.
I missed this file during the refactoring.
2018-08-25 09:05:51 -07:00
Dokyung Song
1d9f787ea6 sys/fuchsia: Remove read_status from zx_channel_call args, and reflect zx_time_t type change (unsigned -> signed) 2018-08-24 20:01:29 -07:00
Dmitry Vyukov
2dc4378f02 prog: don't add fallback signal after seccomp
seccomp filter can produce arbitrary errno values for subsequent syscalls.
Don't trust anything afterwards.
2018-08-19 00:13:24 -07:00
Dmitry Vyukov
7067e78fd6 executor: fix gcc warnings in fuchsia generated code
gcc complains about function declarations not being prototypes,
signed/unsigned cast mismatch and casts between incompatible functions.
Fix them.
2018-08-19 01:53:59 +02:00
Dokyung Song
db1858f6b9 sys/fuchsia: semi-automatically generated FIDL launcher description 2018-08-17 14:31:53 -07:00
Dmitry Vyukov
9ccc1d4565 sys/linux: add uinput support 2018-08-15 01:50:08 +02:00
Dmitry Vyukov
0e6dcb8809 sys/linux: add uhid support 2018-08-15 00:10:16 +02:00
Dmitry Vyukov
1be453f07b sys/linux: fix invalid cdrom description 2018-08-10 18:44:31 +02:00
Dmitry Vyukov
3a2fe60529 executor: fix cgroups
1. Create per-proc cgroup in executor.
2. Setup cgroups after chdir into test dir
   (it assumes relative paths against test dir).
3. Add test.
2018-08-09 16:05:46 +02:00
Dmitry Vyukov
922e8e2734 executor: mount binfmt_mist
We forgot to mount binfmt_misc. Mount it. Add a test.
Increase per-call timeout, otherwise last execve timesout.
Fix csource waiting for call completion at the end of program.
2018-08-09 16:05:46 +02:00
Dmitry Vyukov
acf31536e9 executor: clean up immutable dirs
Turns out dirs can be immutable too.

Update #650
2018-08-09 16:05:46 +02:00
Dokyung Song
2eeda842c8 sys/fuchsia: add syscall description for binding channels to Launcher 2018-08-08 19:31:56 +02:00
Dmitry Vyukov
d46deef51c executor: clean up immutable files
Fixes #650
2018-08-08 15:06:29 +02:00
Dmitry Vyukov
3653592507 pkg/runtest: assorted improvements
Support checking "blocked"/"unfinished" flags for calls.
Support test constanints, e.g. "requires: threaded" or "requires: -sandbox=setuid".
Some improvements in tools/syz-runtest.

Update #603
2018-08-08 15:05:01 +02:00
Dmitry Vyukov
3a7200e49b executor: abort fuse connection
If the test process is not dying after 100ms,
abort all fuse connections in the system.
This gets rid at least of simple fuse deadlocks,
let's see how well this works in all cases.
2018-08-04 17:50:58 +02: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
78e3ad98f6 sys/test: add more tests
Add syz_errno syscall which sets errno to the argument,
and add a test with different errno values.
This mostly tests the testing infrastructure itself.

Add syz_compare syscall which compare two blobs,
this can be used for testing of argument memory layout.

Implement syz_mmap and fix Makefile to allow building syz-execprog for test OS.
Useful for debugging.

Update #603
2018-08-03 19:53:14 +02:00
Dmitry Vyukov
5ba57bfe16 pkg/runtest: add package for syzkaller program unit-testing
Package runtest is a driver for end-to-end testing of syzkaller programs.
It tests program execution via both executor and csource,
with different sandboxes and execution modes (threaded, repeated, etc).
It can run test OS programs locally via run_test.go
and all other real OS programs via tools/syz-runtest
which uses manager config to wind up VMs.
Test programs are located in sys/*/test/* files.

Update #603
2018-08-03 18:47:42 +02:00
Dokyung Song
cc4f6d0a87 sys/fuchsia: zx_log_* got replaced by zx_debuglog_* 2018-08-03 12:03:03 +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
88d4a8fc56 sys/syz-extract: refactor main
main is too long and complex. Move more logic into helper functions.

Update #538
2018-08-02 16:57:32 +02:00
Dmitry Vyukov
8ef497b652 gometalinter: clean up vetshadow
This just cleans up existing warnings.
vetshadow is not enabled yet because it crashes.

Update #538
2018-07-31 20:38:33 +02:00
Dmitry Vyukov
f5d67fbd9c .gometalinter.json: enable gofmt
The part that we want from gofmt is simplify (-s).
Fix all code that needs fixing.

Update #538
2018-07-31 12:16:54 +02:00
Dokyung Song
6982d892b6 sys/targets: fix Fuchsia lib directory
to fix linking error when building syz-executor for Fuchsia.
2018-07-25 08:26:57 +02:00
Dmitry Vyukov
4969639c7c executor: fix strict aliasing violations
test_copyin does bad things. Fix that.

executor/test.h: In function ‘int test_copyin()’:
executor/common.h:299:16: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
   *(type*)(addr) = (type)(val);                                     \
                ^
2018-07-24 13:29:26 +02:00
Dmitry Vyukov
9fe4bdc5f1 executor: overhaul
Make as much code as possible shared between all OSes.
In particular main is now common across all OSes.
Make more code shared between executor and csource
(in particular, loop function and threaded execution logic).
Also make loop and threaded logic shared across all OSes.
Make more posix/unix code shared across OSes
(e.g. signal handling, pthread creation, etc).
Plus other changes along similar lines.
Also support test OS in executor (based on portable posix)
and add 4 arches that cover all execution modes
(fork server/no fork server, shmem/no shmem).

This change paves way for testing of executor code
and allows to preserve consistency across OSes and executor/csource.
2018-07-24 12:04:27 +02:00
Hangbin Liu
570df9b277 sys/linux/socket_netlink_route: add specific policies for IFLA_LINKINFO
Add interface specified policies for IFLA_LINKINFO. I only added the
interfaces we create in initial setup. Remain other types of interfaces
in the TODO list.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
2018-07-17 10:08:31 +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
fcdb43e97d sys/linux: regenerate files 2018-07-13 12:44:14 +02:00
Dmitry Vyukov
f642b4185a sys/linux: improve fuse descriptions 2018-07-12 12:36:38 +02:00
Dmitry Vyukov
95e7a88b97 sys/linux: implement fuse as normal syscalls
Remove syz_fuse* and implement them as normal syscalls.
We not have enough expressive power to form mount options.
2018-07-10 16:18:45 +02:00
Dmitry Vyukov
40ed7e838a sys/linux: use fmt in filesystem options
We currently generate poor formatted intergers,
generate proper integers using the new fmt type.
2018-07-09 21:42:43 +02:00
Dmitry Vyukov
59da9e4393 sys/linux: use negative consts where useful 2018-07-09 20:54:47 +02:00
Dmitry Vyukov
f25e577041 sys/linux: refine 9p descriptions
RVERSION needs to use 0xffff tag, otherwise parsing fails.
Use only tags 1 and 2. They are densely allocated,
so most of the time it's 1. And it needs to be correct in
multiple replies for mount to succeed. So limit tag space.
2018-07-08 22:52:24 +02:00
Dmitry Vyukov
4bf3b336eb sys/linux: modernize cgroup descriptions 2018-07-08 22:52:24 +02:00
Dmitry Vyukov
e63a51b4b3 sys/linux: modernize selinux descriptions 2018-07-08 22:52:24 +02:00
Dmitry Vyukov
eb5690a56d sys/linux: extend 9p descriptions
Add actual protocol messages.
2018-07-08 22:52:24 +02:00
Dmitry Vyukov
306ca0571c prog, pkg/compiler: support fmt type
fmt type allows to convert intergers and resources
to string representation.
2018-07-08 22:52:24 +02:00
Dmitry Vyukov
c9a7a4dccd executor: executor fix fuchsia build 2018-07-07 19:08:38 +02:00
Dmitry Vyukov
4b2ad42d41 sys/linux: refine vfat/msdos options 2018-07-07 16:25:40 +02:00
Julia Hansbrough
ab89aea98e sys/fuchsia: Update Fuchsia syscalls.
Updates cover
* zx_vmo_create
* zx_clock_get_monotonic
* hypervisor- and vCPU-related syscalls
* system_get_features
* some DDK syscalls
2018-07-07 13:56:36 +02:00
Dmitry Vyukov
6c0c0099a0 sys/linux: add 9p descriptions
Only mount for now.
2018-07-06 21:31:31 +02:00
Dmitry Vyukov
c8672723c6 sys/linux: update autogenerated files
"sys/linux: add mount$bpf" commit did not include these changes.
2018-07-06 20:19:58 +02:00
Dmitry Vyukov
3439016dc2 sys/akaros: add all syscalls 2018-07-06 20:19:03 +02:00
Dmitry Vyukov
9636bc933e sys/linux: add mount$bpf
Plus some minor assorted fixes.
2018-07-06 15:29:52 +02:00