summaryrefslogtreecommitdiff
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* atf: refer to `common.mk` using `SRCTOP`Enji Cooper2026-10-291-1/+1
| | | | | | | This helps make the dependent Makefile (and the values contained within) easier to catch when upgrading atf in the future. MFC after: 1 week
* rtld: free heap donelists abandoned by the lookup restartKonstantin Belousov2026-10-293-26/+67
| | | | | | | | | | | | | | | | | | | A symbol lookup done under the read-locked rtld_bind_lock is restarted with the write lock when it needs to load filtees. The restart is done by siglongjmp() from lock_restart_for_upgrade(), which skips donelist_free() for the heap donelists of the unwound frames. Only do_dlsym() freed one such donelist, tracked by SymLook.donelist_mem. The donelist of symlook_default() called from _rtld_bind(), the donelist of get_program_var_addr() called for dlopen(RTLD_TRACE), and the donelists of nested symlook_obj_load_filtees() calls were leaked. Link the heap donelists allocated under the read lock into the list owned by RtldLockState, which also owns the sigjmp_buf, instead of the symlook request. Fixes: 1e370f038778 ("rtld: stop using unbound alloca()") Sponsored by: The FreeBSD Foundation MFC after: 1 week
* rtld: add lockstate_rlocked()Konstantin Belousov2026-10-292-0/+7
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* rtld: add RtldLockState initializerKonstantin Belousov2026-10-293-2/+28
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* rtld: extract donelist heap allocation into donelist_alloc()Konstantin Belousov2026-10-291-6/+11
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Mark network_interfaces as deprecatedPoul-Henning Kamp2026-10-281-1/+1
|
* All Jetway NF541 seem to have the same UUIDPoul-Henning Kamp2026-10-281-0/+2
|
* dl_iterate_phdr(3): do not return garbage for objects not using TLSKonstantin Belousov2026-10-251-2/+6
| | | | | | | | | | For objects without a TLS segment, tlsindex is zero. tls_get_addr_slow() then reads dtv_slots[-1], which is dtv_size, and returns it as the TLS address. Set dlpi_tls_data to NULL for such objects instead. Fixes: d36d68161517 ("rtld dl_iterate_phdr(): dlpi_tls_data is wrong") Sponsored by: The FreeBSD Foundation MFC after: 1 week
* rtld: some cosmetics in donelist_init()Konstantin Belousov2026-10-251-5/+5
| | | | | | | | | | Add a missing word in the comment. Make each assignment a separate statement. Fix formatting. Fixes: 1e370f038778 ("rtld: stop using unbound alloca()") Sponsored by: The FreeBSD Foundation MFC after: 1 week
* rtld: fix leak in get_program_var_addr() on the error pathKonstantin Belousov2026-10-251-1/+3
| | | | | | Fixes: 1e370f038778 ("rtld: stop using unbound alloca()") Sponsored by: The FreeBSD Foundation MFC after: 1 week
* manpages: Fix unusual Xr orderWolfram Schneider2026-10-251-1/+1
|
* rtld: add .cfi_undefined lr to rtld_start.S on powerpc*Piotr Kubaj2026-10-152-0/+2
| | | | | | | | | | | | | Without it, LLVM libunwind doesn't know where to stop when unwinding the main thread, so it uses a stale LR as the return address and crashes. Our libunwind doesn't do that since 5866c369e4fd reverted it, but programs that bundle their own copy, like ClickHouse, are hit by it. amd64, arm64, i386 and riscv already have the same annotation. Approved by: jhibbits MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D60740
* hooks.sh allow running DebugO{n,ff} from hooks_runSimon J. Gerraty2026-10-131-3/+32
| | | | | | | | We need to watch out for _debugO{n,ff}_hooks. Also add add_list (hook lists are just lists). Fix bug in hooks_has() - should look for $2 in list.
* debug.sh avoid trouble from set -eSimon J. Gerraty2026-10-131-7/+17
| | | | | | | | | The setting of _TTY ran afoul of set -e. Also the handling of Myname blew up if debug.sh included by a login sheel (eg in .profile). For non-posix shell, leave false alone if it is a builtin.
* safe_eval.sh: safe_set_var add allow list for valuesSimon J. Gerraty2026-10-131-6/+22
| | | | | | | | | | Complete the controls with -v "values": sh ./safe_eval.sh set_var -a "knob" -v "no yes" knob=yes knob=no knob=ok ok=yes knob=yes knob=no denied value 'ok' for 'knob' denied variable 'ok'
* safe_eval.sh: safe_set_var use [:space:] if possibleSimon J. Gerraty2026-10-111-5/+10
| | | | | Also use $ssv_extra$ssv_only as the default for $ssv_only has '-' which must be last in the character class.
* safe_eval.sh: safe_set_var avoid positional argsSimon J. Gerraty2026-10-111-16/+74
| | | | | | Use options to set ssv_{allow,only,extra} Improve the documentation. Add a test harness for safe_set_var.
* safe_eval.sh fix description of safe_set_var returns.Simon J. Gerraty2026-10-111-4/+4
| | | | | | | The description was out of sync wrt return values. 1. invalid var 2. invalid val 3. var not in allowed list
* safe_eval.sh: add safe_set_varSimon J. Gerraty2026-10-111-4/+11
| | | | | | Get the log message right! Fix default allowed chars (untabify clobbered TAB) Add a couple more : messages to help debugging.
* safe_eval.sh add safe_var_setSimon J. Gerraty2026-10-111-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | safe_var_set can be used to safely handle var=val args from command line. eg. while : do case "$1" in *=*) # eval "$1" can be very dangerous # safe_var_set will only eval if # both var and value are sane. if ! safe_var_set "$1"; then case "$?" in 1) echo invalid variable name;; 2) echo invalide value;; 3) echo variabel not allowed;; esac fi shift ;; *) break ;; esac done
* rtld: release rtld_bind_lock around calls to .preinit_array initializersKonstantin Belousov2026-10-101-3/+5
| | | | | | | | | | | We unlock the bind lock around .init calls anyway. Also, the main object cannot be unloaded. Reported and reviewed by: dim PR: 298943 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60588
* rtld: fix indentKonstantin Belousov2026-10-101-2/+2
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days
* rc.d/mountd: Do not require /etc/exportsChristos Margiolis2026-10-071-1/+0
| | | | | | | | | | | | | | | | | | | mountd exits if it cannot read any exports files. Requiring /etc/exports, however, unconditionally stops mountd from starting on a server that exports ZFS datasets only (/etc/zfs/exports). Let sbin/mountd handle requirements itself, instead of hardcoding /etc/exports, which is also wrong, because different files can be specified in mountd_flags. This patch also works with nfsv4_server_enable="YES", by preserving the behavior of failing to start if there is no "V4:" line in the exports file, which is missing by default on ZFS-only exports. MFC after: 1 week Sponsored by: The FreeBSD Foundation Reviewed by: rmacklem, markj, emaste Differential Revision: https://reviews.freebsd.org/D60044
* rtld.c: avoid double-free on dso load failure in do_load_object()Konstantin Belousov2026-10-061-0/+1
| | | | | | | | | | | The obj->path is assigned directly from the path argument, and load_object() frees the path on do_load_object() failure. Do not free it in obj_free() on the error path. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60402
* rtld-elf/i386: remove no longer true __unused args annotationsKonstantin Belousov2026-10-061-1/+1
| | | | | | Fixes: d45d7aea6197 ("i386 rtld: implement support for TLSDESC relocation") Sponsored by: The FreeBSD Foundation MFC after: 1 week
* nuageinit: apply meta-data if user-data is a scriptAdam Mizerski2026-10-032-15/+30
| | | | | | Tested by: adam.mizerski@ovhcloud.com Sponsored by: OVHcloud Pull Request: https://github.com/freebsd/freebsd-src/pull/2446
* apm(8): Remove support for APM BIOSJohn Baldwin2026-09-302-56/+0
| | | | | | | | | Drop support for queries and commands that are not supported by ACPI's /dev/apm interface. This includes dropping support for enabling/disabling APM BIOS used by /etc/rc.d/apm. Reviewed by: ziaee, imp Differential Revision: https://reviews.freebsd.org/D59941
* apmd: Retire the APM daemonJohn Baldwin2026-09-305-55/+8
| | | | | | | | | | | | | The original purpose of this daemon was to route power management requests to userspace, e.g. when the suspend button was pressed, the APM driver posted an event read by apmd(8) that would invoke zzz(8) to suspend. However, on ACPI systems this is handled by devd(8) events instead and running apmd(8) in addition just adds extra complexity. This probably should have been axed when the APM BIOS support was retired in commit 8c576a279ed5. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D59937
* atf-sh: install kmod_test added as part of the 0.26 releaseEnji Cooper2026-09-221-0/+1
| | | | Fixes: 952231086100 ("contrib/atf: upgrade to 0.26")
* contrib/atf: upgrade to 0.26Enji Cooper2026-09-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new version gets contrib/atf in line with the published version of the package up on [GitHub][github]. Please note that this release is a major update: it contains several bugfixes and feature enhancements. Most were already present in the FreeBSD src repo, but there were a large number of changes made in addition to what was already present. MFC after: 1 month Merge commit '9c78088348bcf1059d82a62bb57a0746309d4312' Conflicts: contrib/atf/.cirrus.yml contrib/atf/Makefile.am contrib/atf/Makefile.in contrib/atf/aclocal.m4 contrib/atf/admin/ar-lib contrib/atf/admin/check-style-common.awk contrib/atf/admin/check-style.sh contrib/atf/admin/compile contrib/atf/admin/config.guess contrib/atf/admin/config.sub contrib/atf/admin/depcomp contrib/atf/admin/install-sh contrib/atf/admin/ltmain.sh contrib/atf/admin/missing contrib/atf/atf-c++/Makefile.am.inc contrib/atf/atf-c++/atf-c++.3 contrib/atf/atf-c++/atf-c++.pc.in contrib/atf/atf-c++/check.cpp contrib/atf/atf-c++/check.hpp contrib/atf/atf-c++/detail/Makefile.am.inc contrib/atf/atf-c++/detail/process_test.cpp contrib/atf/atf-c/Makefile.am.inc contrib/atf/atf-c/atf-c.3 contrib/atf/atf-c/atf-c.pc.in contrib/atf/atf-c/detail/Makefile.am.inc contrib/atf/atf-c/detail/fs.c contrib/atf/atf-c/detail/fs_test.c contrib/atf/atf-c/detail/process_test.c contrib/atf/atf-c/tc.c contrib/atf/atf-c/tc.h contrib/atf/atf-sh/Makefile.am.inc contrib/atf/atf-sh/atf-check.cpp contrib/atf/atf-sh/atf-check_test.sh contrib/atf/bootstrap/Makefile.am.inc contrib/atf/bootstrap/package.m4 contrib/atf/bootstrap/testsuite contrib/atf/config.h contrib/atf/configure contrib/atf/configure.ac contrib/atf/doc/Makefile.am.inc contrib/atf/doc/atf-test-case.7 contrib/atf/m4/developer-mode.m4 contrib/atf/m4/libtool.m4 contrib/atf/m4/ltoptions.m4 contrib/atf/m4/ltsugar.m4 contrib/atf/m4/ltversion.m4 contrib/atf/m4/lt~obsolete.m4 contrib/atf/m4/module-defs.m4 contrib/atf/test-programs/Makefile.am.inc [github]: https://github.com/freebsd/atf
* nuageinit: fix support on OpenStackAdam Mizerski2026-09-171-8/+6
| | | | | | | | | | | | | | Change added in 90a7728cd8905cd26b90d06f7873df8bad43ae9a contained a lot of bugs: - If all network interfaces correctly respond to DHCP, then pwait was waiting forever. - If there was more than 1 interface, then "cat /tmp/ephemeraldhcp.*.pid" joined pid numbers into one long string. - "for iface in $left; do kill -15 $left; done" is not using $iface. Tested by: adam.mizerski@ovhcloud.com Sponsored by: OVHcloud Pull Request: https://github.com/freebsd/freebsd-src/pull/2436
* rtld: more caution when parsing in digest_notes()Konstantin Belousov2026-09-141-5/+10
| | | | | | | | | | | | | | | | | | | Incorrect ELF might have PT_NOTE slightly larger than the needed to contain all notes, and the PT_NOTE size could be larger than one page. Then rtld mmaps just the notes bytes to parse. After the last note, we iterate past the mapped region trying to read the Elf_Note header. This was found in wild. Require full elf note to fit into the [start_note, end_note) region to continue the parsing. Check it in stages, first verifying the Elf_Note header structure fits, to be able to read the name and data length. After that, check the whole note against limit. Reported and tested by: makc Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D59635
* rtld.c: fix indentKonstantin Belousov2026-09-141-1/+1
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days
* amd64 rtld: implement support for TLSDESC relocationKonstantin Belousov2026-09-053-6/+166
| | | | | | | Discussed with: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D59269
* i386 rtld: implement support for TLSDESC relocationKonstantin Belousov2026-09-054-4/+183
| | | | | | | Discussed with: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D59269
* rtld i386: use macro for the 'GNU ABI' calling convention of TLS resolverKonstantin Belousov2026-09-052-3/+5
| | | | | | | Discussed with: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D59269
* rtld: explain the use of rtld_bind_lock in rtld_get_addr_slow()Konstantin Belousov2026-09-051-0/+5
| | | | | | | Discussed with: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D59269
* rtld: allow arches to initialize/finalize objectsKonstantin Belousov2026-09-058-0/+23
| | | | | | | Discussed with: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D59269
* rc: add a backlight service to save/restore backlight levelsKyle Evans2026-09-023-0/+90
| | | | | | | | | | | | | | | The default on my laptop is annoyingly bright, and this is a useful feature to mitigate that. The backlight script is largely a copy of the mixer service which provides the same value for mixers, but this one is specifically dependant on kld to allow DRM drivers a chance to attach. Note that it's off by default to avoid interference with DEs, and document the capability in backlight(8). Set backlight_enable=YES in rc.conf(5) to enable save/restore. Relnotes: maybe Reviewed by: bapt, ivy, manu, ziaee Differential Revision: https://reviews.freebsd.org/D59296
* nfsclient: Add a new nfs_client_rdma_enable variableRick Macklem2026-08-302-0/+4
| | | | | | | | | | | | | | | | | | | This patch adds a new nfs_client_rdma_enable variable to /etc/rc.d/nfsclient to enable the client side of NFS over RDMA. The client side of NFS over RDMA requires the nfsclrdma.ko module, which is still under test/review. I wanted to get the "glue" into main so that others could test the module more easily. Avaliability of the module will be announced on freebsd-current@ soon. It should not affect non-RDMA operation. I've specified a long MFC, since the module still requires extensive testing and, hopefully, a review. MFC after: 3 months
* rc.subr tests: service jail behaviour of run_rc_commandAlexander Leidinger2026-08-302-1/+1179
| | | | | | | | | | Twenty cases over where each rc option and each method executes for a jailed service, the jail's lifetime, and the svcj option handling. Each case drives the service inside a chroot built in its ATF work directory. MFC after: 1 week MFC to: stable/15 Assisted-by: Claude Code (Opus 5)
* rc.subr: svcj - add a setaudit optionAlexander Leidinger2026-08-301-0/+3
| | | | | | | | | | | setaudit(8) is prefixed to the command inside the jail when ${name}_audit_user is set, and needs allow.setaudit. This is not added automatically when ${name}_audit_user is set, this needs an administrative setting of the options on purpose. MFC after: 1 week MFC to: stable/15
* rc.subr: svcj - run a service's own restart and status methods in its jailAlexander Leidinger2026-08-301-1/+17
| | | | | | | | | | | A script that defines non-default restart_cmd or status_cmd should execute them in the service jail. Where there is no jail to enter, restart starts the service instead of failing. Fixes: 2efbd480f1d3 rc: add service jails framework MFC after: 1 week MFC to: stable/15 Assisted-by: Claude Code (Opus 5)
* rc.subr: svcj - remove the service jail when the service is not runningAlexander Leidinger2026-08-301-0/+4
| | | | | | | | | | | A service whose tracked process had died while another process of its own kept the jail alive, therefore left svcj-${name} behind, and the next start would fail. Fixes: 2efbd480f1d3 rc: add service jails framework MFC after: 1 week MFC to: stable/15 Assisted-by: Claude Code (Opus 5)
* rc.subr: svcj - let svcj_all_enable enable service jailsAlexander Leidinger2026-08-302-1/+4
| | | | | | | | Fix the logic for svcj_all_enable. Fixes: 2efbd480f1d3 rc: add service jails framework MFC after: 1 week MFC to: stable/15
* rc.subr: svcj - send the stop signal from inside the service jailJochen Neumeister2026-08-301-0/+3
| | | | | | | | | | | A service running under ${name}_user was signalled from the host as that user, which the parent of a jail may no longer do: since 8a5ceebece03 an unprivileged process would need allow.unprivileged_parent_tampering. Stop and reload therefore failed and left both the service and its jail running. MFC after: 1 week MFC to: stable/15
* rc+devd: Add growfs_postbootColin Percival2026-08-243-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | In VM and cloud environments it is often possible to enlarge virtual disks; this can be useful, for example, if a system is launched with a small root disk and it later becomes clear that more space is needed. On kernels which support run-time resizing of disks (for NVMe, this was added in November 2025; some other disk types have supported this for longer) a SIZECHANGE notification is sent to userland via devd. Add a "nostart" rc.d script (runnable manually but not automatically at boot time) and a devd script which invokes it when a notification arrives. The rc.d script enlarges the "final partition" on partitioned geoms, or the UFS filesystem or zpool device when triggered on a disk containing either of those. Reviewed by: imp, ziaee MFC after: 2 weeks Relnotes: Disk partitions and filesystems can be enlarged automatically when disks grow by setting growfs_postboot_enable=YES in /etc/rc.conf. Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D58582
* nuageinit: root should be allowed to log in when disable_root is falseNavdeep Parhar2026-08-221-0/+2
| | | | | | | | | PermitRootLogin is "no" by default and that stopped root from logging in even though disable_root was set to false during initialization. Reviewed by: bapt Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D59101
* rc.conf: Fix the default NFS-over-RDMA port numberVinicius Ferrao2026-08-151-1/+1
| | | | | | | | | | | The default for nfs_server_rdma_listen transposed two digits: 20490 instead of 20049, the IANA-assigned port for NFS-over-RDMA. Fixes: 471e14267bea ("nfsd: Update the rc.d script for RDMA for the nfsd service") MFC after: 1 month Sponsored by: VersatusHPC Pull Request: #2371 Signed-off-by: Vinícius Ferrão <ferrao@versatushpc.com.br>
* nfsd: Update the rc.d script for RDMA for the nfsd serviceRick Macklem2026-08-142-0/+9
| | | | | | | | | | | | | | | | | | | | | | Commit 7144a1d58c5c added the hooks for the nfsrdma.ko module. Once loaded, this module adds RDMA support to the nfsd. This patch adds a few lines to /etc/rc.d/nfsd, so that nfs_server_rdma_enable="YES" in your /etc/rc.conf will load nfsrdma.ko, so that RDMA service is enabled. It also supports nfs_server_rdma_listen="port#" so that the default of 20490 can be overridden in /etc/rc.conf. At this available as time, the nfsrdma.ko module is an unofficial port, since it was developed by Vinicius Ferrao <ferrao@versatushpc.com.br> using generative AI. As soon as it is available, it will be announced on freebsd-current@freebsd.org. Suggested by: Vinicius Ferrao <versatushpc.com.br> MFC after: 1 month