Commit Graph

586 Commits

Author SHA1 Message Date
Andrey Konovalov
e4bf587846 Merge pull request #100 from xairy/remove-dir-fix
csourse: emit remove_dir only when needed
2016-11-29 19:07:50 +01:00
Andrey Konovalov
11e1b430a8 csourse: emit remove_dir only when needed 2016-11-29 19:02:58 +01:00
Andrey Konovalov
6d413cab8f Merge pull request #99 from xairy/csourse-fix
csourse: fix emitting syz_* syscalls in c reproducer
2016-11-29 18:57:06 +01:00
Andrey Konovalov
b13dc4bf50 csourse: fix emitting syz_* syscalls in c reproducer 2016-11-29 18:53:41 +01:00
Dmitry Vyukov
684beccb2a Merge pull request #98 from xairy/remove-inport
prog: remove unused inport() and inaddr()
2016-11-29 17:50:39 +01:00
Andrey Konovalov
55e1e51c1c prog: remove unused inport() and inaddr() 2016-11-29 17:46:02 +01:00
Andrey Konovalov
ca20a676a9 Merge pull request #92 from xairy/emit-ethernet
Emit ethernet traffic
2016-11-29 17:42:42 +01:00
Andrey Konovalov
c5707f5e57 executor: emit ethernet traffic 2016-11-29 17:39:38 +01:00
Dmitry Vyukov
72e9b239f4 Merge pull request #97 from xairy/inaddr-template
Move inaddr and sockaddr descriptions to templates
2016-11-29 16:51:56 +01:00
Andrey Konovalov
2429a7b034 sys: move sockaddr description to templates 2016-11-29 16:39:02 +01:00
Andrey Konovalov
86917cc3a7 sys: move in_addr description to templates 2016-11-29 16:39:02 +01:00
Dmitry Vyukov
4278c63e64 ipc: improve handling of executor failures
1. Logical executor failures were not handled in waitServing.
2. Fuzzer did not distinguish temporal errors and logical errors
   and always waited for 10 errors before crashing.
Fix that.
2016-11-29 15:19:29 +01:00
Dmitry Vyukov
eac6d72f0e manager: use only 1 proc in debug mode
Parallel procs produce lots of intermixed output.
2016-11-29 15:17:48 +01:00
Dmitry Vyukov
4dea52c066 sys: add new bpf descriptions
These were just added to net-next.
2016-11-28 18:29:10 +01:00
Dmitry Vyukov
ee3c2c3591 tools: enable bpg jit in create-image.sh
JIT should be more interesting to fuzz.
2016-11-28 18:26:56 +01:00
Dmitry Vyukov
ef040b21d2 tools: fix getty configuration in create-gce-image.sh 2016-11-28 18:25:49 +01:00
Dmitry Vyukov
2033db1d8a Merge pull request #96 from a13xp0p0v/vm-startup-fixes
VM startup fixes
2016-11-28 15:10:44 +01:00
Alexander Popov
3a5ae29218 vm/qemu: prevent eth0 renaming
create-image.sh tries to enable eth0 network interface of the virtual machine,
but there is no eth0 in a fresh debian-wheezy, since biosdevname renames interfaces.
VM log quotation:
  e1000 0000:00:03.0 eth0: (PCI:33MHz:32-bit) 52:54:00:12:34:56
  e1000 0000:00:03.0 eth0: Intel(R) PRO/1000 Network Connection
  e1000 0000:00:03.0 ens3: renamed from eth0
  ...
  Cannot find device "eth0"
  Bind socket to interface: No such device
  Failed to bring up eth0.

The simplest fix is disabling biosdevname by adding "net.ifnames=0 biosdevname=0"
to the kernel command line.

Signed-off-by: Alexander Popov <alex.popov@linux.com>
2016-11-28 16:11:24 +03:00
Alexander Popov
1e56aff95f tools: fix getty configuration in create-image.sh
create-image.sh adds the string "V0:23:respawn:/sbin/getty 115200 hvc0" to inittab
of a virtual machine, but a fresh debian-wheezy doesn't have a hvc0 device.
So getty fails to start and respawns over and over again:
  INIT: Id "V0" respawning too fast: disabled for 5 minutes

Let's fix create-image.sh to have a working VM terminal.

Signed-off-by: Alexander Popov <alex.popov@linux.com>
2016-11-28 16:10:09 +03:00
Dmitry Vyukov
23fd96806d ipc: append pid to binary name
E.g. if binary is 'syz-executor' and pid=15,
we create a link from 'syz-executor15' to 'syz-executor' and use 'syz-executor15' as binary.
This allows to easily identify program that lead to a crash in the log.
Log contains pid in "executing program 15" and crashes usually contain "Comm: syz-executor15".
2016-11-26 17:04:23 +01:00
Dmitry Vyukov
c732a41acb csource: don't emit syz_ syscalls is they are not used 2016-11-26 16:41:40 +01:00
Dmitry Vyukov
5d94283455 ipc, prog, sysgen: format code 2016-11-25 20:17:32 +01:00
Dmitry Vyukov
52f73100ee Merge pull request #94 from xairy/proc-type
Add proc type
2016-11-25 20:16:07 +01:00
Dmitry Vyukov
5c8b703fa2 report: don't print size in KASAN reports
I see a bunch of reports of the form:
KASAN: use-after-free Read of size 4059 in copy_from_iter
but size is different in all reports.
This hampers deduplication.
Don't print size.
2016-11-25 20:12:16 +01:00
Andrey Konovalov
253a40f30d sys: add proc type to denote per proccess integers 2016-11-25 17:51:41 +01:00
Andrey Konovalov
16491e22d5 Merge pull request #91 from xairy/minimize-args
Minimize progs based on individual args
2016-11-25 17:23:38 +01:00
Andrey Konovalov
fa9c44b568 prog: minimize based on individual args 2016-11-25 17:22:42 +01:00
Dmitry Vyukov
9d672cd451 config: use dense indices for VMs
CreateVMConfig uses fileutil.ProcessTempDir to assign indices to VMs.
fileutil.ProcessTempDir generates unique indices globally across several processes.
This was required for old vm/qemu code that used the index to choose unique ssh port for the VM.
Now vm/qemu does not use index as port and this global index assignment started
causing problems for adb and gce. Adb really needs indexes to be dense --
index is used to choose adb device id (if we have 2 devices, index 3 causes
out of bounds panic). For gce it leads to creation of unnecessary VM instances
(if I set count=4, I want at most 4 VMs created).

