aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-06-16 15:43:22 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-06-16 16:10:59 +0200
commit559fbe2dbe475b34b57819885b40a494ca4ba175 (patch)
treedc11e2ddc1c820e955c710cf05a4521d2ed1cdf4
parent3674152277d7e8b753a4fe24ec970ff51649597e (diff)
syz-fuzzer: don't include disabled syscall name in panics
These checks still fire episodically [on gvisor instance only?]. I've done several attempts to debug this/extend checks. But so far I have no glue and we are still seeing them. They are rare enough to be directly debuggable and to be something trivial. This may be some memory corruption (kernel or our race), or some very episodic condition. They are rare enough to be a problem, so don't include syscall name so that they all go into a single bug bucket.
-rw-r--r--prog/prio.go6
-rw-r--r--syz-fuzzer/proc.go3
2 files changed, 6 insertions, 3 deletions
diff --git a/prog/prio.go b/prog/prio.go
index bda5df470..647af1cc6 100644
--- a/prog/prio.go
+++ b/prog/prio.go
@@ -246,7 +246,8 @@ func (target *Target) BuildChoiceTable(corpus []*Prog, enabled map[*Syscall]bool
for _, p := range corpus {
for _, call := range p.Calls {
if !enabled[call.Meta] {
- panic(fmt.Sprintf("corpus contains disabled syscall %v", call.Meta.Name))
+ fmt.Printf("corpus contains disabled syscall %v", call.Meta.Name)
+ panic("disabled syscall")
}
}
}
@@ -277,7 +278,8 @@ func (ct *ChoiceTable) choose(r *rand.Rand, bias int) int {
bias = ct.calls[r.Intn(len(ct.calls))].ID
}
if !ct.Enabled(bias) {
- panic("bias to disabled syscall")
+ fmt.Printf("bias to disabled syscall %v", ct.target.Syscalls[bias].Name)
+ panic("disabled syscall")
}
run := ct.runs[bias]
x := r.Intn(run[len(run)-1]) + 1
diff --git a/syz-fuzzer/proc.go b/syz-fuzzer/proc.go
index 3c39879cc..ff0352141 100644
--- a/syz-fuzzer/proc.go
+++ b/syz-fuzzer/proc.go
@@ -279,7 +279,8 @@ func (proc *Proc) executeRaw(opts *ipc.ExecOpts, p *prog.Prog, stat Stat) *ipc.P
}
for _, call := range p.Calls {
if !proc.fuzzer.choiceTable.Enabled(call.Meta.ID) {
- panic(fmt.Sprintf("executing disabled syscall %v", call.Meta.Name))
+ fmt.Printf("executing disabled syscall %v", call.Meta.Name)
+ panic("disabled syscall")
}
}