mean vfs bug in *bsd

From: Arend-Jan Wijtzes (ajat_private)
Date: Sat May 30 1998 - 04:52:49 PDT

  • Next message: David LeBlanc: "Local Group creation on NT"

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



    This archive was generated by hypermail 2b30 : Fri Apr 13 2001 - 13:55:37 PDT