[6874] in bugtraq

home help back first fref pref prev next nref lref last post

mean vfs bug in *bsd

daemon@ATHENA.MIT.EDU (Arend-Jan Wijtzes)
Sat May 30 14:55:03 1998

Date: 	Sat, 30 May 1998 13:52:49 +0200
Reply-To: Arend-Jan Wijtzes <aj@TOAD.STACK.NL>
From: Arend-Jan Wijtzes <aj@TOAD.STACK.NL>
To: BUGTRAQ@NETSPACE.ORG

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 ---

home help back first fref pref prev next nref lref last post