[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 41/44] linux-user: Correct signedness of target_flock
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 41/44] linux-user: Correct signedness of target_flock l_start and l_len fields |
Date: |
Wed, 8 Jun 2016 16:30:22 +0300 |
From: Peter Maydell <address@hidden>
The l_start and l_len fields in the various target_flock structures are
supposed to be '__kernel_off_t' or '__kernel_loff_t', which means they
should be signed, not unsigned. Correcting the structure definitions means
that __get_user() and __put_user() will correctly sign extend them if
the guest is using 32 bit offsets and the host is using 64 bit offsets.
This fixes failures in the LTP 'fcntl14' tests where it checks that
negative seek offsets work correctly.
We reindent the structures to drop hard tabs since we're touching 40%
of the fields anyway.
RV: long long -> abi_llong as suggested by Laurent Vivier <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/syscall_defs.h | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 124754f..6ee9251 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2289,34 +2289,34 @@ struct target_statfs64 {
#endif
struct target_flock {
- short l_type;
- short l_whence;
- abi_ulong l_start;
- abi_ulong l_len;
- int l_pid;
+ short l_type;
+ short l_whence;
+ abi_long l_start;
+ abi_long l_len;
+ int l_pid;
};
struct target_flock64 {
- short l_type;
- short l_whence;
+ short l_type;
+ short l_whence;
#if defined(TARGET_PPC) || defined(TARGET_X86_64) || defined(TARGET_MIPS) \
|| defined(TARGET_SPARC) || defined(TARGET_HPPA) \
|| defined(TARGET_MICROBLAZE) || defined(TARGET_TILEGX)
- int __pad;
+ int __pad;
#endif
- unsigned long long l_start;
- unsigned long long l_len;
- int l_pid;
+ abi_llong l_start;
+ abi_llong l_len;
+ int l_pid;
} QEMU_PACKED;
#ifdef TARGET_ARM
struct target_eabi_flock64 {
- short l_type;
- short l_whence;
- int __pad;
- unsigned long long l_start;
- unsigned long long l_len;
- int l_pid;
+ short l_type;
+ short l_whence;
+ int __pad;
+ abi_llong l_start;
+ abi_llong l_len;
+ int l_pid;
} QEMU_PACKED;
#endif
--
2.1.4
- [Qemu-devel] [PULL 30/44] linux-user: Use safe_syscall wrapper for send* and recv* syscalls, (continued)
- [Qemu-devel] [PULL 30/44] linux-user: Use safe_syscall wrapper for send* and recv* syscalls, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 29/44] linux-user: Use safe_syscall wrapper for connect syscall, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 37/44] linux-user: Use safe_syscall wrapper for epoll_wait syscalls, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 27/44] linux-user: Fix error conversion in 64-bit fadvise syscall, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 36/44] linux-user: Use safe_syscall wrapper for poll and ppoll syscalls, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 32/44] linux-user: Use safe_syscall wrapper for mq_timedsend and mq_timedreceive, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 35/44] linux-user: Use safe_syscall wrapper for sleep syscalls, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 31/44] linux-user: Use safe_syscall wrapper for msgsnd and msgrcv, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 38/44] linux-user: Use safe_syscall wrapper for semop, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 39/44] linux-user: Use safe_syscall wrapper for accept and accept4 syscalls, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 41/44] linux-user: Correct signedness of target_flock l_start and l_len fields,
riku . voipio <=
- [Qemu-devel] [PULL 43/44] linux-user: Special-case ERESTARTSYS in target_strerror(), riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 34/44] linux-user: Use safe_syscall wrapper for rt_sigtimedwait syscall, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 40/44] linux-user: Use safe_syscall wrapper for ioctl, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 42/44] linux-user: Make target_strerror() return 'const char *', riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 44/44] linux-user: In fork_end(), remove correct CPUs from CPU list, riku . voipio, 2016/06/08
- Re: [Qemu-devel] [PULL 00/44] linux-user update, Peter Maydell, 2016/06/08
- Re: [Qemu-devel] [PULL 00/44] linux-user update, Laurent Vivier, 2016/06/09