From db72a5aaacf8a8d11a78ff203731f0d045389856 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 28 Mar 2018 17:41:06 +0200 Subject: 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. --- executor/executor.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'executor') 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; -- cgit mrf-deployment