aboutsummaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* ssp: appease -Wgnu-statement-expression-from-macro-expansionKyle Evans8 days7-13/+13
| | | | | | | | | | | | | | | It's a stupid warning, but some ports enable it by default and were already defining _FORTIFY_SOURCE, thus exposing the new macros immediately. This at least fixes the libfido2 build, perhaps others as well. While we're here, fix a fresh build of stand w/ FORTIFY_SOURCE enabled by not pulling in the ssp headers if _STANDALONE is defined. We do not have runtime support in libsa as of the time of writing. Reported by: netchild Sponsored by: Stormshield Sponsored by: Klara, Inc.
* include: ssp: kill off leftover $FreeBSD$ tagKyle Evans9 days1-2/+0
| | | | | | | | Most of these were fixed when rebasing the patch forward, but this one seems to have been missed. Reported by: marck Fixes: be04fec426 ("Import _FORTIFY_SOURCE implementation [...]")
* Fix the GCC build after _FORTIFY_SOURCE importKyle Evans10 days1-6/+0
| | | | | We haven't exposed gets(3) in a long time, rip out __gets_chk before it's too late and something builds a gets(3) user with it enabled.
* Add a build knob for _FORTIFY_SOURCEKyle Evans10 days4-0/+13
| | | | | | | | | | | | | | | | | In the future, we will Default to _FORTIFY_SOURCE=2 if SSP is enabled, otherwise default to _FORTIFY_SOURCE=0. For now we default it to 0 unconditionally to ease bisect across older versions without the new symbols, and we'll put out a call for testing. include/*.h include their ssp/*.h equivalents as needed based on the knob. Programs and users are allowed to override FORTIFY_SOURCE in their Makefiles or src.conf/make.conf to force it off. Reviewed by: des, markj Relnotes: yes Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32308
* Prepare the system for _FORTIFY_SOURCEKyle Evans10 days1-2/+6
| | | | | | | | | | | | | | | Notably: - libc needs to #undef some of the macros from ssp/* for underlying implementations - ssp/* wants a __RENAME() macro (snatched more or less from NetBSD) There's some extra hinkiness included for read(), since libc spells it as "_read" while the rest of the world spells it "read." Reviewed by: imp, ngie Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32307
* Import _FORTIFY_SOURCE implementation from NetBSDKyle Evans10 days7-1/+441
| | | | | | | | | | | | This is a mostly-unmodified copy of the various *_chk implementations and headers from NetBSD, without yet modifying system headers to start actually including them. A future commit will also apply the needed bits to fix ssp/unistd.h. Reviewed by: imp, pauamma_gundo.com (both previous versions), kib Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32306
* sysexits: Tidy deprecated header and manualAlexander Ziaee13 days1-3/+4
| | | | | | | | | | | | | <sysexits.h> was deprecated in the base system in a1432b4 for FreeBSD 8.0 and is retained only for backwards compatibility. Make that clear, since sysexits(3) suggested using it since it was in style(9) prior to this. MFC after: 1 week Co-authored-by: imp Fixes: a1432b4 Reviewed by: imp, pauamma (previous version) Pull Request https://github.com/freebsd/freebsd-src/pull/1195
* Remove gbde support from swapon(8)Poul-Henning Kamp2024-05-071-1/+0
|
* endian.h: Define uint{16,32,64}_tWarner Losh2024-05-061-1/+25
| | | | | | | | | | | The Draft Posix Issue 8 standard requires that these be defined. Define them in the usual way that lets multiple headers define them. Opted to not just use #include <stdint.h>, allowed by the draft, to be conservative. Add notes about how we comply with Issue 8, and that we've opted to define these only as macros, though the standard allows functions, macros or both. Sponsored by: Netflix
* nvmf: Install nvmf.h and nvmf_proto.h in /usr/include/dev/nvmfJohn Baldwin2024-05-021-0/+6
| | | | | | Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44707
* libthr: add pthread_sigqueue(3)Konstantin Belousov2024-04-231-0/+7
| | | | | | | | PR: 278459 Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44867
* include: Remove repeated wordsElyes Haouas2024-04-111-1/+1
| | | | | | Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/887
* include: Ensure security/audit/audit.h gets staged properly.Stephen J. Kiernan2024-04-041-4/+4
| | | | | | | | | | | | | | | | There is a conflict between bsm/audit.h and security/audit/audit.h due to the way that staging is being set up using .PATH to point to the full directory and the leaf files being specified in the list. Due to this, the bsm/audit.h was getting staged as both bsm/audit.h and security/audit/audit.h since the sys/bsm directory is listed first in the .PATH list. Use sys/security in the .PATH instead of sys/security/audit and specify the audit header files as audit/<name>.h. This ensures that we get the correct audit.h stanged for security/audit/audit.h. Reviewed by: sjg Obtained from: Juniper Networks, Inc.
* include: Allow SDESTDIR to be overriddenStephen J. Kiernan2024-03-271-1/+1
| | | | | | Obtained from: Juniper Networks, Inc. Reviewed by: sjg Differential Revision: https://reviews.freebsd.org/D44540
* timezone: Move to the XSI/POSIX definition for timezone.Warner Losh2024-03-121-1/+2
| | | | | | | | | | | | | | The old timezone(3) function has long since been obsolete and has a fatally flawed interface. Retain this function for compatibility purposes, but shift to providing the offset from UTC in the timezone variable, whether or not the timezone observes summer time in the 'daylight' variable. Document the tzname variable that's already been set. Also make _tztab() static. It's not used in libc (or anywhere in the tree) and it's not exported as a public dynamic symbol. Sponsored by: Netflix Reviewed by: brooks, kib Differential Revision: https://reviews.freebsd.org/D44281
* posix_spawn(3): add POSIX_SPAWN_DISABLE_ASLR_NPKonstantin Belousov2024-03-041-0/+1
| | | | | | | | | similar to Apple _POSIX_SPAWN_DISABLE_ASLR Reviewed by: emaste, kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44195
* dumprestore.h: Fix typos in source code commentsGordon Bergling2024-02-271-3/+3
| | | | | | - s/dumpped/dumped/ MFC after: 3 days
* stdlib.h: Partially revert c27a89971805Warner Losh2024-02-021-1/+1
| | | | | | | | | | | | quick_exit() can call other functions, and we don't guarantee it calls std::terminate should those other functions throw exceptions. And to make it do so has ABI complications for libc. Until that's sorted out, revert this noexcept (but leave a comment behind so people will find this commit message) Requested by: kib Sponsored by: Netflix
* stdlib.h: add __noexcept to prototypesLexi Winter2024-02-021-5/+5
| | | | | | | | | | The noexcept specifier is required on these functions in C++: _Exit(), atexit(), quick_exit(), at_quick_exit(), abort(). MFC after: 2 weeks Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1085
* Revert "nl_types.h: explicitly include cdefs.h"Ed Maste2024-01-251-1/+0
| | | | | | This isn't the right approach for addressing this cross-build issue. This reverts commit 820401bf176996e41091d2e4190aded12a966b1d.
* nl_types.h: explicitly include cdefs.hVal Packett2024-01-241-0/+1
| | | | | | | | This file uses __BEGIN_DECLS/__END_DECLS. When bootstrapping from Linux/musl, they were missing. Sponsored by: https://www.patreon.com/valpackett Pull Request: https://github.com/freebsd/freebsd-src/pull/1066
* Add kcmp(2) userspace bitsKonstantin Belousov2024-01-241-0/+1
| | | | | | | | | | | Unlike Linux, we do provide libc wrapper. All definitions and prototypes are available from <unistd.h> Tested by: manu Reviewed by: brooks, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43518
* resolv: Add a required include to resolv.hJan Beich2024-01-081-0/+1
| | | | | | | | Add a required include to resolv.h for sockaddr_in. This should reduce patching required when porting code written with Linux or NetBSD in mind. PR: 182466 MFC after: 1 week
* libc: expose execvpe for Linux compatBrooks Davis2023-12-111-0/+1
| | | | | | | | | | | | | | We already implemented execvpe internally with an _ prefix in libc so go ahead and expose it for compatibility with Linux. This reverts c605eea952146348e5e1ad5cab6c127d7a1bd164. Bump __FreeBSD_version for the addition and add definitions to supress compat shims in libzfs (zfs changes were merged from upstream). PR: 275370 (request and exp-run (thanks antoine!)) Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D42846
* endian.h: Remove duplicate wordsJose Luis Duran2023-12-101-3/+3
| | | | | Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/920
* include: Automated cleanup of cdefs and other formattingWarner Losh2023-11-276-7/+1
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sccs: Manual changesWarner Losh2023-11-2722-116/+1
| | | | | | | | | | | | | | | For the uncommon items: Go through the tree and remove sccs tags that didn't fit any nice pattern. If in the neighborhood, other SCM tags were removed when they were detritis of long-ago CVS somehow in the early mists of the project. Some adjacent copyrights stringswere removed (they duplicated the copyright notices in the file). This also removed non-standard formations of omission of SCCS tags (usually by adding an extra #if 0 somewhere. After this commit, a number of strings tagged with the 'what' @(#) prefix remain, but they are primarily copyright notices. Sponsored by: Netflix
* include: Remove ancient SCCS tags.Warner Losh2023-11-2783-173/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* dirdeps: Update/fix Makefile.depend* for toolchainKa Ho Ng2023-11-271-0/+1
| | | | This fixes make pseudo/toolchain.
* lib/libc/rpc: switch the per-fd structs in clnt_{dg,vc}.c to RB TreesAlan Somers2023-11-151-1/+0
| | | | | | | | | | | | | This saves oodles of memory, especially when "ulimit -n" is large. It also prevents a buffer overflow if getrlimit should fail. Also replace per-fd condvars with mutexes to simplify the code. PR: 274968 MFC after: 2 weeks Sponsored by: Axcient Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D42597
* Trim various $FreeBSD$John Baldwin2023-10-101-2/+0
| | | | | | Approved by: markj (cddl/contrib changes) Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41961
* pf: convert state retrieval to netlinkAlexander V. Chernikov2023-10-101-1/+2
| | | | | | | | | | | | | | | | | | | | Use netlink to export pf's state table. The primary motivation is to improve how we deal with very large state stables. With the previous implementation we had to build the entire list (both in the kernel and in userspace) before we could start processing. With netlink we start to get data in userspace while the kernel is still generating more. This reduces peak memory consumption (which can get to the GB range once we hit millions of states). Netlink also makes future extension easier, in that we can easily add fields to the state export without breaking userspace. In that regard it's similar to an nvlist-based approach, except that it also deals with transport to userspace and that it performs significantly better than nvlists. Testing has failed to measure a performance difference between the previous struct-copy based ioctl and the netlink approach. Differential Revision: https://reviews.freebsd.org/D38888
* Restrict the glibc compat cookie open functions to __BSD_VISIBLEWarner Losh2023-09-171-0/+2
| | | | Sponsored by: Netflix
* pkgbase: Move headers and libs out of runtime and utilitiesDoug Rabson2023-09-122-1/+3
| | | | | | | | | | | | | | | | | | | | Headers from src/include were in the runtime-dev package but subdirectories of src/include ended up in utilities-dev by default. Neither package is a good choice - the headers in src/include are not useful without the libraries contained in clibs-dev. This moves the standard C headers to clibs-dev (C++ headers are already in this package). While working on this, I found that various clang libraries and headers were also bundled into utilities-dev by default so these are also moved to clang-dev. I also added a FreeBSD-build-essential meta package to make it simple to install all the toolchain parts. PR: 254173 Reviewed byb: manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41815
* include: Implement N2867.Dag-Erling Smørgrav2023-09-072-1/+41
| | | | | | | This adds macros for checked addition, subtraction, and multiplication with semantics similar to the builtins gcc and clang have had for years. Reviewed by: kib, emaste Differential Revision: https://reviews.freebsd.org/D41734
* time.h: Fix visibility check for C11 and C23 features.Dag-Erling Smørgrav2023-09-061-2/+2
| | | | | | | | | __BSD_VISIBLE is always defined; we need to check if it's true. Fixes: d02489d11aed 9b5d724cad10 MFC after: 3 days Reviewed by: brooks, imp Differential Revision: https://reviews.freebsd.org/D41733
* Add mac_grantbylabelSimon J. Gerraty2023-08-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | This module allows controlled privilege escallation via mac labels securely associated with a process via mac_veriexec. There are over 700 PRIV_* but we can compress many of them into a single GBL_* thus constraining the size of gbl labels. The goal is to allow a daemon to run as an unprivileged process while still being able a set of privileged operations needed. We add APIs to libveriexec so that userland processes can check labels and an exec_script API that allows a suitably labeled process to run something like a python interpreter directly if necessary; overcomming the 'indirect' flag applied to the interpreter. Add -l option to sbin/veriexec to report labels. Reviewed by: stevek Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D41431
* libc: Add timespec_getres(3) as per C23.Dag-Erling Smørgrav2023-08-241-1/+7
| | | | | | | This also adds support for TIME_MONOTONIC to timespec_get(3). Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D41524
* Remove $FreeBSD$: one-line xdr patternWarner Losh2023-08-1621-22/+0
| | | | Remove /^\s*%\s*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-1615-15/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-1624-24/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-1653-53/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-1672-144/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* arm64 lib32: prepare arm64 headers to redirect to armMike Karels2023-07-252-4/+69
| | | | | | | | | | | | | | | | | | | | | | | In order to compile lib32 libraries and other 32-bit code on arm64, <machine/foo.h> needs to be redirected to an arm header rather than arm64 when building with -m32. Ifdef the arm64 headers that are installed in /usr/include/machine and used by user-level software (including references from /usr/include/*.h) so that if __arm__ is defined when including the arm64 version, <arm/foo.h> is included rather than using the rest of the file's contents. Some arm headers had no arm64 equivalent; headers were added just to do the redirection. These files use #error if __arm__ is not defined to guard against confusion. Also add an include/arm Makefile, and modify Makefiles as needed to install everything, including the arm files in /usr/include/arm. fenv.h comes from lib/msun/arm/fenv.h. The new arm64 headers are: acle-compat.h cpuinfo.h sysreg.h Reviewed by: jrtc27, imp Differential Revision: https://reviews.freebsd.org/D40944
* include: Migrate from COMPAT_32BIT to generic COMPAT_libcompatJessica Clarke2023-07-091-2/+2
| | | | | | | | See commit 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make variables") for the context behind this change. Reviewed by: emaste, brooks, jhb Differential Revision: https://reviews.freebsd.org/D40924
* elf-hints.h: Allow rtld_paths.h to be included before itJessica Clarke2023-07-091-0/+2
| | | | | | | | | | | | | | | | | Currently rtld_paths.h will #undef _PATH_ELF_HINTS in order to override this to the right value if included afterwards, but the other way round does not work as elf-hints.h tries to define an already-defined macro to a potentially different value. Thus, guard the definition here so that rtld_paths.h's definition continues to take precedence. Note that, although all in-tree uses of _PATH_ELF_HINTS have included rtld_paths.h already, pax-utils wants _PATH_ELF_HINTS from elf-hints.h and so we cannot just drop the define. In-tree uses must just continue to make sure that they include rtld_paths.h to get the right value for libcompat builds as is already required. Reviewed by: kib, brooks, jhb, imp Differential Revision: https://reviews.freebsd.org/D40918
* nvme: Don't install nvme_private.h in /usr/include.John Baldwin2023-06-271-1/+6
| | | | | | Reviewed by: chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D40394
* spdx: Simplify BSD-2-Clause AND BSD-2-ClauseWarner Losh2023-05-121-1/+1
| | | | | | | | | After removing the -FreeBSD and -NetBSD, we're left with a nuber of BSD-2-Clause AND BSD-2-Clause, so tidy that up. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSDWarner Losh2023-05-127-7/+7
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-1243-43/+43
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix