freebsd-nq/sys/fs/fuse
Kyle Evans 6a5abb1ee5 Provide O_SEARCH
O_SEARCH is defined by POSIX [0] to open a directory for searching, skipping
permissions checks on the directory itself after the initial open(). This is
close to the semantics we've historically applied for O_EXEC on a directory,
which is UB according to POSIX. Conveniently, O_SEARCH on a file is also
explicitly undefined behavior according to POSIX, so O_EXEC would be a fine
choice. The spec goes on to state that O_SEARCH and O_EXEC need not be
distinct values, but they're not defined to be the same value.

This was pointed out as an incompatibility with other systems that had made
its way into libarchive, which had assumed that O_EXEC was an alias for
O_SEARCH.

This defines compatibility O_SEARCH/FSEARCH (equivalent to O_EXEC and FEXEC
respectively) and expands our UB for O_EXEC on a directory. O_EXEC on a
directory is checked in vn_open_vnode already, so for completeness we add a
NOEXECCHECK when O_SEARCH has been specified on the top-level fd and do not
re-check that when descending in namei.

[0] https://pubs.opengroup.org/onlinepubs/9699919799/

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D23247
2020-02-02 16:34:57 +00:00
..
fuse_device.c fusefs: don't leak memory of unsent operations on unmount 2019-06-28 18:48:02 +00:00
fuse_file.c fusefs: remove superfluous counter_u64_zero 2019-08-06 00:50:25 +00:00
fuse_file.h [skip ci] update copyright headers in fusefs files 2019-06-28 04:18:10 +00:00
fuse_internal.c Fix an off-by-one error from r351961 2019-09-16 16:41:01 +00:00
fuse_internal.h fusefs: fix the build after r350446 2019-07-31 21:48:35 +00:00
fuse_io.c vfs: introduce v_irflag and make v_type smaller 2019-12-08 21:30:04 +00:00
fuse_io.h [skip ci] update copyright headers in fusefs files 2019-06-28 04:18:10 +00:00
fuse_ipc.c fusefs: remove superfluous counter_u64_zero 2019-08-06 00:50:25 +00:00
fuse_ipc.h fusefs: add a intr/nointr mount option 2019-07-18 17:55:13 +00:00
fuse_kernel.h fusefs: raise protocol level to 7.23 2019-06-21 04:57:23 +00:00
fuse_main.c projects/fuse2: build fixes 2019-07-13 14:42:09 +00:00
fuse_node.c fusefs: add missing CLTFLAG_MPSAFE annotation 2020-01-15 01:31:28 +00:00
fuse_node.h fusefs: fix some minor issues with fuse_vnode_setparent 2019-09-16 14:51:49 +00:00
fuse_vfsops.c vfs: drop the mostly unused flags argument from VOP_UNLOCK 2020-01-03 22:29:58 +00:00
fuse_vnops.c Provide O_SEARCH 2020-02-02 16:34:57 +00:00
fuse.h [skip ci] update copyright headers in fusefs files 2019-06-28 04:18:10 +00:00