aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-diff
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-01-13 19:37:36 +0100
committerAleksandr Nogikh <nogikh@google.com>2025-01-14 11:05:01 +0000
commit102e004727c29072e43dd2c85db7716bdb8d6878 (patch)
treea6a6c68841a7ddbde6998489b2a47677dabbdd4f /tools/syz-diff
parent0dce2409ff7389009070e025857c71f752d814e6 (diff)
all: support empty HTTP config
We don't really need an HTTP server when running syz-manager during kernel image testing and when running syz-diff automatically. Don't require the config to be set and don't start the HTTP server in this case.
Diffstat (limited to 'tools/syz-diff')
-rw-r--r--tools/syz-diff/diff.go24
1 files changed, 13 insertions, 11 deletions
diff --git a/tools/syz-diff/diff.go b/tools/syz-diff/diff.go
index 3707867ae..5e971b1be 100644
--- a/tools/syz-diff/diff.go
+++ b/tools/syz-diff/diff.go
@@ -87,18 +87,19 @@ func main() {
new: new,
store: store,
reproAttempts: map[string]int{},
- http: &manager.HTTPServer{
+ }
+ if newCfg.HTTP != "" {
+ diffCtx.http = &manager.HTTPServer{
Cfg: newCfg,
StartTime: time.Now(),
DiffStore: store,
- },
- }
- diffCtx.http.Pools = map[string]*vm.Dispatcher{
- new.name: new.pool,
- base.name: base.pool,
+ Pools: map[string]*vm.Dispatcher{
+ new.name: new.pool,
+ base.name: base.pool,
+ },
+ }
+ new.http = diffCtx.http
}
- new.http = diffCtx.http
-
diffCtx.Loop(ctx)
}
@@ -116,7 +117,10 @@ type diffContext struct {
func (dc *diffContext) Loop(ctx context.Context) {
reproLoop := manager.NewReproLoop(dc, dc.new.pool.Total()-dc.new.cfg.FuzzingVMs, false)
- dc.http.ReproLoop = reproLoop
+ if dc.http != nil {
+ dc.http.ReproLoop = reproLoop
+ go dc.http.Serve()
+ }
go func() {
// Let both base and patched instances somewhat progress in fuzzing before we take
// VMs away for bug reproduction.
@@ -128,10 +132,8 @@ func (dc *diffContext) Loop(ctx context.Context) {
go dc.base.Loop()
go dc.new.Loop()
- go dc.http.Serve()
runner := &reproRunner{done: make(chan reproRunnerResult, 2), kernel: dc.base}
-
rareStat := time.NewTicker(5 * time.Minute)
for {
select {