Commit Graph

185 Commits

Author SHA1 Message Date
Dmitry Vyukov
bf0a1af0cb vm/gvisor: always give vm all caps
runsc can crash on nil deref without any caps.
So give all of them all the time.
2018-06-22 19:56:39 +02:00
Dmitry Vyukov
39a5713d72 vm/gvisor: allow specifying arbitrary runsc flags 2018-06-22 19:00:12 +02:00
Dmitry Vyukov
412bfd3c58 vm/gvisor: use timeout for all runsc invocations
runsc likes to hang dead. Add timeouts to all invocations.
2018-06-22 18:37:02 +02:00
Dmitry Vyukov
2a075d57ab pkg/report: allow to specify suppressions per OS
Currently all (linux-specific) suppressions are hardcoded in mgrconfig.
This is very wrong. Move them to pkg/report and allow to specify per OS.
Add gvisor-specific suppressions.
This required a bit of refactoring. Introduce mgrconfig.KernelObj finally.
Make report.NewReporter and vm.Create accept mgrconfig directly
instead of passing it as multiple scattered args.
Remove tools/syz-parse and it always did the same as tools/syz-symbolize.
Simplify global vars in syz-manager/cover.go.
Create reporter eagerly in manager. Use sort.Slice more.
Overall -90 lines removed.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
c31f96a8c6 executor: rework fallback coverage
We have fallback coverage implmentation for freebsd.
1. It's broken after some recent changes.
2. We need it for fuchsia, windows, akaros, linux too.
3. It's painful to work with C code.

Move fallback coverage to ipc package,
fix it and provide for all OSes.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
14e6c472f5 vm/gvisor: add package
gvisor package provides support for gVisor, user-space kernel, testing.
See https://github.com/google/gvisor
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
d3bbcc35ee vm/vmimpl: add vm.Diagnose method
Diagnose is called on machine hang to try to get
some additional diagnostic information from it.
For now it's all stubs.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
87bfb99cfe vm: pass instance to MonitorExecution
It may need it later to try to obtain additional
diagnostic from hanged instances.
2018-06-22 16:40:45 +02:00
Dmitry Vyukov
0f0e5db62d vm/adb: don't fail if port 35099 is busy 2018-06-11 16:47:12 +02:00
Dmitry Vyukov
ee885b87a4 vm/qemu: fix 9p for latest distros
9p stopped working on Debian rolling.
Update the init script.
2018-06-11 11:20:55 +02:00
Dmitry Vyukov
0ac1284d5f vm/qemu: fuchsia support
Move most of linux-isms to os/arch configs.
Add proper configs for fuchsia.
2018-06-06 20:45:09 +02:00
Billy Lau
75b2448a26 vm/adb: disable kptr_restrict for Android
echo 0 to kptr_restrict in /proc/sys/kernel to unhide
kernel pointers when fuzzing for more reliable crash
dedup and easier debugging when analyzing crash.
2018-05-16 10:33:18 +02:00
Dmitry Vyukov
9e0846e8a4 all: get rid of underscores in identifiers
Underscores are against Go coding style.

Update #538
2018-05-07 17:59:06 +02:00
Dmitry Vyukov
037b77dc65 vm/{adb,isolated}: dudup common code
Found with gometalinter/dupl.

Update #538
2018-05-06 14:24:42 +02:00
Dmitry Vyukov
78b251cbd7 all: fix too long lines
Not sure why I have not seen warnings about
these lines on another machine...
2018-05-05 16:00:01 +02:00
Dmitry Vyukov
a630fd8b41 gometalinter: some fixes for unparam
But we still can't enable it as there are more [uninteresting] warnings.

Update #538
2018-05-03 15:48:26 +02:00
Dmitry Vyukov
9fe5658a1b gometalinter: check dot imports
Update #538
2018-05-03 14:41:34 +02:00
Dmitry Vyukov
39302300d9 gometalinter: check unkeyed composite literals
Update #538
2018-05-03 14:01:48 +02:00
Dmitry Vyukov
ca03d6881a vm/qemu: don't be too clever with cpu configuration
Some machine configurations have strict limits on number of CPUs
and don't support NUMA (e.g. arm vexpress-a15).
maxcpu and numa options make qemu fail.
Don't be too clever. If necessary maxcpu and numa options
can be added in qemu_args.
2018-04-20 20:14:10 +02:00
Jean-Baptiste Théou
52643b4414 adb: add debug level to ALERT for UART detector
The UART output may filter lower level messages.
This ensure proper detection of the unique ID

