Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102850165
D44601.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D44601.diff
View Options
diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c
--- a/sys/fs/unionfs/union_vnops.c
+++ b/sys/fs/unionfs/union_vnops.c
@@ -79,7 +79,7 @@
static int
unionfs_lookup(struct vop_cachedlookup_args *ap)
{
- struct unionfs_node *dunp;
+ struct unionfs_node *dunp, *unp;
struct vnode *dvp, *udvp, *ldvp, *vp, *uvp, *lvp, *dtmpvp;
struct vattr va;
struct componentname *cnp;
@@ -139,6 +139,9 @@
if (dtmpvp == udvp && ldvp != NULLVP) {
VOP_UNLOCK(udvp);
vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
+ dunp = VTOUNIONFS(dvp);
+ if (error == 0 && dunp == NULL)
+ error = ENOENT;
}
if (error == 0) {
@@ -152,14 +155,15 @@
VOP_UNLOCK(vp);
vrele(vp);
+ dtmpvp = dunp->un_dvp;
+ vref(dtmpvp);
VOP_UNLOCK(dvp);
- *(ap->a_vpp) = dunp->un_dvp;
- vref(dunp->un_dvp);
+ *(ap->a_vpp) = dtmpvp;
if (nameiop == DELETE || nameiop == RENAME)
- vn_lock(dunp->un_dvp, LK_EXCLUSIVE | LK_RETRY);
+ vn_lock(dtmpvp, LK_EXCLUSIVE | LK_RETRY);
else if (cnp->cn_lkflags & LK_TYPE_MASK)
- vn_lock(dunp->un_dvp, cnp->cn_lkflags |
+ vn_lock(dtmpvp, cnp->cn_lkflags |
LK_RETRY);
vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
@@ -272,8 +276,12 @@
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
lockflag = 1;
}
- error = unionfs_mkshadowdir(MOUNTTOUNIONFSMOUNT(dvp->v_mount),
- udvp, VTOUNIONFS(vp), cnp, td);
+ unp = VTOUNIONFS(vp);
+ if (unp == NULL)
+ error = ENOENT;
+ else
+ error = unionfs_mkshadowdir(MOUNTTOUNIONFSMOUNT(dvp->v_mount),
+ udvp, unp, cnp, td);
if (lockflag != 0)
VOP_UNLOCK(vp);
if (error != 0) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 11:43 PM (20 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14706698
Default Alt Text
D44601.diff (1 KB)
Attached To
Mode
D44601: unionfs_lookup(): fix wild accesses to vnode private data
Attached
Detach File
Event Timeline
Log In to Comment