aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/linux/linux_socket.c')
-rw-r--r--sys/compat/linux/linux_socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index ee7bf184ad05..e99ef84f414e 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);