summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_socket.c
diff options
context:
space:
mode:
authornjoly <njoly@NetBSD.org>2008-04-29 09:56:38 +0000
committernjoly <njoly@NetBSD.org>2008-04-29 09:56:38 +0000
commit4490c7c69a745f07b79d9b0db39c028c53631407 (patch)
treeed2ad3c4807222b7992f96cffb64fcdea792fdea /sys/compat/linux/common/linux_socket.c
parent71a4269193c9bd7084f8a2a32c8c9fb4b15e1016 (diff)
In linux_get_sa(), make salen parameter unsigned.
Avoid kernel DIAGNOSTIC 0 bytes uvm mapping assertion, for negative values.
Diffstat (limited to 'sys/compat/linux/common/linux_socket.c')
-rw-r--r--sys/compat/linux/common/linux_socket.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/compat/linux/common/linux_socket.c b/sys/compat/linux/common/linux_socket.c
index ed5226259e9..221d4010a83 100644
--- a/sys/compat/linux/common/linux_socket.c
+++ b/sys/compat/linux/common/linux_socket.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_socket.c,v 1.92 2008/04/28 20:23:44 martin Exp $ */
+/* $NetBSD: linux_socket.c,v 1.93 2008/04/29 09:56:38 njoly Exp $ */
/*-
* Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.92 2008/04/28 20:23:44 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.93 2008/04/29 09:56:38 njoly Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -118,7 +118,7 @@ int linux_to_bsd_tcp_sockopt(int);
int linux_to_bsd_udp_sockopt(int);
int linux_getifhwaddr(struct lwp *, register_t *, u_int, void *);
static int linux_get_sa(struct lwp *, int, struct mbuf **,
- const struct osockaddr *, int);
+ const struct osockaddr *, unsigned int);
static int linux_sa_put(struct osockaddr *osa);
static int linux_to_bsd_msg_flags(int);
static int bsd_to_linux_msg_flags(int);
@@ -1292,7 +1292,8 @@ linux_sys_getpeername(struct lwp *l, const struct linux_sys_getpeername_args *ua
* family and convert to sockaddr.
*/
static int
-linux_get_sa(struct lwp *l, int s, struct mbuf **mp, const struct osockaddr *osa, int salen)
+linux_get_sa(struct lwp *l, int s, struct mbuf **mp,
+ const struct osockaddr *osa, unsigned int salen)
{
int error, bdom;
struct sockaddr *sa;