22 Commits

Author SHA1 Message Date
Dmitry Vyukov
13051717b5 vm/adb: fix ppc64le build 2017-03-02 15:21:26 +01:00
Dmitry Vyukov
c81cc207a6 vm/adb: support fuzzing without console
If no console found, fall back to 'adb shell dmesg -w'.
This is not reliable, and lots of bugs are detected as 'lost connection'
without any kernel output. But users want this.
2017-02-06 16:01:45 +01:00
Dmitry Vyukov
3558653771 vm: properly detect when a program exits
syz-fuzzer never exits (normally) so this does not affect syz-manager.
But during reproduction we can run a short running program (no repeat mode)
and currently VMs treat premature exit as an error.

Properly detect when a program exits and let callers decide what to do with it.
2017-02-02 20:23:40 +01:00
Billy Lau
a0a4a8ed95 adb: executor: Revert to adb reboot
Using `adb shell syz-executor reboot` to reboot devices has stopped
working with the recent Android update, probably due to the intro
of seccomp. I have reverted the device reboot logic to use `adb
shell reboot` although it can be flaky at times so that we can
continue to fuzz on devices, until a more reliable solution can be
sought out.
2017-01-26 13:19:22 +00: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
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
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
4e20245f4d Merge pull request #88 from billy-lau/hotfix/check-battery-level
Added a retry clause when doing battery check in adb.go
2016-11-15 14:12:55 +01:00
Billy Lau
e246add2ca Added a retry clause when doing battery check in adb.go
Some devices may not boot up fast enough when battery check
is done as it currently is in adb.go. Therefore,
getBatteryLevel() is modified to take in a parameter to determine
the number of times to retry before giving up.
2016-11-15 11:53:00 +00:00
Dmitry Vyukov
d7f6556505 vm/adb: print device<->console association 2016-11-15 12:09:40 +01:00
Dmitry Vyukov
85f78e771d vm/adb: support separate serial console cable
For Suzy-Q we matched usb bus/port between adb and console device.
This is not possible for separate serial cables: bus/port are unrelated.
So switch to a different algorithm that supports both Suzy-Q and separate cables.
The overall idea is as follows. We use 'adb shell' to write a unique string onto console,
then we read from all console devices and see on what console the unique string appears.
2016-11-11 14:02:03 -08:00
Dmitry Vyukov
e3653a25ed vm/adb: switch adb to root
Userdebug builds have adb under 'shell' user by default.
Switch to root user before starting fuzzing.
2016-11-11 13:51:23 -08:00
Dmitry Vyukov
222090e3b4 log: add package
Log is a simple wrapper around std log package.
It is meant to solve 2 main problems:
1. Logging from non-main packages (mainly, vm/* packages).
   Currently they can either always log or not log at all.
   But they can't respect program verbosity setting.
   Log package allows all packages to use the same verbosity setting.
2. Exposing recent logs in html UI.
   Namely we want to tee logs to console and html UI.
2016-10-09 11:27:48 +02:00
Dmitry Vyukov
e73ddfcb3a vm/adb: reboot devices in the beginning of each cycle
Issue #70 reports that a device can be permanently OOM,
if we don't reboot it new fuzzers will be always killed.
And it's generally safer to assume that a device is in
some bad shape initially. So always reboot them on start.

Fixes #70
2016-09-29 15:27:13 +02:00
Dmitry Vyukov
93b6291297 vm/adb: avoid draining battery
One common issue we see with android devices is that
fuzzing drains battery episodically, device goes down and
then does not boot until one presses the power button.
Check battery level at the beginning of each cycles
and wait if it is too low.
Current numbers are: wait if level < 20% until it is >=30%.
Let's see how it works.

Fixes #79
2016-09-29 15:13:00 +02:00
Vishwath Mohan
b9b1bb2a04 Improve Case Closed Debugging Port Detection.
The code to detect the ttyUSB number that a Suzy-Q connected device was
exposing wasn't handling the case when the devices were plugged in via a
USB hub (which extends the port numbering scheme). This CL changes the
regexp to detect the serial correctly in these cases as well.
2016-09-06 13:17:08 -07: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
76f68d6039 vm: merger console/fuzzer output line-by-line
Fixes #57
2016-08-28 19:21:57 +02:00
Dmitry Vyukov
62dabb6a64 vm/adb: make more robust
Add timeout to adb invocations and do more reliable reboot.
Clean up temporary files from previous runs.
Also pass enabled syscalls via rpc, as adb barks at too long command line.
Abd is still unreliable, though. Devices hang.
2016-01-26 16:48:37 +01:00
Dmitry Vyukov
3247604265 vm/adb: fix instance leak 2016-01-21 16:12:42 +01:00
Dmitry Vyukov
8cff5843fb vm/adb: use a more reliable way to reboot devices 2016-01-20 13:58:57 +01:00
Dmitry Vyukov
4d906f05d4 vm/adb: add adb-based VM
vm/adb can be used to fuzz on real android devices.
2016-01-11 17:40:26 +01:00