]> 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, 13 Oct 2021 13:33:35 +0000 (09:33 -0400)
commit03d5820f738de130b2feb66833f18741b7f92a14
tree5f1fd4160afa2758b6cf2463032506a65566f7fd
parentd0f0e0bd741af867582ceede8ac1b0aec90eae2d
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
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32475
sys/kern/vfs_mount.c
sys/kern/vfs_subr.c