Date: Wed, 30 Sep 1998 08:04:03 +0200 (CEST) From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: kern/8097: mountpoint on NFS server can be removed by NFS client (patch for -STABLE) Message-ID: <199809300604.IAA25368@internal>
index | next in thread | raw e-mail
>Number: 8097
>Category: kern
>Synopsis: mountpoint on NFS server can be removed by NFS client (patch for -STABLE)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Sep 29 23:10:00 PDT 1998
>Last-Modified:
>Originator: Andre Albsmeier
>Organization:
>Release: FreeBSD 2.2.7-STABLE i386
>Environment:
-stable only, -current is fixed already.
>Description:
see kern/7272
>How-To-Repeat:
see kern/7272
>Fix:
Kirk McKusick fixed this for -current (thanks again) and here is his
patch brought to -stable by me. I have tested it and it works:
*** sys/ufs/ufs/ufs_vnops.c.ORI Wed Sep 30 07:37:48 1998
--- sys/ufs/ufs/ufs_vnops.c Wed Sep 30 07:47:32 1998
***************
*** 1438,1443 ****
--- 1438,1447 ----
* ".." will contain a reference to
* the current directory and thus be
* non-empty.)
+ * Do not allow the removal of mounted on
+ * directories (this can happen when an NFS
+ * exported filesystem tries to remove a
+ * locally mounted on directory).
*/
error = 0;
if (ip->i_nlink != 2 ||
***************
*** 1453,1458 ****
--- 1457,1466 ----
if ((dp->i_flags & APPEND)
|| (ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND))) {
error = EPERM;
+ goto out;
+ }
+ if (vp->v_mountedhere != 0) {
+ error = EINVAL;
goto out;
}
/*
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809300604.IAA25368>
