]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
zfs: reject read(2) of a dirfd with EISDIR
authorKyle Evans <kevans@FreeBSD.org>
Tue, 19 May 2020 02:41:05 +0000 (02:41 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Tue, 19 May 2020 02:41:05 +0000 (02:41 +0000)
commit47c7d8327c84387717ef7c5107bcaa59b2331288
treebb46afff2e2552fdcf93c9268f7b3a877d695af3
parent3f5fe78b9a04614b41a4c5789468651c91159268
zfs: reject read(2) of a dirfd with EISDIR

This is independent of the recently-discussed global change, which is still
in review/discussion stage.

This is effectively a measure for consistency in the ZFS world, where
FreeBSD was the only platform (as far as I could find) that allowed this.
What ZFS exposes is decidedly not useful for any real purposes, to
paraphrase (hopefully faithfully) jhb's findings when exploring this:

The size of a directory in ZFS is the number of directory entries within.
When reading a directory, you would instead get the leading part of its raw
contents; the amount you get being dictated by the "size," i.e. number of
directory entries. There's decidedly (luckily) no stack disclosure happening
here, though the behavior is bizarre and almost certainly a historical
accident.

This change has already been upstreamed to OpenZFS.

MFC after: 1 week
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c