summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_socket.c
diff options
context:
space:
mode:
authornjoly <njoly@NetBSD.org>2009-06-11 19:57:58 +0000
committernjoly <njoly@NetBSD.org>2009-06-11 19:57:58 +0000
commit198ddcca4bc4cafbf5d2f4145520de4e52c3f43d (patch)
tree802c01f3173607bee506fa0867cd2d11925dabc7 /sys/compat/linux/common/linux_socket.c
parent02c4298092fc9ae68426606f2df4c9f45526eba2 (diff)
In sendmsg(2), do copy the msghdr structure before trying to use it.
Diffstat (limited to 'sys/compat/linux/common/linux_socket.c')
-rw-r--r--sys/compat/linux/common/linux_socket.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/compat/linux/common/linux_socket.c b/sys/compat/linux/common/linux_socket.c
index e8b3b9696a9..05efed91c47 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.99 2008/11/19 18:36:03 ad Exp $ */
+/* $NetBSD: linux_socket.c,v 1.100 2009/06/11 19:57:58 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.99 2008/11/19 18:36:03 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.100 2009/06/11 19:57:58 njoly Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -409,6 +409,10 @@ linux_sys_sendmsg(struct lwp *l, const struct linux_sys_sendmsg_args *uap, regis
u_int8_t *control;
struct mbuf *ctl_mbuf = NULL;
+ error = copyin(SCARG(uap, msg), &msg, sizeof(msg));
+ if (error)
+ return error;
+
msg.msg_flags = MSG_IOVUSRSPACE;
/*