FreeBSD git weekly: 2025-09-15 to 2025-09-21

Introduction

This is a display of mostly-automatically-classified git commits from 2025-09-15 to 2025-09-21.

In the future, these reports might include summaries or additional information, but for now our focus is figuring out what type of classification would be most useful.

Table of contents and commits per category:

(5) Highlighted commits (these are copies, not in stats)
1 0.5% Userland programs
18 8.9% Documentation
31 15.3% Hardware support
12 5.9% Networking
27 13.4% System administration
6 3.0% Libraries
3 1.5% Filesystems
29 14.4% Kernel
33 16.3% Build system
1 0.5% Internal organizational stuff
15 7.4% Testing
5 2.5% Style, typos, and comments
8 4.0% Contrib code
13 6.4% Reverted commits
0 0.0% Unclassified commits
202 100% total
Technical notes about this page

Highlighted commits

For extra visibility, these are copies of commits found in other sections. Most (if not all) come from the commit message containing "Relnotes:", or commits modifying UPDATING.

qat: enable qat driver for 402xx device
Enabled qat driver support for 402xx device with
ID 0x4944/0x4945. This is an additional device supported
under the existing qat_4xxx driver. Firmwares specific to
the 402xx device are added.

Signed-off-by: Hareshx Sankar Raj <hareshx.sankar.raj@intel.com>

Relnotes:       yes
Sponsored by:   Intel Corporation
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D52488
7fbd362c091b2b384d14c3ed5af9234bb2eff9c2 Hareshx Sankar Raj 2025-09-04 18:21:36
init: Use root's home directory in single-user mode
When starting single-user mode, use the home directory from user root as
current directory and for the HOME environment variable. If the
directory does not exist, set HOME=/.

Also adjust /root/.profile to stop setting HOME, since it should always
have been set now.

This is intended to keep shell startup files working in single-user mode
after /.profile has been removed.

Reviewed by:    emaste, ivy, kevans
MFC after:      1 week
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D52527
779812d66989a9c3aaed09e4573400fc137f92b0 Jilles Tjoelker 2025-09-14 21:53:34
packages: Remove the tests-dev package
We don't want a tests-dev package, because this means set-devel depends
on tests-dev, which transitively depends on tests, which means you can't
install set-devel without also getting tests.

The only real "dev" files in tests-dev are from ATF (libprivateatf),
so move that to its own package and add a dependency from tests.

Also move Kyua to its own package, since this might be useful for
running tests even when the user doesn't want the whole set of base
tests installed.

Add a dependency from -tests to both -atf and -kyua, and a dependency
on -set-base, since the tests won't work without the full base system
installed.

The remaining "dev" files in tests are actually test artifacts, not real
development libraries.  Add a new NO_DEV_PACKAGE option to bsd.lib.mk,
which causes dev files to be installed in the base package instead of
creating a -dev package, and set this option for everything that
installs test libraries.

While here, add a slightly more informative description for the tests
package.

MFC after:      3 seconds
Reviewed by:    bapt, emaste
Differential Revision:  https://reviews.freebsd.org/D52597
9065390ddc7b1ce2613777f6a947200950a5ac71 Lexi Winter 2025-09-18 09:13:41
packages: Add a mandoc package
Move mandoc to its own package so users can install it independently of
-utilities.  Put the package in the minimal set, since we also ship
manpages in minimal and "man" is a basic Unix utility.

