Commit Graph

744 Commits

Author SHA1 Message Date
Dmitry Vyukov
ff8c0180ab sys, executor: more kvm improvements
1. Basic support for arm64 kvm testing.
2. Fix compiler warnings in x86 kvm code.
3. Test all pseudo syz calls in csource.
4. Fix handling of real code in x86.
2017-01-12 11:57:17 +01:00
Dmitry Vyukov
bcfae12bec ifuzz: fix generation of control registers 2017-01-12 10:25:09 +01:00
Dmitry Vyukov
437a8a0b20 ifuzz/gen: speed up instruction deduplication
Takes 2.7s instead of 6.8s now.
2017-01-11 20:16:35 +01:00
Dmitry Vyukov
b8e1000d66 ifuzz: add package for generation/mutation of machine code
Add ifuzz package that can generate/mutate machine code.
It is based on Intel XED and for now supports only x86 code
(all of real, protected 16/32 and long modes).
This considerably increases KVM coverage.
2017-01-09 20:28:27 +01:00
Dmitry Vyukov
bbd4840872 sys: extend kvm support
Add new pseudo syscall syz_kvm_setup_cpu that setups VCPU into
interesting states for execution. KVM is too difficult to setup otherwise.
Lots of improvements possible, but this is a starting point.
2017-01-09 20:28:10 +01:00
Dmitry Vyukov
c377a6514d prog: reformat source 2017-01-09 20:26:34 +01:00
Dmitry Vyukov
41dcbce504 config: add another suppression for Go OOM 2017-01-09 20:20:49 +01:00
Dmitry Vyukov
244c5f60fd prog: spoof resources less frequently
Passing -1 as file descriptors and passing wrong types
proved to be not very intersting.
2017-01-09 20:20:49 +01:00
Dmitry Vyukov
bdc6d550b0 executor: use NONFAILING strcpy in syz_open_dev
The source is fuzzer provided memory, it can be non-addressable.
2017-01-09 20:20:49 +01:00
Dmitry Vyukov
c5f38186d2 csource: compile with -Werror
Check for compiler warnings during compilation.
Don't require -std=c99.
Fix existing compiler warnings.
2017-01-09 20:20:49 +01:00
Dmitry Vyukov
43d5c364a2 syz-manager: move include files to the bottom of coverage report
They are usually less interesting than source files.
2017-01-09 20:20:49 +01:00
Dmitry Vyukov
83a8f430c9 vm/qemu: add some kvm-related kernel cmd line flags
In particular it is useful to enable nested.
Enable a bunch of others as well.
2017-01-09 20:20:49 +01:00
Dmitry Vyukov
44eebebf58 add *.cfg and workdir* masks to .gitignore
I have lots of them for testing.
2017-01-09 20:20:49 +01:00
Dmitry Vyukov
40a8b2f8e1 vm/adb: increase battery check timeout
Battery info is provided by some OS services.
With KASAN/KCOV these services take long to startup.
This causes episodic timeouts during battery check.
Increase the timeout.
2017-01-09 20:20:49 +01:00
Dmitry Vyukov
327616bdb6 Add kernel-ish clang-format style suitable for emails. 2017-01-09 20:20:49 +01:00
Dmitry Vyukov
b6f204a7e4 syz-stress: add flag that controls generation of new programs 2017-01-09 20:20:49 +01:00
Dmitry Vyukov
1934b6b757 sys: replace syz_open_dev with openat
In lots of cases we don't need the special syz_open_dev call,
openat will do just fine. Standard syscalls are preferrable, so use them.
2017-01-09 20:20:49 +01:00
Dmitry Vyukov
d976f51d72 sys: detail kvm syscalls more 2017-01-09 20:20:48 +01:00
Dmitry Vyukov
e8ddc2ae56 sys: don't add clock_gettime always
Currently we always enable clock_gettime in config.
This is required since the call is needed for generation of timespec/timeval structs.
The negative side effect is that one gets clock_gettime even
if he wants to fuzz a small set of unrelated syscalls.

