From: Alistair Francis Date: Tue, 3 Nov 2020 19:48:44 +0000 (-0800) Subject: linux-user/syscall: Fix missing target_to_host_timespec64() check X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e4ce178b6153205c2e17a9b719287c83e1e67a72;p=qemu.git linux-user/syscall: Fix missing target_to_host_timespec64() check Coverity pointed out (CID 1432339) that target_to_host_timespec64() can fail with -TARGET_EFAULT but we never check the return value. This patch checks the return value and handles the error. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Message-Id: Signed-off-by: Laurent Vivier --- diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 6fef8181e7..3160a9ba06 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7592,7 +7592,9 @@ static int do_futex_time64(target_ulong uaddr, int op, int val, target_ulong tim case FUTEX_WAIT_BITSET: if (timeout) { pts = &ts; - target_to_host_timespec64(pts, timeout); + if (target_to_host_timespec64(pts, timeout)) { + return -TARGET_EFAULT; + } } else { pts = NULL; }