From d68400a8d17b612757bb456754601b8975a18e06 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 6 Dec 2018 16:30:14 +0100 Subject: tools/syz-trace2syz: merge config package into proggen Since we now have only single variable there, it does not seem to deserve a separate package. --- tools/syz-trace2syz/config/unsupported_calls.go | 41 ------------------------ tools/syz-trace2syz/proggen/proggen.go | 3 +- tools/syz-trace2syz/proggen/unsupported_calls.go | 41 ++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 43 deletions(-) delete mode 100644 tools/syz-trace2syz/config/unsupported_calls.go create mode 100644 tools/syz-trace2syz/proggen/unsupported_calls.go diff --git a/tools/syz-trace2syz/config/unsupported_calls.go b/tools/syz-trace2syz/config/unsupported_calls.go deleted file mode 100644 index e2453c2ba..000000000 --- a/tools/syz-trace2syz/config/unsupported_calls.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2018 syzkaller project authors. All rights reserved. -// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. - -package config - -var ( - // ShouldSkip lists system calls that we should skip when parsing - // Some of these are unsupported or not worth executing - ShouldSkip = map[string]bool{ - // While we have system call descriptions for execve it is not worth adding - // the ones in traces. Every trace has an execve at the beginning which means - // all the system calls afterwards will not execute - "execve": true, - // Unsafe to set the addr argument to some random argument. Needs more care - "arch_prctl": true, - // Don't produce multithreaded programs. - "wait4": true, - "wait": true, - "futex": true, - // Cannot obtain coverage from the forks. - "clone": true, - // Can support these calls but need to identify the ones in the trace that are worth keeping - "mmap": true, - "msync": true, - "mremap": true, - "mprotect": true, - "madvise": true, - "munmap": true, - // Not interesting coverage - "getcwd": true, - "getcpu": true, - // Cannot evaluate sigset - "rt_sigprocmask": true, - "rt_sigtimedwait": true, - "rt_sigreturn": true, - "rt_sigqueueinfo": true, - "rt_sigsuspend": true, - // Require function pointers which are not recovered by strace - "rt_sigaction": true, - } -) diff --git a/tools/syz-trace2syz/proggen/proggen.go b/tools/syz-trace2syz/proggen/proggen.go index a3387ea15..70678fd52 100644 --- a/tools/syz-trace2syz/proggen/proggen.go +++ b/tools/syz-trace2syz/proggen/proggen.go @@ -9,7 +9,6 @@ import ( "github.com/google/syzkaller/pkg/log" "github.com/google/syzkaller/prog" - "github.com/google/syzkaller/tools/syz-trace2syz/config" "github.com/google/syzkaller/tools/syz-trace2syz/parser" ) @@ -363,7 +362,7 @@ func reorderStructFields(syzType *prog.StructType, traceType *parser.GroupType, func shouldSkip(ctx *Context) bool { syscall := ctx.CurrentStraceCall - if config.ShouldSkip[syscall.CallName] { + if unsupportedCalls[syscall.CallName] { return true } switch syscall.CallName { diff --git a/tools/syz-trace2syz/proggen/unsupported_calls.go b/tools/syz-trace2syz/proggen/unsupported_calls.go new file mode 100644 index 000000000..3b677fc2a --- /dev/null +++ b/tools/syz-trace2syz/proggen/unsupported_calls.go @@ -0,0 +1,41 @@ +// Copyright 2018 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +package proggen + +var ( + // unsupportedCalls lists system calls that we should skip when parsing. + // Some of these are unsupported or not worth executing. + unsupportedCalls = map[string]bool{ + // While we have system call descriptions for execve it is not worth adding + // the ones in traces. Every trace has an execve at the beginning which means + // all the system calls afterwards will not execute + "execve": true, + // Unsafe to set the addr argument to some random argument. Needs more care + "arch_prctl": true, + // Don't produce multithreaded programs. + "wait4": true, + "wait": true, + "futex": true, + // Cannot obtain coverage from the forks. + "clone": true, + // Can support these calls but need to identify the ones in the trace that are worth keeping + "mmap": true, + "msync": true, + "mremap": true, + "mprotect": true, + "madvise": true, + "munmap": true, + // Not interesting coverage + "getcwd": true, + "getcpu": true, + // Cannot evaluate sigset + "rt_sigprocmask": true, + "rt_sigtimedwait": true, + "rt_sigreturn": true, + "rt_sigqueueinfo": true, + "rt_sigsuspend": true, + // Require function pointers which are not recovered by strace + "rt_sigaction": true, + } +) -- cgit mrf-deployment