Commit Graph

306303 Commits

Author SHA1 Message Date
Konstantin Belousov 2b1db07bec x86: add machine/ifunc.h
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-01-22 21:09:21 +02:00
Dag-Erling Smørgrav 4b96204338 mdmfs: Fix soft updates logic
Now that newfs(8) has a command-line argument to disable soft updates,
use that instead of running tunefs(8) after the fact to turn them off.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	mckusick, imp
Differential Revision:	https://reviews.freebsd.org/D54783
2026-01-22 19:16:45 +01:00
Mark Johnston 14dce731d7 syslogd/tests: Fix flakiness in forwarding tests
syslogd_start() waits for the local log socket to appear before
returning, to ensure that the daemon is ready to handle log messages.
Some tests start two daemons, so by default the socket already exists
when the second daemon is started, so syslogd_start() returns early.
The test subsequently sends a message to this second daemon, which
sometimes isn't ready.

Define a separate log socket for the second daemon.  Add a check to
syslogd_start() to help catch this type of bug.

Reviewed by:	jlduran
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D54800
2026-01-22 15:52:00 +00:00
Mark Johnston 92d251472e syslogd/tests: Improve loopback interface initialization
- In syslogd_start(), assign the lo0 address in the specified jail.
- Use the correct netmask.

Reviewed by:	jlduran
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D54799
2026-01-22 15:51:42 +00:00
Mark Johnston 560c22937b syslogd/tests: Address races
I occasionally see failures in the syslogd test suite.  The problem is
that the tests are racy: they send a message using logger(1), then
immediately check whether the message was logged to a log file.  If the
syslogd instance under test doesn't get a chance to run before the
second step, the test fails.

This change reworks things to avoid the race while minimizing the amount
of time sleeping.
1) Each test uses a single logfile, so have them use a new common
   variable, SYSLOGD_LOGFILE, instead of something test-specific.
2) In syslogd_start(), if the configuration references SYSLOGD_LOGFILE,
   wait for it to be created by syslogd before returning.
3) Add a helper syslogd_check_log(), to check for a given log entry in
   the last line of SYSLOGD_LOGFILE, instead of using atf_check
   directly.
4) In syslogd_check_log(), poll the logfile until the desired log entry
   appears, or the test times out.

With this change, I was able to run the tests 1000 times in a loop with
4-way parallelism without seeing any test failures.  Without the change
I usually get a failure within 10 loops.

Reviewed by:	jlduran
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D54779
2026-01-22 15:50:25 +00:00
Mark Johnston ffdbc1bc21 syslogd/tests: Use a helper function to log from within a jail
This is just for consistency with all other logger(1) invocations, which
happen from the syslogd_log() function.

No functional change intended.

Reviewed by:	jlduran
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D54778
2026-01-22 15:50:14 +00:00
Ed Maste dec3ea45b6 libiconv: Fix typo in comment 2026-01-22 10:36:37 -05:00
Eugene Grosbein 129aec7225 libfetch: allow disabling TLS v1.3 when the connection
MFC after:	3 days
2026-01-22 21:37:54 +07:00
Eugene Grosbein 8f8a7f6fff libfetch: apply timeout to SSL_read()
Currently, fetchTimeout works for non-SSL connections only, so does fetch -T.
Fix it applying specified timeout to SSL_read().

