Steps to reproduce:
1. Mount a MFS to /mnt
2. Compile the example program with -static and copy to /mnt
3. Do a chroot /mnt unveil
4. Try to unmount: umount /mnt
The umount command will fail at least with OpenBSD 6.5 and -current with
EBUSY. I haven't tested if the error also exists in 6.4.
As far as we found out, the use counter of the vnode for the directory
Re: Leaking vnode with chroot to mounted file system due to unveil()
On Tue, Jul 16, 2019 at 02:04:12PM +0200, Silamael wrote:
> We found a problem with programs using unveil() executed by chroot in a
> mounted file system.
> After the program run, umount of the file system will return with EBUSY.
If I understand the code in ufs_lookup() correctly, *vpp = tdp is
refcounted in the ISDOTDOT case. This happens also if *vpp == vdp.
So it is wrong to skip dereferencing if parent != vp. I have written
a test and this diff survived a full make regress run.