Synopsis: any local user can hang or panic the system
NetBSD versions: NetBSD 1.3.3 and prior; NetBSD-current until 19990409
Thanks to: William Studemund, Antti Kantee and Matthew Orgass
Reported in NetBSD Security Advisory: SA1999-008


Index: vfs_lookup.c
===================================================================
RCS file: /cvsroot/src/sys/kern/vfs_lookup.c,v
retrieving revision 1.24.2.1
diff -u -r1.24.2.1 vfs_lookup.c
--- vfs_lookup.c	1997/10/31 07:50:45	1.24.2.1
+++ vfs_lookup.c	1999/04/08 01:59:46
@@ -162,7 +162,7 @@
 				cnp->cn_flags |= HASBUF;
 			return (0);
 		}
-		if ((cnp->cn_flags & LOCKPARENT) && ndp->ni_pathlen == 1)
+		if ((cnp->cn_flags & LOCKPARENT) && (cnp->cn_flags & ISLASTCN))
 			VOP_UNLOCK(ndp->ni_dvp);
 		if (ndp->ni_loopcnt++ >= MAXSYMLINKS) {
 			error = ELOOP;