diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-04-18 11:19:17 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-04-30 09:36:03 +0000 |
| commit | 67a25df5ff7f0d2a8b09049c3b30ecc79afa3f1e (patch) | |
| tree | d56b73658b823fef52b72036c0b36fcdd3bb6b79 /pkg/fuzzer/fuzzer.go | |
| parent | ff1693fc52bf20fb123b27fe87212ce216b0ef58 (diff) | |
pkg/fuzzer: move Signal type from rpctype
Now that manager sends ipc.ExecOpts to the fuzzer,
there is no point in having Signal type in rpctype.
It belongs to pkg/fuzzer.
Diffstat (limited to 'pkg/fuzzer/fuzzer.go')
| -rw-r--r-- | pkg/fuzzer/fuzzer.go | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/pkg/fuzzer/fuzzer.go b/pkg/fuzzer/fuzzer.go index a5b338b13..42fc62ea5 100644 --- a/pkg/fuzzer/fuzzer.go +++ b/pkg/fuzzer/fuzzer.go @@ -14,7 +14,6 @@ import ( "github.com/google/syzkaller/pkg/corpus" "github.com/google/syzkaller/pkg/ipc" - "github.com/google/syzkaller/pkg/rpctype" "github.com/google/syzkaller/pkg/signal" "github.com/google/syzkaller/pkg/stats" "github.com/google/syzkaller/prog" @@ -87,7 +86,7 @@ type Request struct { Prog *prog.Prog NeedCover bool NeedRawCover bool - NeedSignal rpctype.SignalType + NeedSignal SignalType NeedHints bool // If specified, the resulting signal for call SignalFilterCall // will include subset of it even if it's not new. @@ -99,6 +98,14 @@ type Request struct { resultC chan *Result } +type SignalType int + +const ( + NoSignal SignalType = 0 // we don't need any signal + NewSignal SignalType = 1 // we need the newly seen signal + AllSignal SignalType = 2 // we need all signal +) + type Result struct { Info *ipc.ProgInfo Stop bool @@ -108,7 +115,7 @@ func (fuzzer *Fuzzer) Done(req *Request, res *Result) { // Triage individual calls. // We do it before unblocking the waiting threads because // it may result it concurrent modification of req.Prog. - if req.NeedSignal != rpctype.NoSignal && res.Info != nil { + if req.NeedSignal != NoSignal && res.Info != nil { for call, info := range res.Info.Calls { fuzzer.triageProgCall(req.Prog, &info, call, req.flags) } @@ -249,10 +256,10 @@ func (fuzzer *Fuzzer) nextRand() int64 { } func (fuzzer *Fuzzer) pushExec(req *Request, prio priority) { - if req.NeedHints && (req.NeedCover || req.NeedSignal != rpctype.NoSignal) { + if req.NeedHints && (req.NeedCover || req.NeedSignal != NoSignal) { panic("Request.NeedHints is mutually exclusive with other fields") } - if req.SignalFilter != nil && req.NeedSignal != rpctype.NewSignal { + if req.SignalFilter != nil && req.NeedSignal != NewSignal { panic("SignalFilter must be used with NewSignal") } fuzzer.nextExec.push(&priorityQueueItem[*Request]{ |
