In order to have the same view as tracee has, with regards to
"never fail" syscalls.
* syscall.c (tamper_with_syscall_exiting): Call get_error after the
return value tampering to re-initialise u_rval and u_error fields
of struct tcb.
}
struct inject_opts *opts = tcb_inject_opts(tcp);
+ bool update_tcb = false;
if (!opts)
return 0;
if (arch_set_success(tcp)) {
tcp->u_rval = u_rval;
} else {
+ update_tcb = true;
tcp->u_error = 0;
}
} else {
tcp->u_error = new_error;
if (arch_set_error(tcp)) {
tcp->u_error = u_error;
+ } else {
+ update_tcb = true;
}
}
}
+ if (update_tcb) {
+ tcp->u_error = 0;
+ get_error(tcp, !(tcp->s_ent->sys_flags & SYSCALL_NEVER_FAILS));
+ }
+
return 0;
}