Bugtraq mailing list archives

mean vfs bug in *bsd


From: aj () TOAD STACK NL (Arend-Jan Wijtzes)
Date: Sat, 30 May 1998 13:52:49 +0200


Hi.

As we upgraded to freeBSD 2.2.6-STABLE the following bug came to my attention:
when linking a device like /dev/null to a file on a NFS mounted fs
the machien freeses.
This has been reported to freeBSD, however bsdi seems to be
vulnerable too. Crashes have also been reported on 2.2.5 systems


A short ugly hack follows:
It 'fixes' this by not allowing a device to be hard-linked period.
Someone fix this proper please :)

Arend-jan Wijtzes,
aj () stack nl,
Chief sysadmin M.C.G.V. Stack

--- Cut here ---


--- /usr/src/sys/kern/vfs_syscalls.c    Thu May 28 15:46:03 1998
+++ /usr/src/sys/kern/vfs_syscalls.c    Thu May 28 15:47:28 1998
@@ -904,7 +904,9 @@
        if (error)
                return (error);
        vp = nd.ni_vp;
-       if (vp->v_type == VDIR)
+       if ((vp->v_type == VCHR) || (vp->v_type == VBLK))
+               error = EPERM;          /* STACK HACK gehaktdag */
+       else if (vp->v_type == VDIR)
                error = EPERM;          /* POSIX */
        else {
                NDINIT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, uap->link, p);


--- Cut here ---



Current thread: