aboutsummaryrefslogtreecommitdiffstats
path: root/vm/gce
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-09-28 16:51:53 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-09-28 16:53:58 +0200
commit8136bdad2fe7e71d4c395ef362adcbc6b0c02251 (patch)
tree6900b569c3a60375339307a3d5c6d6be0242e6ea /vm/gce
parenta13111c7f3d400d2a9d0b84d0d777710b3696d29 (diff)
pkg/kd: add KD protocol decoder
Very primitive decoder that only decodes amd64 exceptions. Use it in vm/gce. Now crashes contain something more or less reasonable which is caught by manager as crash: BUG: first chance exception 0x80000003 &kd.stateChange64{state:0x3030, processorLevel:0x6, processor:0x0, numProcessors:0x2, thread:0xffff9c0bd015e080, pc:0xfffff8017615c380, exception:kd.exception64{code:0x80000003, flags:0x0, record:0x0, address:0xfffff8017615c380, numParams:0x1, unused:0x0, params:[15]uint64{ 0x0, 0x40, 0xfffff801768699e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, firstChance:0x1}, report:kd.controlReport{ dr6:0xffff0ff0, dr7:0x400, eflags:0x86, numInstr:0x10, reportFlags:0x3, instr:[16]uint8{0xcc, 0xc3, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xf, 0x1f, 0x84, 0x0, 0x0, 0x0, 0x0, 0x0}, cs:0x10, ds:0x2b, es:0x2b, fs:0x53}}
Diffstat (limited to 'vm/gce')
-rw-r--r--vm/gce/gce.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/vm/gce/gce.go b/vm/gce/gce.go
index 59d33cbc3..a226b080d 100644
--- a/vm/gce/gce.go
+++ b/vm/gce/gce.go
@@ -26,6 +26,7 @@ import (
"github.com/google/syzkaller/pkg/config"
"github.com/google/syzkaller/pkg/gce"
"github.com/google/syzkaller/pkg/gcs"
+ "github.com/google/syzkaller/pkg/kd"
. "github.com/google/syzkaller/pkg/log"
"github.com/google/syzkaller/pkg/osutil"
"github.com/google/syzkaller/vm/vmimpl"
@@ -231,7 +232,11 @@ func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command strin
tee = os.Stdout
}
merger := vmimpl.NewOutputMerger(tee)
- merger.Add("console", conRpipe)
+ var decoder func(data []byte) (int, int, []byte)
+ if inst.env.OS == "windows" {
+ decoder = kd.Decode
+ }
+ merger.AddDecoder("console", conRpipe, decoder)
// We've started the console reading ssh command, but it has not necessary connected yet.
// If we proceed to running the target command right away, we can miss part