From a0c026b20b499c61df6fa4153a626efb7ccb0e59 Mon Sep 17 00:00:00 2001 From: dchagin Date: Sat, 16 May 2009 18:46:51 +0000 Subject: 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) --- sys/compat/linux/linux_socket.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/compat/linux/linux_socket.c') diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index ee7bf18..e99ef84 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -597,6 +597,8 @@ linux_socket(struct thread *td, struct linux_socket_args *args) 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); -- cgit v1.1