summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_extattr.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2006-10-26 13:20:28 +0000
committerkib <kib@FreeBSD.org>2006-10-26 13:20:28 +0000
commit33638419eac25821429642d4f2e2b447836295d9 (patch)
treec9f267d2a6b98c409765669ebf2b9cdd0ab2f60f /sys/kern/vfs_extattr.c
parentd4be3ff6232ed7efab0672ae12c4c7a38236894a (diff)
downloadFreeBSD-src-33638419eac25821429642d4f2e2b447836295d9.zip
FreeBSD-src-33638419eac25821429642d4f2e2b447836295d9.tar.gz
The attempt to rename "." with MAC framework compiled in would cause attempt
to twice unlock the vnode. Check that ni_vp and ni_dvp are different before doing second unlock. Reviewed by: rwatson Approved by: pjd (mentor) MFC after: 1 week
Diffstat (limited to 'sys/kern/vfs_extattr.c')
-rw-r--r--sys/kern/vfs_extattr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index 81529f0..8a57786 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -3270,7 +3270,8 @@ kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg)
error = mac_check_vnode_rename_from(td->td_ucred, fromnd.ni_dvp,
fromnd.ni_vp, &fromnd.ni_cnd);
VOP_UNLOCK(fromnd.ni_dvp, 0, td);
- VOP_UNLOCK(fromnd.ni_vp, 0, td);
+ if (fromnd.ni_dvp != fromnd.ni_vp)
+ VOP_UNLOCK(fromnd.ni_vp, 0, td);
#endif
fvp = fromnd.ni_vp;
if (error == 0)
OpenPOWER on IntegriCloud