diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-03-28 17:41:06 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-03-28 18:17:44 +0200 |
| commit | db72a5aaacf8a8d11a78ff203731f0d045389856 (patch) | |
| tree | e14104f33c24b535f6e02bd9a626e757250a8904 /executor/executor.h | |
| parent | bf5e585c5e1b12fe80ee486fdd48eeb71a13fa21 (diff) | |
executor: don't let syscalls fail with errno=0
Our syz syscalls may mishandle errno in some cases
and fail with errno=0. Fix it up.
Diffstat (limited to 'executor/executor.h')
| -rw-r--r-- | executor/executor.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/executor/executor.h b/executor/executor.h index 0e2c8c112..36da89a9a 100644 --- a/executor/executor.h +++ b/executor/executor.h @@ -635,6 +635,8 @@ void execute_call(thread_t* th) th->args[3], th->args[4], th->args[5], th->args[6], th->args[7], th->args[8]); th->reserrno = errno; + if (th->res == -1 && th->reserrno == 0) + th->reserrno = EINVAL; // our syz syscalls may misbehave th->cover_size = read_cover_size(th); th->fault_injected = false; |
