diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2019-08-01 15:09:26 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2019-08-01 15:09:26 +0000 |
commit | 601bcd1dc134d4246855db4c576ce05ad026e35a (patch) | |
tree | 5b14fb560a1b745f5d4d4ca7c3ab2758872e8c88 /sys | |
parent | 6008b248a54651296c85f8e8b9e1102d160785d7 (diff) |
In ufs_lookup() *vpp is always refcounted, also in the ISDOTDOT
case even if *vpp == vdp. So in unveil_find_cover() it is wrong
to skip dereferencing if parent == vp. This fixes an umount(8)
device busy error when unveil(2) and chroot(2) are used together
on a file system.
reported by Matthias Pitzl; OK deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_unveil.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/kern_unveil.c b/sys/kern/kern_unveil.c index ac6d96e120e..ac82d5a7478 100644 --- a/sys/kern/kern_unveil.c +++ b/sys/kern/kern_unveil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_unveil.c,v 1.29 2019/07/29 23:14:06 deraadt Exp $ */ +/* $OpenBSD: kern_unveil.c,v 1.30 2019/08/01 15:09:25 bluhm Exp $ */ /* * Copyright (c) 2017-2019 Bob Beck <beck@openbsd.org> @@ -309,8 +309,7 @@ unveil_find_cover(struct vnode *dp, struct proc *p) break; } - if (parent != vp) - vrele(vp); + vrele(vp); (void) unveil_lookup(parent, p, &ret); vput(parent); |