Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions syz-cluster/pkg/fuzzconfig/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ func GeneratePatched(cfg *api.FuzzConfig) (*mgrconfig.Config, error) {
}

func applyFuzzConfig(mgrCfg *mgrconfig.Config, cfg *api.FuzzConfig) error {
if len(cfg.Focus) == 0 {
noFocus(mgrCfg)
return nil
}
haveFocus := map[string]bool{}
for _, focus := range cfg.Focus {
cb := setFocus[focus]
if cb == nil {
Expand All @@ -79,6 +76,16 @@ func applyFuzzConfig(mgrCfg *mgrconfig.Config, cfg *api.FuzzConfig) error {
if err != nil {
return fmt.Errorf("failed to apply focus %s: %w", focus, err)
}
haveFocus[focus] = true
}
if len(haveFocus) == 0 {
noFlakyFsCalls(mgrCfg)
noFlakyTraceCalls(mgrCfg)
}
// This could have been done in a more generic ways, but so far
// there are not too many such cases.
if haveFocus[api.FocusNet] && !haveFocus[api.FocusBPF] {
noFlakyTraceCalls(mgrCfg)
}
return nil
}
Expand Down Expand Up @@ -183,6 +190,12 @@ var setFocus = map[string]func(*mgrconfig.Config) error{
},
}

func noFocus(mgrCfg *mgrconfig.Config) {
mgrCfg.DisabledSyscalls = []string{"perf_event_open*", "syz_mount_image$hfs", "syz_mount_image$gfs*"}
func noFlakyFsCalls(mgrCfg *mgrconfig.Config) {
mgrCfg.DisabledSyscalls = append(mgrCfg.DisabledSyscalls,
"syz_mount_image$hfs", "syz_mount_image$gfs*")
}

func noFlakyTraceCalls(mgrCfg *mgrconfig.Config) {
mgrCfg.DisabledSyscalls = append(mgrCfg.DisabledSyscalls,
"perf_event_open*", "ioctl$PERF*", "bpf$BPF_RAW_TRACEPOINT_OPEN")
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"reset_acc_state": false,
"remote_cover": true,
"cover_edges": false,
"descriptions_mode": "manual"
"descriptions_mode": "manual",
"enable_kfuzztest": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"reset_acc_state": false,
"remote_cover": true,
"cover_edges": false,
"descriptions_mode": "manual"
"descriptions_mode": "manual",
"enable_kfuzztest": false
}
}
3 changes: 2 additions & 1 deletion syz-cluster/pkg/fuzzconfig/testdata/singular/bpf.base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"reset_acc_state": false,
"remote_cover": true,
"cover_edges": false,
"descriptions_mode": "manual"
"descriptions_mode": "manual",
"enable_kfuzztest": false
}
}
3 changes: 2 additions & 1 deletion syz-cluster/pkg/fuzzconfig/testdata/singular/bpf.patched.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"reset_acc_state": false,
"remote_cover": true,
"cover_edges": false,
"descriptions_mode": "manual"
"descriptions_mode": "manual",
"enable_kfuzztest": false
}
}
9 changes: 6 additions & 3 deletions syz-cluster/pkg/fuzzconfig/testdata/singular/default.base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
"reproduce": true,
"preserve_corpus": true,
"disable_syscalls": [
"perf_event_open*",
"syz_mount_image$hfs",
"syz_mount_image$gfs*"
"syz_mount_image$gfs*",
"perf_event_open*",
"ioctl$PERF*",
"bpf$BPF_RAW_TRACEPOINT_OPEN"
],
"strace_bin": "",
"strace_bin_on_target": false,
Expand All @@ -44,6 +46,7 @@
"reset_acc_state": false,
"remote_cover": true,
"cover_edges": false,
"descriptions_mode": "manual"
"descriptions_mode": "manual",
"enable_kfuzztest": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
"fuzzing_vms": 3,
"preserve_corpus": true,
"disable_syscalls": [
"perf_event_open*",
"syz_mount_image$hfs",
"syz_mount_image$gfs*"
"syz_mount_image$gfs*",
"perf_event_open*",
"ioctl$PERF*",
"bpf$BPF_RAW_TRACEPOINT_OPEN"
],
"strace_bin": "",
"strace_bin_on_target": false,
Expand All @@ -45,6 +47,7 @@
"reset_acc_state": false,
"remote_cover": true,
"cover_edges": false,
"descriptions_mode": "manual"
"descriptions_mode": "manual",
"enable_kfuzztest": false
}
}
3 changes: 2 additions & 1 deletion syz-cluster/pkg/fuzzconfig/testdata/singular/fs.base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"reset_acc_state": false,
"remote_cover": true,
"cover_edges": false,
"descriptions_mode": "manual"
"descriptions_mode": "manual",
"enable_kfuzztest": false
}
}
3 changes: 2 additions & 1 deletion syz-cluster/pkg/fuzzconfig/testdata/singular/fs.patched.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
"reset_acc_state": false,
"remote_cover": true,
"cover_edges": false,
"descriptions_mode": "manual"
"descriptions_mode": "manual",
"enable_kfuzztest": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"reset_acc_state": false,
"remote_cover": true,
"cover_edges": false,
"descriptions_mode": "manual"
"descriptions_mode": "manual",
"enable_kfuzztest": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"reset_acc_state": false,
"remote_cover": true,
"cover_edges": false,
"descriptions_mode": "manual"
"descriptions_mode": "manual",
"enable_kfuzztest": false
}
}
3 changes: 2 additions & 1 deletion syz-cluster/pkg/fuzzconfig/testdata/singular/kvm.base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"reset_acc_state": false,
"remote_cover": true,
"cover_edges": false,
"descriptions_mode": "manual"
"descriptions_mode": "manual",
"enable_kfuzztest": false
}
}
3 changes: 2 additions & 1 deletion syz-cluster/pkg/fuzzconfig/testdata/singular/kvm.patched.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"reset_acc_state": false,
"remote_cover": true,
"cover_edges": false,
"descriptions_mode": "manual"
"descriptions_mode": "manual",
"enable_kfuzztest": false
}
}
8 changes: 7 additions & 1 deletion syz-cluster/pkg/fuzzconfig/testdata/singular/net.base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@
"openat$ptp*",
"ioctl$PTP*"
],
"disable_syscalls": [
"perf_event_open*",
"ioctl$PERF*",
"bpf$BPF_RAW_TRACEPOINT_OPEN"
],
"strace_bin": "",
"strace_bin_on_target": false,
"execprog_bin_on_target": "",
Expand All @@ -113,6 +118,7 @@
"reset_acc_state": false,
"remote_cover": true,
"cover_edges": false,
"descriptions_mode": "manual"
"descriptions_mode": "manual",
"enable_kfuzztest": false
}
}
8 changes: 7 additions & 1 deletion syz-cluster/pkg/fuzzconfig/testdata/singular/net.patched.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@
"openat$ptp*",
"ioctl$PTP*"
],
"disable_syscalls": [
"perf_event_open*",
"ioctl$PERF*",
"bpf$BPF_RAW_TRACEPOINT_OPEN"
],
"strace_bin": "",
"strace_bin_on_target": false,
"execprog_bin_on_target": "",
Expand All @@ -114,6 +119,7 @@
"reset_acc_state": false,
"remote_cover": true,
"cover_edges": false,
"descriptions_mode": "manual"
"descriptions_mode": "manual",
"enable_kfuzztest": false
}
}
Loading