Signed-off-by: Jean-Baptiste Théou <jb@essential.com>
2018-04-18 09:26:01 +02:00
Dmitry Vyukov
5e6a2eea61 vm/qemu: add image_device config parameter
For some configurations device is "sd" instead of "hda".
2018-04-16 21:44:30 +02:00
Dmitry Vyukov
1bf59f0525 vm: make sshkey argument optional
An image can well be setup without a key.
Just password-less root login.
2018-04-16 21:33:13 +02:00
Dmitry Vyukov
f032e929b9 vm/qemu: don't enable usb/sound by default
Such options can be enabled in qemu_args if necessary.
2018-04-16 21:25:38 +02:00
Dmitry Vyukov
36d1c4540a all: fix gometalinter warnings
Fix typos, non-canonical code, remove dead code, etc.
2018-03-08 18:48:26 +01:00
Dmitry Vyukov
64482eb948 pkg/gce: use current instance network
The current instance is not necessary in the default network.
2018-02-27 11:58:41 +01:00
Dmitry Vyukov
fc3afc7164 vm: keep more context before new output
In pkg/report we add up to 5 lines of kernel output before the report.
However, MonitorExecution leaves only up to 128 bytes of preceeding output,
so frequently preceeding lines are not included in the report.
Increase the context to 512 bytes.
2018-02-19 21:48:20 +01:00
Dmitry Vyukov
4198e58824 vm/vmimpl: unbreak freebsd build
Also add freebsd/netbsd host build to presubmit.
2018-01-16 06:41:23 +01:00
Dmitry Vyukov
376f424e08 vm/gce: connect to instances by ip
Don't connect by hostname, this seems to be broken on GCE.
Episodically connecting by hostname gives:

Could not resolve hostname: Name or service not known
2017-12-27 09:18:26 +01:00
Dmitry Vyukov
1db7a350a9 vm/qemu: respect cpu config parameter
Fixes #42
2017-12-17 11:39:14 +01:00
Dmitry Vyukov
f2d5384a68 vm/isolated: allow to specify ssh port for target machines 2017-12-17 11:39:14 +01:00
Andrey Konovalov
38a2a3f586 pkg/report: fix report extraction
Try extracting report from console output only first. If that doesn't work,
try extracting it from the whole log.

Add regexp for executor printed BUGs.

Optimize regexps for rcu detected stalls.

