HomeFreeBSD

mount: Check for !VDIR mount points before handling -o emptydir

Description

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)

Details

Provenance
markjAuthored on Oct 13 2021, 12:11 AM
Parents
rGf89204d6b99d: libc/locale: Fix races between localeconv(3) and setlocale(3)
Branches
Unknown
Tags
Unknown