Module Name:    src
Committed By:   njoly
Date:           Thu Jun 11 19:57:58 UTC 2009

Modified Files:
        src/sys/compat/linux/common: linux_socket.c

Log Message:
In sendmsg(2), do copy the msghdr structure before trying to use it.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/compat/linux/common/linux_socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_socket.c
diff -u src/sys/compat/linux/common/linux_socket.c:1.99 src/sys/compat/linux/common/linux_socket.c:1.100
--- src/sys/compat/linux/common/linux_socket.c:1.99	Wed Nov 19 18:36:03 2008
+++ src/sys/compat/linux/common/linux_socket.c	Thu Jun 11 19:57:58 2009
@@ -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 @@
 	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;
 
 	/*

Reply via email to