Commit Graph

2682 Commits

Author SHA1 Message Date
Dmitry Vyukov
b8bd991ee2 executor: make current_time_ms/sleep_ms
Fix conditions for when current_time_ms/sleep_ms are used
and make them static.
2018-07-30 11:17:44 +02:00
Dmitry Vyukov
1a381291a3 executor: collect coverage from unfinished syscalls
Write coverage from unfinished syscalls.
Also detect when a syscall was blocked during execution,
even if it finished. Helpful for fallback coverage.

Fixes #580
2018-07-29 19:46:05 +02:00
Dmitry Vyukov
0824d7a1bf vm/gce: fix build
fail
2018-07-29 10:16:20 +02:00
Dmitry Vyukov
419000cc0a vm: fix "kill fuzzer on first kernel bug"
The problem with that commit is that for GCE implementation
we immidiately kill console connection too when receive diagnose signal.
This leads to truncated output.
2018-07-29 10:07:30 +02:00
Dmitry Vyukov
ebf656d79b syz-fuzzer: generate programs more frequently if no coverage
Generating every other time should be good,
because fallback signal is really weak.
2018-07-27 21:13:10 +02:00
Dmitry Vyukov
3abee99f46 dashboard/app: fix crash selection for reporting
See the issue for the problem description.
Include repro level into reporting priority,
so that we can order by just it during selection
and ignore ReproC/ReproSyz.

Fixes #634
2018-07-27 21:10:01 +02:00
Dmitry Vyukov
a43c5ed638 pkg/csource: turn off 32-bit tests
Test OS fails the same was as linux on travis.
2018-07-27 13:48:44 +02:00
Dmitry Vyukov
9faf980ad5 executor: disable clang-format for some parts
clang-format badly mishandles this part,
moreover different versions mishandle it differently.
2018-07-27 13:48:44 +02:00
Dmitry Vyukov
ca3f673ab4 .travis.yml: use clang-format 6.0.1 2018-07-27 13:48:44 +02:00
Dmitry Vyukov
788351b1b0 pkg/csource: rewrite gen.sh in Go
Shell files cause portability problems.
On Linux it's hard to install /bin/sh,
/bin/bash is not present on *BSD.
Any solution is hard to test on Darwin.
Don't even want to mention Windows.

Just do it in Go.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
b25fc7b831 pkg/csource: add option to trace syscall results
This will be needed for testing of generated programs.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
9d92841b4e pkg/csource: tidy generated code
1. Remove unnecessary includes.
2. Remove thunk function in threaded mode.
3. Inline syscalls into main for the simplest case.
4. Define main in common.h rather than form with printfs.
5. Fix generation for repeat mode
   (we had 2 infinite loops: in main and in loop).
6. Remove unused functions (setup/reset_loop, setup/reset_test,
   sandbox_namespace, etc).
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
c3da5dc5e0 executor: simplify event_timedwait
We always have current_time_ms in event_timedwait
so use it instead of manual clock_gettime calls
which tend to be bulkier.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
4dcfea28eb pkg/host: support test OS
test OS parasitizeson other OSes just as akaros,
and there is nothing to detect as well.
So use the same stub for test as for akaros.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
22105302cc executor: ignore unshare errors in setuid sandbox
We already do this in sandbox=none, but forgot about setuid.
2018-07-27 10:22:23 +02:00
Dmitry Vyukov
c7725f52b1 syz-execprog: initialize net devices 2018-07-27 10:22:23 +02:00
Dmitry Vyukov
68faa52582 prog: parse comments in serialized programs
Remember per-call comments, will be useful for annotating tests.
Also support this form:
call() # comment
2018-07-27 10:22:23 +02:00
Zach Riggle
0889ba7a79 adb: Add console logic for ttyUSB.serial
By using UDEV rules, we can create device nodes which exist at

	/dev/ttyUSB.{android device serial}

Which makes it easier to determine which console belongs to a device.

