freebsd-dev/lib/libc
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
..
aarch64 Fix initial exec TLS mode for dynamically loaded shared objects. 2019-03-29 17:52:57 +00:00
amd64 amd64: sync up libc memcmp with the kernel version (r357309) 2020-01-30 19:57:05 +00:00
arm arm/ffs.S: remove stale comment. 2019-12-28 02:11:41 +00:00
capability Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
compat-43 Adjust history, info source from v1's manuals 2019-09-04 13:44:46 +00:00
db Remove "All rights reserved" from my files. 2018-05-10 06:41:08 +00:00
gdtoa libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
gen libc: remove forward compat added in r356830 for F_ISUNIONSTACK 2020-01-29 01:52:27 +00:00
gmon mcount: tidy up ANSIfication 2018-10-20 22:39:35 +00:00
i386 remove obsolete i386 MD memchr implementation 2019-09-25 16:49:22 +00:00
iconv libc: correct iconv buffer overflow 2019-07-02 23:56:37 +00:00
include Add linux-compatible memfd_create 2019-09-25 18:03:18 +00:00
inet libc: fix cases of undefined behavior. 2018-08-07 15:24:19 +00:00
isc SPDX: more ISC-related files. 2017-12-08 17:52:53 +00:00
locale libc: Fix a few bugs in the xlocale collation code. 2020-01-09 20:49:26 +00:00
md Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
mips mips: fix some mcount nits 2019-09-02 01:55:55 +00:00
nameser Bounds check again after advancing cp, otherwise we have a possible 2019-09-05 19:35:30 +00:00
net Increase YPMAXRECORD to 16M to be compatible with Linux. 2019-08-12 20:27:33 +00:00
nls Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
posix1e Remove some redundant code in _posix1e_acl_strip_np 2019-02-19 19:15:15 +00:00
powerpc [PowerPC] Fix typo in _ctx_start on ppc32 2019-11-23 23:41:21 +00:00
powerpc64 [PPC64] memcpy/memmove/bcopy optimization 2020-01-15 20:25:52 +00:00
powerpcspe [PowerPC] Fix SPE floating point environment manipulation 2019-12-12 17:12:18 +00:00
quad Revert r351078, r351085: stand/quad.h eviction 2019-08-15 17:15:32 +00:00
regex lib/libc/regex: fix build with REDEBUG defined 2019-09-24 12:21:01 +00:00
resolv Rather than using the legacy IP struct fields in the union for the 2019-06-04 20:53:35 +00:00
riscv Use "far" calls and branches so that lld uses valid relocations. 2019-12-04 21:01:13 +00:00
rpc Increase YPMAXRECORD to 16M to be compatible with Linux. 2019-08-12 20:27:33 +00:00
secure ssp: knock out some trivial warnings that come up with WARNS=6 2020-01-04 20:07:11 +00:00
softfloat Add implementations for clog(3), clogf(3), and clog(3). 2018-05-13 09:54:34 +00:00
sparc64 Fix initial exec TLS mode for dynamically loaded shared objects. 2019-03-29 17:52:57 +00:00
stdio stdio: provide _unlocked variants of fflush, fputc, fputs, fread, fwrite 2020-01-30 03:31:16 +00:00
stdlib rand(3): Replace implementation with one backed by random(3) algorithm 2020-02-01 20:33:23 +00:00
stdtime strptime: make %k and %l specifiers match their description in 2018-11-03 23:37:13 +00:00
string [PPC64] strncpy optimization 2020-01-15 19:53:03 +00:00
sys Provide O_SEARCH 2020-02-02 16:34:57 +00:00
tests Provide O_SEARCH 2020-02-02 16:34:57 +00:00
uuid libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
x86 Remove resolver_qual from DEFINE_IFUNC/DEFINE_UIFUNC macros. 2019-05-16 22:20:54 +00:00
xdr General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
yp Increase the size of the send and receive buffers for YP client rpc 2019-09-16 06:42:01 +00:00
libc_nossp.ldscript Add different libc ldscript: the one without libssp -- 2016-10-12 13:19:21 +00:00
libc.ldscript
Makefile revert r341429 "disable BIND_NOW in libc, libthr, and rtld" 2019-03-28 02:12:32 +00:00
Makefile.depend Update Makefile.depend files 2019-12-11 17:37:53 +00:00
Makefile.depend.options Update libssp paths in various Makefile.depend* files 2020-01-06 18:15:55 +00:00
Versions.def Create namespace for the symbols added during 13-CURRENT cycle. 2018-11-12 19:12:14 +00:00