aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-06-26 18:59:39 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-06-26 18:59:39 +0200
commitecbe6d99d3f2a394e35774d5970ecea076af988d (patch)
tree58e9a9c8796675983dee6059447a90289b9f79b1
parenteecefab32c6f158629abd2ac7f6cb0b070f88b4a (diff)
syz-fuzzer: fix testing when shmem is not used
We get program output info only if shmem is used. Output info over pipes is not implemented. So don't fail when we got nothing.
-rw-r--r--syz-fuzzer/testing.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/syz-fuzzer/testing.go b/syz-fuzzer/testing.go
index 990891348..0819d4dc4 100644
--- a/syz-fuzzer/testing.go
+++ b/syz-fuzzer/testing.go
@@ -128,6 +128,7 @@ func checkSimpleProgram(args *checkArgs) error {
if err != nil {
return fmt.Errorf("failed to create ipc env: %v", err)
}
+ defer env.Close()
p := args.target.GenerateSimpleProg()
output, info, failed, hanged, err := env.Exec(args.ipcExecOpts, p)
if err != nil {
@@ -139,6 +140,11 @@ func checkSimpleProgram(args *checkArgs) error {
if failed {
return fmt.Errorf("program failed:\n%s", output)
}
+ if args.ipcConfig.Flags&ipc.FlagUseShmem == 0 {
+ // Output is currently only supported via shmem.
+ // So if we are using pipes, we won't get any info.
+ return nil
+ }
if len(info) == 0 {
return fmt.Errorf("no calls executed:\n%s", output)
}