diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-06-29 20:34:43 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-06-29 20:34:43 +0200 |
| commit | f7498af7af98d89cb5dc49c872213a3a5ef8268a (patch) | |
| tree | 32abb56358551c45dbce9a4c865781009fddd122 /pkg | |
| parent | 0c4b1960d01985c2d8d6da62e8c82395b70838c8 (diff) | |
prog: add stronger fallback signal
Also mixin resource constructors and some signature
of flags values for successful calls into fallback coverage.
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/ipc/ipc.go | 15 | ||||
| -rw-r--r-- | pkg/signal/signal.go | 8 |
2 files changed, 8 insertions, 15 deletions
diff --git a/pkg/ipc/ipc.go b/pkg/ipc/ipc.go index 5ab5e26a7..65e883acf 100644 --- a/pkg/ipc/ipc.go +++ b/pkg/ipc/ipc.go @@ -19,7 +19,6 @@ import ( "unsafe" "github.com/google/syzkaller/pkg/osutil" - "github.com/google/syzkaller/pkg/signal" "github.com/google/syzkaller/prog" "github.com/google/syzkaller/sys/targets" ) @@ -329,12 +328,14 @@ func (env *Env) Exec(opts *ExecOpts, p *prog.Prog) (output []byte, info []CallIn // We use syscall number or-ed with returned errno value as signal. // At least this gives us all combinations of syscall+errno. func addFallbackSignal(p *prog.Prog, info []CallInfo) { - for i, call := range p.Calls { - inf := &info[i] - if !inf.Executed || len(inf.Signal) != 0 { - continue - } - inf.Signal = []uint32{signal.EncodeFallback(call.Meta.ID, inf.Errno)} + callInfos := make([]prog.CallInfo, len(info)) + for i, inf := range info { + callInfos[i].Executed = inf.Executed + callInfos[i].Errno = inf.Errno + } + p.FallbackSignal(callInfos) + for i, inf := range callInfos { + info[i].Signal = inf.Signal } } diff --git a/pkg/signal/signal.go b/pkg/signal/signal.go index 9af1bcce1..20deba46a 100644 --- a/pkg/signal/signal.go +++ b/pkg/signal/signal.go @@ -191,11 +191,3 @@ func Minimize(corpus []Context) []interface{} { } return result } - -func EncodeFallback(id, errno int) uint32 { - return uint32(id)<<16 | uint32(errno)&0x3ff -} - -func DecodeFallback(s uint32) (int, int) { - return int(s >> 16), int(s & 0x3ff) -} |