While this is non-standard behavior, it's an inexpensive path check
and makes the lookup faster and deterministic.
2018-07-26 20:13:37 +02:00
Dmitry Vyukov
ad155aa428 pkg/csource: say what compiler is missing 2018-07-25 10:44:45 +02:00
Dmitry Vyukov
e0c1bcbabc prog: move MaxPids const to prog
The const may be needed by other packages.
E.g. when checking manager config.
2018-07-25 10:39:29 +02:00
Dmitry Vyukov
3cbc0ac516 pkg/csource: tun/cgroups are linux-specific 2018-07-25 10:39:29 +02:00
Dmitry Vyukov
5164d966fd executor: remove unused file
Leftover after "executor: overhaul".
2018-07-25 10:39:29 +02:00
Dmitry Vyukov
1ca246b8b2 Makefile: fix build 2018-07-25 08:39:05 +02:00
Dmitry Vyukov
da1670a69d Makefile: install /bin/sh
Installs /bin/sh required for pkg/csource/gen.sh
2018-07-25 08:36:42 +02:00
Anton Lindqvist
9182049979 pkg/csource: remove /bin/bash assumption
OpenBSD and probably other BSDs does not ship with /bin/bash. This particular
script runs fine with regular /bin/sh.
2018-07-25 08:30:07 +02:00
Julia Hansbrough
a922a2e809 [manager] Fix typo.
s/cash/crash/
2018-07-25 08:28:36 +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
375a3e31e1 pkg/build: save kernel config early
Currently we don't capture kernel config for broken builds
because the config is saved as the last step.
Save it as early as possible.
2018-07-24 14:30:05 +02:00
Dmitry Vyukov
9b6bfa3fe8 dashboard/app: don't show broken links to empty configs 2018-07-24 14:29:21 +02:00
Dmitry Vyukov
daf70d7973 dashboard/config: disable CONFIG_DRM_AMDGP
Causes build failures:
https://syzkaller.appspot.com/bug?extid=9118f0a7ae77f4eee4a9
and we don't test it anyway.

While we are here disable other GPUs
and update config to latest version.
2018-07-24 14:28:01 +02:00
Dmitry Vyukov
d1ed573636 Makefile: disable 32-bit executor build
Fails on travis...
2018-07-24 14:04:43 +02:00
Dmitry Vyukov
beb957b793 vm/qemu, vm/gce: kill fuzzer on first kernel bug
Some kernel bugs don't stop kernel.
For such bugs whiel vm.MonitorExecution waits for kernel output for 10 secs,
fuzzer continues running programs and produces tons of output
after the kernel bug message. Kill fuzzer once MonitorExecution
detects a kernel bug.
2018-07-24 13:44:48 +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
Dmitry Vyukov
db7957bc09 pkg/report: add format for akaros warnings 2018-07-24 10:10:45 +02:00
Dmitry Vyukov
a0512a53a3 vm/qemu: use e1000 instead of e1000e
e1000e fails on recent Debian distros with:
Initialization of device e1000e failed: failed to find romfile "efi-e1000e.rom
2018-07-23 20:28:18 +02:00
Anton Lindqvist
912c93d745 executor: fix typo in comment 2018-07-23 11:11:32 +02:00
Anton Lindqvist
54bb6b9222 prog: add missing Default() implementation for ConstType 2018-07-23 11:11:32 +02:00
Anton Lindqvist
e3c4ac00ee executor: ensure RLIMIT_NOFILE is greater than kInPipeFd 2018-07-23 11:11:32 +02:00
Anton Lindqvist
3f17ab418a executor: add missing cover_size_ptr field 2018-07-23 11:11:32 +02:00
Jiangen Jiao
f69c5fcd76 syz-manager: Support kernelSrc and vmlinux from different tree
If vmlinux built from different tree from kernelSrc, cover page will failed to
show. So match only the path without prefix.
2018-07-23 09:52:04 +02:00
Dmitry Vyukov
8cc079c3f6 syz-ci: fix poll of fixing commits 2018-07-20 20:48:34 +02:00
Dmitry Vyukov
af255b09a7 pkg/vcs: poll fixing commits on akaros and fuchsia 2018-07-20 20:26:59 +02:00
Dmitry Vyukov
49f3583951 pkg/report: add another akaros backtrace message 2018-07-18 17:34:19 +02:00
Dmitry Vyukov
809256c36c dashboard/config: add fs.mount-max = 100 sysctl
See "mnt: Add a per mount namespace limit on the number of mounts"
commit for details.
2018-07-18 11:14:00 +02:00
Dmitry Vyukov
6d5bd5b5eb syz-ci: fix arch passed to build.Clean 2018-07-17 17:55:52 +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
bad4246bf2 pkg/report: improve akaros reporter and implement symbolization 2018-07-16 17:03:14 +02:00