aboutsummaryrefslogtreecommitdiff
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* RTLD_DEEPBIND: make lookup not just symbolic, but walk all refobj' DAGsKonstantin Belousov2023-11-302-2/+7
| | | | | | | | | | | | | before starting the walk over the global list. Effectively we visit needed objects first as well, instead of just the object itself. This seems to better match the semantic offered by the glibc flag. Reported by: kevans PR: 275393 Reviewed by: kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D42841
* libexec: Automated cleanup of cdefs and other formattingWarner Losh2023-11-2733-68/+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
* Remove copyright strings ifdef'd outWarner Losh2023-11-277-66/+0
| | | | | | | | | | | We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require). Sponsored by: Netflix
* libexec: Remove ancient SCCS tags.Warner Losh2023-11-2757-144/+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
* rc.d/ldconfig: Remove stray ;;Cy Schubert2023-11-241-1/+0
| | | | | | Stray ";;" causes the ldconfig rc script to fail at boot. Remove it. Fixes: 73902ed85ab7
* ldconfig: only configure compat32 when kernel supports itKonstantin Belousov2023-11-241-5/+2
| | | | | | | | | and eliminate hard-coded arch list. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D42669
* ldconfig: filter out non-existing directories from default pathKonstantin Belousov2023-11-201-1/+5
| | | | | | | | | | | | | This is done only for ld-elf32.so.1, where /lib32 is kept in the path due to the way STANDARD_LIBRARY_PATH is defined in rtld_paths.h. This change fixes innocent warning appearing after 99132daf6f70cb0cc969c555d3612547fa3cf1db Reviewed by: dim, emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D42626
* Spaces to tabs for consistency. No content change.Jens Schweikhardt2023-11-181-2/+2
|
* rc.d/ldconfig: Prepend rtld stdlib paths to ldconfig(32)_pathsJohn W. O'Brien2023-11-131-1/+4
| | | | | | | | | | | Ensure that ldconfig-managed elf and elf32 hints always include the standard library paths that are known independently to rtld. PR: 275031 Reviewed by: kib MFC after: 2 weeks Sponsored by: Saltant Solutions LLC Differential Revision: https://reviews.freebsd.org/D42557
* defaults: oomprotect sshd and local_unboundAlexander Leidinger2023-11-131-0/+2
| | | | | | | | | | | | | | | | | Add sshd and local_unbound to the oom protected services. syslogd is protected by default already, document it. This was discussed on arch@, see https://lists.freebsd.org/archives/freebsd-arch/2023-November/000543.html sshd is protected to be able to investigate and fix oom issues on systems which don't have out-of-band console access. local_unbound is protected as it may be enabled for local use and without DNS a lot grinds to a halt (including sshd). Relnotes: yes MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D42544
* rtld/arm: fix initial-exec (IE) thread-local storage relocationR. Christian McDonald2023-11-031-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | net/frr[89] revealed an interesting edge-case on arm when dynamically linking a shared library that declares more than one static TLS variable with at least one using the "initial-exec" TLS model. In the case of frr[89], this library was libfrr.so which essentially does the following: #include <stdio.h> #include "lib.h" static __thread int *a __attribute__((tls_model("initial-exec"))); void lib_test() { static __thread int b = -1; printf("&a = %p\n", &a); printf(" a = %p\n", a); printf("\n"); printf("&b = %p\n", &b); printf(" b = %d\n", b); } Allocates a file scoped `static __thread` pointer with tls_model("initial-exec") and later a block scoped TLS int. Notice in the above minimal reproducer, `b == -1`. The relocation process does the wrong thing and ends up pointing both `a` and `b` at the same place in memory. The output of the above in the broken state is: &a = 0x4009c018 a = 0xffffffff &b = 0x4009c018 b = -1 With the patch applied, the output becomes: &a = 0x4009c01c a = 0x0 &b = 0x4009c018 b = -1 Reviewed by: kib Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D42415/
* Track upstream project rename in contrib/blocklistdEd Maste2023-11-033-4/+4
| | | | | | | | Upstream is now https://github.com/zoulasc/blocklist/. Rename the contrib directory and update Makefiles to match, in advance of the next vendor branch update. Sponsored by: The FreeBSD Foundation
* ino64: Remove 'forward compat' code for thisWarner Losh2023-10-311-2/+2
| | | | | | | | | | | | | | | Forward compatibility code was added for running newer ino64 binaries on older kernels as a transition aide. Now that ino64 has been in the tree 6 years, this code is no longer useful and should have been removed long ago. Remove it now. Should be no user-visible changes at this point as all the 'upgrade' scenarios it was intended for are long since past. Also need to remove this stuff from rtld since the _foo versions no longer exist. Sponsored by: Netflix Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D42382
* rtld: Teach rtld about the BTI elf noteAndrew Turner2023-10-301-0/+4
| | | | | | | | | | Add the Branch Target Identification (BTI) note to libc assembly sources. As all obect files need the note for rtld to have it we need to insert it in all asm files. Reviewed by: markj, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42228
* rtld: introduce STATIC_TLS_EXTRAStephen J. Kiernan2023-10-3010-12/+35
| | | | | | | | | | | | | | | | | | The new STATIC_TLS_EXTRA variable provides a means for applications to increases the size of the extra static TLS space allocated by rtld beyond the default of '128'. This extra static TLS space is used for objects loaded with dlopen. The value specified in the variable must be no less than the default value and no greater than the maximum allowed value for size_t type. If an invalid value is specified, rtld will ignore it and just use the default value. The rtld(1) man page is updated to document this new option. Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D42025
* ttys: bump dateWarner Losh2023-10-261-1/+1
|
* ttys: Document insecure flagWarner Losh2023-10-261-2/+3
| | | | | | | | | Both the secure and insecure flag is documented in init(8). the secure flag is documented here; however, the insecure flag is not. Nor is the nuance that a line missing the 'secure' flag is also considered insecure. Document both here. Sponsored by: Netflix
* flua: add fbsd moduleBaptiste Daroussin2023-09-274-1/+169
| | | | | | | | | | | | This module is bundled into flua, it only provides for now the exec function. The point of the function is to be able to execute a program without actually executing a shell. to use it: fbsd.exec({"id", "bapt"}) Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D41840
* Purge more stray embedded $FreeBSD$ stringsJohn Baldwin2023-09-2529-91/+0
| | | | | | | These do not use __FBSDID but instead use bare char arrays. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41957
* jail: avoid a clash with /etc/jail.conf.d between rc and jail(8)Jamie Gritton2023-09-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | Since 13.1, /etc/rc.d/jail has looked for a per-jail config file in /etc/jail.conf.d. For RELENG 14, the ".include" directive was added to jail(8), with a sample line in the jail.conf(5) man page that includes "/etc/jail.conf.d/*.conf". These two use cases don't work together. When the jail.conf.d files are included from a master jail.conf, the files in jail.conf.d are likely to hold only partial configurations, and shouldn't be directly loaded by rc.d/jail. But there are existing configurations that depend on the current rc.d behavior. While users could be advised not to include from /etc/jail.conf.d, it's the natural choice even if not mentioned in jail.conf.5. The workaround is for rc.d/jail to continue to load the individual files, but only when /etc/jail.conf doesn't include from that directory (via a simple grep test), This allows the current use while not breaking the previous use. Reported by: antranigv at freebsd.am Differential Revision: https://reviews.freebsd.org/D41962
* rc.subr: don't require service to be enabled for `status`Daniel Tameling2023-09-211-2/+3
| | | | | | | | | | | | | | For a service that sets an rcvar, there is a check whether it has been enabled before the actual command is executed. If the check fails, one gets a message to enable it and the returned exit status is 0. However, this is usually undesirable for the status command, which is a) supposed to check whether the service is running anyway and b) returns a non-zero exit code if that is not the case. Thus, skip the check for the status command. PR: 272282 Reviewed by: emaste MFC after: 3 days
* save-entropy: Add manual pageFernando Apesteguía2023-09-182-0/+98
| | | | | | | | | | Succinct manual page for save-entropy(8). PR: 223998 Reported by: AJ Jordan <alex+freebsd@strugee.net> Reviewed by: carlavilla@, delphij@, lwhsu@, pauamma_gundo.com Approved by: delphi, lwhsu (src) Differential Revision: https://reviews.freebsd.org/D41768
* rtld: output rtld errors into the dbg channelKonstantin Belousov2023-09-151-0/+1
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* ftpd: correct deprecation notice markupEd Maste2023-09-131-2/+2
| | | | | | | | Also bump .Dd for the original change. Reported by: karels Fixes: 98b98ec1bc7e ("ftpd: add deprecation notice") Sponsored by: The FreeBSD Foundation
* ftpd: add deprecation noticeEd Maste2023-09-091-0/+10
| | | | | | Approved by: gordon Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26447
* __crt_aligned_alloc_offset(): fix ov_index for backing allocation addressKonstantin Belousov2023-09-061-1/+1
| | | | | | | | | | | Wrong value of ov_index resulted in magic check failure, and refuse to free() the memory allocated with __crt_aligned_alloc_offset(). Then the TLS segments of exited threads leaked. Reported and tested by: glebius Fixes: c29ee08204ce4106d4992474005c5f2fb7d5fbf1 Sponsored by: The FreeBSD Foundation MFC after: 3 days
* rtld: switch from malloc_aligned() to __crt_aligned_alloc()Konstantin Belousov2023-08-213-32/+15
| | | | | | | | | Use regular free(), since it works now. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D41150
* rtld_malloc: add __crt_aligned_alloc_offset()Konstantin Belousov2023-08-212-3/+32
| | | | | | | | | | | | It is modelled after aligned_alloc(3). Most importantly, to free the allocation, __crt_free() can be used. Additionally, caller may specify offset into the aligned allocation, so that we return offset-ed from alignment pointer. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D41150
* rtld_malloc: increase overhead index to uint16Konstantin Belousov2023-08-211-2/+2
| | | | | | | | | Reorder it with magic, to keep alignment. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D41150
* rtld_malloc.c: change return type of cp2op() to voidKonstantin Belousov2023-08-211-2/+2
| | | | | | | | | for it to be useful to return unaligned pointer. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D41150
* rtld: unlock bind lock when calling into crt __pthread_distribute_static_tls ↵Konstantin Belousov2023-08-201-0/+2
| | | | | | | | | | | | | | | | method The method might require resolving and binding symbols, which means recursing on the bind lock. It is safe to unlock the bind lock, since we operate on the private object list, and user attempting to unload an object from the list of not yet fully loaded objects caused self-inflicted race. It is similar to how we treat user' init/fini methods. Reported by: stevek Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Use 115200 bps by default for serial communicationEd Maste2023-08-171-3/+3
| | | | | | | | | | | | | 9600 was a standard baud rate decades ago, but 115200 is now more common so choose defaults that are useful to the largest number of users. Note that boot0sio does not support rates above 9600 so it remains unchanged. Reviewed by: bz, imp, manu Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36295
* Fix partially removed comment by removing the restWarner Losh2023-08-161-2/+0
| | | | Fixes: 2a63c3be1582
* Remove $FreeBSD$: one-line bare tagWarner Losh2023-08-163-6/+0
| | | | Remove /^\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-1612-12/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-1616-32/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-16304-305/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1641-81/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-1614-14/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-1611-11/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-1666-132/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* cpuset(8): move to /bin/Enji Cooper2023-08-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: This change moves /usr/bin/cpuset to /bin/cpuset so it is more readily available on hosts where the /usr partition might not be mounted at the time / has been mounted. Remove some complexity from rc.subr(8) since /bin is assumed to always be present if/when / is mounted. MFC after: 2 weeks MFC with: 0661f93892a2, 271d552379af Test Plan: - Test out rc.subr change. - Confirm that the installation logic does what's needed. Relnotes: yes (moving cpuset may impact strict file permissions/mode checking) Reviewers: kevans Subscribers: imp Differential Revision: https://reviews.freebsd.org/D40057
* ldconfig script: enable 32-bit compat on aarch64Mike Karels2023-08-051-1/+1
| | | | | Add aarch64 to set of architectures that support 32-bit compat libraries.
* libexec: Automatically generate rtld-elf list and generalise TAGSJessica Clarke2023-07-272-3/+11
| | | | | | | | | Note that the pattern for matching is made slightly more specific, so as to permit libcompats where one is a prefix of another (e.g. CheriBSD has lib64 and lib64c). Reviewed by: brooks, jhb, emaste, imp, kib Differential Revision: https://reviews.freebsd.org/D41183
* rtld_malloc: add cp2op() helperKonstantin Belousov2023-07-261-2/+8
| | | | | | | | converting user allocation address into overhead pointer Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D41150
* rtld_malloc: only include internal rtld headers when building for rtldKonstantin Belousov2023-07-261-0/+2
| | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D41150
* rtld: remove dup __crt_malloc prototypesKonstantin Belousov2023-07-262-5/+1
| | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D41150
* rtld_malloc: remove outdated commentsKonstantin Belousov2023-07-261-4/+0
| | | | | | | | | | | The ovu_magic is not neccessary overlaps with low byte of the ov_next, for the big endian machines. There is no range checking in the allocator. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D41150
* atf_pytest_wrapper: fix use with pytest-7.4Kristof Provost2023-07-211-0/+2
| | | | | | | | | | | | | | As of pytest 7.4 it no longer walks all the way to the root directory of the file system to find conftest files. As a result we don't find / usr/tests/conftest.py, and don't load atf_python. That in turn causes atf_python tests to fail. Explicitly set the confcutdir, as advised by the pytest changelog. See also: https://github.com/pytest-dev/pytest/pull/11043 MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D41064
* Revert "tftpd: fix double-colon typo in option string"Dmitry Morozovsky2023-07-201-1/+1
| | | | | | | | | It was not a typo: -d takes an optional argument, which is indicated with a double colon. This reverts commit 3cbc8e752b92442c784306731e94fd904de3373c. Spotted by: kevans