Commit Graph

2481 Commits

Author SHA1 Message Date
Alexander Potapenko
fb6f59caba Add the /dev/tlk_device (Open Trusted Execution device driver) description 2016-09-05 11:00:05 +02:00
Dmitry Vyukov
09f9a9a968 Update README.md 2016-09-04 12:32:23 +02:00
Dmitry Vyukov
80394dfdd5 Update README.md 2016-09-04 12:31:49 +02:00
Dmitry Vyukov
fcf6db1996 sys: remove autogenerated files
They were necessary when they were the source of constant values
extracted from kernel code (hard to do). Now constants are checked-in
separately, and these large files can be easily regenerated with 'make generate'.
Now they are only a source of large uninteresting diffs in commits.
Remove them.
2016-09-02 18:57:29 +02:00
Dmitry Vyukov
5a6ebade95 Makefile: format after generate 2016-09-02 18:50:58 +02:00
Dmitry Vyukov
97bd0d9fdb sysgen: check that structs are not passed as syscall arguments 2016-09-02 18:37:27 +02:00
Dmitry Vyukov
0e77b5a187 manager, repro: unify VM monitoring
Unify and factor out VM monitoring loop used in syz-manager and syz-repro.
This allows syz-repro to detect all the same bugs (e.g. "no output", "lost connection", etc).
And also just deduplicates code.
2016-09-01 19:54:55 +02:00
Dmitry Vyukov
27b03f4ba3 prog: generate shifted integers with some probability
Useful for bitfield-like integers.
2016-09-01 17:17:37 +02:00
Dmitry Vyukov
b06a63128a manager: improve how crashes are saved
Now crashes dir contains 1 subdirectory per unique crash type.
Each subdirectory contains 'description' file with a unique string identifying
the crash type (e.g. "KASAN: slab-out-of-bounds Read of size 2 in bit_putcs"),
and up to 100 logN and reportN files with raw crash log (as before) and
post processed kernel oops message.
2016-09-01 17:08:22 +02:00
Dmitry Vyukov
9ec6b54fae report: add a function that symbolizes reports 2016-09-01 15:09:39 +02:00
Dmitry Vyukov
54d923bb5d manager: mark covered lines with /*covered*/
Mark covered lines with /*covered*/ in coverage report,
so that it is possible to quickly find if there are few of them.
2016-08-31 19:20:27 +02:00
Dmitry Vyukov
365791764b symbolizer: move symbolizer to a separate package
Make it reusable.
Support several binaries (vmlinux, modules).
Support symbolization of individual PCs.
Add tests.
2016-08-31 19:20:21 +02:00
Dmitry Vyukov
bb1e3bfda5 report: extract better, unique identifiers of oopses 2016-08-31 13:20:57 +02:00
Dmitry Vyukov
14dfa4f109 report: add a new package for report parsing and processing
Move vm.FindCrash to the new package.
2016-08-30 15:19:28 +02:00
Dmitry Vyukov
bc9b349bd7 vm/adb: support multiple adb devices
Device IDs are specified in "devices" config param.
2016-08-30 14:33:39 +02:00
Dmitry Vyukov
26a5cf9efa vm: fix potential deadlock in OutputMerger 2016-08-28 21:00:18 +02:00
Dmitry Vyukov
e9d2eec662 sys: fix incorrect argument type introduced in 7690667267 2016-08-28 20:17:50 +02:00
Dmitry Vyukov
0113f7f048 repro: a little bit more graceful shutdown
Bring down at least some VM instances.
Booting instances can still leak.
2016-08-28 20:09:05 +02:00
Dmitry Vyukov
76f68d6039 vm: merger console/fuzzer output line-by-line
Fixes #57
2016-08-28 19:21:57 +02:00
Dmitry Vyukov
1f9bd1e845 csource: make collide mode more random
Update #59
2016-08-28 16:37:24 +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
58b2762fed sysgen: sort resources by name to avoid unnecessary diffs 2016-08-28 15:04:37 +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
f0eccc7052 repro: use correct sandbox mode
Update #59
2016-08-28 13:51:09 +02:00
Dmitry Vyukov
888b041f6d csource: support nonfailing argument copyin/copyout
Update #59
2016-08-28 12:24:39 +02:00
Dmitry Vyukov
776431e726 manager: ignore .git dir in corpus
For the case the corpus is checked into git.
2016-08-28 10:48:21 +02:00
Dmitry Vyukov
7690667267 sys: specify resources in text descriptions
Currently to add a new resource one needs to modify multiple source files,
which complicates descirption of new system calls.
Move resource descriptions from source code to text desciptions.
2016-08-27 18:27:50 +02:00
Dmitry Vyukov
da848feef5 Merge pull request #58 from mortonfox/patch-1
Fix configuration anchor link
2016-08-27 07:13:53 +02:00
Morton Fox
49ed4cb914 Fix configuration anchor link 2016-08-27 00:37:22 -04:00
Dmitry Vyukov
a71989d077 sys: fix links and formatting in README.md 2016-08-26 15:36:17 +02:00
Dmitry Vyukov
78553d2247 sys: update README to describe the new 2-step generation process 2016-08-26 15:20:36 +02:00
Dmitry Vyukov
c152f0e981 sysgen: fix generation of flags
On arm64 all constants are removed for some ptrace flags.
Use plain int in such cases.
2016-08-26 14:20:36 +02:00
Dmitry Vyukov
d78bc6e66c sys: fix skipping of syscalls with unknown constants
Still need to generate description for such syscalls so that
they at least can be parsed, and so that Go and C entries match.
2016-08-26 12:51:25 +02:00
Dmitry Vyukov
04fb414b49 extract.sh: add a comment with required package names 2016-08-26 07:33:13 +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
Dmitry Vyukov
34120ddc6e executor: add experimental mode to skip paging faults
Ignore SIGSEGV/SIGBUS during copyin/copyout of arguments.
The memory may not be addressable. The ignoring allows to
pass partially-addressable input data to kernel.
It's unclear if it's a good idea or not yet.
2016-08-22 17:50:49 -07:00
Dmitry Vyukov
6eb48645a4 vm/qemu: support 9p host-based image
If "image" is set to "9p" in config file,
qemu VM will create a minimalistic image based
on readonly-mapped host filesystem.
The main things that we need are working sshd and ssh-keygen.
/tmp, /etc/, /var, /root are remounted as tmpfs.
2016-08-22 13:48:51 -07:00
Dmitry Vyukov
96cc1ccc79 manager: measure execution speed starting from first VM connect
Currently execution speed is considerably skewed on start
because we take into account VM boot time.
2016-08-21 19:04:50 -07:00
Dmitry Vyukov
f0d0cfcbd6 fuzzer: prioritize triaging of existing corpus on start
That's more important on start than fuzzing.
2016-08-21 18:55:04 -07:00
Dmitry Vyukov
e7021ac638 prog: don't try to execute ioctl(FIFREEZE) and mknod
ioctl(FIFREEZE) renders machine dead.
FIFREEZE is an interesting thing, and we could test it
in namespace (?) or on manually mounted file systems (?).
But that will require more complex handling.
Disable it until we have that logic.

