summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcasper <none@none>2005-07-08 06:34:31 -0700
committercasper <none@none>2005-07-08 06:34:31 -0700
commit5193bcebea435be326caef89fc8034a96ed03226 (patch)
tree39176b551443ea76aafac3ff6b4bff276c92c676
parentdc7ca608a1a4e35965dfcf132d5c9606c8947310 (diff)
downloadillumos-joyent-5193bcebea435be326caef89fc8034a96ed03226.tar.gz
6268481 unprivileged user calling umount on a autofs mountpoint hangs
-rw-r--r--usr/src/uts/common/fs/autofs/auto_vnops.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr/src/uts/common/fs/autofs/auto_vnops.c b/usr/src/uts/common/fs/autofs/auto_vnops.c
index 207dc4790c..fa12fb9866 100644
--- a/usr/src/uts/common/fs/autofs/auto_vnops.c
+++ b/usr/src/uts/common/fs/autofs/auto_vnops.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -155,6 +155,13 @@ auto_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cred)
AUTOFS_DPRINT((4, "auto_getattr vp %p\n", (void *)vp));
+ /*
+ * Recursive auto_getattr/mount; go to the vfsp == NULL
+ * case.
+ */
+ if (vn_vfswlock_held(vp))
+ goto defattr;
+
if (error = vn_vfswlock_wait(vp))
return (error);
@@ -201,6 +208,7 @@ auto_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cred)
vn_vfsunlock(vp);
}
+defattr:
ASSERT(vp->v_type == VDIR || vp->v_type == VLNK);
vap->va_uid = 0;
vap->va_gid = 0;