diff options
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/executor.cc | 9 | ||||
| -rw-r--r-- | executor/executor_fuchsia.h | 9 | ||||
| -rw-r--r-- | executor/executor_linux.h | 8 |
3 files changed, 4 insertions, 22 deletions
diff --git a/executor/executor.cc b/executor/executor.cc index b221c2070..2f90e4092 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -1112,12 +1112,9 @@ void execute_call(thread_t* th) errno = EFAULT; NONFAILING(th->res = execute_syscall(call, th->args)); th->reserrno = errno; - if (th->res == -1 && th->reserrno == 0) - th->reserrno = EINVAL; // our syz syscalls may misbehave - if (call->attrs.ignore_return) { - th->res = 0; - th->reserrno = 0; - } + // Our pseudo-syscalls may misbehave. + if ((th->res == -1 && th->reserrno == 0) || call->attrs.ignore_return) + th->reserrno = EINVAL; // Reset the flag before the first possible fail(). th->soft_fail_state = false; diff --git a/executor/executor_fuchsia.h b/executor/executor_fuchsia.h index 84ebac44d..88a1ccff5 100644 --- a/executor/executor_fuchsia.h +++ b/executor/executor_fuchsia.h @@ -22,15 +22,6 @@ static intptr_t execute_syscall(const call_t* c, intptr_t a[kMaxArgs]) { intptr_t res = c->call(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); if (strncmp(c->name, "zx_", 3) == 0) { - // Convert zircon error convention to the libc convention that executor expects. - // The following calls return arbitrary integers instead of error codes. - if (res == ZX_OK || - !strcmp(c->name, "zx_debuglog_read") || - !strcmp(c->name, "zx_clock_get") || - !strcmp(c->name, "zx_clock_get_monotonic") || - !strcmp(c->name, "zx_deadline_after") || - !strcmp(c->name, "zx_ticks_get")) - return 0; errno = (-res) & 0x7f; return -1; } diff --git a/executor/executor_linux.h b/executor/executor_linux.h index 8f0dc579a..8c5a19ef7 100644 --- a/executor/executor_linux.h +++ b/executor/executor_linux.h @@ -84,13 +84,7 @@ static intptr_t execute_syscall(const call_t* c, intptr_t a[kMaxArgs]) { if (c->call) return c->call(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); - intptr_t res = syscall(c->sys_nr, a[0], a[1], a[2], a[3], a[4], a[5]); - // Some prctl commands don't respect the normal convention for return values - // (e.g. PR_GET_TIMERSLACK, but there are more) and may produce all possible - // errno values. This conflicts with fallback coverage. - if (!flag_coverage && res == -1 && !strcmp(c->name, "prctl")) - errno = EINVAL; - return res; + return syscall(c->sys_nr, a[0], a[1], a[2], a[3], a[4], a[5]); } static void cover_open(cover_t* cov, bool extra) |
