aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2023-02-22 16:09:15 +0100
committerTaras Madan <tarasmadan@google.com>2023-02-24 12:47:23 +0100
commit26be8df8135ecb59e8034967927aa18c26117a3a (patch)
tree9d57a23cc7a370192bae44f7af6c6131fd7a1e6d /pkg
parent4c742139504eff0ac045069d3729ae52f2da5138 (diff)
all: tools/syz-env make generate result
Diffstat (limited to 'pkg')
-rw-r--r--pkg/csource/csource.go34
-rw-r--r--pkg/email/parser_test.go4
-rw-r--r--pkg/kconfig/config.go2
-rw-r--r--pkg/log/log.go8
-rw-r--r--pkg/tool/tool.go7
5 files changed, 28 insertions, 27 deletions
diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go
index 8671a57db..d4972261b 100644
--- a/pkg/csource/csource.go
+++ b/pkg/csource/csource.go
@@ -4,23 +4,23 @@
// Package csource generates [almost] equivalent C programs from syzkaller programs.
//
// Outline of the process:
-// - inputs to the generation are the program and options
-// - options control multiple aspects of the resulting C program,
-// like if we want a multi-threaded program or a single-threaded,
-// what type of sandbox we want to use, if we want to setup net devices or not, etc
-// - we use actual executor sources as the base
-// - gen.go takes all executor/common*.h headers and bundles them into generated.go
-// - during generation we tear executor headers apart and take only the bits
-// we need for the current program/options, this is done by running C preprocessor
-// with particular set of defines so that the preprocessor removes unneeded
-// #ifdef SYZ_FOO sections
-// - then we generate actual syscall calls with the given arguments
-// based on the binary "encodingexec" representation of the program
-// (the same representation executor uses for interpretation)
-// - then we glue it all together
-// - as the last step we run some text post-processing on the resulting source code:
-// remove debug calls, replace exitf/fail with exit, hoist/sort/dedup includes,
-// remove duplicate empty lines, etc
+// - inputs to the generation are the program and options
+// - options control multiple aspects of the resulting C program,
+// like if we want a multi-threaded program or a single-threaded,
+// what type of sandbox we want to use, if we want to setup net devices or not, etc
+// - we use actual executor sources as the base
+// - gen.go takes all executor/common*.h headers and bundles them into generated.go
+// - during generation we tear executor headers apart and take only the bits
+// we need for the current program/options, this is done by running C preprocessor
+// with particular set of defines so that the preprocessor removes unneeded
+// #ifdef SYZ_FOO sections
+// - then we generate actual syscall calls with the given arguments
+// based on the binary "encodingexec" representation of the program
+// (the same representation executor uses for interpretation)
+// - then we glue it all together
+// - as the last step we run some text post-processing on the resulting source code:
+// remove debug calls, replace exitf/fail with exit, hoist/sort/dedup includes,
+// remove duplicate empty lines, etc
package csource
import (
diff --git a/pkg/email/parser_test.go b/pkg/email/parser_test.go
index edeb4a8de..b6eb58257 100644
--- a/pkg/email/parser_test.go
+++ b/pkg/email/parser_test.go
@@ -159,8 +159,8 @@ line1
#syz fix bar baz
line 2
`,
- cmd: CmdFix,
- str: "fix",
+ cmd: CmdFix,
+ str: "fix",
args: "bar baz",
},
{
diff --git a/pkg/kconfig/config.go b/pkg/kconfig/config.go
index a9c571b1d..4a917df28 100644
--- a/pkg/kconfig/config.go
+++ b/pkg/kconfig/config.go
@@ -36,7 +36,7 @@ const (
prefix = "CONFIG_"
)
-// Value returns config value, or No if it's not present at all.
+// Value returns config value, or No if it's not present at all.
func (cf *ConfigFile) Value(name string) string {
cfg := cf.Map[name]
if cfg == nil {
diff --git a/pkg/log/log.go b/pkg/log/log.go
index 92063f6de..935b0d1cd 100644
--- a/pkg/log/log.go
+++ b/pkg/log/log.go
@@ -2,10 +2,10 @@
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// Package log provides functionality similar to standard log package with some extensions:
-// - verbosity levels
-// - global verbosity setting that can be used by multiple packages
-// - ability to disable all output
-// - ability to cache recent output in memory
+// - verbosity levels
+// - global verbosity setting that can be used by multiple packages
+// - ability to disable all output
+// - ability to cache recent output in memory
package log
import (
diff --git a/pkg/tool/tool.go b/pkg/tool/tool.go
index 690bfa4b8..0221cb876 100644
--- a/pkg/tool/tool.go
+++ b/pkg/tool/tool.go
@@ -11,9 +11,10 @@ import (
)
// Init handles common tasks for command line tools:
-// - invokes flag.Parse
-// - adds support for optional flags (see OptionalFlags)
-// - adds support for cpu/mem profiling (-cpuprofile/memprofile flags)
+// - invokes flag.Parse
+// - adds support for optional flags (see OptionalFlags)
+// - adds support for cpu/mem profiling (-cpuprofile/memprofile flags)
+//
// Use as defer tool.Init()().
func Init() func() {
flagCPUProfile := flag.String("cpuprofile", "", "write CPU profile to this file")