summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-09-16 00:42:45 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-09-16 00:42:45 +0000
commitdcf53c92ea15715a4406b9230a1c68943501ffb2 (patch)
tree1d6ac3cb6ae47126af1dc54f4f0f5bac7afc49b7 /sys/kern
parent3b1414ef904bbd7e35b23fc1509a3ea20e822cae (diff)
Add some missing lengths checks when passing data from userland to
kernel. From based on NetBSD patches.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_subr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index b0534e07561..bc6919c9793 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.65 2001/08/02 08:16:45 assar Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.66 2001/09/16 00:42:44 millert Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -1513,6 +1513,8 @@ vfs_hang_addrlist(mp, nep, argp)
mp->mnt_flag |= MNT_DEFEXPORTED;
return (0);
}
+ if (argp->ex_addrlen > MLEN)
+ return (EINVAL);
i = sizeof(struct netcred) + argp->ex_addrlen + argp->ex_masklen;
np = (struct netcred *)malloc(i, M_NETADDR, M_WAITOK);
bzero((caddr_t)np, i);