Don't use fileutil.ProcessTempDir-generated index in CreateVMConfig
and instead just use the dense indices passed by caller.
2016-11-25 17:11:56 +01:00
Dmitry Vyukov
9604794dce manager: reproduce crashes on the fly
With this change manager will run reproduction on crashes
until reproducer is discovered, but at most 3 times.

If reproducer is discovered it is saved with crashes and shown on the web UI.
2016-11-25 11:07:52 +01:00
Andrey Konovalov
1107daa8e7 Merge pull request #90 from xairy/combine-progs
Combine progs from corpus
2016-11-25 09:59:30 +01:00
Andrey Konovalov
a5df734b8d fuzzer: combine progs from corpus 2016-11-25 09:58:17 +01:00
Dmitry Vyukov
4de5c7eb20 prog: fix pointer direction validation
Currently the added test description leads to crashes:

--- FAIL: TestMinimizeRandom (0.12s)
	prog_test.go:20: seed=1480014002950172453
panic: syscall syz_test$regression0: pointer arg 'f0' has output direction [recovered]
	panic: syscall syz_test$regression0: pointer arg 'f0' has output direction

The description is OK. Fix that.
2016-11-24 20:20:05 +01:00
Dmitry Vyukov
3356f68f1a vm/qemu: support non-native mode
Add config bin_args parameter that contains additional arguments for qemu binary.
This allows to specify e.g. "bin_args": "-machine virt -cpu cortex-a57".
Also restore qemu debugging output when -debug flag is specified.
2016-11-22 17:00:47 +01:00
Andrey Konovalov
599adaf8f8 Merge pull request #89 from xairy/small-fixes
Small fixes
2016-11-22 16:12:43 +01:00
Andrey Konovalov
5f1dc34693 manager: add empty line before per-call coverage in html 2016-11-22 16:06:49 +01:00
Andrey Konovalov
7c5f5c84aa manager: print actual number of loaded progs 2016-11-22 16:06:49 +01:00
Andrey Konovalov
557cc42a1f prog: better validate arg data 2016-11-22 16:06:45 +01:00
Andrey Konovalov
c1c3a73cd9 prog: fix checks for max and min len when mutating a bin blob 2016-11-22 15:56:24 +01:00
Dmitry Vyukov
ab3f4a0736 executor: fix sandbox=setuid
Need to chmod(0777) the work dir before we do setuid(nobody).
Otherwise nobody user won't have rights to use the temp dir.
2016-11-22 15:51:00 +01:00
Dmitry Vyukov
7f3778fa10 ipc: extend error messages 2016-11-22 15:50:31 +01:00
Dmitry Vyukov
a5761fa21b syz-hub: fix log format string 2016-11-22 15:50:31 +01:00
Dmitry Vyukov
431793d307 csourceL add missing include and define 2016-11-22 15:50:31 +01:00
Dmitry Vyukov
20468be84d Update README.md 2016-11-21 14:48:22 +01:00
Dmitry Vyukov
c9ae0f69d8 vm: add ability to interrupt commands
This is required for crash reproduction in manager.
2016-11-19 11:14:11 +01:00
Dmitry Vyukov
59f7c210d0 repro: factor out of syz-repro tool
Factor out repro logic from syz-repro tool,
so that it can be used in syz-manager.
Also, support sandboxes in code generated by
csoure. This is required to reproduce crashes
that require e.g. namespace sandbox.
2016-11-19 10:00:36 +01:00
Dmitry Vyukov
dbc7ff3805 manager: unbreak build 2016-11-18 19:18:09 +01:00
Dmitry Vyukov
e8de4be407 manager: enable keepalives on rcp connections
VMs die frequently and it causes orphan tcp rpc connections on manager.
2016-11-18 19:06:04 +01:00
Dmitry Vyukov
50c9bc2948 sys: disable /dev/console
/dev/console known to cause problems on at least two different kernels.
It can turn off all output or produce massive amounts of garbage on console.
Disable it for now.
2016-11-18 19:05:33 +01:00
Dmitry Vyukov
578ee4fa8d prog: sanitize mknodat the same way as mknod 2016-11-18 10:24:13 +01:00
Dmitry Vyukov
cd74cc9cf4 syz-hub: add program
syz-hub is used to exchange programs between syz-managers.
2016-11-17 18:38:10 +01:00