diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-01-05 17:58:50 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-01-05 17:28:48 +0000 |
| commit | 397c964fceb327fe12c6f42334b879e1887412fc (patch) | |
| tree | 93920e35277d433e0cc9eb11eaf4a48fe4a8ad78 /executor | |
| parent | ed58bbb9537b28097e0d75fd34a70b40beebd481 (diff) | |
executor: prevent netlink_send_ext with dofail=true
This should never be happening during fuzzing. Otherwise we let
syz-executor silently crash and restart insane number of times.
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/common_linux.h | 7 | ||||
| -rw-r--r-- | executor/executor.cc | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h index 950c43096..9558bdb7d 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -258,6 +258,13 @@ static void find_vf_interface(void) static int netlink_send_ext(struct nlmsg* nlmsg, int sock, uint16 reply_type, int* reply_len, bool dofail) { +#if SYZ_EXECUTOR + if (in_execute_one && dofail) { + // We can expect different sorts of breakages during fuzzing, + // we should not kill the whole process because of them. + failmsg("invalid netlink_send_ext arguments", "dofail is true during syscall execution"); + } +#endif if (nlmsg->pos > nlmsg->buf + sizeof(nlmsg->buf) || nlmsg->nesting) fail("nlmsg overflow/bad nesting"); struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf; diff --git a/executor/executor.cc b/executor/executor.cc index 3d6d8f1b8..8b58287b1 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -188,6 +188,10 @@ static uint64 syscall_timeout_ms; static uint64 program_timeout_ms; static uint64 slowdown_scale; +// Can be used to disginguish whether we're at the initialization stage +// or we already execute programs. +static bool in_execute_one = false; + #define SYZ_EXECUTOR 1 #include "common.h" @@ -748,6 +752,7 @@ void realloc_output_data() // execute_one executes program stored in input_data. void execute_one() { + in_execute_one = true; #if SYZ_EXECUTOR_USES_SHMEM realloc_output_data(); output_pos = output_data; |
