[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/26] linux-user: Fix handling of iovec counts
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 01/26] linux-user: Fix handling of iovec counts |
Date: |
Thu, 22 Sep 2016 15:13:21 +0300 |
From: Peter Maydell <address@hidden>
In the kernel the length of an iovec is generally handled as
an unsigned long, not an integer; fix the parameter to
lock_iovec() accordingly.
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/syscall.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ca06943..71f40e3 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3119,7 +3119,7 @@ static abi_long do_getsockopt(int sockfd, int level, int
optname,
}
static struct iovec *lock_iovec(int type, abi_ulong target_addr,
- int count, int copy)
+ abi_ulong count, int copy)
{
struct target_iovec *target_vec;
struct iovec *vec;
@@ -3132,7 +3132,7 @@ static struct iovec *lock_iovec(int type, abi_ulong
target_addr,
errno = 0;
return NULL;
}
- if (count < 0 || count > IOV_MAX) {
+ if (count > IOV_MAX) {
errno = EINVAL;
return NULL;
}
@@ -3207,7 +3207,7 @@ static struct iovec *lock_iovec(int type, abi_ulong
target_addr,
}
static void unlock_iovec(struct iovec *vec, abi_ulong target_addr,
- int count, int copy)
+ abi_ulong count, int copy)
{
struct target_iovec *target_vec;
int i;
@@ -3462,7 +3462,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct
target_msghdr *msgp,
{
abi_long ret, len;
struct msghdr msg;
- int count;
+ abi_ulong count;
struct iovec *vec;
abi_ulong target_vec;
--
2.1.4
- [Qemu-devel] [PULL 00/26] linux-user update, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 01/26] linux-user: Fix handling of iovec counts,
riku . voipio <=
- [Qemu-devel] [PULL 03/26] linux-user: Allow bad msg_name for recvfrom on connected socket, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 02/26] linux-user: Fix errno for sendrecvmsg with large iovec length, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 05/26] linux-user: Use direct syscall for utimensat, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 04/26] linux-user: Implement FS_IOC_GETFLAGS and FS_IOC_SETFLAGS ioctls, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 07/26] linux-user: Range check the nfds argument to ppoll syscall, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 08/26] linux-user: report signals being taken in strace output, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 06/26] linux-user: Check for bad event numbers in epoll_wait, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 09/26] linux-user: Pass missing MAP_ANONYMOUS to target_mmap() call, riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 11/26] linux-user: Fix incorrect use of host errno in do_ioctl_dm(), riku . voipio, 2016/09/22
- [Qemu-devel] [PULL 10/26] linux-user: Check lock_user() return value for NULL, riku . voipio, 2016/09/22