]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
mount: Check for !VDIR mount points before handling -o emptydir
authorMark Johnston <markj@FreeBSD.org>
Wed, 13 Oct 2021 00:11:02 +0000 (20:11 -0400)
committerMark Johnston <markj@FreeBSD.org>
Wed, 20 Oct 2021 00:53:33 +0000 (20:53 -0400)
commit348fc38fd53920cce82175f90b13765258cee027
tree6b633536cdf58ba48f2c3cf75117d8f509006227
parentf89204d6b99d11aa1f67722e8c1d33b0fc4d61d7
mount: Check for !VDIR mount points before handling -o emptydir

To implement -o emptydir, vfs_emptydir() checks that the passed
directory is empty.  This should be done after checking whether the
vnode is of type VDIR, though, or vfs_emptydir() may end up calling
VOP_READDIR on a non-directory.

Reported by: syzbot+4006732c69fb0f792b2c@syzkaller.appspotmail.com
Reviewed by: kib, imp
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 03d5820f738de130b2feb66833f18741b7f92a14)
sys/kern/vfs_mount.c
sys/kern/vfs_subr.c