MFC after:	3 days
2026-01-22 15:40:35 +07:00
Cy Schubert ad9932995c hwpstate: Add CPPC enable tunable
The Framework 13 runs very hot the maximum frequency is possible. By
disabling CPPC (reverting to Cool`n'Quiet 2.0) we can use powerd to
limit the CPU frequency to 2200, thereby reducing the CPU temperature.

Some systems may run slower with CPPC enabled. See PR/292615 for that
bug.

Those experiencing either of these issues may add the following to
their loader.conf or device.hints to disable CPPC:

machdep.hwpstate_amd_cppc_enable="0"

PR:			292615
Reviewed by:		lwhsu, olce
Differential revision:	https://reviews.freebsd.org/D54803
2026-01-21 20:36:33 -08:00
Kyle Evans eacc501eff truncate: fix a minor nit + add a hole-punching test
The struct spacectl_range we use is only really used in these three
lines of code, so re-scope it down to just the dealloc branch.  This is
marginally easier to reason about what might be necessary to replace in
porting our truncate(1) to other platforms.

While we're here, add a test for the -d flag to be sure it really does
punch a hole in the file.  The test also tries to confirm that it does
not disturb other segments of the file in the process, just to inspire
some confidence that it's not corrupting the file somehow.

Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D51207
2026-01-21 17:35:25 -06:00
Bjoern A. Zeeb 6c61f58562 ath10k: update Atheros/QCA's ath10k driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7 ( tag: v6.19-rc6 ).

Sponsored by:	The FreeBSD Foundation
2026-01-21 19:57:42 +00:00
Bjoern A. Zeeb 80ba8933a9 rtw88: update Realtek's rtw88 driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7 ( tag: v6.19-rc6 ).

Sponsored by:	The FreeBSD Foundation
2026-01-21 19:57:15 +00:00
Bjoern A. Zeeb 275c7f5131 LinuxKPI: netdevice: add structs net_device_path, net_device_path_ctx
mt76(4) is using this along with a mac80211.h functiontion pointer to
resolve a path in an offload case.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-21 18:31:08 +00:00
Bjoern A. Zeeb d4898c6e01 LinuxKPi: 802.11: add more defines
Add more defines and a mac80211 op function pointer used by
mt76(4) at Linux v6.19-rc6.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-21 18:31:08 +00:00
Bjoern A. Zeeb f1d7eea9dc LinuxKPI: skbuff: implement skb_queue_splice()
Add skb_queue_splice() and use it in skb_queue_splice_init() which
already had that functionality (plus the init bit).
The new function is used by rtw89(4).

Sponosred by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-21 18:31:08 +00:00
Bjoern A. Zeeb b2c90d106c LinuxKPI: 802.11: rename enum ieee80211_tx_rate_flags and move file
What we used to call enum ieee80211_tx_rate_flags is now used as
enum mac80211_rate_control_flags for the ieee80211_tx_rate.flags
in rtw89(4).  Rename the enum and move it to mac80211 as it seems
to belong there.

Sponsonred by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-21 18:31:07 +00:00
Bjoern A. Zeeb 18de28308c LinuxKPI: 802.11: add new field to struct cfg80211_bitrate_mask
rtw89(4) accesses eht_mcs[].
Add the field to struct cfg80211_bitrate_mask.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-21 18:31:07 +00:00
Bjoern A. Zeeb 5f7b5dde10 radiotap: add more EHT definitions
Add more EHT definitions used by at least iwlwifi.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-21 18:31:07 +00:00
Bjoern A. Zeeb e4a4841d7a LinuxKPI: 802.11: Management MIC element can have 8 or 16 octets MIC
Management MIC element (MME) can have 8 or 16 octets MIC.  Add a second
structure used by at least iwlwifi and update reference to latest
standard version.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-21 18:31:07 +00:00
Artem Bunichev 2c6bee2b23 socket.2: Cross-reference protocol families
While here, make wider use of Dv for socket types and protocol families
and reference fcntl(2) flags for the `type` argument values.

MFC after:		3 days
Reviewed by:		glebius, ziaee
Differential Revision:	https://reviews.freebsd.org/D54434
2026-01-21 12:25:36 -05:00
Sarah Walker 98cb4874e2 simd.7: Add Arm MOPS memcpy(), memmove() and memset() to manpage
Fixes:			41ccf82b29 (Use MOPS implementations)
Reviewed by:		ziaee
Sponsored by:		Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D54812
2026-01-21 11:51:10 -05:00
John Baldwin 5eb1d4eec6 rpctls_impl.c: Use a direct cast to uintptr_t instead of __DECONST
This fixes the build on CHERI architectures where the compiler warns
about a direct cast between uint64_t and const void * inside of
__DECONST.  However, GCC would also complain about this on 32-bit
kernels due to uint64_t not being the same size as a pointer.  Also,
a direct cast to uintptr_t to right-size the cookie value is more
direct than using __DECONST given that there is no "const" pointer
involved in the expression.

Reviewed by:	brooks, glebius
Obtained from:	CheriBSD
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D54797
2026-01-21 11:10:53 -05:00
Ed Maste 37de3763b8 CODEOWNERS: Add myself for openssh and makefs 2026-01-21 10:09:58 -05:00
Warner Losh 76ca619f10 MAINTAINERS: remove stale entry 2026-01-21 07:39:59 -07:00
Michael Tuexen d8b8dc776b dpaa2: cleanup
No functional change intended.

Reviewed by:		bz, dsl
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D54805
2026-01-21 08:16:46 +01:00
Xin LI 53d6b23765 cron.8: clarify system crontab format
PR:		234504
MFC after:	1 week
2026-01-20 22:33:48 -08:00
Justin Hibbits 21a7a9ef8b powerpc/mpc85xx: Fix PCI attach error cleanup
If an error occurs during attach after ofw_pcib_init() runs, the device
is torn down, leaving the rmans embedded in the softc attached to the
rman list, thus corrupting the rman list.  Fix this by undoing
everything that was done by this point.

MFC after:	1 week
2026-01-20 23:28:41 -05:00
Justin Hibbits 24d048be7a powerpc/mpc85xx: Set pc_hwref to the primary thread ID
On multithreaded cores (e6500) the CPU ID in the device tree (reg[0]) is
the primary core, which may not match the cpuid, until Book-E threading
is added.
2026-01-20 23:28:40 -05:00
Justin Hibbits c611ef5747 dpaa: Simplify CPU binding for bman and qman
If cpu-handle property doesn't exist simply iterate and assign the CPUs
in sequence rather than following the convoluted search which may not
bear fruit in some cases.  If cpu-handle doesn't exist for one portal it
probably doesn't exist for any of them.
2026-01-20 23:28:40 -05:00
Xin LI 12444a4da5 cron: Implement full PAM session lifecycle for user jobs
Extend PAM integration beyond account checks to include credential
establishment and session management, allowing PAM modules to configure
the execution environment for user cron jobs.

Previously, cron only called pam_acct_mgmt() to verify account validity
but immediately terminated the PAM handle before job execution. This
prevented PAM modules from establishing sessions, setting credentials
(e.g., Kerberos tickets), or exporting environment variables needed by
jobs.

The PAM handle now persists in the intermediate process throughout the
job execution, enabling proper session open/close pairing. Credentials
are established and sessions opened while still running as root, before
dropping privileges in the grandchild. PAM environment variables are
exported in the job process with user crontab variables taking precedence.

A session rule (pam_permit.so) is added to /etc/pam.d/cron to enable
session support without changing default behavior. Administrators can
replace this with other modules as needed.

System crontab entries continue to bypass all PAM operations.

PR:		bin/244844
Reviewed by:	des
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D54415
2026-01-20 18:47:16 -08:00
Rick Macklem 053449fa5c nfscl: Fix the build
Fixes:	f2155a6fb5 ("nfscl: Fix handling of case insensitive file systems")
2026-01-20 17:32:23 -08:00
Rick Macklem f2155a6fb5 nfscl: Fix handling of case insensitive file systems
Name caching must be handled somewhat differently
for case insensitive file systems.  Negative name
caching does not work and, for rename, all names
associated with the rename'd vnode must be disabled.

For a case insensitive ZFS file system that is exported,
the unpatched code did work, since the change in mtime
or ctime of the directory when other case names were
created or rename'd would disable the false name cache
hit.  However, an export of an msdosfs file system
breaks the NFS client, because it only works if ctime/mtime
is changed whenever a name is added/removed.  Depending
on what the server file system is, this may not happen,
due to clock resolution or lack of support for these
attributes.

This patch checks to see if the server file system is
case insensitive and modifies the name caching to handle
this.

There is still a problem if a case insensitive file system
is a subtree of a non-case insensitive is exported by the
NFSv4 server.  This can be fixed someday, when the NFSv4
client gets support for submounts within the mount.

Suggested by:	kib
MFC after:	2 weeks
2026-01-20 16:21:52 -08:00
Konstantin Belousov 6bb3f20861 ktrace: do not enqueue request if the process' ktrioparams are freed
The p_ktrioparms are freed on termination of tracing.  Any ktr requests
added to the queue after that would hang there and leak on the struct
proc recycling, or trigger an assert in the process destructor for debug
builds.

Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54804
2026-01-20 21:44:54 +02:00
Ed Maste 466bad427d src.conf.5: Add WITHOUT_SOUND description
Fixes: f74f891581 ("src.opts: Introduce MK_SOUND")
Sponsored by:	The FreeBSD Foundation
2026-01-20 13:13:10 -05:00
Cy Schubert 2d8ec3bab2 krb5: Fix another GCC build issue
Fixes:		1876de606e
X-MFC with:	1876de606e
MFC after:	2 weeks
2026-01-20 09:40:52 -08:00
Bjoern A. Zeeb c592d54a24 LinuxKPI: 802.11: fix build for non-debug kernels
lkpi_nl80211_band_name() is only available under LINUXKPI_DEBUG_80211.
IMPROVE in theory should be as well or defined to nothing but we cannot
do that in cfg80211.h mac80211.h where we possibly (re-)define this.

Put an #ifdef around the IMPROVE call for now (untested).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Fixes:		768332d619
Reported by:	CI
2026-01-20 17:19:29 +00:00
Michael Tuexen 8d82dafa56 sctp: support bridge interfaces
Reported by:	Timo Völker
Tested by:	Timo Völker
MFC after:	3 days
2026-01-20 18:06:17 +01:00
John Baldwin 8e1c85f032 OptionalObsoleteFiles.inc: Treat compat runtime loaders as libraries
Binaries require the runtime loader to use shared libraries, and
removing the runtime loader in `make delete-old` while leaving the
libraries around makes it impossible to use those shared libraries.
Treat rtld as a de facto dependency of shared libraries to ensure it
is not removed until the corresponding shared libraries are removed.

Differential Revision:	https://reviews.freebsd.org/D52210
2026-01-20 12:07:21 -05:00
Jose Luis Duran eced166af0 nanobsd: Avoid unnecessary subshell execution
Mimic c99bb5747f ("nanobsd: minor formatting cleanup") and cleanup
_create_code_slice(), somehow I missed it when rebasing.

No functional change intended.

Fixes:		ecc039be7f ("nanobsd: Add a NO_ROOT build option")
MFC after:	3 days
2026-01-20 16:51:09 +00:00
Jose Luis Duran aed4089c25 nanobsd: Use NANO_DEF_{UNAME,GNAME}
Prefer to use NANO_DEF_UNAME and NANO_DEF_GNAME instead of a fixed
"root/wheel".

Fixes:		61ac7309c3 ("nanobsd: Add a provisional populate_part function")
MFC after:	3 days
2026-01-20 16:51:06 +00:00
Bjoern A. Zeeb c670af3725 net80211: correct return code for ieee80211_ampdu_request()
We used to return the result of (*ic_send_action) directly but
ieee80211_ampdu_request() returns 1 on success and 0 on error,
which is contrary to the result of (*ic_send_action).  Deal with
that accordingly and update the documentation of the function.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D54794
2026-01-20 15:45:58 +00:00
Bjoern A. Zeeb 768332d619 LinuxKPI: 802.11: factor out rate logic for mandatory channels
I was looking at rate work for another problem and found more flags
in ath9k (which we will likely never need).  The documentation then
revealed the "mandatory" flags as well and with discussions about
cfg80211 going on I decided to use the momentum and split our
"supp_rates" setup between lkpi_lsta_alloc() and wiphy_register().

There should be no functional change.

While there also initialize max_rc_amsdu_len.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-20 15:44:30 +00:00
Cy Schubert 6637e8f616 krb5: Fix gcc14 build
Fixes:		1876de606e
X-MFC with:	1876de606e
MFC After:	2 weeks
2026-01-20 07:35:00 -08:00
Konstantin Belousov be1b2da855 sys/abi_compat.h: fix UB for bintime32 handling
Do not cast and then access potentially unaligned uint64_t in the BT_CP()
macro.  Use freebsd32_uint64_t type and FU64_CP() for the frac member.

Noted by:	des
Reviewed by:	des, emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54663
2026-01-20 16:42:35 +02:00
Konstantin Belousov 96acaa9600 compat32: provide a type and a macro for (u)int64_t handling on non-x86 arches
uint64_t is 4-byte aligned on i386, but is 8-bytes aligned on all other
32bit arches FreeBSD supports.  Provide the freebsd32_uint64_t type and
the FU64_CP() macro, which are intended to be used where 32bit ABI uses
(u)int64_t type, and do proper layout and copying for the aggregate type.

Reviewed by:	des, emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54663
2026-01-20 16:42:35 +02:00
Cy Schubert 1876de606e krb5: Expose missing symbols
Add symbols found in the port but not in base. This requires replacing
a shared libkrb5profile.so with libkrb5profile.a (with -fPIC so it can
be used by shared libraries). We do this by making libkrb5profile
INTERNALLIB.

Base currently has libkrb5profile in a shared library. The patch moves
those functions to the various "consumer" libraries as the port does.

Symbols that should be in the other libraries are in libkrb5profile.so.
This is causing some ports issues.

PR:		291695
Reported by:	michaelo, markj,  Chris Inacio <inacio@andrew.cmu.edu>
Tested by:	michaelo
Fixes:		ae07a5805b
Reviewed by:	michaelo (previous version)
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D54323
2026-01-20 05:41:02 -08:00
Timo Völker 6f15ba8004 ip: improve deferred computation of checksums
This patch adds the same functionality for the IPv4 header checksum
as was done erlier for the SCTP/TCP/UDP transport checksum.
When the IP implementation sends a packet, it does not compute the
corresponding checksum but defers that. It will determine whether the
network interface selected for the packet has the requested capability
and computes the checksum in software, if the selected network
interface does not have the requested capability.
Do this not only for packets being sent by the local IP stack, but
also when forwarding packets. Furthermore, when such packets are
delivered to a local IP stack, do not compute or validate the checksum,
since such packets have never been on the wire. This allows to support
checksum offloading also in the case of local virtual machines or
jails. Support for epair interfaces will be added in a separate commit.

Reviewed by:		pouria, tuexen
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D54455
2026-01-20 11:36:40 +01:00
Michael Tuexen 3d771e0db6 dwc: cleanup
No functional change intended.

Reviewed by:		Timo Völker
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D54788
2026-01-20 11:25:31 +01:00
Kyle Evans 3f3b53e68a jail(3): fix common usage after mac.label support
Nobody else's mac.conf(5) has any entries for jails, so they get a
trivial ENOENT and we fail before we can fetch any jail parameters.
Most notably, this breaks `jls -s` / `jls -n` if you do not have any
loaded policy that applies jail labels.

Add an entry that works for everyone, and hardcode that as an ENOENT
fallback in libjail to provide a smoother transition.  This is probably
not harmful to leave in long-term, since mac.conf(5) will override it.

This unearthed one additional issue, in that mac_get_prison() in the
MAC framework handled the no-label-policies bit wrong.  We don't want
to break jail utilities enumerating jail parameters automatically, so
we must ingest the label in all cases -- we can still use it as a small
optimization to avoid trying to copy out any label.  We will break
things if a non-optional element is specified in the copied in label,
but that's expected.

The APIs dedicated to jaildescs remain unphased, since they won't be
used in the same way.

Fixes:	db3b39f063 ("libjail: extend struct handlers [...]")
Fixes:	bd55cbb50c ("kern: add a mac.label jail parameter")
Reported by:	jlduran (on behalf of Jenkins)
Reviewed by:	jlduran
Differential Revision:	https://reviews.freebsd.org/D54786
2026-01-19 20:57:42 -06:00