Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jun 2009 05:08:48 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r194283 - in stable/7/sys: . compat/linux contrib/pf dev/ath/ath_hal
Message-ID:  <200906160508.n5G58mOM012870@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Tue Jun 16 05:08:48 2009
New Revision: 194283
URL: http://svn.freebsd.org/changeset/base/194283

Log:
  MFC r192205:
  
  Return EINVAL in case when the incorrect or unsupported
  type argument is specified.
  
  Do not map type argument value as its Linux values are
  identical to FreeBSD values.
  
  Approved by:	kib (mentor)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/compat/linux/linux_socket.c
  stable/7/sys/compat/linux/linux_socket.h
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)

Modified: stable/7/sys/compat/linux/linux_socket.c
==============================================================================
--- stable/7/sys/compat/linux/linux_socket.c	Tue Jun 16 05:07:34 2009	(r194282)
+++ stable/7/sys/compat/linux/linux_socket.c	Tue Jun 16 05:08:48 2009	(r194283)
@@ -554,6 +554,8 @@ linux_socket(struct thread *td, struct l
 
 	bsd_args.protocol = args->protocol;
 	bsd_args.type = args->type;
+	if (bsd_args.type < 0 || bsd_args.type > LINUX_SOCK_MAX)
+		return (EINVAL);
 	bsd_args.domain = linux_to_bsd_domain(args->domain);
 	if (bsd_args.domain == -1)
 		return (EAFNOSUPPORT);

Modified: stable/7/sys/compat/linux/linux_socket.h
==============================================================================
--- stable/7/sys/compat/linux/linux_socket.h	Tue Jun 16 05:07:34 2009	(r194282)
+++ stable/7/sys/compat/linux/linux_socket.h	Tue Jun 16 05:08:48 2009	(r194283)
@@ -59,6 +59,16 @@
 #define	LINUX_AF_APPLETALK	5
 #define	LINUX_AF_INET6		10
 
+/* Supported socket types */
+
+#define	LINUX_SOCK_STREAM	1
+#define	LINUX_SOCK_DGRAM	2
+#define	LINUX_SOCK_RAW		3
+#define	LINUX_SOCK_RDM		4
+#define	LINUX_SOCK_SEQPACKET	5
+
+#define	LINUX_SOCK_MAX		LINUX_SOCK_SEQPACKET
+
 struct l_ucred {
 	uint32_t	pid;
 	uint32_t	uid;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906160508.n5G58mOM012870>