@@ -12043,9 +12043,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
p = lock_user (VERIFY_READ, arg2, arg3, 1);
if (arg5 != 0) {
- target_to_host_timespec(&ts, arg5);
+ if (target_to_host_timespec(&ts, arg5)) {
+ return -TARGET_EFAULT;
+ }
ret = get_errno(safe_mq_timedsend(arg1, p, arg3, arg4, &ts));
- host_to_target_timespec(arg5, &ts);
+ if (!is_error(ret) && host_to_target_timespec(arg5, &ts)) {
+ return -TARGET_EFAULT;
+ }
} else {
ret = get_errno(safe_mq_timedsend(arg1, p, arg3, arg4, NULL));
}
@@ -12062,10 +12066,14 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
p = lock_user (VERIFY_READ, arg2, arg3, 1);
if (arg5 != 0) {
- target_to_host_timespec(&ts, arg5);
+ if (target_to_host_timespec(&ts, arg5)) {
+ return -TARGET_EFAULT;
+ }
ret = get_errno(safe_mq_timedreceive(arg1, p, arg3,
&prio, &ts));
- host_to_target_timespec(arg5, &ts);
+ if (!is_error(ret) && host_to_target_timespec(arg5, &ts)) {
+ return -TARGET_EFAULT;
+ }
} else {
ret = get_errno(safe_mq_timedreceive(arg1, p, arg3,
&prio, NULL));