[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/18] linux-user: fix target_to_host_timespec64()
From: |
Laurent Vivier |
Subject: |
[PULL 14/18] linux-user: fix target_to_host_timespec64() |
Date: |
Thu, 27 Aug 2020 21:20:14 +0200 |
in 32 bit mode, drop the padding in tv_nsec. If host is 64bit and target
is 32bit, the padding bytes will be copied from the target and as the
kernel checks the value, the syscall exits with EINVAL.
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200827070449.2386007-1-laurent@vivier.eu>
Fixes: c6c8d1026e75 ("linux-user/syscall: Add support for
clock_gettime64/clock_settime64")
---
linux-user/syscall.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index fd13e72305de..3b725bbe2513 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1229,6 +1229,8 @@ static inline abi_long target_to_host_timespec64(struct
timespec *host_ts,
}
__get_user(host_ts->tv_sec, &target_ts->tv_sec);
__get_user(host_ts->tv_nsec, &target_ts->tv_nsec);
+ /* in 32bit mode, this drops the padding */
+ host_ts->tv_nsec = (long)(abi_long)host_ts->tv_nsec;
unlock_user_struct(target_ts, target_addr, 0);
return 0;
}
--
2.26.2
- [PULL 00/18] Linux user for 5.2 patches, Laurent Vivier, 2020/08/27
- [PULL 01/18] linux-user: Fix 'semop()' and 'semtimedop()' implementation, Laurent Vivier, 2020/08/27
- [PULL 02/18] linux-user: Fix 'clock_nanosleep()' implementation, Laurent Vivier, 2020/08/27
- [PULL 07/18] linux-user: Add an api to print enumareted argument values with strace, Laurent Vivier, 2020/08/27
- [PULL 03/18] linux-user: syscall: ioctls: support DRM_IOCTL_I915_GETPARAM, Laurent Vivier, 2020/08/27
- [PULL 04/18] linux-user: Make cpu_env accessible in strace.c, Laurent Vivier, 2020/08/27
- [PULL 05/18] linux-user: Add strace support for printing arguments of truncate()/ftruncate() and getsid(), Laurent Vivier, 2020/08/27
- [PULL 09/18] linux-user: Add generic 'termbits.h' for some archs, Laurent Vivier, 2020/08/27
- [PULL 14/18] linux-user: fix target_to_host_timespec64(),
Laurent Vivier <=
- [PULL 08/18] linux-user: Add strace support for printing arguments of some clock and time functions, Laurent Vivier, 2020/08/27
- [PULL 06/18] linux-user: Add strace support for printing arguments of syscalls used to lock and unlock memory, Laurent Vivier, 2020/08/27
- [PULL 17/18] linux-user: Add support for 'rt_sigtimedwait_time64()' and 'sched_rr_get_interval_time64()', Laurent Vivier, 2020/08/27
- [PULL 12/18] linux-user: detect mismatched ELF ABI in qemu-mips[n32][el], Laurent Vivier, 2020/08/27
- [PULL 15/18] linux-user: Add support for 'mq_timedsend_time64()' and 'mq_timedreceive_time64()', Laurent Vivier, 2020/08/27
- [PULL 11/18] linux-user: Add strace support for printing arguments for ioctls used for terminals and serial lines, Laurent Vivier, 2020/08/27
- [PULL 16/18] linux-user: Add support for 'clock_nanosleep_time64()' and 'clock_adjtime64()', Laurent Vivier, 2020/08/27
- [PULL 10/18] linux-user: Add missing termbits types and values definitions, Laurent Vivier, 2020/08/27
- [PULL 13/18] linux-user: Fix 'mq_timedsend()' and 'mq_timedreceive()', Laurent Vivier, 2020/08/27
- [PULL 18/18] linux-user: Add support for utimensat_time64() and semtimedop_time64(), Laurent Vivier, 2020/08/27