Don't enable clock_gettime by default.
Instead handle timeval/timespec as other resources.
2017-01-09 20:20:48 +01:00
Dmitry Vyukov
9ba75ee1d7 executor: increase coverage size from 16K to 64K PCs
On some KVM syscalls soverage reaches 36K+ PCs.
2017-01-09 20:20:48 +01:00
Dmitry Vyukov
94b38efc1d sys: allow to specify number of pages for vma type
Allows to write vma[4] or vma[5-10] to specify desired number of pages.
2017-01-09 20:20:48 +01:00
Dmitry Vyukov
b5aa8b4506 prog: test that Deserialize does not return nil prog
That happened when parser did not check scanning errors and
a program contains too long line.
2017-01-09 20:19:44 +01:00
Dmitry Vyukov
4ca49b389a csource: fix fork bomb 2017-01-09 20:19:44 +01:00
Dmitry Vyukov
746f74d254 csource: remove more predefined defines from generated source 2017-01-09 20:19:44 +01:00
Dmitry Vyukov
ec9744f3e5 syz-manager, syz-gce: output 20 log lines instead of 50 in web UI
50 lines take too much space, there is scroll bar if necessary.
2017-01-09 20:19:44 +01:00
Dmitry Vyukov
3f9152d9e2 vm/qemu: enable more kvm features in test kernel 2017-01-09 20:19:44 +01:00
Dmitry Vyukov
0913359f79 prog: increase line length limit when deserializing programs
bufio.Scanner has a default limit of 4K per line,
if a program contains longer line, it fails.
Extend the limit to 64K.
Also check scanning errors. Turns out even scanning of bytes.Buffer
can fail due to the line limit.
2017-01-09 20:19:44 +01:00
Andrey Konovalov
26f0782d08 Merge pull request #104 from xairy/bytesize-n
prog: add bytesizeN types
2017-01-09 16:43:29 +01:00
Andrey Konovalov
df98b6bde5 prog: add bytesizeN types 2016-12-20 18:12:07 +01:00
Dmitry Vyukov
80b6c954f8 manager: add ability to ignore bugs
Add new config parameter "ignores" which contains list of regexp expressions.
If one of the expressions is matched against oops line,
crash report is not saved and VM is not restarted.
2016-12-19 17:39:03 +01:00
Dmitry Vyukov
a074da17a4 vm/adb: support BeagleBone console
BeagleBone console requires some special tty-ism to work.
Fortunately, this code also works with Suzy-Q.
2016-12-19 15:56:10 +01:00
Dmitry Vyukov
53366f4571 gce: remove external IPs
No, external IPs do not help.
Seems to be some problem with kernel configs...
2016-12-16 18:50:45 +01:00
Dmitry Vyukov
fa3280e0b4 gce: temporary add external IPs to instances
There seems to be some issue with DHCP if instance does not have external IP.
Test if it will work with external IP.
2016-12-16 16:46:07 +01:00
Dmitry Vyukov
a59452c4b2 vm/gce: handle graceful preemption
In case of graceful preemption fuzzer should be terminated by SIGTERM.
Catch it and propagate to manager.
2016-12-16 16:11:18 +01:00
Dmitry Vyukov
f83633edbe tools/syz-symbolize: add report symbolizer utility 2016-12-16 15:53:30 +01:00
Dmitry Vyukov
c0edd52ce1 report: whitelist WARNING printed by sshd 2016-12-16 15:48:14 +01:00
Dmitry Vyukov
81efdbb29c sys: describe new pkey_* syscalls 2016-12-16 15:42:11 +01:00
Dmitry Vyukov
739d40c1b8 report: support new stack trace format without PC values 2016-12-16 15:40:53 +01:00
Dmitry Vyukov
5d23ba9171 executor: don't fail on ENOMEM 2016-12-16 15:36:29 +01:00
Dmitry Vyukov
d1b6b5b9b1 syz-extract: don't fail if no flags to extract 2016-12-13 21:07:59 +01:00
Dmitry Vyukov
fb3b63b70e Merge pull request #103 from tjjh89017/patch-repro
Fix make repro failed
2016-12-12 14:44:00 +01:00
Date Huang
d536a20ed5 Fix make report failed 2016-12-12 19:19:09 +08:00
Dmitry Vyukov
df27b4deaf Merge pull request #102 from ste/url-fix
Fix broken links for KASAN and KUBSAN
2016-12-09 21:38:21 +01:00
Stephen Hildrey
611fbd7885 Fix broken links for KASAN and KUBSAN 2016-12-09 20:32:10 +00:00
Dmitry Vyukov
9c94dffdc5 executor: handle exit failures
See the added comment for explanation.
2016-12-08 17:38:31 +01:00
Dmitry Vyukov
ebfa6e169e ipc: produce more detailed error messages
Always prepend executor PID to error messages,
so it is clear what program triggered a bug.
Extend coverage parsing error messages.
2016-12-08 17:28:48 +01:00
Dmitry Vyukov
73b7be0e9c manager: print how long VMs running before restarting
For a potential case VM unexpectedly exits too early.
2016-12-08 17:28:42 +01:00
Dmitry Vyukov
6f9e42e9ba report: support "spinlock recursion" oops 2016-12-07 16:43:48 +01:00
Dmitry Vyukov
72a439b447 executor: add struct to cap structs
Otherwise it does not compile as C.
Also regenerate csource/common.go (it misses the MAX_PIDS change).
2016-12-07 16:00:20 +01:00
Dmitry Vyukov
60fd47e308 tools/create-image.sh: install sudo into the image 2016-12-07 15:58:51 +01:00