summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2012-04-13 19:16:11 +0000
committerderaadt <deraadt@openbsd.org>2012-04-13 19:16:11 +0000
commita00f2a54a9ac78426c8465e8b66d0936a32d5cac (patch)
tree2ef4ef42e891db4fcf15588c9d98f365a53f8bea
parentDo not clamp the file descriptors to the buffer size; that leads to (diff)
downloadwireguard-openbsd-a00f2a54a9ac78426c8465e8b66d0936a32d5cac.tar.xz
wireguard-openbsd-a00f2a54a9ac78426c8465e8b66d0936a32d5cac.zip
oops, wrong version of diff in previous
Diffstat (limited to '')
-rw-r--r--sys/kern/uipc_usrreq.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index a832142876b..c8c37890a2e 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_usrreq.c,v 1.58 2012/04/13 19:12:44 deraadt Exp $ */
+/* $OpenBSD: uipc_usrreq.c,v 1.59 2012/04/13 19:16:11 deraadt Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
/*
@@ -649,8 +649,10 @@ unp_externalize(struct mbuf *rights, socklen_t controllen)
controllen = 0;
else
controllen -= CMSG_ALIGN(sizeof(struct cmsghdr));
- if (nfds > controllen / sizeof(int))
- return EMSGSIZE;
+ if (nfds > controllen / sizeof(int)) {
+ error = EMSGSIZE;
+ goto restart;
+ }
rp = (struct file **)CMSG_DATA(cm);