Update rep.StartPos and rep.EndPos in vm/vm.go as well as rep.Output.
2017-12-08 15:08:13 +01:00
Dmitry Vyukov
d9c79f8842 vm/gce: always ignore serial relay errors
GCE serial reply seems to be buggy, we see lots of "serialport: VM disconnected"
and "packet_write_wait: Connection to 1.2.3.4 port 9600: Broken pipe"
errors, which do not have any explanation.
Ignore all serial relay errors.
2017-12-05 20:08:06 +01:00
Dmitry Vyukov
2fa91450df dashboard/app: add manager monitoring
Make it possible to monitor health and operation
of all managers from dashboard.
1. Notify dashboard about internal syz-ci errors
   (currently we don't know when/if they happen).
2. Send statistics from managers to dashboard.
2017-12-01 13:58:11 +01:00
Dmitry Vyukov
5153aeaffd syz-ci: test images before using them
Boot and minimally test images before declaring them as good
and switching to using them.

If image build/boot/test fails, upload report about this to dashboard.
2017-11-30 14:50:50 +01:00
Dmitry Vyukov
29b0fd90e6 pkg/report: include Maintainers into report
Currently getting a complete report requires a complex,
multi-step dance (including getting information that
external users are not interested in -- guilty file).

Simplify interface down to 2 functions: Parse and Symbolize.
Parse does what it did before, Symbolize symbolizes report
and fills in maintainers. This simplifies both implementations
of Reporter interface and all users of the interface.

Potentially we could get this down to 1 function Parse
that does everything. However, (1) Symbolize can fail,
while Parse cannot, (2) usually we want to ignore (log)
Symbolize errors, but otherwise proceed with the report,
(3) repro does not need symbolization for all but the
last report.
2017-11-29 18:24:30 +01:00
Dmitry Vyukov
34f2c2332b pkg/report: add Output to Report
Whole raw output is indivisble part of Report,
currently we always pass Output separately along with Report.
Make Output a Report field.

Then, put whole Report into manager Crash and repro context and Result.
There is little point in passing Report as aa bunch of separate fields.
2017-11-29 14:36:51 +01:00
Dmitry Vyukov
eea051f798 vm/qemu: fix up osutil.RunCmd call 2017-11-24 13:41:08 +01:00
Dmitry Vyukov
31af2ce022 vm/gce: fix boot output capture
Turns out GetSerialPortOutput API does not work if instance has
serial port connections enabled (which we always have).
Get output from serial port relay service instead.
2017-11-22 17:56:48 +01:00
Dmitry Vyukov
ad0af9fff5 vm: return Report from MonitorExecution
This allows callers to get access to Report.Corrupted.
Better than adding 6-th return value and will allow
to pipe other report properties if necessary.
2017-11-21 19:02:35 +01:00
Dmitry Vyukov
2d24bbb225 vm/gce: fix nil deref
New console output code crashes with nil deref,
because we shadow outer err variable and then
dereference nil err.

Also express ssh connect timeout in real time.
Currently the timeout is on par of ~25 mins
(5s sleep + 10s connect timeout) * 100.
Reduce timeout to 5m of real time.
2017-11-20 11:57:42 +01:00
Dmitry Vyukov
9badd05327 vm/gce: provide VM console output on boot failures
"can't ssh into the instance" is not a very useful error.
2017-11-19 12:29:00 +01:00
Dmitry Vyukov
c4d43f4773 pkg/osutil: don't leace runaway processes
When manager is stopped there are sometimes runaway qemu
processes still running. Set PDEATHSIG for all subprocesses.
We never need child processes outliving parents.
2017-11-16 12:48:02 +01:00
Dmitry Vyukov
4bd78cef05 pkg/report, pkg/repro, syz-manager: name crash attributes consistently
We currently have several names for crash attributes, which is disturbing.
E.g. crash title is called "Title" or "Desc". Name them consistently.

Title - single line bug identity.
Report - whole crash text.
Log - whole fuzzer/kernel output.
2017-11-14 10:04:22 +01:00
Dmitry Vyukov
10112655d7 vm: remove needOutput arg for MonitorExecution
Always wait 10 secs for output.
If anything this can only lead to missed crashes during repro.
Let's unify manager and repro behavior.
2017-11-14 09:45:34 +01:00
Dmitry Vyukov
7a53e7e35d pkg/report: combine report data into a struct
Parse returns 5 variables now. Later we may want to add crash "priority".
Introduce Report struct that holds all report data.
2017-11-14 09:41:55 +01:00
Andrey Konovalov
f9a8d567eb pkg/report: add corrupted report detection
This change makes pkg/report try to detect corrupted reports by
using some heuristics.
2017-11-13 17:18:16 +03:00
Dmitry Vyukov
e0a2b1953b vm: merge "not executing programs" into "no output"
Frequently it's the same condition.
In one case there is just a stray error message on console
that turns the crash into "not executing programs".
While in another case there is no stray message,
and then it's detected as "no output".
2017-11-08 18:01:43 +01:00
Dmitry Vyukov
c1c91039f7 vm/gce: fix error formatting
This is detected with newer Go toolchain:

vm/gce/gce.go:376: Errorf format %v reads arg #1, but call has only 0 args
vm/gce/gce.go:381: Errorf format %v reads arg #1, but call has only 0 args
2017-11-07 13:25:27 +01:00
Dmitry Vyukov
6fd57ceb7d vm/vmimpl: add netbsd console stub 2017-10-26 11:53:10 +02:00
Dmitry Vyukov
da63ec6526 vm/qemu: support netbsd 2017-10-23 10:19:38 +02:00