Index: kern/vfs_syscalls.c =================================================================== RCS file: /space2/ncvs/src/sys/kern/vfs_syscalls.c,v retrieving revision 1.260 diff -u -p -r1.260 vfs_syscalls.c --- kern/vfs_syscalls.c 21 Jun 2002 06:18:02 -0000 1.260 +++ kern/vfs_syscalls.c 22 Jun 2002 16:46:22 -0000 @@ -119,7 +119,8 @@ nmount(td, uap) struct uio auio; struct iovec *iov, *needfree; struct iovec aiov[UIO_SMALLIOV]; - long error, i; + unsigned int i; + int error; u_int iovlen, iovcnt; iovcnt = SCARG(uap, iovcnt); @@ -140,19 +141,15 @@ nmount(td, uap) } auio.uio_iov = iov; auio.uio_iovcnt = iovcnt; - auio.uio_rw = UIO_WRITE; auio.uio_segflg = UIO_USERSPACE; - auio.uio_td = td; - auio.uio_offset = 0; - auio.uio_resid = 0; if ((error = copyin((caddr_t)uap->iovp, (caddr_t)iov, iovlen))) goto finish; + for (i = 0; i < iovcnt; i++) { - if (iov->iov_len > INT_MAX - auio.uio_resid) { + if (iov->iov_len > MMAXOPTIONLEN) { error = EINVAL; goto finish; } - auio.uio_resid += iov->iov_len; iov++; } error = vfs_nmount(td, SCARG(uap, flags), &auio); @@ -188,8 +185,7 @@ kernel_mount(iovp, iovcnt, flags) int flags; { struct uio auio; - struct iovec *iov; - int error, i; + int error; /* * Check that we have an even number of iovec's @@ -200,19 +196,7 @@ kernel_mount(iovp, iovcnt, flags) auio.uio_iov = iovp; auio.uio_iovcnt = iovcnt; - auio.uio_rw = UIO_WRITE; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_offset = 0; - auio.uio_td = NULL; - auio.uio_resid = 0; - iov = iovp; - for (i = 0; i < iovcnt; i++) { - if (iov->iov_len > INT_MAX - auio.uio_resid) { - return (EINVAL); - } - auio.uio_resid += iov->iov_len; - iov++; - } error = vfs_nmount(curthread, flags, &auio); return (error); @@ -255,11 +239,7 @@ kernel_vmount(int flags, ...) auio.uio_iov = iovp; auio.uio_iovcnt = iovcnt; - auio.uio_rw = UIO_WRITE; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_offset = 0; - auio.uio_td = NULL; - auio.uio_resid = len; error = vfs_nmount(curthread, flags, &auio); FREE(iovp, M_MOUNT); Index: sys/mount.h =================================================================== RCS file: /space2/ncvs/src/sys/sys/mount.h,v retrieving revision 1.128 diff -u -p -r1.128 mount.h --- sys/mount.h 20 Jun 2002 20:03:42 -0000 1.128 +++ sys/mount.h 22 Jun 2002 16:47:12 -0000 @@ -120,6 +120,7 @@ struct statfs { */ TAILQ_HEAD(vnodelst, vnode); +#define MMAXOPTIONLEN 65536 /* maximum length of a mount option */ TAILQ_HEAD(vfsoptlist, vfsopt); struct vfsopt { TAILQ_ENTRY(vfsopt) link;