aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-02-02 12:20:16 +0100
committerAleksandr Nogikh <nogikh@google.com>2024-02-03 08:35:26 +0000
commit6ce93dd4258e133bb60b00fb7a0435b755be7bf4 (patch)
treeee6cab33401b874954b297ab5f9dc2b68d333d17 /vm
parent60bf9982e3c5f47dee643bd88d86c7f0b631e32d (diff)
syz-manager: don't set up pprof endpoints for host fuzzing
In this mode, all syz-fuzzers will be on the same network and will start competing with each other for binding to the same port. For now, we don't have the need to use pprof in the host fuzzer mode, so let's just disable it.
Diffstat (limited to 'vm')
-rw-r--r--vm/vm.go37
-rw-r--r--vm/vm_test.go1
2 files changed, 24 insertions, 14 deletions
diff --git a/vm/vm.go b/vm/vm.go
index 434a3da2e..b129c5aa9 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -46,14 +46,16 @@ type Pool struct {
template string
timeouts targets.Timeouts
activeCount int32
+ hostFuzzer bool
}
type Instance struct {
- impl vmimpl.Instance
- workdir string
- timeouts targets.Timeouts
- index int
- onClose func()
+ impl vmimpl.Instance
+ workdir string
+ timeouts targets.Timeouts
+ index int
+ onClose func()
+ hostFuzzer bool
}
var (
@@ -115,10 +117,11 @@ func Create(cfg *mgrconfig.Config, debug bool) (*Pool, error) {
return nil, err
}
return &Pool{
- impl: impl,
- workdir: env.Workdir,
- template: cfg.WorkdirTemplate,
- timeouts: cfg.Timeouts,
+ impl: impl,
+ workdir: env.Workdir,
+ template: cfg.WorkdirTemplate,
+ timeouts: cfg.Timeouts,
+ hostFuzzer: cfg.SysTarget.HostFuzzer,
}, nil
}
@@ -146,11 +149,12 @@ func (pool *Pool) Create(index int) (*Instance, error) {
}
atomic.AddInt32(&pool.activeCount, 1)
return &Instance{
- impl: impl,
- workdir: workdir,
- timeouts: pool.timeouts,
- index: index,
- onClose: func() { atomic.AddInt32(&pool.activeCount, -1) },
+ impl: impl,
+ workdir: workdir,
+ timeouts: pool.timeouts,
+ index: index,
+ onClose: func() { atomic.AddInt32(&pool.activeCount, -1) },
+ hostFuzzer: pool.hostFuzzer,
}, nil
}
@@ -188,6 +192,11 @@ func (inst *Instance) Info() ([]byte, error) {
}
func (inst *Instance) PprofPort() int {
+ if inst.hostFuzzer {
+ // In the fuzzing on host mode, fuzzers are always on the same network.
+ // Don't set up pprof endpoints in this case.
+ return 0
+ }
if ii, ok := inst.impl.(vmimpl.PprofPortProvider); ok {
return ii.PprofPort()
}
diff --git a/vm/vm_test.go b/vm/vm_test.go
index d01e97310..2a3f1171a 100644
--- a/vm/vm_test.go
+++ b/vm/vm_test.go
@@ -347,6 +347,7 @@ func testMonitorExecution(t *testing.T, test *Test) {
Slowdown: 1,
NoOutput: 5 * time.Second,
},
+ SysTarget: targets.Get(targets.Linux, targets.AMD64),
},
Workdir: dir,
Type: "test",