diff options
author | bde <bde@FreeBSD.org> | 1996-12-19 19:59:51 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1996-12-19 19:59:51 +0000 |
commit | fd7150cc218c3746b6dfad8cbe103d6bb390f3d1 (patch) | |
tree | 7afbb72c0e13fffadae4d78fdeb95ce04e5d51c4 /sys/kern/kern_descrip.c | |
parent | d8370232258e75a57361cafc2243862df35d18f1 (diff) | |
download | FreeBSD-src-fd7150cc218c3746b6dfad8cbe103d6bb390f3d1.zip FreeBSD-src-fd7150cc218c3746b6dfad8cbe103d6bb390f3d1.tar.gz |
Fixed nonexistent checking of lock types for F_GETLK.
Found by: NIST-PCTS
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r-- | sys/kern/kern_descrip.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 9111d46..dbbd616 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94 - * $Id: kern_descrip.c,v 1.32 1996/09/28 16:33:21 bde Exp $ + * $Id: kern_descrip.c,v 1.33 1996/12/19 19:41:35 bde Exp $ */ #include <sys/param.h> @@ -322,6 +322,9 @@ fcntl(p, uap, retval) error = copyin((caddr_t)uap->arg, (caddr_t)&fl, sizeof (fl)); if (error) return (error); + if (fl.l_type != F_RDLCK && fl.l_type != F_WRLCK && + fl.l_type != F_UNLCK) + return (EINVAL); if (fl.l_whence == SEEK_CUR) fl.l_start += fp->f_offset; if ((error = VOP_ADVLOCK(vp,(caddr_t)p,F_GETLK,&fl,F_POSIX))) |