[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 3/4] linux-user/syscall: Fix missing target_to_host_timespec64() c
|
From: |
Laurent Vivier |
|
Subject: |
[PULL 3/4] linux-user/syscall: Fix missing target_to_host_timespec64() check |
|
Date: |
Thu, 5 Nov 2020 08:08:36 +0100 |
From: Alistair Francis <alistair.francis@wdc.com>
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 <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id:
<cad74fae734d2562746b94acd9c34b00081c89bf.1604432881.git.alistair.francis@wdc.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/syscall.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 6fef8181e738..3160a9ba06bd 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;
}
--
2.28.0
- [PULL 0/4] Linux user for 5.2 patches, Laurent Vivier, 2020/11/05
- [PULL 2/4] linux-user: Use "!= 0" when checking if MAP_FIXED_NOREPLACE is non-zero, Laurent Vivier, 2020/11/05
- [PULL 4/4] linux-user: Check copy_from_user() return value in vma_dump_size(), Laurent Vivier, 2020/11/05
- [PULL 3/4] linux-user/syscall: Fix missing target_to_host_timespec64() check,
Laurent Vivier <=
- [PULL 1/4] linux-user/mips/cpu_loop: silence the compiler warnings, Laurent Vivier, 2020/11/05
- Re: [PULL 0/4] Linux user for 5.2 patches, no-reply, 2020/11/05
- Re: [PULL 0/4] Linux user for 5.2 patches, Peter Maydell, 2020/11/06