aboutsummaryrefslogtreecommitdiffstats
path: root/syz-manager/hub.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-03-15 19:53:15 +0100
committerAleksandr Nogikh <nogikh@google.com>2024-03-25 13:12:00 +0000
commit409ee912f2c4f07e3064b4e6f4a83e1f812531d8 (patch)
treeef7701845a10852597eb2fbf3c962d27f47ca161 /syz-manager/hub.go
parent5d5b1ae5147428cf089a616a3114af1add92068d (diff)
all: move fuzzer to the host
Instead of doing fuzzing in parallel in running VM, make all decisions in the host syz-manager process. Instantiate and keep a fuzzer.Fuzzer object in syz-manager and update the RPC between syz-manager and syz-fuzzer to exchange exact programs to execute and their resulting signal and coverage. To optimize the networking traffic, exchange mostly only the difference between the known max signal and the detected signal.
Diffstat (limited to 'syz-manager/hub.go')
-rw-r--r--syz-manager/hub.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/syz-manager/hub.go b/syz-manager/hub.go
index d06a0cd0e..7a38310d5 100644
--- a/syz-manager/hub.go
+++ b/syz-manager/hub.go
@@ -9,6 +9,7 @@ import (
"time"
"github.com/google/syzkaller/pkg/auth"
+ "github.com/google/syzkaller/pkg/fuzzer"
"github.com/google/syzkaller/pkg/hash"
"github.com/google/syzkaller/pkg/host"
"github.com/google/syzkaller/pkg/log"
@@ -73,7 +74,7 @@ type HubConnector struct {
// HubManagerView restricts interface between HubConnector and Manager.
type HubManagerView interface {
getMinimizedCorpus() (corpus, repros [][]byte)
- addNewCandidates(candidates []rpctype.Candidate)
+ addNewCandidates(candidates []fuzzer.Candidate)
hubIsUnreachable()
}
@@ -213,9 +214,9 @@ func (hc *HubConnector) sync(hub *rpctype.RPCClient, corpus [][]byte) error {
}
func (hc *HubConnector) processProgs(inputs []rpctype.HubInput) (minimized, smashed, dropped int) {
- candidates := make([]rpctype.Candidate, 0, len(inputs))
+ candidates := make([]fuzzer.Candidate, 0, len(inputs))
for _, inp := range inputs {
- _, disabled, bad := parseProgram(hc.target, hc.enabledCalls, inp.Prog)
+ p, disabled, bad := parseProgram(hc.target, hc.enabledCalls, inp.Prog)
if bad != nil || disabled {
log.Logf(0, "rejecting program from hub (bad=%v, disabled=%v):\n%s",
bad, disabled, inp)
@@ -229,8 +230,8 @@ func (hc *HubConnector) processProgs(inputs []rpctype.HubInput) (minimized, smas
if smash {
smashed++
}
- candidates = append(candidates, rpctype.Candidate{
- Prog: inp.Prog,
+ candidates = append(candidates, fuzzer.Candidate{
+ Prog: p,
Minimized: min,
Smashed: smash,
})
@@ -283,7 +284,6 @@ func (hc *HubConnector) processRepros(repros [][]byte) int {
typ = crash.MemoryLeak
}
hc.hubReproQueue <- &Crash{
- vmIndex: -1,
fromHub: true,
Report: &report.Report{
Title: "external repro",