mknod of char/block devices can do all kinds of nasty stuff
(read/write to IO ports, kernel memory, etc).
Disable it for now.
2016-08-21 18:07:55 -07:00
Dmitry Vyukov
a949600ee5 vm/qemu: use -no-reboot and -display=none
Rebooting only confuses syz-manager as it thinks that it's the same
dirty instance. Let syz-manager recreate the VM from scratch instead.

-display=none does not disable graphics subsystem which may be useful for fuzzing.
It also seems to be newer than -nographics.
2016-08-21 17:50:57 -07:00
Dmitry Vyukov
0bdfe39372 host: detect at least some unsupported syscalls if kallsyms is not available
We know how to detect availability of at least some syscalls without kallsyms. Do it.
2016-08-13 18:15:38 -07:00
Dmitry Vyukov
08e664c044 prog: generate SIGSEGVs with lower probability
Addresses that trigger SIGSEGV does not seem to uncover any bugs.
But they crash executor preventing programs from being executed.
Lower probability of generating addresses that lead to SIGSEGVs.
2016-08-13 15:28:07 -07:00
Dmitry Vyukov
b3e0b2be97 ipc: read out executor output
If executor constantly prints something, it will eventually hang
since the pipe will overflow. Read out executor output to prevent the hang.
2016-08-13 14:44:46 -07:00
Dmitry Vyukov
1e22c7aefa sys: use ranged int in few syscalls so that it is tested 2016-08-13 09:16:28 -07:00
Dmitry Vyukov
7e6402c003 sys: change int range to use ':' instead of '~'
We can't use '-' because '-' can denote negative numbers.
Colon is used is several range notations (e.g. Go, Mathlab, Excel).
2016-08-13 09:10:12 -07:00
Dmitry Vyukov
7460de4a28 prog: generate ints outside of the specified range once in a while 2016-08-13 09:04:19 -07:00
Dmitry Vyukov
3b9fe41fe3 reformat sources 2016-08-13 09:02:44 -07:00
Dmitry Vyukov
ae9d77a96b sys: regenerate syscall descriptions with latest linux sources 2016-08-13 09:01:42 -07:00
Dmitry Vyukov
7bb59c0ad0 Merge pull request #53 from sploving/master
support range int
2016-08-13 17:47:14 +02:00