From 4ce69996ec362f8dd9762dcc1643d13cebaab44a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 5 Dec 2020 09:00:06 +0100 Subject: sys/linux, sys/freebsd: apply more ignore_return attributes 1. Apply ignore_return to semctl$GETVAL which produces random errno values on linux and freebsd. 2. Apply ignore_return to prctl and remove the custom code in executor. 3. Remove the custom errno ignoring code in fuchsia executor. The calls are already marked as ignore_return, so this is just a leftover. 4. Only reset errno for ignore_return. The syscall can still return a resource (maybe). We only need to reset errno for fallback coverage. --- executor/executor.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'executor/executor.cc') 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; -- cgit mrf-deployment