[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/17] linux-user: removed unnecessary MAX_SOCK_ADDR
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PATCH 15/17] linux-user: removed unnecessary MAX_SOCK_ADDR checks for socket syscalls |
Date: |
Tue, 31 Mar 2009 23:40:47 +0300 |
From: Mika Westerberg <address@hidden>
- This check is not needed because kernel will check whether given
buffer is too small and there is no upper limit for size of the buffer.
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/syscall.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ef2bf55..81366f7 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1208,16 +1208,13 @@ static abi_long do_socket(int domain, int type, int
protocol)
return get_errno(socket(domain, type, protocol));
}
-/* MAX_SOCK_ADDR from linux/net/socket.c */
-#define MAX_SOCK_ADDR 128
-
/* do_bind() Must return target values and target errnos. */
static abi_long do_bind(int sockfd, abi_ulong target_addr,
socklen_t addrlen)
{
void *addr;
- if (addrlen < 0 || addrlen > MAX_SOCK_ADDR)
+ if (addrlen < 0)
return -TARGET_EINVAL;
addr = alloca(addrlen+1);
@@ -1232,7 +1229,7 @@ static abi_long do_connect(int sockfd, abi_ulong
target_addr,
{
void *addr;
- if (addrlen < 0 || addrlen > MAX_SOCK_ADDR)
+ if (addrlen < 0)
return -TARGET_EINVAL;
addr = alloca(addrlen);
@@ -1307,7 +1304,7 @@ static abi_long do_accept(int fd, abi_ulong target_addr,
if (get_user_u32(addrlen, target_addrlen_addr))
return -TARGET_EFAULT;
- if (addrlen < 0 || addrlen > MAX_SOCK_ADDR)
+ if (addrlen < 0)
return -TARGET_EINVAL;
addr = alloca(addrlen);
@@ -1332,7 +1329,7 @@ static abi_long do_getpeername(int fd, abi_ulong
target_addr,
if (get_user_u32(addrlen, target_addrlen_addr))
return -TARGET_EFAULT;
- if (addrlen < 0 || addrlen > MAX_SOCK_ADDR)
+ if (addrlen < 0)
return -TARGET_EINVAL;
addr = alloca(addrlen);
@@ -1360,7 +1357,7 @@ static abi_long do_getsockname(int fd, abi_ulong
target_addr,
if (get_user_u32(addrlen, target_addrlen_addr))
return -TARGET_EFAULT;
- if (addrlen < 0 || addrlen > MAX_SOCK_ADDR)
+ if (addrlen < 0)
return -TARGET_EINVAL;
addr = alloca(addrlen);
@@ -1398,7 +1395,7 @@ static abi_long do_sendto(int fd, abi_ulong msg, size_t
len, int flags,
void *host_msg;
abi_long ret;
- if (addrlen < 0 || addrlen > MAX_SOCK_ADDR)
+ if (addrlen < 0)
return -TARGET_EINVAL;
host_msg = lock_user(VERIFY_READ, msg, len, 1);
@@ -1433,7 +1430,7 @@ static abi_long do_recvfrom(int fd, abi_ulong msg, size_t
len, int flags,
ret = -TARGET_EFAULT;
goto fail;
}
- if (addrlen < 0 || addrlen > MAX_SOCK_ADDR) {
+ if (addrlen < 0) {
ret = -TARGET_EINVAL;
goto fail;
}
--
1.6.2.1
- [Qemu-devel] [PATCH 00/17] linux-user patches in maemo, riku . voipio, 2009/03/31
- [Qemu-devel] [PATCH 05/17] Fix and cleanup IPCOP_shm* ipc calls handling, riku . voipio, 2009/03/31
- [Qemu-devel] [PATCH 01/17] Fix fstatat64()/newfstatat() syscall implementation, riku . voipio, 2009/03/31
- [Qemu-devel] [PATCH 04/17] Implement sem* syscalls, riku . voipio, 2009/03/31
- [Qemu-devel] [PATCH 02/17] Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets, riku . voipio, 2009/03/31
- [Qemu-devel] [PATCH 15/17] linux-user: removed unnecessary MAX_SOCK_ADDR checks for socket syscalls,
riku . voipio <=
- [Qemu-devel] [PATCH 08/17] Added posix message queue syscalls except mq_notify, riku . voipio, 2009/03/31
- [Qemu-devel] [PATCH 10/17] More strace formatting for posix message queues syscalls, riku . voipio, 2009/03/31
- [Qemu-devel] [PATCH 09/17] Format mq_open strace arguments, riku . voipio, 2009/03/31
- [Qemu-devel] [PATCH 11/17] Add support for passing contents of argv0, riku . voipio, 2009/03/31
- [Qemu-devel] [PATCH 14/17] Revived GUEST_BASE support for usermode emulation targets., riku . voipio, 2009/03/31
- [Qemu-devel] [PATCH 16/17] Prefer glibc over direct syscalls, riku . voipio, 2009/03/31
- [Qemu-devel] [PATCH 17/17] linux-user: Proper exit code for uncaught signals, riku . voipio, 2009/03/31
- [Qemu-devel] [PATCH 07/17] shmat(): use mmap_find_vma to find free memory area, riku . voipio, 2009/03/31
- [Qemu-devel] [PATCH 03/17] Fix and cleanup IPCOP_sem* ipc calls handling, riku . voipio, 2009/03/31