aboutsummaryrefslogtreecommitdiffstats
path: root/vm/gvisor
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-01-22 12:09:32 +0100
committerAleksandr Nogikh <nogikh@google.com>2024-01-22 18:19:36 +0000
commitef01311589507ea3919e3804f43781eeb0ca9777 (patch)
treec55a9742423f78afcaaf6af2eeb37d8f75830804 /vm/gvisor
parent9bd8dcda8c7c494d59bd3132a668f4784ea835c6 (diff)
all: refactor pprof endpoint configuration
In some cases (e.g. gVisor instances using host's network namespace) attempts to bind() all syz-fuzzer processes to the same port result in conflicts and fuzzing breakages. Refactor the code to enable custom pprof configuration depending on the vm type. For now, just disable pprof endpoints for gVisor VMs. Once we actually need the feature there, we can generate custom ports for every gVisor VM.
Diffstat (limited to 'vm/gvisor')
-rw-r--r--vm/gvisor/gvisor.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/vm/gvisor/gvisor.go b/vm/gvisor/gvisor.go
index 5ca3e0971..45c076b23 100644
--- a/vm/gvisor/gvisor.go
+++ b/vm/gvisor/gvisor.go
@@ -243,6 +243,14 @@ func (inst *instance) Info() ([]byte, error) {
return []byte(info), nil
}
+func (inst *instance) PprofPort() int {
+ // Some of the gVisor instances use the host's network namespace, which
+ // results in conflicting bind operations on the same HTTP port.
+ // Until there's an actual need to debug gVisor VMs with pprof, let's
+ // just disable it.
+ return 0
+}
+
func (inst *instance) runscCmd(add ...string) *exec.Cmd {
cmd := osutil.Command(inst.image, append(inst.args(), add...)...)
cmd.Env = []string{