mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-03 23:28:58 +00:00
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
This commit is contained in:
parent
ae4e9636ac
commit
9a969e626c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=163703
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue