aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-execprog
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2019-04-05 18:44:53 +0200
committerDmitry Vyukov <dvyukov@google.com>2019-04-09 10:53:11 +0200
commit5c51045d28eb1ad9465a51487d436133ce7b98d2 (patch)
treeff89db14c5b528bbf0901eaffad8f6a930149340 /tools/syz-execprog
parente619f52452849cfe06939fbb73a9efbbbd57ffd6 (diff)
all: add optional close_fds feature to reproducers
Instead of always closing open fds (number 3 to 30) after each program, add an options called EnableCloseFds. It can be passed to syz-execprog, syz-prog2c and syz-stress via the -enable and -disable flags. Set the default value to true. Also minimize C repros over it, except for when repeat is enabled.
Diffstat (limited to 'tools/syz-execprog')
-rw-r--r--tools/syz-execprog/execprog.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/syz-execprog/execprog.go b/tools/syz-execprog/execprog.go
index 07bae4567..b2902ba14 100644
--- a/tools/syz-execprog/execprog.go
+++ b/tools/syz-execprog/execprog.go
@@ -324,5 +324,8 @@ func createConfig(target *prog.Target, entries []*prog.LogEntry,
if featuresFlags["binfmt_misc"].Enabled {
config.Flags |= ipc.FlagEnableBinfmtMisc
}
+ if featuresFlags["close_fds"].Enabled {
+ config.Flags |= ipc.FlagEnableCloseFds
+ }
return config, execOpts
}