aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/runtest/run_test.go
diff options
context:
space:
mode:
authorKris Alder <kalder@google.com>2022-03-07 23:00:21 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2022-03-08 16:54:29 +0100
commit9e8eaa75a18a5cf8102e862be692c0781759e51b (patch)
treeb253a2b502230a21593f5e923f99f282a9c78966 /pkg/runtest/run_test.go
parenta5b3b10236688cbda247663ecf994584548f3ef0 (diff)
pkg/host: only try enabled syscalls when starting syz-fuzzer
When syz-fuzzer starts, it tries all syscalls to filter out any that are not supported. This process should include only the syscalls that are enabled using the 'enable_syscalls' and 'disable_syscalls' fields in syz-manager's config. This is useful for fuzzing Cuttlefish devices, for example, where the 'vhost_vsock' syscall needs to be excluded from fuzzing and from this test.
Diffstat (limited to 'pkg/runtest/run_test.go')
-rw-r--r--pkg/runtest/run_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/runtest/run_test.go b/pkg/runtest/run_test.go
index adafedab2..bc71a9f08 100644
--- a/pkg/runtest/run_test.go
+++ b/pkg/runtest/run_test.go
@@ -58,7 +58,11 @@ func test(t *testing.T, sysTarget *targets.Target) {
if err != nil {
t.Fatalf("failed to detect host features: %v", err)
}
- calls, _, err := host.DetectSupportedSyscalls(target, "none")
+ enabled := make(map[*prog.Syscall]bool)
+ for _, c := range target.Syscalls {
+ enabled[c] = true
+ }
+ calls, _, err := host.DetectSupportedSyscalls(target, "none", enabled)
if err != nil {
t.Fatalf("failed to detect supported syscalls: %v", err)
}