Add a pkg-triggers(5) hook to run makewhatis when new manpages are
installed, so that apropos(1) works.  This depends on a new pkg(8)
feature expected to be in in the upcoming 2.3.2 release; in the mean
time, this is a no-op (i.e., having an older pkg doesn't break anything,
it just won't run the trigger).

MFC after:      3 seconds
Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D52564
ea5e50c2985bea029e7b30ecee773a59fe22cd68 Lexi Winter 2025-09-18 09:14:45
sys/netinet6: Implement RFC 7217
Implement RFC 7217 (A Method for Generating Semantically Opaque
Interface Identifiers with IPv6 Stateless Address Autoconfiguration
(SLAAC)) in our IPv6 stack.

A new ifconfig `stableaddr` flag is added to enable the feature on
interfaces, which defaults to on or off for new interfaces based
on the sysctl `net.inet6.ip6.use_stableaddr` (off by default, so
this commit causes no change in behavior with default settings).

The algorithm follows the RFC in its logic, using SHA256-HMAC as
the algorithm to derive addresses so as to provide code that can
be leveraged by future implentations of RFC 8981, leveraging the
`hostuuid` as the secret.

The source of the hostidentifier can be configured using the sysctl
`net.inet6.ip6.stableaddr_netifsource`, while the number of retries
generating a new address in case of collision can be configured
using the `net.inet6.ip6.stableaddr_maxretries` sysctl (default 3).

Documentation about all these flags is added to the ifconfig(8) man
page.

Reviewed by:            cognet, glebius, hrs
Tested by:              zarychtam@plan-b.pwste.edu.pl
Approved by:            cognet, glebius
Relnotes:               yes
Differential Revision:  https://reviews.freebsd.org/D49681
31ec8b6407fdd5a87d70265762457c67ce618283 Guido Falsi 2025-09-20 12:26:41

Userland programs

Commits about commands found in man section 1 (other than networking).

stat: Add option to list holes
Add a new -h option that causes stat to print a list of holes for each
file argument.

Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D52481
1a7a067da456f8962ef87bfdf75c94cd12988615 Dag-Erling Smørgrav 2025-09-16 13:37:57

Documentation

Man pages, release notes, etc.

jail.2: Mention EPERM is returned on open directories
The manual page does not directly mention this reason for getting EPERM,
instead referring the reader to chroot(2).  We have had some questions
about it recently, in part due to a bug (fixed), and this case is not an
obvious permission/problem, so let's be more explicit.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280809
Reviewed by:    jamie
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52319
ef2f36be8fce8cf7a62ce7d33ab1c4a181fac3e2 Olivier Certner 2025-09-01 09:31:23
pf.conf.5: document tcp.tsdiff
from jesper wallin
ok bluhm

Obtained from:  OpenBSD, jmc <jmc@openbsd.org>, 8c83d32726
Sponsored by:   Rubicon Communications, LLC ("Netgate")
864458ce5025ab83c3d8cbaa514185b8cbc53acf Kristof Provost 2025-08-20 14:33:14
pf.conf.5: hint how to set tcp timeout collectively
Hint that the tcp timeout values can be adjusted collectively via "set
optimization".

from jesper wallin
ok bluhm

Obtained from:  OpenBSD, jmc <jmc@openbsd.org>, df80715c2d
Sponsored by:   Rubicon Communications, LLC ("Netgate")
0a67f601fe4f2e8af72cb0f99785cba4c91f7d7c Kristof Provost 2025-08-20 14:34:33
MODULE_PNP_INFO.9: tweak list indent
So that it renders as intended.

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
a7340d559ee942c21ea1a037d1d60a7859dd873b Mitchell Horne 2025-09-05 16:14:07
vtnet: deprecate loader tunable fixup_needs_csum
If this tunable is enabled and vtnet receives a packet with
VIRTIO_NET_HDR_F_NEEDS_CSUM set, vtnet computes the TCP/UDP checksum
and writes it in the checksum field.
This was somewhat useful when vtnet pretended that such a packet has
a correct checksum and set the mbuf flag CSUM_DATA_VALID.
But this is not the case anymore.

Reviewed by:            tuexen
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D52546
5da388d93917f5fa74022960cc65452592f71539 Timo Völker 2025-09-16 21:37:45
getgrouplist.3: Rework, use more appropriate terminology
Bring up to date with NSS by substituting "file" with "database".

Describe more precisely which database is accessed, i.e., only the group
database, which value should be used and where it lands in the result.

Prefer a terminology referring to POSIX terms, i.e., use "effective
group list" instead of "group access list".

Reviewed by:    gbe
MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52283
9294eb44eecb71f573f29ff84ce1bd3aa93c077c Olivier Certner 2025-08-29 14:53:52
setgroups.2: Add SECURITY CONSIDERATIONS, fix the groups limit, rework
Add a new SECURITY CONSIDERATIONS section describing in details what the
new behavior is after commit 9da2fe96ff2e ("kern: fix setgroups(2) and
getgroups(2) to match other platforms"), what setgroups(2) does not
do anymore, and how programs using it are affected.

Fix the groups limit after commit 9da2fe96ff2e ("kern: fix setgroups(2)
and getgroups(2) to match other platforms").

Prefer a terminology referring to POSIX terms, i.e., use "effective
group list" instead of "group access list".

While here, fix some style.

Note for MFC to stable/14: The content will have to be revised as the
new behavior is not in place.  The latter should still be mentioned as
upcoming in 15.

Fixes:          https://cgit.freebsd.org/src/commit/?id=9da2fe96ff2e ("kern: fix setgroups(2) and getgroups(2) to match other platforms")
MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52284
6d22cd6b5f8b5604f1fe9e70930b1506f990e31e Olivier Certner 2025-08-29 15:10:22
setcred.2: Remove now obsolete mention of setgroups(2)'s different behavior
Reviewed by:    gbe
Fixes:          https://cgit.freebsd.org/src/commit/?id=9da2fe96ff2e ("kern: fix setgroups(2) and getgroups(2) to match other platforms")
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52285
66b54c48b2ae1c1759134cad5daa6fc27b679918 Olivier Certner 2025-08-29 15:12:59
getgroups.2: Clarify, mention ascending order, add SECURITY CONSIDERATIONS
Clarify and be more precise about the behavior of getgroups(2), in
particular with respect to 'gidsetlen'.

Prefer a terminology referring to POSIX terms, i.e., use "supplementary
groups" instead of "group access list".

Say that getgroups(2) reports the supplementary groups in strictly
ascending order and returns the cardinal of the set they form (and
mention this has been the case since FreeBSD 14.3).

Add a new SECURITY CONSIDERATIONS section contrasting the new behavior
after commit 9da2fe96ff2e ("kern: fix setgroups(2) and getgroups(2) to
match other platforms") with the historical one.

While here, fix some style.

Note for MFC to stable/14: The content will have to be revised as the
new behavior is not in place.  The latter should be mentioned as
upcoming in 15.

Reviewed by:    gbe (older version)
MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52286
4be38acc826f260e4c7d3ebbb9de534db449782e Olivier Certner 2025-08-29 22:43:10
group.5: Add a reference to setcred(2)
Reviewed by:    gbe
MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52287
313d769e995c4fa4c5e3ae2470af16a8fbeaa3c1 Olivier Certner 2025-08-29 15:13:17
ucred.9: crsetgroups_and_egid(): Clarify differences with crsetgroups()
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52288
6b26d0a335b6222744e2778753086e16389b6029 Olivier Certner 2025-08-29 15:17:36
pfctl.8: omit preceding flag from command/modifier lists to get tags
reads odd to repeat, e.g. -F, when listing all its modifiers.
as a consequence, automatic tagging wouldn't work, e.g. no "zero"
tag would exist to jump to that -F modifier's definition.

also add manual tags for -R and -T as get explained together with
-s and -t, respectively, where only the first flag gets tagged.

Obtained from:  OpenBSD, kn <kn@openbsd.org>, e08605c7f2
Sponsored by:   Rubicon Communications, LLC ("Netgate")
05e99f5d175117fb095ee62352903d5157cb1796 Kristof Provost 2025-08-25 09:21:49
pfctl.8: -z honours -a (reset rule stats per anchor)
OK sashan henning deraadt

Obtained from:  OpenBSD, kn <kn@openbsd.org>, 1ddc001403
Sponsored by:   Rubicon Communications, LLC ("Netgate")
c016bd00294df7be6b3b3dbc661ac7b952831475 Kristof Provost 2025-08-25 14:46:33
pf.conf.5: rephrase macro section
In the manual pages for configuration files based on parse.y, describe
the syntax of both defining and using macros, rather than exclusively
relying on examples, which some of the pages do not even provide.
In those pages containing tables of content, also clarify that
the "Macros" section contains *definitions* of variables.
Both changes were already committed to vm.conf(5) earlier.

OK florian@, and deraadt also requests keeping these manuals in sync.

Obtained from:  OpenBSD, schwarze <schwarze@openbsd.org>, 20aba01e82
Sponsored by:   Rubicon Communications, LLC ("Netgate")
3c3322d7ee974673f6b8f7a490153f3558e71118 Kristof Provost 2025-08-25 15:08:36
Commit group #0: vnet.9: Rename vnet.9/vimage.9 to VNET.9/VIMAGE.9
vnet.9: Rename vnet.9/vimage.9 to VNET.9/VIMAGE.9

Fix crossreferences to VNET(9) by correcting it's capitalization.

MFC after:      3 days
Reviewed by:    enji, ziaee
Closes:         https://github.com/freebsd/freebsd-src/pull/1848
3049b2f5115b3b4aed202274e866f360fa2560d1 Quentin Thébault 2025-09-16 02:38:18

ObsoleteFiles: Remove the miscapitalized vnet.9

MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=3049b2f5115b (vnet.9: Rename vnet.9/vimage.9)
08d41d8803d9dd49b709518e8f2ce292b59e9828 Alexander Ziaee 2025-09-17 15:54:13

ObsoleteFiles: Remove the miscapitalized vimage.9

MFC after:      3 days
Fixes: https://cgit.freebsd.org/src/commit/?id=08d41d8803d9 (ObsoleteFiles: Remove the miscapitalized vnet.9)
Fixes: https://cgit.freebsd.org/src/commit/?id=3049b2f5115b (vnet.9: Rename vnet.9/vimage.9 to VNET.9/VIMAGE.9)
8f7a4d7949d83c13a7451cba7626950d182dfc5d Alexander Ziaee 2025-09-18 16:22:56
cdceem.4: Clean description for apropos, tag spdx
CDCEEM is already defined in the document name, no need to list it in
parentheticals a second time in the document description. This brings
the apropos listing down to one line on the one true standard console.

MFC after:      3 days
89bc43a1ea9b23cac9cb94f0b684d5655c9a90e4 Alexander Ziaee 2025-09-18 20:14:30

Hardware support

Hardware drivers and architecture-specific code.

arm64: Add the new C1 CPU IDs
Add the Arm C1-Nano, C1-Pro, C1-Premium, and C1-Ultra CPUs from their
Technical Reference Manuals.

Sponsored by:   Arm Ltd
8fee6b9ecc84d3602a461f1cd33df91e50849cdf Andrew Turner 2025-09-15 12:05:05
arm64: Fix the FEAT_WFxT check
The check was always true so would incorrectly enable the feature when
it wasn't supported.

Due to another bug this was harmless.

Sponsored by:   Arm Ltd
226375a1f6e3a71ca250c717e8d6d2c2e4b0b2e7 Andrew Turner 2025-09-15 12:08:04
udbc: Add usb debug host mode driver
xhci offers a debugging interface which uses a special usb 3 cable with the D+,
D- and VBUS pairs disconnected. This interface allows a target device to
configure its xhci controller as a debugging channel which can then be used to
provide a serial link between the target and a debug host.

This change extracts the udbc host mode driver from hrs@'s xhci debug
implementation.

Reviewed by:    bcr (man page)
MFC after:      Before 15-ALPHA3 builds
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D51299
d566b6a70bcbc329e8c690464043401fa8bdd49f Tom Jones 2025-07-08 08:04:00
sound: Honor CHN_F_NBIO
If the device is opened with O_NONBLOCK, even though we check for it in
order to set CHN_F_NBIO, the subsequent chn_reset() calls will clear all
flags, except those set in CHN_F_RESET, which does not include
CHN_F_NBIO.

Add CHN_F_NBIO to CHN_F_RESET. Additionally, because primary channels
can be reused, make sure we do not unintentionally keep CHN_F_NBIO set
if the channel is re-opened, but without O_NONBLOCK.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289441
MFC after:      2 days
Reviewed by:    christos, markj
Differential Revision:  https://reviews.freebsd.org/D52493
e8b5025c3880b04c1c2139fe73b65fbd6deb41d4 Damjan Jovanovic 2025-09-15 17:42:41
e1000: fix/complete merge of previous two commits
When fixing the conflicts caused by gallatin's commit and the reviewed
patch, I missed this location because it didn't exist when gallatin did
their change.

Obtained from: Juniper Networks, Inc.
e1bc42cb1551ca2a18ef60c38247fb5dc2509ea2 John-Mark Gurney 2025-09-15 21:29:11
riscv: Provide prototypes for fpgetmask/fpsetmask
These functions are stubs that do nothing but are called by some software
and not providing them results in implicit function declaration errors.
This was missed in D25740.

Reviewed by:    #riscv, mhorne
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D52035
90234b9dd8cb293f3eb9ce3765b17ebc05f9201a Alex Richardson 2025-09-15 22:07:32
aarch64: Clarify the initial adjustments to sp for kernel exception entry
The first store-pair instruction in save_registers_head decrements the
stack pointer to create room for most of the trapframe (and the
redzone area for nested exceptions).  However, the expression was a
bit non-intuitive as it was using an expression without a leading
negative sign to adjust the stack pointer.  Rewrite the expression so
that it is more clearly a negative adjustment to the stack pointer.

Suggested by:   andrew
Reviewed by:    andrew
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D52514
7314f78b240bdbf2bcec07e3d5a475e37941bb6b John Baldwin 2025-09-16 11:21:39
aarch64: Save correct value of x18 on trapframe for nested faults
x18 is overwritten with a temporary copy of the kernel stack pointer
when it is saved in the trapframe.  This does not matter in terms of
function since nested exception return does not restore x18 from the
trapframe, but it does mean that examining x18 in a debugger in stack
frames above a nested fault outputs the wrong register value.

To fix, compute the value of the original stack pointer to save in x18
later after the trapframe has been constructed.

Reviewed by:    jhb, andrew
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D52472
99213b3c352cdf568ea7cf5b4dddb1879f16a601 Konrad Witaszczyk 2025-09-16 11:21:57
if_re: Add PNP info for module
Add PNP info so it the module can be by devmatch(8) and automatically
loaded. On non-x86 platforms it is not included in GENERIC.

Reviewed by:    imp
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52557
e13b5298ec87be03da2231bc7b44a6a4b976b850 Mitchell Horne 2025-09-16 13:19:00
rk_tsadc: use tsadc_temp_to_raw for shutdown_temp
Use tsadc_temp_to_raw instead of tsadc_raw_to_temp, otherwise rk3566/68
get stuck in a kernel reboot cycle.

https://forums.freebsd.org/threads/running-freebsd-on-radxa-rock-3c-rk3566-board.89389/post-624890

Submitted by:   covacat
Reviewed by:    mmel
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D52309
2b0f8c6907b96a8e150a1250e56d25a7a5d202d8 Evgenii Ivanov 2025-09-17 14:07:26
ufshci: revisit controller reset path and add I/O timeout handling
This patch revisits the controller reset path and introduces timeout
handling for I/O commands.

To support controller reset during driver operation, the controller’s
construct, destruct, enable, and disable functions are clearly
separated in ufshci_ctrlr.c. ufshci_ctrlr_hw_reset() function is
added to leverage enable/disable.

After initialization, ufshci_ctrlr_reset_task() is also introduced to
ensure controller resets are performed via the task queue.

Timeout handling is designed in five steps. This patch implements
Step 1 and Step 5, while the remaining steps will be added later.
The timeout mechanism follows the same shared timeout model used in
the NVMe driver.

Test: Intentionally delayed UPIU I/O in QEMU to trigger a timeout and
verify timeout handling.

Sponsored by:           Samsung Electronics
Reviewed by:            imp (mentor)
Differential Revision:  https://reviews.freebsd.org/D52440
6b841d70960a3a0ec4e43392683053878c403f9c Jaeyoon Choi 2025-09-18 14:37:08
cpuctl: run amd_ucode_wrmsr only on one CPU and report if it failed
The CPUCTL_UPDATE is supposed to be applied only to the CPU the ioctl(2)
was performed on.  This is true for Intel CPUs, but for AMD the SMP
rendezvouz of amd_ucode_wrmsr() effectively executed it on all CPUs.
Also, the update failure was not reported.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D52466
6683dcf61b3d0dfa8639c9e501eefb7709922ddf Gleb Smirnoff 2025-09-18 15:10:59
gpioled: remove redundant -1 check
The function is never called with onoff = -1

MFC after:      3 days
MFC with:       9ae3c30
e0c83ab3b362c9bd45c5d21683012cecab28d802 Ahmad Khalifa 2025-09-18 22:03:32
Commit group #1: arm64
arm64: Move the FEAT_PAN check later

We only need to enable PAN (Privileged access never) before userspace
is running. Before that there are no unprivileged mappings to protect
the kernel from accessing.

While here switch to use get_kernel_reg to handle the case some CPUs
have FEAT_PAN, while some don't.

Reviewed by:    emaste
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D52576
72828486ca9412f118d7e2316e584cd1cab8c90f Andrew Turner 2025-09-19 10:05:46

arm64: Add cpu_feat_disabled for disabled features

When a feature is disabled we may need to run a cleanup handler, e.g.
to remove a feature from the sanitized ID registers. Add support for
this with a new feat_disabled handler.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D52577
055229eda697445880edd0050d0230a3f1bc85b3 Andrew Turner 2025-09-19 10:05:46

arm64: Read the CPU feature tunables once

Rather than reading the CPU tunables each time we enable a feature
just read them once on boot. Reading them early on non-boot CPUs
causes issues where they try to allocate memory before the core is set
up to do so. As they don't change it is safe to cache the state of
them.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D52578
5e0e2565288f3d1f1b4223d8bb53c7d70e0aa92c Andrew Turner 2025-09-19 10:05:47

arm64: Fix enabling CPU features

Previously when enabling CPU feature we assumed the no check function
means the feature was unconditionally enabled. When adding support to
disable features on boot this check was incorrectly partially left in
place. As all current features have a check function this meant all
features were disabled.

Fix this by restoring the previous behaviour while also allowing the
user to disable the feature.

Reviewed by:    emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=4bc68fa98f68 ("arm64: Support managing features from loader")
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D52579
5e690f1e12ce8699f16019854dfffd1857a801d8 Andrew Turner 2025-09-19 10:05:47

arm64: Set the endian without a memory access

Early in the kernel we set the endian through the sctlr_el1 and
sctlr_el2 registers. To get the value to put into these registers we
load them from memory. As this will depend on the endian to get the
fields in the correct order then it will fail if the endian is not
what the kernel expects.

Add a macro to load a 64-bit value into a register without a memory
access and use this to set the register. As instructions are not
affected by the endian set in sctlr this is safe.

It is unlikely this will be hit as UEFI requires the processor to be
in little endian mode, however when booting using the Linux ABI the
kernel may start in big-endian, and secondary CPUs could be big-endian.

Reviewed by:    emaste
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D51012
0706d3464f4ef375fc31ecc7fa0733a13eca9d19 Andrew Turner 2025-09-19 10:05:47

arm64: Enable EPAN and IESB

These are both safe to enable. EPAN only affects PAN when it's enabled,
and IESB makes exception entry and exit an Implicit Error
Synchronization event.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D51013
68b3d0cbe03467abac0523bbeea0cfc34efd9b05 Andrew Turner 2025-09-19 10:05:48
usb: update wifi drivers to use IEEE80211_FEXT_SEQNO_OFFLOAD
Migrate the following wifi drivers to use the seqno offload option.

Locally tested (STA mode) on:

* mtw
* uath
* upgt
* ural
* urtw
* uzyd

Differential Revision:  https://reviews.freebsd.org/D50771
Okayed by: bz
cce278510a820785d883e2c9b19a95c176427880 Adrian Chadd 2025-06-09 19:52:35
net80211: convert the rest of the native net80211 drivers to SEQNO_OFFLOAD
* Convert the rest of the drivers to implement driver/offloaded sequence
  number handling.

* For drivers that implement their own sequence number space handling
  for A-MPDU, only call ieee80211_output_seqno_assign() if the frame
  isn't tagged with M_AMPDU_MPDU, which mirrors the original net80211
  sequence number behaviour.  (Except of course, the assignment is
  now happening during final encap/transmit, not early in encap.)

Locally tested (sta mode):

* ath
* iwn
* bwi
* bwn
* iwm
* otus
* ral

Differential Revision:  https://reviews.freebsd.org/D50772
Okayed by: bz
785edcc2af5ae32c24f5caf5b9552f62bdae33ee Adrian Chadd 2025-06-10 04:22:10
[rtwn] don't send NULL data frames if we're compiled with firmware enabled
the firmware should be sending these.

Differential Revision:  https://reviews.freebsd.org/D52298
Reviewed by: bz

Locally tested:

* rtl8821/rtl8812au (STA)
d9ae618c0816d24bc8127e479db5787c97a23140 Adrian Chadd 2025-08-27 17:04:39
[iwn] Don't originate NULL data frames in net80211
Don't originate null data frames in net80211; leave that up to the
iwn firmware.

This should fix a bunch of cases where we're seeing out of sequence
802.11n aggregation data packets because net80211 power management
stuff was triggering NULL data frames when we don't need them and
messing up the firmware / ring buffer sequence number space.

Differential Revision:  https://reviews.freebsd.org/D52299

Locally tested:

* 6205, STA mode
a58f307880700fff7646416101c301e4d1784bfb Adrian Chadd 2025-08-27 20:06:55
[iwx] tell net80211 not to originate NULL data frames
Tell it not to originate NULL / QoS NULL data frames.
The firmware will handle them here.

Differential Revision:  https://reviews.freebsd.org/D52300
Reviewed by: bz
Locally tested:

* 9260, STA mode
db69f613ee45c2614a38d40f3e82733e6247e13a Adrian Chadd 2025-08-30 05:10:22
random: fxrng: Add an entry for RANDOM_RANDOMDEV to the source table
Otherwise we get a NULL pointer dereference when writing to /dev/random.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288826
Reviewed by:    cem
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=fa8db724ae6e ("random: Treat writes to /dev/random as separate from /entropy")
Differential Revision:  https://reviews.freebsd.org/D52633
174d5d9397c492aff67f7ad49e130039697dc1dd Mark Johnston 2025-09-19 22:58:22
arm, powerpc, riscv: implement atomic_set/clear_16
Reviewed by:  jrtc27, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D52626
b31abc95eb730d566891e134ba14af852645f772 Konstantin Belousov 2025-09-19 18:01:47
arm/atomic.h: remove misleading comment
Noted and reviewed by:        jrtc27
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D52626
1c0465a3d32e59cd260067e87469abd013571470 Konstantin Belousov 2025-09-20 19:10:02
x86: directly use clflushopt mnemonic in cpufunc.h
We already use clflushopt in support.S, there is no reason to manually
construct the encoding.  Initially it was done because toolchains did
not supported the (then) new instruction.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
5c55b2f3ba6f48575496bde2d4d86272d10a8197 Konstantin Belousov 2025-09-21 03:03:09
moused(8): Add command line option to restrict interface type
to evdev or sysmouse. It is required to avoid receiving of double events
on hybrid devices supporting both interfaces like ums (4).

MFC after:      1 day
Reviewed by:    glebius (via private chat)
Differential Revision:  https://reviews.freebsd.org/D52647
1335bf5ce1c9f0bf15c1fbed502f49e5a4950e32 Vladimir Kondratyev 2025-09-21 13:14:48
iwx: re-add sequence numbers for non-AMPDU, preserving previous behaviour
I received a report on freebsd-wireless@ that traffic stopped working.
It seems that although my AX210 is fine with this change, the AX201/22000
hardware/firmware seems to require it.

There's a bit to set in the TX command to force the FW to set the
sequence control.  We only set a few flags, and we don't set that.

So, add the sequence number allocation where encryption is performed.

Locally tested:

* AX210, STA mode
* AX201, STA mode

Differential Revision:  https://reviews.freebsd.org/D52652
Reviewed by:    kevans
Tested by:      kevans
52245588707851f3175551bf3934e206ca2b6ad7 Adrian Chadd 2025-09-21 01:55:00
iwm: assign sequence numbers even if we ask the firmware to override
I've had a report of this breaking without the sequence number
assigned (from glebius@) so, similar to iwx work, let's just re-add
it here.

Reported by:    glebius
Differential Revision:  https://reviews.freebsd.org/D52664
Reviewed by:    glebius
Tested by:      glebius
5e49712ca8fef53262f2f6769c119f27e0e175ee Adrian Chadd 2025-09-21 17:21:34

Networking

Network-related commands, library, and kernel.

pf: Show pf fragment reassembly counters.
Framgent count and statistics are stored in struct pf_status.  From
there pfctl(8) and systat(1) collect and show them.  Note that pfctl
-s info needs the -v switch to show fragments.

input claudio@; OK henning@

Obtained from:  OpenBSD, bluhm <bluhm@openbsd.org>, 19e99d0613
Sponsored by:   Rubicon Communications, LLC ("Netgate")
c00aca9a714ee3cdb867d4014898ec4e345465a5 Kristof Provost 2025-08-21 08:09:13
pf: sync_ifp doesn't exist, remove externs
Obtained from:        OpenBSD, jsg <jsg@openbsd.org>, 7ac7a88014
Sponsored by:   Rubicon Communications, LLC ("Netgate")
a66df2b575c8add6331fc0a0a0f536e90ccfafb7 Kristof Provost 2025-08-21 09:33:06
Commit group #2: ng_hci: Cast NG_HCI_BDADDR_ANY to const bdaddr_t *
ng_hci: Cast NG_HCI_BDADDR_ANY to const bdaddr_t *

This is needed to address some compiler errors cleanly, where consumer
functions want this address to be a const pointer.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D52310
680f9acc3657efcea07d8ac0954645b6eaf8dac8 Christos Margiolis 2025-09-15 13:09:42

ng_btsocket_rfcomm: Mark a couple buffers as const in a helper function

Fixes:  https://cgit.freebsd.org/src/commit/?id=680f9acc3657 ("ng_hci: Cast NG_HCI_BDADDR_ANY to const bdaddr_t *")
18fd3f8ec5c50da21515757af24421a078a4a468 Mark Johnston 2025-09-15 13:57:19
ip6: add SO_BINTIME support
This adds support for obtaining timestamps from IPv6 packets using the
SO_BINTIME socket option, bringing it in parity with IPv4 behavior.

Enable testing the SO_BINTIME option in the relevant (manual) regression
test.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289423
Reviewed by:    markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D52504
cd02a8a9f8be2085d5242606a79668dc3720e7b0 Jonathan T. Looney 2025-09-12 17:49:17
if_ovpn.c: fix use of uninitialized variable
In case we use OVPN_CIPHER_ALG_NONE, the memcpy will attempt to copy 0
bytes from an uninitialized pointer. While the memcpy() implementation
will treat this as a no-op and not actually dereferece the undefined
variable it is still undefined behaviour to the compiler and should be
fixed. Found by building with clang HEAD

Reviewed by:    kp
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D52543
969be39fb3caf4272f128dbf3267ceba5966a6ce Alex Richardson 2025-09-15 22:08:43
IPv6: fix off-by-one in pltime and vltime expiration checks
Previously, the macros used '>' instead of '>=' when comparing elapsed
time against the preferred and valid lifetimes. This caused any deprecated
address to become usable again for one extra second after receiving each
Router Advertisement. In that short window, the address could be
selected as a source for outgoing connections.

Update the checks to use '>=' so that addresses are deprecated or
invalid when their lifetime expires.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289177
Reported by:    Dmitry Nexus <fbsd.4f6a at nexus tel>
Reviewed by:    zlei
Submitted by:   Marek Zarychta
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D52323
588a5fad3e8b98955b60707e3e92b8b43566e3f7 Andrey V. Elsukov 2025-09-16 07:34:55
ipfw: Teach ipfw that EtherIP is an upper layer protocol
so that we do not discard EtherIP packets ( over IPv6 network ) when
net.inet6.ip6.fw.deny_unknown_exthdrs is set to 1 ( which is the default
value ).

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227450
Reviewed by:    ae, #network
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D52566
0418e6690e91aa6c38dd9af9da43c4c5a9dc1cd2 Zhenlei Huang 2025-09-16 15:58:24
pf: Count m_gethdr() failures in PFRES_MEMORY counter
This requires passing the reason pointer down into pf_build_tcp().

ok bluhm@

Obtained from:  OpenBSD, sf <sf@openbsd.org>, 03c532ca70
Sponsored by:   Rubicon Communications, LLC ("Netgate")
1066515eb5219904c76f6f142e65ccf57eee6c53 Kristof Provost 2025-08-25 09:36:23
pf: allows TCP RST packets in the backwards window if ACK matches
TCP reset packets are generated for the sequence numbers that have
been acknowledged.  Our pf(4) is quite strict regarding sequence
numbers of reset packets to avoid evil connection drops.  It expected
exact match and did not allow a sequence window for resets.  As pf
tracks neither gaps in the sequence space nor the acknowledged data,
it does not know where exactly the reset is expected by the TCP
stack.

Problem was that legit reset packets before a gap but not at the
highest sequence numbers were blocked by pf.  Solution is to fix
pf_tcp_track_full().  Now it allows sequence number windows if the
packet has ACK+RST flags set and the acknowlege number matches
perfectly.  This still prevents reset number guessing by an attacker.

Curiously the TCP stack behaves correctly and accepts only resets
before the gap.  pf only allowed resets after the final data.  So
any reset was ignored by the system.  When the other side processed
the challenge ACK, the situation could be fixed.

bug reported and fix tested by Lucas Aubard with Johan Mazel, Gilles
Guette and Pierre Chifflier; OK sashan@

Obtained from:  OpenBSD, bluhm <bluhm@openbsd.org>, 12e4c257ea
Sponsored by:   Rubicon Communications, LLC ("Netgate")
fc63421de9f69ed67aad7bae29712fca2f570693 Kristof Provost 2025-08-25 13:49:22
pf: fix rules_counter:keepcounters test
The previous pf_krule_global leak fix was a bit too aggressive and cleaned up
the inactive tree pointer before we needed it to preserve counters. Only clean
up anchors that are entirely unused. Clean up pf_main_ruleset on pf shutdown.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289299
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=275ff85b25 ("pf: fix struct pf_krule_global leak")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
e63534edbcd050215bc109cd89a31ba30c5ea850 Kristof Provost 2025-09-17 08:12:11
sys/netinet6: Implement RFC 7217
Implement RFC 7217 (A Method for Generating Semantically Opaque
Interface Identifiers with IPv6 Stateless Address Autoconfiguration
(SLAAC)) in our IPv6 stack.

A new ifconfig `stableaddr` flag is added to enable the feature on
interfaces, which defaults to on or off for new interfaces based
on the sysctl `net.inet6.ip6.use_stableaddr` (off by default, so
this commit causes no change in behavior with default settings).

The algorithm follows the RFC in its logic, using SHA256-HMAC as
the algorithm to derive addresses so as to provide code that can
be leveraged by future implentations of RFC 8981, leveraging the
`hostuuid` as the secret.

The source of the hostidentifier can be configured using the sysctl
`net.inet6.ip6.stableaddr_netifsource`, while the number of retries
generating a new address in case of collision can be configured
using the `net.inet6.ip6.stableaddr_maxretries` sysctl (default 3).

Documentation about all these flags is added to the ifconfig(8) man
page.

Reviewed by:            cognet, glebius, hrs
Tested by:              zarychtam@plan-b.pwste.edu.pl
Approved by:            cognet, glebius
Relnotes:               yes
Differential Revision:  https://reviews.freebsd.org/D49681
31ec8b6407fdd5a87d70265762457c67ce618283 Guido Falsi 2025-09-20 12:26:41

System administration

Stuff in man section 8 (other than networking).

pfctl: fix anchortypes bounds test
found by "buffer overflow 'anchortypes' 10 <= 12" smatch error
feedback and ok sashan@, ok miod@ on an earlier version

Obtained from:  OpenBSD, jsg <jsg@openbsd.org>, 730c5d0121
Sponsored by:   Rubicon Communications, LLC ("Netgate")
c2d03a920ec75c431f0c6af0ad9cb6ae43e48dda Kristof Provost 2025-08-20 14:26:00
pfctl: add af-to and other missing action types in print_rule()
Sponsored by: Rubicon Communications, LLC ("Netgate")
79a0959affecd2b055b9048002c0635018576103 Kristof Provost 2025-08-20 14:28:24
pfctl: ctime(3) and ctime_r(3) can fail when timestamps are way off.
Add missing error checks

Input kettenis, millert
OK millert

Obtained from:  OpenBSD, florian <florian@openbsd.org>, a7b9eedcb4
Sponsored by:   Rubicon Communications, LLC ("Netgate")
2c42aecee69696aba85f1ad4c45033dd2db86b02 Kristof Provost 2025-08-21 09:01:21
pfctl: remove prototypes with no matching function
Obtained from:        OpenBSD, jsg <jsg@openbsd.org>, 6768654732
Sponsored by:   Rubicon Communications, LLC ("Netgate")
8e84e9443bb6655f7e6c73546ac28549f768f4f3 Kristof Provost 2025-08-21 09:35:07
ifconfig: Enter jail as soon as possible
Some options (in particular, -g) are processed immediately upon being
parsed.  This will produce the wrong result in combination with -j since
we only attach to the jail after we're done parsing arguments.  Solve
this by attaching to the jail immediately when -j is encountered.  The
downside is that e.g. `ifconfig -j foo -j bar` would previously attach
to jail “bar”, whereas now it will attempt to attach to jail “foo”, and
if successful, attempt to attach to jail “bar” within jail “foo”.  This
may be considered a feature.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289134
MFC after:      1 week
Reviewed by:    zlei
Differential Revision:  https://reviews.freebsd.org/D52501
18fd1443d205aed6be22966125a4820f77571948 Dag-Erling Smørgrav 2025-09-15 17:56:33
boot/universe.sh: toggle LOADER_BIOS_TEXTONLY
Build without LOADER_BIOS_TEXTONLY since it is now the default.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D52559
27699e31fa50e2bee6fdd0b5a0bfb92b4d35d7b7 Ahmad Khalifa 2025-09-15 20:15:02
bhyve: assign a valid INTPIN to NVIDIA GPUs
When passing an NVIDIA GPU to a Linux VM, the GPU driver refuses to work and
complains about a missing IRQ:

[ 77.208984] NVRM: Can't find an IRQ for your NVIDIA card!
[ 77.212697] NVRM: Please check your BIOS settings.
[ 77.212699] NVRM: [Plug & Play OS] should be set to NO
[ 77.212700] NVRM: [Assign IRQ to VGA] should be set to YES
[ 77.212702] nvidia: probe of 0000:00:07.0 failed with error -1

By setting a valid INTPIN in the PCI config space those error messages
disappear. Additionally, tools like nvidia-smi are able to detect the GPU and
the GPU driver seems to work properly.

Note that bhyve still doesn't support legacy interrupts. So, the guest
shouldn't try to use it even though we're assigning an INTPIN.

Reviewed by:            jhb
Tested by:              chuck
MFC after:              1 week
Sponsored by:           Beckhoff Automation GmbH & Co. KG
Differential Revision:  https://reviews.freebsd.org/D51892
effcd0ded0ef1c92bef29c1e9bbf517c97bb45b8 Corvin Köhne 2022-03-17 12:11:14
init: Use root's home directory in single-user mode
When starting single-user mode, use the home directory from user root as
current directory and for the HOME environment variable. If the
directory does not exist, set HOME=/.

Also adjust /root/.profile to stop setting HOME, since it should always
have been set now.

This is intended to keep shell startup files working in single-user mode
after /.profile has been removed.

Reviewed by:    emaste, ivy, kevans
MFC after:      1 week
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D52527
779812d66989a9c3aaed09e4573400fc137f92b0 Jilles Tjoelker 2025-09-14 21:53:34
hastd: Remove some now useless assertion
It is in fact redundant with the previous one, as the set of
supplementary groups is expected to be empty.

MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52281
59049f4b47ea8924ffae7c3c7b9e8c00a79285e0 Olivier Certner 2025-08-29 08:21:38
pfctl: allow tables to be defined inside anchors
This change allows user to define table inside the anchor like that:
        anchor foo {
                table <bar> { 192.168.1.1 }
                pass in from <bar> to <self>
        }
Without this diff one must either create table <bar> in main
ruleset (root) or use 'pfctl -a foo -t bar -T add 192.168.1.1'
This glitch is hard to notice. Not many human admins try to attach
tables to non-global anchors. Deamons which configure pf(4) automatically
at run time such as relayd(8) and spamd(8) create tables attached to
thair anchors (for example 'relayd/*') but the deamons use way similar
to pfctl(8) to add and manage those tables.

The reason why I'd like to seal this gap is that my long term goal
is to turn global `pfr_ktable` in pf(4) into member of pf_anchor.
So each ruleset will get its own tree of tables.

feedback and OK bluhm@

Obtained from:  OpenBSD, sashan <sashan@openbsd.org>, 30269bc362
Sponsored by:   Rubicon Communications, LLC ("Netgate")
9dfc5e03da50d12f02c2b481139acf9f089d504f Kristof Provost 2025-08-22 11:34:39
pf: set limits before rules
The current way to adjust pf(4) limits in pf.conf(5) is inconvenient.
For example when ruleset uses more than 512 anchors (the current default
limit) one would typically add 'set limit anchor 1024' to adjust
the limit so the 'pf.conf(5)' gets processed. Unfortunately it
does not work because limit gets changed with DIOCXCOMMIT which
is too late. The pf.conf(5) fails to load the anchors to transaction,
because the old lower limit is still in place. To fix it we must
set the limit as soon as we parse 'set limit ...' option.

The issue has been reported and fix tested by rafal _dot_ ramocki _von_ eo.pl

OK @bluhm

Obtained from:  OpenBSD, sashan <sashan@openbsd.org>, 85baac7751
Sponsored by:   Rubicon Communications, LLC ("Netgate")
9d9bc7f462bd152d87ab8f1767cad19bab09bf8b Kristof Provost 2025-08-25 13:43:10
syslogd: Make some code more clear.
This moves some math to where it logically makes more sense for skipping
over the ": " separator in the message formatted "app[PID]: MSG".

No functional change.

Fixes:          https://cgit.freebsd.org/src/commit/?id=18bcf5a0 ("Restore local kernel "prog" filtering")
Sponsored by:   Dell Inc.
cddb9806b50b49722140d7b30c09643376feeaed Bryan Drewery 2025-09-17 21:23:19
cpucontrol: return selected revision from ucode_amd_find()
This fixes two printing bugs in cpucontrol(1).  First, the utility will
now print "updating from rev X to rev Y", instead of incorrect "updating
to revision X", where X is actually the old revision.  This also matches
what Intel updater prints.  Second, the utility won't incorrectly warn
that the update failed after reading the new revision post update.

Reviewed by:            kib, markj
Differential Revision:  https://reviews.freebsd.org/D52506
83804499b72405475027e670690d4cdbada46090 Gleb Smirnoff 2025-09-18 15:11:03
nanobsd: minor formatting cleanup
- Reformat function definitions

POSIX states that compound commands, i.e., ones that use `(..)` or
`{ .. } `, are permissible as function definitions, however, many shell
syntax validators do not acknowledge the former format.

Switch to the latter format so more naive editors, like the vim syntax
highlighter, better parse the syntax of the file.

Moreover, replacing `(..)` with `{..}` replaces several subshells with
their non-subshell equivalents. Given that `set -e` is used liberally
and `exit` is not used in the calling code when `set -e` is not
enforced, there is no net loss by making this change.

- Clean trailing whitespace.
- Reindent some related comments to match the indentation of the
  previous line.
- Add shebangs to the tops of files to help syntax colorizers and file
  identifiers understand that the files are in shell syntax.

MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D52596
c99bb5747f5e88527e7414fd543c903f367001c4 Enji Cooper 2025-09-17 18:06:43
Commit group #3: pw
pw: Remove duplicate lines from the pw useradd usage message

No functional change intended.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
4784ca87441093328cec4e9b133608e172343f64 Mark Johnston 2025-09-18 15:13:26

pw: Print warnings when metadata updates fail

We do this in most places already, but not consistently.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
daa63c9417a28ad08881ff03df828fd8180dad12 Mark Johnston 2025-09-18 22:38:33

pw: Clean up a couple of errx() calls

- Remove a stray backslash.
- Make an error message fit on one line.

No functional change intended.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
bc69d5dffa21cdf228e481b5502fd0f053d65e6d Mark Johnston 2025-09-18 22:38:45
Commit group #4: pw
pw: Add a missing chown() when creating dirs in mkdir_home_parents()

mkdir_home_parents() effectively performs a mkdir -p of the root home
directory.  It chowns the home directory to 0, 0, but doesn't do so for
the intermediate directories.  Add an explicit chown() call for those
too.  Fix a long line while here.

Reviewed by:    bapt
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D52587
41b2a80353e0dd04939cc260d5763854a264c158 Mark Johnston 2025-09-18 22:39:11

pw: Use copy_file_range() when copying skeleton files

As a bonus, check for I/O errors and print them to standard error.

Reviewed by:    bapt, emaste
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D52588
a03d150a3d44c49344ebd0862defd1a5ad1f524e Mark Johnston 2025-09-18 22:39:39

pw: Add a metalog output mode

When creating OS images as a non-root user, it may be useful to
pre-create users in the staged tree.  The useradd operation adds files
to the new user's home directory, copied from the skeleton directory
(/usr/share/skel), which makes it inconvient for use in this scenario
since the added files are not recorded in the mtree metalog.

To cover this gap, this change adds a new -M <metalog> option to pw's
useradd operation, causing pw to add mtree entries for newly added
files.

Extend an existing regression test to validate this mode.

Reviewed by:    bapt, emaste
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D52590
182ed3c0755f1bf161d8be02016b5f6cf9b57556 Mark Johnston 2025-09-18 22:40:00
bsdinstall: Use package sets for pkgbase install
Update the pkgbase component selection dialogue to take the components
list from the meta-package sets available on the install media, except
for "kernel" which is still handled magically.

Always install "minimal", and by default select "base", "kernel-dbg"
and any libcompat sets (e.g., lib32) if they're available.

Replace the various "dbg" options with a single "debug" component that
installs the debug symbols for all the components the user selected,
except for kernel since we handle that separately and it's common to
want kernel debugs symbols without userland debug symbols.

MFC after:      3 seconds
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D52558
561dc357c2f5892af3aa481a1020860b7ff473e0 Lexi Winter 2025-09-18 17:28:36
bsdinstall: fix vfs.zfs.vdev.min_auto_ashift oid
Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266374
Pull request: https://github.com/freebsd/freebsd-src/pull/1851
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
87a7b35f04b60956e9aa192680ae80773ec38f14 Siva Mahadevan 2025-07-15 16:45:24
mtree: Add package tags to some root directories
This ensures the normally-empty directories /proc, /net, /media and /mnt
are created on a fresh pkgbase install.

Put /proc, /mnt and /media in -runtime since those are basic directories
that should always exist.  /net is only used by the automounter, so put
that in -autofs.  While here, also tag /rescue in -rescue, since nothing
else installs there.

Reported by:    Graham Perrin <grahamperrin@gmail.com>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289654
MFC after:      3 days
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D52622
b3468202994f6856c5c49f3365e05f4f8017d680 Lexi Winter 2025-09-19 16:38:24
ifconfig: Fix the display of the IFCAP_MEXTPG capability without netlink
Historically this capability is IFCAP_NOMAP but it was renamed to
IFCAP_MEXTPG. Catch up with the change 3f43ada98c89.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289545
Fixes:          https://cgit.freebsd.org/src/commit/?id=3f43ada98c89 Catch up with https://cgit.freebsd.org/src/commit/?id=6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG
MFC after:      3 days
5017fdb728811fd3e15d7151524378f49a49aee1 Zhenlei Huang 2025-09-19 19:18:27
moused(8): Start moused with devd
It is appeared that currently starting of moused does not depend on
moused_enable variable value in rc.conf. That leads to missing USB mice
support in default configuration. Start moused in traditional per
device mode with devd to follow POLA.

One daemon per system mode still can be enabled with setting of
moused_port="auto"
moused_nondefault_enable="NO"
variables in /etc/rc.conf

To revert to sysmouse mode add moused_type="sysmouse" to /etc/rc.conf

Reported by:    many
Requested by:   glebius
Reviewed by:    glebius
MFC after:      1 day
Differential Revision:  https://reviews.freebsd.org/D52430
66e7f048f0c8e9e726738fadd9dc819bfda3cbfe Vladimir Kondratyev 2025-09-21 13:14:49
ifconfig: Display the IFCAP_HWSTATS capability without netlink
This follows the commit 4cdc1f5421c5, which introduces the IFCAP_HWSTATS
capability.

Fixes:  https://cgit.freebsd.org/src/commit/?id=4cdc1f5421c5 There are some high performance NICs that count statistics in hardware
MFC after:      3 days
595acb29a35f36a4fc08b89d3a476f16c1d108b4 Zhenlei Huang 2025-09-21 16:47:45
ifconfig: Display the IFCAP_NV capability without netlink
This follows the commit 051e7d78b039, which introduces the IFCAP_NV
capability.

Fixes:  https://cgit.freebsd.org/src/commit/?id=051e7d78b039 Kernel-side infrastructure to implement nvlist-based set/get ifcaps
MFC after:      3 days
0c1684dd456e3df306b359b04e61f9f2048d9ff2 Zhenlei Huang 2025-09-21 16:47:45

Libraries

libsamplerate: Define as PRIVATELIB
Fixes the following warnings:

ld: error: relocation R_X86_64_32S cannot be used against local symbol; recompile with -fPIC

>>> defined in /usr/obj/usr/src/amd64.amd64/lib/libsamplerate/libsamplerate.a(samplerate.o)
>>> referenced by samplerate.c:498 (/usr/src/contrib/libsamplerate/samplerate.c:498)
>>>
>>>   samplerate.o:(src_new) in archive /usr/obj/usr/src/amd64.amd64/lib/libsamplerate/libsamplerate.a

Related discussion: https://reviews.freebsd.org/D52306

Sponsored by:   The FreeBSD Foundation
Reviewed by:    fuz
Differential Revision:  https://reviews.freebsd.org/D52307
dafd960a3d65cdaccb1f8b9395fad14092ec9eb2 Christos Margiolis 2025-09-15 13:09:38
libc: compat.h: Remove a superfluous blank line at end
No functional change (intended).

MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
580d2d429598e6eb3549f9ea7490d10e19904f7c Olivier Certner 2025-09-15 16:54:23
libprocstat: procstat_getgroups_kvm(): Output again the effective GID
In particular, fixes 'procstat -s -M' (for processes with more than 16
groups).

Reviewed by:    kib
Fixes:          https://cgit.freebsd.org/src/commit/?id=be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52275
11cbb7d122ac0219c214ad52c4d6f7cbb9d60ac1 Olivier Certner 2025-08-28 14:49:07
initgroups(3): Fix return value on allocation failure
We must not return ENOMEM, but rather -1 with 'errno' set to ENOMEM, as
described in the manual page and as other implementations are doing.
A malloc() failure actually already sets ENOMEM for us.  Add comments
indicating which function set 'errno' each time we return.

While here, improve style and remove useless headers.

Reviewed by:    kib, emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=54404cfb13d4 ("In preparation for raising NGROUPS and NGROUPS_MAX, ...")
MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52580
0b018cfd81d8fdd64af3fe94c6989a82c0d3afa9 Olivier Certner 2025-09-16 15:52:20
initgroups(3): Add a pre-FreeBSD-15-compatible version
After commit 9da2fe96ff2e ("kern: fix setgroups(2) and getgroups(2) to
match other platforms"), initgroups() does not set the effective GID
anymore and uses all passed groups as the supplementary group list.
This effectively breaks backwards compatibility with programs/libraries
compiled on a FreeBSD 14 or earlier system.

Restore compatibility by creating a new version of the 'initgroups'
symbol that designates the current implementation and providing
a pre-FreeBSD-15-compatible version under the symbol's previously
exported version.  The new version calls the new setgroups(2) system
call, while the compatible one calls the original one (called
freebsd14_setgroups()).

Update the manual page with some history and comparison with other
current open-source systems.  Add a "SECURITY CONSIDERATIONS" section
highlighting some security properties of this approach and the reasons
we adopt it.  While here, revamp the manual page, in particular to use
the exact POSIX terminology where possible.

Note for MFC to stable/14: Only the manual page update is to be MFCed,
and the text changed to reflect the old behavior and inform readers of
the new upcoming behavior in 15.

Reviewed by:    kib
Fixes:          https://cgit.freebsd.org/src/commit/?id=9da2fe96ff2e ("kern: fix setgroups(2) and getgroups(2) to match other platforms")
MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52282
9dc1ac8691966480ff8bd9c37dd405b981b41dd5 Olivier Certner 2025-08-29 14:19:33
sdp(3): Change bdaddr parameter type in sdp_register_service()
Fixes compiler error when the caller passes a const bdaddr_t *
paramemeter (e.g., NG_HCI_BDADDR_ANY).

Sponsored by:   The FreeBSD Foundation
MFC after:      1 day
Reviewed by:    markj, emaste
Differential Revision:  https://reviews.freebsd.org/D52582
3d14cc82d7a8c11cd164a6ba668d20b939c576fe Christos Margiolis 2025-09-17 14:12:03

Filesystems

fuse: Fix GID when sending FUSE_INTERRUPT to a FUSE daemon
Due to the partial-only changes of commit 46c07316f906 ("kern: adopt the
cr_gid macro for cr_groups[0] more widely"), subsequent commit
be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
caused a mismatch between filling cr_groups[0] in 'reused_creds' in
fuse_interrupt_send() and reading 'cr_gid' from it in
fuse_setup_ihead(), with the consequence that the kernel would send
a FUSE_INTERRUPT message to the FUSE deamon with an uninitialized GID in
its header (which, besides being wrong, would disclose 4 bytes from its
stack).

Fixes:          https://cgit.freebsd.org/src/commit/?id=be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52255
d22592cd6fd2d39432add376dad460a66488a846 Olivier Certner 2025-08-26 12:39:16
nfsd: nfsd_excred(): Remove an obsolete comment
This comment has been obsoleted by commit be1f7435ef21 ("kern: start
tracking cr_gid outside of cr_groups[].").

No functional change.

MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52264
5fa6ca8b8affc8d948687c4ede7aeed297ae2dc0 Olivier Certner 2025-08-27 13:40:42
fusefs: fix a kernel panic regarding SCM_RIGHTS
If the last copy of an open file resides within the socket buffer of a
unix-domain socket, then VOP_CLOSE will be called with no thread
information.  Fix fusefs to handle that case, and add a regression test.

Also add a test case for writes to a file that lies within a sockbuf.
Along with close, a write from the writeback cache is the only other
operation I can think of that might apply to a file residing in a
sockbuf.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289686
Reported by:    iron.udjin@gmail.com
MFC after:      1 week
Sponsored by:   ConnectWise
Reviewed by:    glebius, markj
Differential Revision: https://reviews.freebsd.org/D52625
e043af9ca59608309cac2fd222c17f989ba0d35e Alan Somers 2025-09-19 16:02:25

Kernel

Kernel stuff (other than networking, filesystems, and drivers).

qat: enable qat driver for 402xx device
Enabled qat driver support for 402xx device with
ID 0x4944/0x4945. This is an additional device supported
under the existing qat_4xxx driver. Firmwares specific to
the 402xx device are added.

Signed-off-by: Hareshx Sankar Raj <hareshx.sankar.raj@intel.com>

Relnotes:       yes
Sponsored by:   Intel Corporation
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D52488
7fbd362c091b2b384d14c3ed5af9234bb2eff9c2 Hareshx Sankar Raj 2025-09-04 18:21:36
vm_fault_busy_sleep(): update comment after addition of allocflags arg
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D52538
f1b656f14464c2e3ec4ab2eeade3b00dce4bd459 Konstantin Belousov 2025-09-15 00:52:47
dtraceall: Enable kinst for aarch64 and riscv as well
aarch64 and riscv are supported since 2023 so it should be safe to
enable it by default.

MFC after:      2 weeks
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D52575
67f3c0d6a575f74a013974b4d4860a36e4fcc8ab Christos Margiolis 2025-09-16 15:37:19
jail: Optionally allow audit session state to be configured in a jail
Currently it is impossible for a privileged, jailed process to set audit
session state.  This can result in suprising audit event misattribution.
For example, suppose a user ssh'es into a jail and restarts a service;
normally, sshd sets audit state such that events generated by the SSH
session are attributed to the newly authenticated user, but in a jail,
the corresponding setaudit(2) call fails, so events are attributed to
the user who had started sshd in the jail (typically the user who had
started the jail itself by some means).

While this behaviour is reasonable, administrators might want to trust
the jailed sshd to reset audit state, such that the authenticated user
appears in audit logs.  Add a jail knob to enable this.  Add a simple
regression test.

This is a reapplication of commit 246d7e9fc23928 following a revert.
The audit system calls must preserve the old behaviour of returning
ENOSYS if the system call is disallowed within a jail, as some
applications depend on that behaviour.

Reviewed by:    kevans, jamie (previous version)
MFC after:      1 week
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D51719
Differential Revision:  https://reviews.freebsd.org/D52572
4be491e1b9b3b650494208eb61511f4a45c7db3f Mark Johnston 2025-09-15 17:23:50
vm/vm_fault.c: update and split comments for vm_fault() and vm_fault_trap()
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differrential revision: https://reviews.freebsd.org/D52567
22cce201da76a1916be5c993201f0478f3048292 Konstantin Belousov 2025-09-16 03:41:55
tcp: improve compilation of cc and their helper modules
* Allow the congestion control modules CDG, CHD, HD, and vegas also
  to be compiled into the kernel for IPv6 only kernel configs.
* Compile the helper module h_ertt for round trip time estimation only
  into the kernel, if one of the congestion control module using it
  (one of CDG, CDH, HD, or vegas) is also compiled into the kernel.
Please note the second point implies that TCP TSO is done whenever
possible as long as none of the congestion control modules CDG, CHD,
HD, or vegas is loaded or compiled into the kernel.

Reviewed by:            cc
MFC after:              3 days
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D52547
1bb72d3d6eee50232b6d6acbc201f9aaac93e2b5 Michael Tuexen 2025-09-16 21:30:40
unix: SCM_CREDS: Restore passing the effective GID
cmcred_groups[0] in 'struct cmsgcred' must be the effective GID.

Note that the code in unp_addsockcred() filling up 'struct
sockcred'/'struct sockcred2' (LOCAL_CREDS/LOCAL_CREDS_PERSISTENT
options) was in fact "wrong" before 'cr_gid' was moved out of
cr_groups[], in the sense that it would transmit the effective GID
twice, both separately as 'sc_egid' and as the first element of
'sc_groups'.  It is now exact, so is left unchanged, which causes
a difference in output (the effective GID is no more in 'sc_groups',
unless it is also a supplementary group) that is unlikely to affect
applications in practice.

Reviewed by:    glebius
Fixes:          https://cgit.freebsd.org/src/commit/?id=be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52262
c5e920e49c0cf068da3962688cc60ab514ea1252 Olivier Certner 2025-08-26 17:01:03
Commit group #5: cred
cred: 'kern.ngroups' tunable: Rework the comment on the initial value

Remove the parts about the effective GID being stored as the first
element of the groups array, as this is generally not the case now after
commit be1f7435ef21 ("kern: start tracking cr_gid outside of
cr_groups[]") (some credentials export structures still have the old
layout, and need to do the 'ngroups_max + 1' computation, but given the
computation needed to obtain a size in bytes, this detail is not really
important here).

Remove the part about 32-bit machines, avoiding another modification
when support for them is removed.

No functional change.

MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52265
a61e7b5c98f840b4a7777d718218d0f63569c52a Olivier Certner 2025-08-27 13:50:59

cred: Update some comments after 'cr_gid' is no more cr_groups[0]

While here, fix style of some already-updated comments.

Fixes:          https://cgit.freebsd.org/src/commit/?id=be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52266
9397b2ef741c57c8b2f0fdf796cc86267ecf2213 Olivier Certner 2025-08-27 14:07:03

cred: Remove obsolete comment after getgroups() not returning the eGID

No functional change.

Fixes:          https://cgit.freebsd.org/src/commit/?id=9da2fe96ff2e ("kern: fix setgroups(2) and getgroups(2) to match other platforms")
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52267
30193fce433cdad465904b6efe3814bf234ea74e Olivier Certner 2025-08-29 16:35:56

cred: Restore proper checking of effective groups in some security policies

The removal of 'cr_gid' from cr_groups[] as cr_groups[0] made
cr_canseeothergids() skip considering the subject's first supplementary
group, causing the 'security.bsd.see_other_gids' policy to be too
restrictive, and cr_xids_subset() miss a check on the effective GID,
relaxing the "can debug" and "can export KTLS keys" checks.

Fix these policies.

Fixes:          https://cgit.freebsd.org/src/commit/?id=be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52268
fa1cbb02d12055db0584882d586658be643f0949 Olivier Certner 2025-08-27 14:28:15

cred: 'struct ucred': Rework comment on 'cr_gid'/cr_groups[]

Make it more straightforward for consumers.  Also, recommend using
cr_sgroups[] for supplementary groups, as this can generally alleviate
index problems and will help us spot and change consumers if/when
'struct ucred' is evolved incompatibly (and cr_sgroups[] suppressed).

MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52269
0abeb8d8d8df1842b0c2d2276c958b0150579a1c Olivier Certner 2025-08-27 14:33:24
MAC/bsdextended: Restore matching subjects' effective GID
Fixes:          https://cgit.freebsd.org/src/commit/?id=be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52270
ab7186a486347216fde099498471cf847828565c Olivier Certner 2025-08-27 14:56:21
MAC/do: Restore matching the first supplementary group
As 'cr_gid' was in fact stored in cr_groups[0],
rule_grant_supplementary_groups() would loop only on further elements of
cr_groups[].  Now that cr_groups[0] is not 'cr_gid' anymore, but some
supplementary group, take it into account.

Fixes:          https://cgit.freebsd.org/src/commit/?id=be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52271
d39756f23fe223d14ff00b1392ba39e94d5eadbc Olivier Certner 2025-08-27 15:22:26
cr_canseeothergids(): Make the logic easier to grasp
Invert the initial test on whether the policy is in force so that, if
there are no restrictions, the function bails out early, allowing to
de-indent the rest of the code and have it finish with a non-zero (deny)
'return'.

No functional change (intended).

MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52272
f75d0dc533923345c653dcdcd5ebd1e53377a7c5 Olivier Certner 2025-08-27 16:53:14
Commit group #6: linux
linux: Simplify further getgroups() after 'cr_gid' not in cr_groups[]

No functional change (intended).

While here, fix/improve style a bit and in setgroups().

MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52276
a207833f4fed5431cac853c082fa34dc8f33cba6 Olivier Certner 2025-08-28 15:29:33

linux: setgroups(): Fix the group number's upper limit

'ngroups_max' is the maximum number of supplementary groups the system
will accept, and this has not changed.

Fixes:          https://cgit.freebsd.org/src/commit/?id=9da2fe96ff2e ("kern: fix setgroups(2) and getgroups(2) to match other platforms")
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52277
bbdea7c9f4aeae26b35f842382df0203fcda24a5 Olivier Certner 2025-08-28 16:58:53

linux: setgroups(): Avoid allocation under the process lock

This was missed in commit 838d9858251e ("Rework the credential code to
support larger values of NGROUPS (...)").

No functional change (intended).

MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52278
b7a87d7c0dd19016e82f5d33f2c5ec90479c31fe Olivier Certner 2025-08-28 15:47:38

linux: setgroups16(): Pre-extend the groups array

For the size we know we will need in the end.

No functional change (intended).

MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52279
b1326edddb302a28fc9418ab60df6210513cc07c Olivier Certner 2025-08-28 16:27:30

linux: getsockopt(): Simplify exporting groups a bit

No functional change (intended).

Go through conversion to a 'l_gid_t' before copying out in order to cope
with differing group types (except for not representable values, of
course).  This is what is done, e.g., for getgroups() in 'linux_misc.c'.
As Linux's group type is the same as ours on all architectures, we could
as well just stop bothering and copy out our memory representation,
eliminating the loop here.  Whatever the choice, though, it has to be
consistent here and there.

Introduce 'out' of type 'l_gid_t' to avoid performing "by hand" array
arithmetics when copying out.

MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52280
10b789d7e14862c77f77f07e8af84d73d73012c6 Olivier Certner 2025-08-29 08:26:59
syscalls: Old setgroups(2)/getgroups(2): Remove superfluous STD type
An examination of the scripts under 'sys/tools/syscalls' indicates that
keeping STD as a type in the presence of COMPATxx does not make any
difference, and regenerating system call files with STD removed does
indeed not show any difference.  Moreover, this practice is inconsistent
with the rest of the file.

Thus, remove the superfluous STD type for the two above-mentioned system
calls.  While here, re-order the remaining types for getgroups() to be
consistent with other such occurences (COMPATxx before CAPENABLED).

Reviewed by:    kevans, emaste
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52499
696cfb27ca4e60ebd49c45355a8a9c4945f84f98 Olivier Certner 2025-09-12 12:27:43
witness: Record the first acquired file and line for recursable locks
and the last acquired file and line to witness object.

For recursable locks, unfortunately current implementation records only
the recurse count and the last acquired file and line, but does not
restore the previous acquired file and line on unlock. Hence it is
possible to report false acquired file and line, and that may mislead
developers and make the report by users a little harder to analyse.

Since subsequent recurse locks do not affect how witness order check,
record the first acquired file and line so that the logic is much clear.

Reported by:    bz
Reviewed by:    kib (previous version), markj
See also:       https://lists.freebsd.org/archives/freebsd-current/2025-June/007944.html
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D52496
2d85bc89294baa04daf509e81ec3880bff79cc10 Zhenlei Huang 2025-09-17 16:48:54
vfs: remove a stale comment about unlock + unref relationship in vput
It does not hold since introduction of vnode state tracking, which
validates unlock only happens after the target vnode is sorted out
(fully constructed or aborted). See 829f0bcb5fe24bb5 ("vfs: add the
concept of vnode state transitions").
ea1652bc01c4093eb4a8c6971c69a410883df189 Mateusz Guzik 2025-09-17 22:40:24
dtrace: Deduplicate dtrace_sync() and dtrace_xcall() implementations
dtrace_xcall() is just a thin wrapper around smp_rendezvous_cpus().
There's no need for six identical implementations to live in MD layers.

No functional change intended.

MFC after:      2 weeks
bf115203bb8a61bd03ba23931ff0b5bf931b7d1b Mark Johnston 2025-09-17 15:29:48
linuxkpi: Move string_helpers.h to string_choices.h
Chace Linux change fca76071bab2 ("lib/string_helpers: Split out
string_choices.h") from v6.5.  Everything that we implemented from
string_helpers.h has moved, so rename the file, update the include
guards, and add a new dummy string_helpers.h that just #includes it.
This matches Linux for the functionality that we have.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52606
4d6d5f5a21abc4abd715c63c0d99c82aaa3955c0 Ed Maste 2025-09-18 20:46:56
remote coredump: fully initialize coredump_vnode_ctx and coredump_writer structs
Reported and tested by:       pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
11205b0854113eae68f725287b8501951d67be0f Konstantin Belousov 2025-09-19 15:38:07
sanitizers: Provide wrappers for atomic_testandset_acq_long
Noticed when building a kernel with options RANDOM_FENESTRASX.

MFC after:      1 week
7ea59a07046a0bf25d4fccb456715dffaae52021 Mark Johnston 2025-09-19 22:54:20
kern/vfs_vnops.c: generalize the lock primitive for file foffset
Generalize foffset_lock/unlock() by splitting the locking info
file_v_lock/unlock() (LP64 case) or file_v_lock/unlock_mtxp() for ILP32
(using mutex pool) and then taking the action to read the offset.

sys/file.h: rename struct file f_vnread_flags member into generic f_vflags

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D52486
0ee6f5efdfc6550077f15204335a68aab9c34d67 Konstantin Belousov 2025-09-10 16:35:01
fcntl(F_SETFL): only allow one thread to perform F_SETFL
Use f_vflags file locking for this.
Allowing more than one thread handling F_SETFL might cause de-sync
between real driver state and flags.

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D52487
4c3a868d13c053ef173268cdfe1365978a282178 Konstantin Belousov 2025-09-11 10:05:04

Build system

iwlwifi: Don't compile for gcc before 14
gcc 13 and earlier don't have __builtin_bitcountg. The linux wifi kpi
uses this unconditionally. While in this one use, it might not be
needed, I opted to not compile iwlwifi when building gcc12 or 13 rather
than risk breaking it for everbody else.

With this change gcc12 builds the kernel. Maybe this will stop jenkins
email for every commit I make.

Sponsored by:           Netflix
5e0a4859f28ad4869f7a73faf42debc355a370bf Warner Losh 2025-09-14 18:03:16
udbc(4): connect to build
Reviewed by:  thj
MFC with:       d566b6a70bcbc329e8c690464043401fa8bdd49f
Sponsored by:   The FreeBSD Foundation
a75c3c2c633dfa29b628f692fc7274cab1920640 Li-Wen Hsu 2025-09-15 18:34:43
share/man/man[49]: Set PACKAGE=kernel-man
When MANSPLITPKG is disabled (which is now the default), the kernel
manpages in sections 4 and 9 are installed in the -kernel package
instead of the -kernel-man package, because bsd.man.mk doesn't add
the -man suffix.

Since we already have handling for kernel-man in generate-ucl.lua,
set PACKAGE=kernel-man to make sure they're always in the right
package.

To avoid creating -kernel-man-man when WITH_MANSPLITPKG is enabled,
add some logic to bsd.man.mk (suggested by kevans) to avoid adding
the -man suffix if the package already has a -man suffix, and while
here, ensure ${__group}PACKAGE is always defined.

MFC after:      3 seconds
Reviewed by:    des, bapt
Differential Revision:  https://reviews.freebsd.org/D52525
6d83ae143b1f598b5f8868508f6e8a7d3440f568 Lexi Winter 2025-09-15 18:22:09
release: Pass ABI to running pkgbase-stage on dvd
I did this for disc1 but forgot to amend the dvd invocation.

Fixes:  https://cgit.freebsd.org/src/commit/?id=340e68fd7c0d ("release: Pass ABI to pkgbase-stage.lua")
MFC after:      3 days
Sponsored by:   https://www.patreon.com/cperciva
b050bfa88d4ee2acedb590777603e5c3656cdaca Colin Percival 2025-09-16 01:04:56
release: Enable installing packages as a non-root user
Provide variables, PKG_REPOS_DIR and PKG_REPO_NAME, to allow the user to
configure the source package repository.  Configure pkg to emit added
files to a metalog which gets concatenated with the main metalog
immediately before we build the root filesystem.

Reviewed by:    cperciva, emaste
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D52453
5eb917426e0aab1e82c7b0e7239724d18bae206a Mark Johnston 2025-09-16 16:05:06
packages: remove src from base set
The FreeBSD-src package is the largest single pkgbase package at 158M
currently. Remove it and FreeBSD-src-sys (87M) from the base set as
they are not useful to all users.

Reviewed by:    emaste, ivy
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52573
87a78d9618ab5430b12dd5c54ec61fcaeb8f0655 Isaac Freund 2025-09-16 15:01:00
packages: remove tests from base set
Create a new tests package set to hold the tests, which are not useful
to all users and don't belong in the base set.

Reviewed by:    emaste, ivy
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52574
36edc5014f633c1f00031f5fc5a291f8cdd46d83 Isaac Freund 2025-09-16 15:01:09
Commit group #7: release
release: Make azure cloudware images buildable as non-root

- Don't chroot to uninstall pkg since we don't install pkg in the first
  place.
- Use pw -R instead of chrooting.
- Add metalog entries.

Reviewed by:    cperciva, emaste
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D52451
bab6b01bcfead662b8b10dc52a18beeb42794505 Mark Johnston 2025-09-16 16:53:13

release: Prepare EC2 cloudware images to be buildable as non-root

- Avoid chrooting to uninstall pkg, as it will not be installed in the
  first place when in non-root mode.
- Add metalog entries.

Reviewed by:    cperciva
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D52452
8027de008d9f3c5cd5509d586f14846abd0f3db2 Mark Johnston 2025-09-16 16:53:35

release: Prepare oracle cloudware images for non-root builds

- Add metalog entries.
- Remove a stray entry in the package list.

Reviewed by:    cperciva, emaste
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D52454
8f5791873a30122f72266cc44309933118d7fe36 Mark Johnston 2025-09-16 16:53:56

release: Prepare GCE cloudware images for building as non-root

- Avoid mounting devfs just to list packages and fetch distfiles.
- Add metalog entries.

Reviewed by:    cperciva, emaste
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D52455
f1995d6fc13fa4a36f83cea3b90f27bce2aca4d9 Mark Johnston 2025-09-16 16:54:11

release: Prepare Vagrant cloudware images for building as non-root

Add metalog entries for various files.  This is a bit incomplete as
pw(8) doesn't yet have support for emitting metalog entries, which we
need since it's used here to create an interactive user.

Reviewed by:    emaste
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D52456
135cb071e0683ea947c308a2de404d1185558ea6 Mark Johnston 2025-09-16 16:54:25
Commit group #8: crypto/openssl: apply polish to new vendor import process
crypto/openssl: apply polish to new vendor import process

This change does the following 2 things:
- Makes the build more repeatable by isolating the environment. This
  prevents bmake from leaking variables into gmake and makes the overall
  process a bit more robust.
- Add debug printouts to make the process more straightforward to the
  reader and whoever is executing doing the current vendor import.

MFC after: 1 month
Differential Revision:  https://reviews.freebsd.org/D52420
d18058b7b850c78f2ca1be746ab411c0bed5acc9 Enji Cooper 2025-08-22 00:19:25

crypto/openssl: fix importing new versions from pristine trees

Prior to this change, CC was not being passed through to Configure,
which was resulting in failures when Configure was running compiler
checks.

Pass through CC via `WRK_ENV` to Configure so the compiler is defined
properly as part of the initial build.

MFC after:      1 month
Fixes:          https://cgit.freebsd.org/src/commit/?id=d18058b7b850 ("crypto/openssl: apply polish to new vendor import process")
Differential Revision:  https://reviews.freebsd.org/D52595
52c4b76d1dd385fbe33b78172e39a10749b83d13 Enji Cooper 2025-09-17 05:57:32
Commit group #9: packages
packages: Add minimal-jail set

This is minimal, but without bootloader, hardware and networking support
that's typically not required in jails.

This requires extending the 'set' annotation to be a comma-separated
list, so that packages can be in multiple sets.

MFC after:      3 seconds
Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D52591
9b7bddfd082d1df2b4c97e7ec974d1d67e98a1de Lexi Winter 2025-09-17 20:11:20

packages: Mark all sets as vital

At least "minimal" must be vital, because it's required for a functional
system.  For example, we might create new packages in the future which
are required for the multi-user system and are part of the minimal set,
so it's important that users don't remove set-minimal to ensure they get
those new packages.

For the other sets, it's debatable whether they should be vital or not,
but let's start out with the assumption that if the user installed a
set, they should have to have to explicit request it be removed.  This
means if, for example, they install set-devel, then remove lldb, pkg
won't remove set-devel and cause the next "pkg autoremove" to remove
everything else that was in set-devel.

We might want to adjust this later (or possibly adjust the behaviour
of pkg(8) itself) based on user feedback.

While here, fix a typo in the description of the devel set.

Suggested by:   bapt
MFC after:      3 seconds
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D52562
9537aa02f40454ba8243e8c877695876d3e4c150 Lexi Winter 2025-09-17 20:12:21

packages: Move kernel-man to the minimal set

Currently this is in the "kernels" set, which doesn't make sense
because it's not a kernel.

Move it to the "minimal" set, on the basis that minimal already includes
a bunch of manpages, and a user who installs with minimal expects that
e.g. "man ix" will work.

MFC after:      3 seconds
Reported by:    des
Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D52560
a2783fb75401c85f5ae815a1349fbad8e7ab7b3c Lexi Winter 2025-09-17 20:13:04
release: Add images for almost all packages, with & without toolchain
Contains almost everything of use in a container except:

- *lib32
- *dev
- *dbg
- *src
- anything expecting hardware such as device config tools

Differential Revision:  https://reviews.freebsd.org/D51471

Reviewed by:    dfr, emaste
Approved by:    cperciva
MFC after:      1 day
Sponsored by:   SkunkWerks, GmbH
728ec0c094ce473ae17ebd1adb05f0959bf3a68e Dave Cottlehuber 2025-09-17 21:16:37
Commit group #10: Include a pkg package in the pkgbase repo
Include a pkg package in the pkgbase repo

It is essential that users be able to install the FreeBSD base system
from release media and have all the bits needed to update the FreeBSD
base system without touching the ports tree or pkg.freebsd.org.  To
that end, resurrect (and heavily rewrite) the make-pkg-package.sh
script and hook it into the create-packages target; if /usr/ports
exists when building pkgbase packages, we'll also (cross)build pkg
and include it in the repository.

Scripting for actually installing this package as part of the FreeBSD
installation process to come later, but I wanted this in the tree in
time to test it in this week's snapshots.

MFC after:      1 day
Sponsored by:   https://www.patreon.com/cperciva
6b5adf33873a309523dc4e585ff08d70bb6c6f2f Colin Percival 2025-09-17 22:34:25

Bootstrap pkg before building a pkg package

At sufficiently high levels of build parallelism we can try to create
the pkg before any of the other pkgbase-creation steps have taken
care of the bootstrap.

Fixes:  https://cgit.freebsd.org/src/commit/?id=6b5adf33873a ("Include a pkg package in the pkgbase repo")
MFC after:      12 hours
Sponsored by:   https://www.patreon.com/cperciva
98d74493619ee0e1587bffed79ce8e9573c3fc8b Colin Percival 2025-09-18 04:22:50
Commit group #11: release
release: Allow powerpc GENERIC64(le)? kernels

The pkgbase-stage.lua script asserts that it has exactly one "kernel",
but only accepts GENERIC as a "kernel".  Use a slightly more permissive
regex in order to capture kernels with names which start "GENERIC".

Reviwed by:     ivy
MFC after:      12 hours
Sponsored by:   https://www.patreon.com/cperciva
Differential Revision:  https://reviews.freebsd.org/D52544
b9afd7f6a5b1cf1a6cbcef7a55aede7e71a0babc Colin Percival 2025-09-15 02:44:07

release: Make PKGBASE the default

Replace the PKGBASE option by a NOPKGBASE option.

Check for both whether the option is defined and whether it is empty,
since when running from release.sh we always define NOPKGBASE.

MFC after:      12 hours
Sponsored by:   https://www.patreon.com/cperciva
Differential Revision:  https://reviews.freebsd.org/D52536
35b81af1eee699509bae2bbe12fdc770d9cee40a Colin Percival 2025-09-15 00:37:20

release: Always dist sets on dvd1

In the !NOPKGBASE && !NODISTSETS case, we only want the pkgbase repo
on disc1; but we want both packaging formats on dvd in order to allow
for offline installs in both methods and also tools which ingest the
dist sets from the dvd image.

MFC after:      12 hours
Sponsored by:   https://www.patreon.com/cperciva
Differential Revision:  https://reviews.freebsd.org/D52537
7c0bc6c703eeaea737d0dbc21996764967e4dc97 Colin Percival 2025-09-15 00:39:42
packages: Remove the tests-dev package
We don't want a tests-dev package, because this means set-devel depends
on tests-dev, which transitively depends on tests, which means you can't
install set-devel without also getting tests.

The only real "dev" files in tests-dev are from ATF (libprivateatf),
so move that to its own package and add a dependency from tests.

Also move Kyua to its own package, since this might be useful for
running tests even when the user doesn't want the whole set of base
tests installed.

Add a dependency from -tests to both -atf and -kyua, and a dependency
on -set-base, since the tests won't work without the full base system
installed.

The remaining "dev" files in tests are actually test artifacts, not real
development libraries.  Add a new NO_DEV_PACKAGE option to bsd.lib.mk,
which causes dev files to be installed in the base package instead of
creating a -dev package, and set this option for everything that
installs test libraries.

While here, add a slightly more informative description for the tests
package.

MFC after:      3 seconds
Reviewed by:    bapt, emaste
Differential Revision:  https://reviews.freebsd.org/D52597
9065390ddc7b1ce2613777f6a947200950a5ac71 Lexi Winter 2025-09-18 09:13:41
packages: Add a mandoc package
Move mandoc to its own package so users can install it independently of
-utilities.  Put the package in the minimal set, since we also ship
manpages in minimal and "man" is a basic Unix utility.

Add a pkg-triggers(5) hook to run makewhatis when new manpages are
installed, so that apropos(1) works.  This depends on a new pkg(8)
feature expected to be in in the upcoming 2.3.2 release; in the mean
time, this is a no-op (i.e., having an older pkg doesn't break anything,
it just won't run the trigger).

MFC after:      3 seconds
Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D52564
ea5e50c2985bea029e7b30ecee773a59fe22cd68 Lexi Winter 2025-09-18 09:14:45
Commit group #12: pkgbootstrap: Build pkg if PORTSDIR exists
pkgbootstrap: Build pkg if PORTSDIR exists

If we don't already have the pkg tool installed, we need to install it
before we can build packages for pkgbase.  (This arises in release
builds which run in clean chroots; most users will have pkg installed
already.)  Installing it from pkg.freebsd.org via "pkg bootstrap" runs
into two problems: First, it's an external dependency with security
implications; and second, there's a bootstrapping problem on new major
versions where pkg.freebsd.org does not have packages yet.

Instead, if we have a ports tree, use it to build pkg ourselves.

With hat:       re
MFC after:      6 hours
Sponsored by:   https://www.patreon.com/cperciva
2c06b824436df6177545cc0f1603e5c3bfbf3365 Colin Percival 2025-09-18 19:21:29

pkgbootstrap: Gate building from ports

In release builds we want to build pkg from the ports tree for reasons
mentioned in a previous commit; but non-release pkgbase builds may be
just fine with installing pkg from pkg.freebsd.org.

Gate it behind BOOTSTRAP_PKG_FROM_PORTS rather than building form ports
any time we have a ports tree available.

While I'm here, make the pkgbase-repo target in release/Makefile
create the temporary directories we need for building.

Reviewed by:    ivy
MFC after:      6 hours
Sponsored by:   https://www.patreon.com/cperciva
Fixes:  https://cgit.freebsd.org/src/commit/?id=2c06b824436d ("pkgbootstrap: Build pkg if PORTSDIR exists")
e87b75a8bfc8fb7fda8225e55255d9ad99cdefb2 Colin Percival 2025-09-19 16:46:21
release: Allow pkg build on "wrong" major
While we usually build FreeBSD releases on the same major version, we
do need to be able to e.g. build 15 on 16.  Tell the ports tree that
we know what we're doing.  (We don't, not really, but we can at least
pretend...)

MFC after:      6 hours
Sponsored by:   https://www.patreon.com/cperciva
5918b4866a9689b50180da42aad6d742466b0d1b Colin Percival 2025-09-18 23:37:46
release: use sets to select base packages
The introduction of package sets allows us to replace the current
fragile string matching with this simpler and more robust alternative.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 seconds
Reviewed by:    emaste, ivy
Differential Revision:  https://reviews.freebsd.org/D52592
7e79bc8ce70693a892c443c42af5ec16a95ba466 Isaac Freund 2025-09-16 19:38:54
release: More fixes for building pkg package
* Ignore "wrong major" errors when obtaining WRKDIR.
* Put distfiles in /tmp in case /usr/ports is read-only.

MFC after:      6 hours
Sponsored by:   https://www.patreon.com/cperciva
088e21000507510a2c3b1ec22684fe9665f6c8a7 Colin Percival 2025-09-19 08:07:17
pkgbase: Don't include pkg by default
We need to put pkg into the pkgbase repository for release builds, but
not for non-release pkgbase builds.  Gate the contents of package-pkg
behind INCLUDE_PKG_IN_PKGBASE_REPO=YES and set that when building
releases.

Reviewed by:    ivy
MFC after:      6 hours
Sponsored by:   https://www.patreon.com/cperciva
060f7edadcff77cf804b60ecb25f8517c8dca62f Colin Percival 2025-09-19 16:20:37
Commit group #13: release.sh: Bootstrap pkg from the ports tree
release.sh: Bootstrap pkg from the ports tree

When building OCI continers, we create a pkgbase repository; but we
need pkg in order to do this, and it may not be fetchable.  Bootstrap
it from the ports tree instead.

Note that this pkgbase repository is not the same one as we ship as
part of the release build; this duplication of package-creation will
be fixed at a later date.

MFC after:      6 hours
Sponsored by:   https://www.patreon.com/cperciva
08adaf71e2e5a44ea27df0e2b09fbe8279a2523e Colin Percival 2025-09-20 04:20:07

release.sh: Use mkdir -p

Don't fail if directories already exist.

Fixes:  https://cgit.freebsd.org/src/commit/?id=08adaf71e2e5 ("release.sh: Bootstrap pkg from the ports tree")
MFC after:      6 hours
Sponsored by:   https://www.patreon.com/cperciva
f0b1e0470af5c89c1deac5e6788fe7a8d0063a6f Colin Percival 2025-09-20 12:05:48

Internal organizational stuff

committers-src: add myself (jaeyoon@)
Add myself (jaeyoon@) as a new src committer with imp@ as my mentor.

Reviewed by: imp (mentor)
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D52570
380e4a8233c8e17877b0bcdfb8003b3e9638071b Jaeyoon Choi 2025-09-18 14:31:07

Testing

fusefs: fix the last_local_modify LLM/LastLocalModify.lookup/3 test
The LastLocalModify tests were originally written to simulate a race
condition between VOP_SETATTR and VOP_LOOKUP.  They were later extended
to cover some other VOPs that can affect file size, including VOP_WRITE.
However, the test never correctly simulated the race with VOP_WRITE.  So
that test only ever passed by accident.  Fix it by always opening the
file with O_DIRECT.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289237
Reported by:    Siva Mahadevan <me@svmhdvn.name>
MFC after:      1 week
d1eaa52d10f9b85e5f6358e1a280899b9d55dd07 Alan Somers 2025-09-15 00:22:36
stress2: Do not exit the test program without clearing the trace flags
7780766b403dd00b04cc597b44b6358010986616 Peter Holm 2025-09-15 08:48:01
pf tests: test fragment counters
Ensure that the fragmentation counters work as expected.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
5e89648ee68e44d01d00d41d53b6934c604f8c50 Kristof Provost 2025-08-21 08:10:08
pf tests: verify rule numbers in pflog output
Sponsored by: Rubicon Communications, LLC ("Netgate")
d0ea3de0fe71fe67537f84df59da69770784fa9a Kristof Provost 2025-08-21 13:08:05
stress2: Fix how the reproducer is run. Lingering threads seen before
8af56f7e08c54e8a79054fe0bf65eb6e50a09231 Peter Holm 2025-09-16 09:18:20
stress2: Added two new fdescfs test scenarios
da20d88599d52667c9cd422632302cf5e2e19938 Peter Holm 2025-09-16 09:21:04
cp: Drop test helper
Now that stat(1) can report whether a file is sparse, we no longer need
a helper program for our tests.

Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D52482
9b8224b950fb74c8674d257a5a4795baa759c35b Dag-Erling Smørgrav 2025-09-16 13:38:03
pf tests: Add python3 as a dependency
These tests use pft_ping.py, which requires python3 and Scapy.

Reviewed by:    ngie
Approved by:    emaste (mentor)
Fixes:  https://cgit.freebsd.org/src/commit/?id=65c318630123 ("pf: Add prefer-ipv6-nexthop option for route-to pools")
MFC after:      10 days
Differential Revision:  https://reviews.freebsd.org/D52589
dea1dd66905462e3b65688928dc4016eeae4ce80 Jose Luis Duran 2025-09-17 00:26:49
tools/regression/priv: Don't call setgroups() with the effective GID
The 'setgroups(0, NULL);' stance works the same on all versions of
FreeBSD, getting rid of all supplementary groups.  The replaced code
would force the effective GID to also be a supplementary group.

Fixes:          https://cgit.freebsd.org/src/commit/?id=9da2fe96ff2e ("kern: fix setgroups(2) and getgroups(2) to match other platforms")
MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52289
ff7252cdafbd9dab104a5e7b33b8bb84117a8789 Olivier Certner 2025-08-29 17:00:07
stress2: Fix removal of supplementary groups
To this end, call setgroups(0, NULL) instead of passing the effective
GID.  This stance is fully compatible with older versions of FreeBSD.

Fixes:          https://cgit.freebsd.org/src/commit/?id=9da2fe96ff2e ("kern: fix setgroups(2) and getgroups(2) to match other platforms")
MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52290
de4832289625f3c1cea4200d8eb7b4c753b90648 Olivier Certner 2025-08-29 17:01:27
pf tests: declare a table inside an anchor
Sponsored by: Rubicon Communications, LLC ("Netgate")
26c373aa367c71394f0734af368974cafcf878d0 Kristof Provost 2025-08-22 15:34:29
pf tests: test set limit
Verify that 'set limit anchors' now has the expected effect.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
7eb30b26aa12cf1b80b6a784ccbd0b6f648f4529 Kristof Provost 2025-08-25 13:44:11
atf_pytest: fix xfail detection from pytest report
The location of the 'wasxfail' attribute was moved from
the 'reason' attribute back to the parent 'report'. This
fixes an issue where xfails are wrongly reported to ATF
as skipped tests.

Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
Pull-request: https://github.com/freebsd/freebsd-src/pull/1849
Sponsored by: The FreeBSD Foundation
df997faca8411bdf8008c25de5db3ed719019d21 Siva Mahadevan 2025-09-17 20:34:58
stress2: Do not follow symbolic links
6ef1bf8f34605c1ffce1e5643e95213a9943c7df Peter Holm 2025-09-21 09:12:46
stress2: Limit disk usage to avoid a disk full message
b1442e6b8d34971d3311e08dc72cafc6649c27db Peter Holm 2025-09-21 09:14:07

Style, typos, and comments

These could go in other categories, but it's more clear if they're here instead.

fusefs: spaces to tabs. No functional change.
[skip ci]
2918cf3582915bd8853784f53c88e2c34055df1f Alan Somers 2025-09-15 00:31:56
UPDATING: fix typos
Fixed typos in UPDATING

Signed-off-by: Harry Fellowes <harryfellowes1@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1846
e239f49146e0b8a400db5eb014f4a3f706380780 Harry Fellowes 2025-09-14 18:12:33
release: Fix typo in powerpc mkisoimages.sh
"[ n foo ]" is an error and should have been "[ -n foo ]".

Fortunately the only ill effect was to result in garbage in /tmp/ when
creating powerpc ISO images.

Fixes:  https://cgit.freebsd.org/src/commit/?id=6c3e01bf8578 ("release: Randomize powerpc boot block file name")
MFC after:      3 days
Sponsored by:   https://www.patreon.com/cperciva
8c9a919abaa3f6f16a17586ca72bab939788bf69 Colin Percival 2025-09-16 01:09:05
stand/man: Fix mdoc typos for emails, tag spdx
MFC after:    3 days
a37825313f624121c6f07bc03f9cf655c300885b Alexander Ziaee 2025-09-18 17:12:19
pw: Style
No functional change intended.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
42dc71a544a4d78d0068f70b6d4089a8c9e07cb1 Mark Johnston 2025-09-18 22:38:58

Contrib code

zfs: Use the correct type for raidz_outlier_check_interval_ms
raidz_outlier_check_interval_ms has type hrtime_t, which is a long long,
which is 64 bits wide on all supported platforms.
081f0e38e3324dd3ca63a2d5036a15f52e6cf858 Mark Johnston 2025-09-15 14:07:35
Commit group #14: libc++
libc++: avoid use of deprecated builtin

This pulls in LLVM commit accfbd4cb327411ad66c0109ba1841482b871967 to
avoid the use of __libcpp_is_trivially_relocatable.
This fixes building FreeBSD libc++ with clang HEAD as of today.

Original commit message:
[libc++] Replace __is_trivially_relocatable by is_trivially_copyable (#124970)

The __is_trivially_relocatable builtin has semantics that do not
correspond to any current or future notion of trivial relocation.
Furthermore, it currently leads to incorrect optimizations for some
types on supported compilers:
- Clang on Windows where types with non-trivial destructors get
  incorrectly optimized
- AppleClang where types with non-trivial move constructors get
  incorrectly optimized

Until there is an agreed upon and bugfree implementation of what it
means to be trivially relocatable, it is safer to simply use trivially
copyable instead. This doesn't leave a lot of types behind and is
definitely correct.

Reviewed by:    dim
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D52529
d61c75f634cf52fdef9590601d881f85275eee9a Alex Richardson 2025-09-15 22:10:07

libc++: avoid use of deprecated __reference_binds_to_temporary

This was removed in upstream libc++ in commit
437ad06f762ab07d89badecdd20627db200b98d3, but as this does not apply
cleanly to the current repository, I am applying the equivalent change
in a minimally invasive way. This is needed to build with latest clang
HEAD as of today.

Reviewed by:    dim
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D52530
dee76cf2f3dace6290ccab07c2db17355994e70f Alex Richardson 2025-09-15 22:11:39

libc++: Fix deprecation warnings with latest clang

Latest clang has become more strict in diagnosing deprecated decls, so
pull in LLVM commit 9feac2cbd0d80927ce9a8b4c3e810d2b81802d55.

Original commit message:
[libc++] Improve deprecated diagnostic guards.

Recent Clang-21 builds improved the deprecated diagnotics. This
uncovered missing guards in libc++ internally.

Reviewed by:    dim
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D52531
086ce467adec42d58414fdb4d54c2b6819cf0c07 Alex Richardson 2025-09-15 22:13:46

libc++: silence -Wnontrivial-memaccess warning with newer clang

Apply part of LLVM commit 71315698c91d0cda054b903da0594ca6f072c350 to
silence the -Wnontrivial-memaccess warning that is triggered any time
this function is instantiated by user code. This fixes another
buildworld failure with Clang HEAD.

Original commit message:
[clang] Warn about memset/memcpy to NonTriviallyCopyable types (#111434)
This implements a warning that's similar to what GCC does in that
context: both memcpy and memset require their first and second operand
to be trivially copyable, let's warn if that's not the case.

Reviewed by:    emaste, dim
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D52534
34a006eaa39ceb6b0a96fa386c9b9b8a44681979 Alex Richardson 2025-09-15 22:14:18
dtrace: Fix effective GID shown by 'curpsinfo'
Reviewed by:    emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after:      5 days
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52274
e4cc7f9930573daeb7f1056d008e424aa4c3fd33 Olivier Certner 2025-08-28 13:46:18
OpenSSL: update Makefiles to reflect 3.5.1 release
This is a targeted effort to update the INCS and SRCS entries for
libcrypto, the legacy provider, and libssl to match what upstream
(OpenSSL) builds in their respective libraries.

The number of stylistic changes were kept at a minimum.

Another incoming change will reformat this file to make future
maintenance easier.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D52554
d5984d5f29a7c717b88ccd17a85a747792403cdf Enji Cooper 2025-09-08 03:20:42
MFV: libexpat 2.7.2
MFC after:    3 days
627b778d9e6b603a44a010d22d823ca7c392b363 Xin LI 2025-09-19 02:43:17

Reverted commits

Commit & revert pair: acpi: Fix build when `ACPI_DEBUG_OUTPUT` defined
acpi: Fix build when `ACPI_DEBUG_OUTPUT` defined

Reviewed by:    olce
Fixes:          https://cgit.freebsd.org/src/commit/?id=ce5e22b28ef6 ("acpi: Use sleep types defined in sys/power.h")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52545
4894f5ba394306a75dbed9ed4377ab0eae75aede Aymeric Wibo 2025-09-15 09:17:57

Revert "acpi: Fix build when `ACPI_DEBUG_OUTPUT` defined"

This reverts commit 4894f5ba394306a75dbed9ed4377ab0eae75aede.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289634
25cddb1dfec6cfd874961ed08dcc9c76ec533df1 Aymeric Wibo 2025-09-18 09:45:12
Commit & revert pair: jail: Optionally allow audit session state to be configured in a jail
jail: Optionally allow audit session state to be configured in a jail

Currently it is impossible for a privileged, jailed process to set audit
session state.  This can result in suprising audit event misattribution.
For example, suppose a user ssh'es into a jail and restarts a service;
normally, sshd sets audit state such that events generated by the SSH
session are attributed to the newly authenticated user, but in a jail,
the corresponding setaudit(2) call fails, so events are attributed to
the user who had started sshd in the jail (typically the user who had
started the jail itself by some means).

While this behaviour is reasonable, administrators might want to trust
the jailed sshd to reset audit state, such that the authenticated user
appears in audit logs.  Add a jail knob to enable this.  Add a simple
regression test.

Reviewed by:    kevans, jamie
MFC after:      1 week
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D51719
246d7e9fc23928be22db38220f5439f5cdee5264 Mark Johnston 2025-09-15 17:23:50

Revert "jail: Optionally allow audit session state to be configured in a jail"

Changing audit system calls to return EPERM instead of ENOSYS when
invoked from a jail breaks some userspace applications.  Revert for now
until a more complete change is reviewed.

This reverts commit 246d7e9fc23928be22db38220f5439f5cdee5264.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289645
1c3ca0c733a4e4ba550cedfa8019260fb0cf5707 Mark Johnston 2025-09-16 13:43:47
Revert "sys/power: Sleep type reporting by PM backends"
This reverts commit e779891327b1d9b9ab10ba482e59f498790505a7.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289634
87e2b532ec9e9504ac743931ffae528679a1f4c0 Aymeric Wibo 2025-09-18 09:45:27
Revert "acpi: Use sleep types defined in sys/power.h"
This reverts commit ce5e22b28ef6caff3ffd228ac188114b08c0da02.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289634
506b36c4fdde0b402cc730b41a9d9d20130e1bca Aymeric Wibo 2025-09-18 09:45:36
Commit & revert pair: kern/vfs_vnops.c: generalize the lock primitive for file foffset
kern/vfs_vnops.c: generalize the lock primitive for file foffset

Generalize foffset_lock/unlock() by splitting the locking info
file_v_lock/unlock() (LP64 case) or file_v_lock/unlock_mtxp() for ILP32
(using mutex pool) and then taking the action to read the offset.

sys/file.h: rename struct file f_vnread_flags member into generic f_vflags

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D52486
94a0f9f63e164e4f3791bc7d105d6f267b4d47bc Konstantin Belousov 2025-09-10 16:35:01

Revert "kern/vfs_vnops.c: generalize the lock primitive for file foffset"

Temporarily back this out to fix the tree while I try 16.0 snapshot
builds.  It will come back once D52626 lands.

This reverts commit 94a0f9f63e164e4f3791bc7d105d6f267b4d47bc.

Discussed with: kib
1f2a65222b8808dfa0466d6cad165116431dd6a9 Colin Percival 2025-09-19 19:15:31
Commit & revert pair: fcntl(F_SETFL): only allow one thread to perform F_SETFL
fcntl(F_SETFL): only allow one thread to perform F_SETFL

Use f_vflags file locking for this.
Allowing more than one thread handling F_SETFL might cause de-sync
between real driver state and flags.

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D52487
40a42785dbba93cc5196178fc49d340c1a89cabe Konstantin Belousov 2025-09-11 10:05:04

Revert "fcntl(F_SETFL): only allow one thread to perform F_SETFL"

Temporarily back this out to fix the tree while I try 16.0 snapshot
builds.  It will come back once D52626 lands.

This reverts commit 40a42785dbba93cc5196178fc49d340c1a89cabe.

Discussed with: kib
8f268240ee60b55f29910c89f546dbecf412c94c Colin Percival 2025-09-19 19:14:19
Revert "zfs readdir: if there were no dirents to copy out, return EINVAL same as UFS"
This reverts commit 9a3edc8d5dbcb896179cfa7867f961184e146a09.
Apparently returning EINVAL is more aggressive than UFS does it, and
this causes compatibility issues with apps that actually trigger the
behavior.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289485, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289678
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
932e404f12c172e3d4ec47dedee02da400ef8f92 Konstantin Belousov 2025-09-19 17:05:08
Revert "zfsctl_root_readdir: if there were no dirents to copy out, return EINVAL"
This reverts commit cead6157cc1b748df29b32072f492d4f6afae65a.
Same as 9a3edc8d5dbcb896179cfa7867f961184e146a09

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
72924ce99c7f177db486bd2764a76bcf25892a17 Konstantin Belousov 2025-09-19 17:06:54
Revert ".cirrus.yml: Reenable CI with pre-commit CI scripts"
This reverts commit 676d64ee8327851063d92d0dd6a4ceee6b3a25e6.

These tests take a combined 3h to run and are consuming our montly
Cirrus-CI credits in short order, before failing.

In the PR markj reports that the failure appeared somewhere between:

good: da64f6e047b5f6cd9b9e8450d19072cb0b6e44d0
bad:  b197d2abcb6895d78bc9df8404e374397aa44748

Unfortunately, even after we find the offending commit and have a fix we
still do not have sufficient monthly compute credit.  Disable these
tests for now, pending a solution to both issues.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289696
Reviewed by:    ngie
Differential Revision: https://reviews.freebsd.org/D52618
2b8bfdcad1f46076eaf40938634538fbcb13cb1c Ed Maste 2025-09-19 14:09:48

Unclassified commits

Not classified automatically, and waiting for manual attention.

-- no commits in this category this week --

Technical notes

Dates:

Automatic grouping:

Automatic categories:

Source code:


Generated with commits-periodical 0.18 at 2025-11-03 03:26:52+00:00.

This work is supported by Tarsnap Backup Inc.

Alternate version: 2025-09-15 (debug) (contains info about the classification)