diff options
| author | Andrey Konovalov <andreyknvl@google.com> | 2019-04-05 18:44:53 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-04-09 10:53:11 +0200 |
| commit | 5c51045d28eb1ad9465a51487d436133ce7b98d2 (patch) | |
| tree | ff89db14c5b528bbf0901eaffad8f6a930149340 /executor/executor.cc | |
| parent | e619f52452849cfe06939fbb73a9efbbbd57ffd6 (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 'executor/executor.cc')
| -rw-r--r-- | executor/executor.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/executor/executor.cc b/executor/executor.cc index f1f6ba294..bbbb2da31 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -119,6 +119,7 @@ static bool flag_enable_net_dev; static bool flag_enable_net_reset; static bool flag_enable_cgroups; static bool flag_enable_binfmt_misc; +static bool flag_enable_close_fds; static bool flag_collect_cover; static bool flag_dedup_cover; @@ -454,6 +455,7 @@ void parse_env_flags(uint64 flags) flag_enable_net_reset = flags & (1 << 9); flag_enable_cgroups = flags & (1 << 10); flag_enable_binfmt_misc = flags & (1 << 11); + flag_enable_close_fds = flags & (1 << 12); } #if SYZ_EXECUTOR_USES_FORK_SERVER @@ -732,6 +734,10 @@ retry: } } +#if SYZ_HAVE_CLOSE_FDS + close_fds(); +#endif + if (flag_collide && !flag_inject_fault && !colliding && !collide) { debug("enabling collider\n"); collide = colliding = true; |
