aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor.h
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-03-28 17:41:06 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-03-28 18:17:44 +0200
commitdb72a5aaacf8a8d11a78ff203731f0d045389856 (patch)
treee14104f33c24b535f6e02bd9a626e757250a8904 /executor/executor.h
parentbf5e585c5e1b12fe80ee486fdd48eeb71a13fa21 (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.h2
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;