FreeBSD git weekly: 2026-04-01 to 2026-06-30

Introduction

This is a display of mostly-automatically-classified git commits from 2026-04-01 to 2026-06-30.

Table of contents and commits per category:

(24) Highlighted commits (these are copies, not in stats)
44 1.9% Userland programs
167 7.1% Documentation
461 19.7% Hardware support
215 9.2% Networking
263 11.3% System administration
93 4.0% Libraries
41 1.8% Filesystems
511 21.9% Kernel
124 5.3% Build system
14 0.6% Internal organizational stuff
101 4.3% Testing
80 3.4% Style, typos, and comments
120 5.1% Contrib code
102 4.4% Reverted commits
0 0.0% Unclassified commits
2336 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.

RELNOTES: Document WITHOUT_BZIP2* removal
2d843b7c9758ad767216c1ae88c49157314857a7 Lexi Winter 2026-04-03 13:53:43
RELNOTES: Make an entry for supporting an NFSv4 root fs
dc752c26b7e5013557dbc141644e4add1015351d Rick Macklem 2026-04-07 19:30:40
MFV: zstd 1.5.7.
MFC after:    2 weeks
Relnotes:       yes
c0d9a07101a1e72769ee0619a583f63a078fb391 Xin LI 2026-04-08 21:22:45
if_geneve: Add Support for Geneve (RFC8926)
geneve creates a generic network virtualization tunnel interface
for Tentant Systems over an L3 (IP/UDP) underlay network that provides
a Layer 2 (ethernet) or Layer 3 service using the geneve protocol.
This implementation is based on RFC8926.

Reviewed by:    glebius, adrian
Discussed with: zlei, kp
Relnotes:       yes
Differential Revision: https://reviews.freebsd.org/D54172
e44d2e941e8ebd74e6a1b1fdbed83fe86671cbc6 Pouria Mousavizadeh Tehrani 2026-04-11 14:12:01
release: remove Oracle Cloud Infrastructure build targets
Oracle's previous support is no longer available to the project.
Repeated attempts to find a sponsor within Oracle's cloud business
have not been successful.

The last published official images are from 15.0-RELEASE.

https://marketplace.oracle.com/app/freebsd-release

Relnotes:       yes
Sponsored by:   SkunkWerks, GmbH
Differential Revision:  https://reviews.freebsd.org/D56360
MFC after:      3 days
3b108068121ba30fb3dbed569d6757da2ab529a4 Dave Cottlehuber 2026-04-12 22:29:44
rc.d/NETWORKING: remove the NETWORK alias
NETWORKING is the documented placeholder, while
/etc/rc.d/NETWORKING still provides the legacy alias
NETWORK.

The NETWORKING script was originally introduced to avoid
conflicts with NetBSD's lowercase network script on
case-insensitive file systems.  The NETWORK alias was
retained for compatibility with older scripts.

Following the discussion in PR 293652, remove the legacy
NETWORK alias from 16-CURRENT.  Keeping both names adds
more confusion than value now that NETWORKING is the
documented placeholder and current base system and ports
tree uses are already clean.

Add an UPDATING entry to note that local RC scripts using
REQUIRE: NETWORK should be migrated to REQUIRE: NETWORKING.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293652
Reviewed by:    michaelo, jlduran
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D56300
47a9af4b39bf174efed7f6d43644d4b0bc0c9886 Aotian Cao 2026-04-08 07:58:00
nd6: Add support for route information (RFC 4191)
Implement RFC 4191 by handling received Router Adverisement (RA)
packets with route information option.
For default routes, use the route information's lifetime and
preference to overwrite the RA's lifetime/preference.
Also install and update more-specific route prefixes with the
option's lifetime and expire them when their lifetime elapses.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263982
Reviewed by:    markj
Tested by:      Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Relnotes:       yes
Differential Revision: https://reviews.freebsd.org/D55449
c8d25804f56ae7c35eaa492b6110807a2675d41a Pouria Mousavizadeh Tehrani 2026-04-16 14:23:49
Merge llvm-project release/21.x llvmorg-21.1.8-0-g2078da43e25a
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/21.x llvmorg-21.1.8-0-g2078da43e25a,
a.k.a. 21.1.8 release.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
7351d001fc7f5a77a18a102e12a3ca2cbfd6988c Dimitry Andric 2026-01-10 15:55:44
Bump __FreeBSD_version for llvm 21.1.8 merge
8f95b8b19088bd8d73f6d14dab7afe848dfc0c35 Dimitry Andric 2026-04-25 12:34:45
groups.7: New manual page of standard group names
Import groups(7) from NetBSD, with tweaks for our system. The group
list is sorted by GID. All the group names from /usr/src/etc/group
are described, except "uucp". The FILES section was added on top of
the original manual page.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264966
Relnotes:               yes
MFC after:              3 days
Obtained from:          NetBSD
Reviewed by:            des, ziaee
Differential Revision:  https://reviews.freebsd.org/D54114
e09104dfb76a36b65a64bd315bd1520941c4beed Artem Bunichev 2026-04-28 13:48:52
RELNOTES: Add an entry for recent improvements to multicast routing
Reviewed by:  kevans
Sponsored by;   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D56710
6c09b7608905af2eaff4b5dfa6cbbd42ce286db6 Mark Johnston 2026-04-29 14:22:41
ports.7/FILES: Expand and refactor into 3 tables
Add make.conf, CHANGES, CONTRIBUTING.Md, UPDATING, and Tools/scripts.
Refactor the FILES section of the ports reference manual into a bigger
table with three sections separated by root directory. Remove preceeding
article from all but "the big Kahuna", and root dirs where reasonable.

MFC after:              3 days
Relnotes:               yes
Reported by:            adamw, arrowd, linimon
Differential Revision:  https://reviews.freebsd.org/D55441
28deec9b7e2b08b00160eb39de84ade6f27eb125 Alexander Ziaee 2026-05-03 17:25:41
bsdinstall: do pkgbase installations with the "script" command
"bsdinstall script" will now do a pkgbase installation by default.  The
system components to install can be specified in the COMPONENTS
variable, and have the same names as those used in the interactive
installer.  bsdinstall will still do a legacy distset installation if
DISTRIBUTIONS is defined in the installerconfig file.

MFC:            1 week
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290375
Sponsored by:   ConnectWise
Reviewed by:    ziaee, ivy, jduran
Differential Revision: https://reviews.freebsd.org/D56717
dc14ae4217a0babb1240f813b642edc2d7b955a6 Alan Somers 2026-04-28 17:27:17
EC2: Don't enable firstboot_pkgs in small flavour
The EC2 "base" flavour installs the devel/py-awscli package at boot
time by default; we don't do this in the "small" flavour, so the
default behaviour was to update the FreeBSD-ports repository and
then do nothing with it.

Turn off firstboot_pkgs by default; if someone is using the "small"
flavour of AMIs and wants to install packages at instance launch
time, they simply need to add 'firstboot_pkgs_enable="YES"' to
/etc/rc.conf (which they must already be editing via user-data, in
order to provide the list of packages they want installed).

Sponsored by:   Amazon
MFC after:      3 days
MFC to:         stable/15
Relnotes:       EC2 "small" images now have firstboot_pkgs_enable="NO".
61df4be487cfbfd27b0959e1eb66ef0d8f84562f Colin Percival 2026-05-16 18:58:13
routing: Add support for metric
In our routing stack implementation, metric is an attribute
of the nexthop, not the route itself.
Store metric in nhop_priv which is control-plane data of
nexthop, filter the nexthops by metric and populate the mpath
slots in nexthop group with only the lowest metric nexthops
for use in the forwarding path.

`cmp_priv()` compares nhops based on priv hash.
Add metric compare logic to it and only return nexthops
with different metrics if the input nexthop's metric is
zero (wildcard).
Also, add support for metric via rtsock by introducing rmx_metric.

Finally, remove the upper 8-bit reservation of weight for
administrative distance.

Reviewed by:    adrian
Discussed with: markj
Relnotes:       yes
Differential Revision: https://reviews.freebsd.org/D56322
c0256b31efcccb6964822b5aadb183e8a6d45507 Pouria Mousavizadeh Tehrani 2026-05-02 20:04:26
MAC/do: Executable paths feature (GSoC 2025's final state)
By design, mac_do(4) only authorizes credentials change requests if they
are issued by a process spawned from '/usr/bin/mdo'.  The executable
paths feature introduces some flexibility by allowing to change that
path, thus allowing another executable to make requests, and to use
multiple such paths (up to 8 in the current implementation).  Its
purpose is to enable thin jails scenarios where mdo(1) may not be at its
canonical path ('/usr/bin/mdo') and to allow experimenting with other
userland programs leveraging setcred(2).

Configuration of executable paths is per-jail and intentionally works
completely similarly with rules.  It is accessible from within a jail
through the 'security.mac.do.exec_paths' sysctl knob and from outside
a jail through the 'mac.do.exec_paths' jail parameter.

This commit groups the verbatim changes of the following commits that
Kushagra Srivastava, our GSoC 2025 student, created in his GitHub
repository (https://github.com/thesynthax/freebsd-src), branch
'task/exec-paths-refactor':

mac_do(4): Complete refactor of allowed executable paths feature
mac_do(4): Fixed changing security.mac.do.* knobs in inheritance mode
mac_do(4): Debugging rules and exec_paths leak on destroy
mac_do(4): Deep copy rules
mac_do(4): Fixed leak
mac_do(4): fixed various bugs, structs inlined, leaks remain
mac_do(4): MAC/do working in jail, leaks decreased
mac_do(4): MAC/do fixed, works in host and jails, leaks removed
mac_do(4): style

Frozen log for these commits:
https://github.com/OlCe2/freebsd-src/compare/main...14fdc49fb29265fac5d0daf95a13d0dce325c951.
The corresponding pull request is at:
https://github.com/OlCe2/freebsd-src/pull/2.

The GSoC's final state of this code still has a number of problems that
are fixed in subsequent commits.  It is however committed separately to
clearly delineate Kushagra's work.

Reviewed by:    olce (amendments to come, see above)
MFC after:      1 month
Relnotes:       yes
Sponsored by:   Google LLC (GSoC 2025)
Sponsored by:   The FreeBSD Foundation (review, commit)
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
9818224174c41a434028446fb6fa5516a6291755 Kushagra Srivastava 2025-08-14 14:41:57
fs/msdosfs: add support for file namws with surrogate pairs
Long file names are using UTF-16 symbols to represent international or
special characters. The implementation in FreeBSD did not support the
"Supplementary Private Use Area-B" (PUA-B), which requires a surrogate
pair to be represented in UTF-16 (Unicode code points beyond U+FFFF).

The PUA-B is used to represent emoji characters, which are supported
in file names on other common operating systems. The motivation for
this change was that removable media written on another system were
only partially readable on FreeBSD, since they contained emojis in
file names.

A test script that verifies correct operations on files names with
emojis has been added to the tools/test/stress2/misc directory under
the name msdos24.sh.

Reported by:    Fabian Keil <fk@fabiankeil.de>
Reviewed by:    ib
Approved by:    mkcusick
MFC after:      1 week
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D57313
f983cb362de77773efba8975eb0f4b247ce5e6f9 Stefan Eßer 2026-06-01 05:50:22
linux: Fix sockopt copyout
The Linux getsockopt did not check the size of the provided buffer when
copying out the value, leading to buffer overflows (e.g., for TCP_INFO).

Fix is to use the smaller of the option value size and the provided
buffer.

MFC after:      1 month
Relnotes:       yes
Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D55881
471fdd91d9156aeab026dc420fb97d97be872d65 Chuck Tuffli 2026-06-08 21:19:34
linux: Add TCP_INFO support
Implement the getsockopt for TCP_INFO by mapping FreeBSD's version to
what Linux expects.

MFC after:      1 month
Relnotes:       yes
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D55882
925ca9b8355d10a0dc85175dc865095c9b3370c4 Chuck Tuffli 2026-06-10 00:22:49
sound: Create all device nodes with GID_AUDIO
Commit 6024e3f99a1e ("Add audio group") introduced GID_AUDIO, initially
for virtual_oss(8) loopback devices. Now make all of them with
GID_AUDIO.

Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Reviewed by:    emaste
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/35
a6aa95eba6ee2dd199d6cb8063dbaccd8a6f7512 Christos Margiolis 2026-05-21 18:03:31
powerpc64le: switch long double to IEEE binary128
Change powerpc64le's long double from 64-bit double to IEEE 754
binary128 (quad, 113-bit mantissa), matching aarch64 and riscv64.

Gated on FreeBSD 16 and powerpc64le only.

Differential Revision: https://reviews.freebsd.org/D57388
Reviewed by:    adrian
Relnotes:       yes
255538cd906045095d0c2113ae6c4731ce36c0cf Piotr Kubaj 2026-06-15 15:37:26
Source upgrade doc: etcupdate no longer needs -B
Note: We confusingly have the instructions to build the system in the
build manual, the UPDATING file, and the Makefile. These will get out
of sync and will be harmful when they do.

Fixes:  https://cgit.freebsd.org/src/commit/?id=ddf6fad0295a ("etcupdate: Make nobuild the default")
Reviewed by:            jhb
Differential Revision:  https://reviews.freebsd.org/D57644
704db3fe9840ee3e51b080b7c35defd1a74c0c2d Alexander Ziaee 2026-06-21 17:54:12
hwpstate_intel: Use 8bit scale instead of percentage scale
Reviewed by:    olce
Relnotes:       yes
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55629
8452afeb5682052b2533363ee3351d6d0e183e60 ShengYi Hung 2026-02-26 06:26:06
rc.firewall: Support on-disk lists
For firewall_allowservices and firewall_trusted, if an element of the
list looks like an absolute path, read the file, skipping comments and
blank lines, and treat the first word on each line as an address or
subnet to be added to the list.

We should probably be using tables instead, but this is still an
improvement over the status quo ante.

MFC after:      1 week
Relnotes:       yes
Reviewed by:    allanjude
Differential Revision:  https://reviews.freebsd.org/D57679
a71abf38e2b46c02965f3224c62bb6ef1971996e Dag-Erling Smørgrav 2026-06-26 14:38:53

Userland programs

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

truss: add support for decoding Netlink messages
Netlink usage is growing in FreeBSD. This patch adds support to
`truss(1)` to decode Netlink headers in sendmsg/recvmsg calls, making
debugging network configuration tools significantly easier.

Changes:

libsysdecode: Add `sysdecode_netlink()` to parse struct `nlmsghdr`.
truss: Detect `AF_NETLINK` sockets and decode the message payload.

Reviewed by:    kp
Signed-off-by:  Ishan Agrawal <iagrawal9990@gmail.com>
Github PR:      https://github.com/freebsd/freebsd-src/pull/1950
8ef0093f297af7c917037f058af9813105e67662 Ishan Agrawal 2026-01-06 12:05:59
find: add -xattr and -xttrname
We use -xattr in our openrsync tests for convenience, and it seems like
a good addition to FreeBSD.  -xattr and -xattrname will both consult all
available namespaces by default, but -xattrname allows filtering by
namespace using a "user:" or "system:" prefix.

Inspired by:    https://github.com/apple-oss-distributions/shell_cmds
Reviewed by:    kib, rmacklem
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55286
22fba3a9d64140d80a9e2093cfc02c9c503b2e19 Kyle Evans 2026-04-09 02:41:12
sh: Increase default history size to POSIX mandated minimum of 128
The default history size in bin/sh is currently 100 however POSIX.1-2024
mandates that a default greater than or equal to 128 shall be used,
therefore this increases the default history size in /bin/sh to 128.

POSIX standards reference:
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/sh.html#tag_20_110_08

MFC after:      3 days
Reviewed by:    emaste, jilles, jlduran, ziaee
Signed-off-by:  Kristofer Peterson <kris@tranception.com>
Closes:         https://github.com/freebsd/freebsd-src/pull/2093
81b2055c49dec8884d7bb23503f1dfeac37ac95d Kristofer Peterson 2026-03-24 14:56:48
du: Complete libxo transition
* Use xo_warn() / xo_err() instead of warn() / err().

* Add a test case for the POSIX-mandated stdout error check.

* While here, don't assume the size of off_t, address some style issues,
  and broaden the use of bool instead of int.

* Reorder SEE ALSO section.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    allanjude
Differential Revision:  https://reviews.freebsd.org/D56402
6c18dd3eb42b50fddb6d9605ddde1362ae9c504a Dag-Erling Smørgrav 2026-04-15 14:12:30
mkimg: Fix parsing of filenames containing colons
When using PART_KIND_FILE (-p type:=filename), mkimg uses a colon
to separate an optional offset (e.g., filename:offset).

strsep() was being used to split the string at the first colon.
This caused failures when the filename itself contained a colon
(e.g., "th:is").

This patch uses stat() to check if the entire string exists as a
file. If so, use it directly without splitting.

If the full string is not a valid file, fall back to splitting
at the right-most colon using strrchr().

Uses errc() to fail and exit immediately when an existing directory
is input instead of a file in PART_KIND_FILE mode.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257960
Signed-off-by: Aaditya Singh <aadityavksingh@gmail.com>
Reviewed by: jlduran
Pull Request: https://github.com/freebsd/freebsd-src/pull/2041
50c1240ebfaf920ad12f05eb16d00f8b5b9d72e0 Aaditya Singh 2026-02-21 18:13:54
yacc: Fix SYSTEM_NAME
This usually gets bumped by re@ when the version number changes in
sys/conf/newvers.sh, but apparently we forgot for the past two major
versions.
6a3e2223ff35781fb837862f7cf7aaaa991968d9 Colin Percival 2026-04-16 20:33:58
caesar: Add SPDX-License-Identifier tags
Reviewed by:  imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55461
3cc113c94fb9635ba9f11f5dd797530b9231ca58 Tuukka Pasanen 2026-04-21 14:43:35
kdump: tweaks for the extended errors decoding
Format the message.
Convert category to the source name if known.

Still print the raw value for the category, and the values of the
EXTERROR() optional arguments.

Requested and reviewed by:      mckusick
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56542
5c89d661a023c83a2001cf5b354b09c7d3ac91d8 Konstantin Belousov 2026-04-21 06:13:04
termcap: fix screen entry standout mode (so/se) capabilities
so=\E[3m (italic) is incorrect, should be so=\E[7m (reverse video).
se=\E[23m (italic off) is incorrect, should be se=\E[27m (reverse off).

mr=\E[7m (reverse video) is correctly defined in the same entry.
screen-256color inherits from screen via tc=screen and is fixed
transitively.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294499
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2139
MFC after:      1 week

Signed-off-by: Dan Mahoney <freebsd@gushi.org>
2bff747bb04db6beb19678abc45edd96be0a1347 Dan Mahoney 2026-04-14 03:53:51
kdump(1): add sys/ prefix for exterror source file name
This makes it consistent with libc formatting.

Requested by:   mckusick
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
4d062dbc20dce5a94da8dca1253ac9337b951c51 Konstantin Belousov 2026-04-22 07:35:06
Commit group #0: ident: Clean up
ident: Clean up

* Use libcasper instead of reinventing it.

* Add long option support.

* Drop pointless use of temporary locales.

* Consistently check for stdio errors.

* Clean up the code.

* Clean up and expand the tests.

MFC after:      1 week
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D56505
394f6b1b0a658755a9420906fb7a459c3d9501a5 Dag-Erling Smørgrav 2026-04-22 08:19:35

ident: Fix typo in manual page

Fixes:          https://cgit.freebsd.org/src/commit/?id=394f6b1b0a65 ("ident: Clean up")
3e6a26df1fb7e0508e1f81f826f8945b15a8bb48 Dag-Erling Smørgrav 2026-04-25 18:06:19
printenv: Clean up
* Error out if more than one argument is given.

* Check for stdio errors.

* Clean up the code.

* Clean up and expand the tests.

MFC after:      1 week
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D56506
abdf2a711cabebc107a04fd286e441e2030827f0 Dag-Erling Smørgrav 2026-04-22 08:19:39
freebsd-version(1): Disable pathname expansion in -j option
Set the -f flag to sh(1) to disable pathname expansion.
Also, quote the jail variable to ensure correct behavior when passed
to jexec(8).

Signed-off-by:  Nami Arjmandi <namiarjmandi@gmail.com>
Reviewed by:    pouria
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2158
f3bd86ba18512aca7099af2d2d49da5e46708d17 Nami Arjmandi 2026-04-22 16:23:22
sh: Allow vfork on redirected simple commands
Things like `{ some_program; } >/dev/null` use vfork, so use vfork
similarly for things like `some_program >/dev/null`.

This cannot be done for command substitutions, because of two problems:

* Redirections might cause the error message for later redirections or
  for an unknown command to be sent to the pipe (to be substituted), and
  this might cause a deadlock if the message is too long.

* The assignment of the pipe needs to come before instead of after the
  redirections.

Reviewed by:    bdrewery
Differential Revision:  https://reviews.freebsd.org/D55190
7262e60119b8840ee400d281421b8e65d8af9d84 Jilles Tjoelker 2026-04-25 13:03:29
tail(1): Fix -r (reverse) to work on pseudo filesystems
Pseudo filesystems (e.g., procfs) advertise a zero file size.
Fix reverse() to handle such a case similarly as forward() so
that '-r' works on pseudo filesystems.

Signed-off-by:  Aaron LI <aly@aaronly.me>
Reviewed by:    pouria, Ricardo Branco <rbranco@suse.de>, des
Fixes:          https://cgit.freebsd.org/src/commit/?id=1fb3caee7 ("tail: Do not trust st_size if it equals zero.")
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2080
4feeca3193c316c18472cd40f215446fda3bd739 Aaron LI 2026-03-17 04:53:49
bin/sh: make it possible to use as interactive init
If the /sbin/init binary is broken somehow, the way out is to set the
loader environment variable init_path to something else.  The most
natural choice would be either /bin/sh or /rescue/sh.  Unfortunately,
this does not work because the init process starts withoud stdin/out
descriptors.

Make it nicer to users by teaching /bin/sh startup code to open standard
descriptors on /dev/console if the shell is run as init.

Reviewed by:    imp, jilles, zlei
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56536
d7338bb4914d120e5719d3216b23a509c49ed3be Konstantin Belousov 2026-04-20 18:03:39
Commit group #1: stat: fix use of devname(3)
stat: fix use of devname(3)

Besides being a little hard to parse through visually, this had its own
bug of inspecting st->st_mode to determine what to pass to devname(3),
which is only correct for st_rdev.

For st_dev, you're likely to be looking at files or directories and
attempting to assess what device they're located on, so the mode is
meaningless- we just have to assume that our filesystems are on
character devices and attempt to resolve st_dev as such.

Reviewed by:    des, kib (previous version)
Differential Revision:  https://reviews.freebsd.org/D56565
4d4acdbfc22c84081037f31cff4fb03d18373036 Kyle Evans 2026-05-01 03:00:26

stat: The devname test case requires root

Fixes:          https://cgit.freebsd.org/src/commit/?id=4d4acdbfc22c ("stat: fix use of devname(3)")
72b1aae09bf0bcc01c76df757699e27ad7cf7ecc Dag-Erling Smørgrav 2026-05-02 17:28:50
stat: Drop unused code and conditionals
We haven't pulled from upstream in over 15 years, and the codebases
have diverged so far it is unlikely that we ever will.

* Drop NetBSD and OpenBSD version control information.

* Drop support for building on non-BSD / non-POSIX platforms.

* Fix a few minor style issues.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56771
0095c1425633cb6a40fd86fc870ac5945363df2f Dag-Erling Smørgrav 2026-05-03 15:35:06
lockf: Avoid spinning when operating on an fd
When operating on a file descriptor, acquire_lock() would ignore the
flags argument and always operate in non-blocking mode, resulting in
unnecessary busy-looping.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294832
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56722
d90513ea85693da0ca5955173609f4e81e38ae16 Christian Ullrich 2026-05-03 15:35:10
mdo: Avoid relying on header pollution
The uses of PAGE_SIZE and roundup2() require param.h.

MFC after:      1 week
35a36d4a54df244e93bf280345426a600e394a90 Mark Johnston 2026-05-12 17:46:17
find: Include signal.h to get a definition for sig_atomic_t
MFC after:    1 week
5615db1007bdc935ac6592a66721320ccd8335ce Mark Johnston 2026-05-12 17:46:29
elfdump: Decode SHT_LLVM_ADDRSIG section header type
Reported by:  bz
Sponsored by:   The FreeBSD Foundation
3c07cfb25283d93f03cdac51158289853d0e17a8 Ed Maste 2026-05-18 15:43:41
Commit group #2: tftp
tftp: Simplify URI handling

* No need to copy our argument into a new buffer; it is writeable and
  will not be reused after we return.

* Instead of constructing the string "get path" and then splitting it
  into an argument vector, just construct the vector directly.  This
  avoid potentially overrunning the buffer.

* Call settftpmode() just once, with either the default mode or the
  user-provided value we already validated.

* Use errx() instead of fprintf(stderr) + exit().

Reported by:    Moyao, Minghao Fu
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57070
a4b17594181502cea38ab0d8b2a9a10782286334 Dag-Erling Smørgrav 2026-05-22 17:57:08

tftp: Close files when we're done with them

Also, delete the file we created if receiving it failed.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57071
29351335704e39ce3ca09c528d534c7898bbdc2c Dag-Erling Smørgrav 2026-05-22 17:57:12

tftp: Fix handling of port name or number

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57105
47e4571df15804fe2b010a3c82b22691d80ee680 Dag-Erling Smørgrav 2026-05-22 17:57:16

tftp: Replace fgets with getline

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57072
5fd928cf1cef21e0fc20ab7c2be156a0eeecdf40 Dag-Erling Smørgrav 2026-05-22 17:57:20
bin/sh: Fix history long line truncation/corruption
When reading from standard input with editline history enabled, increase
buffer size to accomodate long lines so that history is recorded
correctly. Cleanup el_gets() handling avoiding potentially dangerous
retention of pointers to editline buffers across calls.  Ensure struct
parsefile objects are properly zero initialised when created. Remove
push argument from setinputstring() and simplify logic as it was always
called with a value of one and as was written was potentially dangerous
if ever called with a value of zero.

This commit does not fix long lines when history is enabled but editing
is not (e.g. if there is no terminal).

MFC after:      3 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2028
Signed-off-by: Kristofer Peterson <kris@tranception.com>
95e4fce8f0c4fc6bf828288b1d63faf0f1300198 Kristofer Peterson 2026-02-16 15:53:47
vtfontcvt: Return error from write_fnt_source
Previously write_fnt_source always returned 0, silently discarding
errors.  Return rv so that errors set vtfontcvt's shell exit
appropriately.

Sponsored by: The FreeBSD Foundation
f05fb5157ba1291ee5019bacece8d1e98ea95b35 Ed Maste 2026-05-22 18:37:51
limits: Improve consistency
Historical precedent seems pretty consistent: size limits have singular
names, number limits have plural names.  RLIMIT_VMM broke this, and I
made matters worse by referring to this limit as “vmms” in limits(1).
Consistently use “vms” everywhere user-visible, while leaving the
question of whether or not to rename RLIMIT_VMM itself for another day.

Fixes:          https://cgit.freebsd.org/src/commit/?id=1092ec8b3375 ("kern: Introduce RLIMIT_VMM")
Fixes:          https://cgit.freebsd.org/src/commit/?id=53af2026f213 ("limits: Unbreak after RLIMIT_VMM addition")
Reviewed by:    bnovkov
Differential Revision:  https://reviews.freebsd.org/D57265
f2a89e7e1d87c5a3aaa243aff3f6086e7312ecf5 Dag-Erling Smørgrav 2026-05-27 17:02:07
cap_mkdb: Fix memory leak
This is not a big deal since it only iterates once before exiting, but
that's no reason to set a bad example.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195128
MFC after:      1 week
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D57251
6880405bf97df03ffce227d34c2faa99b602a49d Dag-Erling Smørgrav 2026-05-27 17:02:12
install: add -z <max_cmp_size> option
Introduces the -z <max_cmp_size> flag, enabling users to set a custom file
size limit for pre-installation change checks and avoiding future hard-coded
limit modifications.

Reviewed by:    glebius
Approved by:    glebius (mentor)
Obtained from:  Fudo Security
MFC after:      2 weeks
Sponsored by:   Fudo Security
Differential Revision:  https://reviews.freebsd.org/D57230
97cad013a50a4012328e11424ed2350c1efc036c Aleksandr Rybalko 2026-05-25 07:53:20
install: Bump compare size limit (128MB) to support large binaries
Preserve metadata and prevent redundant disk writes during builds with
the install's -C (compare) flag.

The previous historical comparison limit of 16MB is insufficient for
modern toolchains, frequently choked or bypassed by a large base
components like LLVM/Clang, kernels, Rust apps, and large runtime
libraries.

By leaving matching files alone, install keeps their modification timestamps
intact. make(1) safely ignores those files on subsequent runs.

Base examples: 15.0 amd64 GENERIC kernel - 28MB, clang - 105MB, lldb - 97MB, etc.

Reviewed by:    glebius
Approved by:    glebius (mentor)
Obtained from:  Fudo Security
MFC after:      2 weeks
Sponsored by:   Fudo Security
Differential Revision:  https://reviews.freebsd.org/D57271
5a8e0e03ae86b449f29626b4f9db25d17c89b273 Aleksandr Rybalko 2026-05-27 12:07:47
sh: Fix pipebuf limit
Since the factor is not 1, we need to provide a unit.

MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=5d92f20c7d31 ("bin/sh: support RLIMIT_PIPEBUF")
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57352
dfd2273d27627313f944650840381e878077e825 Dag-Erling Smørgrav 2026-06-01 08:51:24
xinstall: Do not allow -l and -s together
Cannot strip the target if creating a link.

Reviewed by:    des
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57398
521afce6a859c1d7ac9674e8f21ff45418becaf5 Ed Maste 2026-06-03 01:27:54
diff: Correct fd 0 case on pipe
After git commit c8d40bf8ecc60cc15e3904410db62065ea681fdc, if fd 0 was
not open, it is left with CLOEXEC set and therefore fails. This is an
unlikely situation, but fixing it reduces the size of the code (by using
posix_spawn_file_actions_adddup2's special case if the two file
descriptor numbers are the same).

At the same time, check the error code from
posix_spawn_file_actions_adddup2.

Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D56910
8bf4902569869133affd91bdcb71b74656cfc36e Jilles Tjoelker 2026-06-03 20:42:01
limits: Fix pipebuf resource type
* pipebuf is a size but is listed as a count

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295623
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=f54f41403d14 ("usr.bin/limits: support RLIMIT_PIPEBUF")
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57456
ad524568f9fb77e270a22744d81b9cea0a2ab0eb Dag-Erling Smørgrav 2026-06-04 22:41:41
procstat binary: do not skip pid if either path or osrel sysctls failed
PR:   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295893
Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57493
9f378397ee89044a4faec522916b50f0a164d62e Konstantin Belousov 2026-06-07 07:28:29
install: drop obsolete file size limit for -C
Removes the file size limit for -C comparisons. The limit was
meant to prevent oversized mmap allocations, which is no longer
relevant as mmap is no longer used here (removed by
a0439a1b820fa0e742c00d095f5f5c06f5f19432, review D44809).
Credit to bdrewery.
See: https://reviews.freebsd.org/D57230

Reviewed by:    bdrewery, glebius, ziaee
Approved by:    glebius (mentor)
Obtained from:  Fudo Security
MFC after:      2 weeks
Sponsored by:   Fudo Security
Differential Revision:  https://reviews.freebsd.org/D57503
9d10b4d2c9e86d8f6ff1b654f468381a4a4cad6d Aleksandr Rybalko 2026-06-08 14:32:05
grep: periodic timer-based fflush instead of unconditional per-line flush
Replace the unconditional fflush(stdout) in grep_printline and
procmatches with a periodic timer that flushes at most once every
100ms.  This preserves interactive responsiveness (grep | tee,
grep | tail -f) while avoiding 1M+ write(2) syscalls when
processing large inputs.

The flush interval is tracked via clock_gettime(CLOCK_MONOTONIC)
and a static timespec.  --line-buffered continues to flush
immediately via setlinebuf(3), as before.

Benchmark on 1M lines (37MB output to file):
  unconditional fflush:  1.90s  (sys 1.22s)
  periodic 100ms timer:   0.49s  (sys 0.007s)

Reviewed by:            kevans
Differential Revision:  https://reviews.freebsd.org/D57528
ffe47c424e0a45f5d8d20a5944477821bd946eef Baptiste Daroussin 2026-06-12 12:13:35
grep(1): optimize -w/--word-regexp word boundary check
The -w option checks word boundaries before and after each potential
match by decoding the adjacent character.  This was done via the
heavyweight sscanf(3) with "%lc", which goes through the full scanf
parser and locale-aware mbrtowc(3) machinery even for simple ASCII.

Replace with a three-tier fast path:

1. ASCII bytes (< 0x80): simple isalnum(3) / '_' comparison
2. UTF-8 continuation bytes (0x80-0xBF): interior bytes of a multi-byte
   character are always word characters -> no further decoding needed
3. Multi-byte start bytes (>= 0xC0): decode with mbrtowc(3) directly
   instead of sscanf(3)/%lc, avoiding scanf parser overhead

Benchmark with ministat(1) (10 runs each):

Worst-case ASCII (100k lines of 100 'a' chars, -w 'a'):
    Difference at 95.0% confidence: -15.3% +/- 3.1%

Worst-case Unicode (50k lines of 100 accented 'e', -w 'e'):
    Difference at 95.0% confidence: -11.2% +/- 4.7%

Normal -w (500k lines, -w 'the'):
    Difference at 95.0% confidence: -18.1% +/- 3.6%

French text (100k lines, -w accented 'ete'):
    Difference at 95.0% confidence: -18.0% +/- 4.1%

Non -w case shows no regression.

Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57587
a74c77cc7bed8dba50e976a7be2aa0094ee27b61 Baptiste Daroussin 2026-06-10 14:41:39
install: Explicitly include sys/param.h for MAXPATHLEN
MFC after:    1 week
Sponsored by:   The FreeBSD Foundation
ca89b0fa1a93744a5bbf7a5c949826bbee4e2559 Mark Johnston 2026-06-22 20:19:29
truss: add AF_NETLINK syscall argument decoding support
Track AF_NETLINK socket file descriptors in procinfo using fd_domain
entries and use them to detect Netlink traffic across later syscalls.

Add Netlink payload decoding support for sendto(), recvfrom(), and
sendmsg() paths by integrating sysdecode_netlink() into BinString and
Msghdr argument handling, with fallback to existing binary/iovec
printing when decoding fails.

Reviewed by:    kp
Signed-off-by:  Ishan Agrawal <iagrawal9990@gmail.com>
Sponsored by:   Google LLC (GSoC 2026)
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2295
6c744621c72062edf176ecf28b92ad10e8264454 Ishan Agrawal 2026-06-24 05:20:15

Documentation

Man pages, release notes, etc.

Commit group #3: procctl.2: Align list indentation
procctl.2: Align list indentation

Remove 81 lines of whitespace at default manual rendering width.

MFC after: 3 days
db9bbe131c92f55e6cf03657dc030c9eea93a9fb Alexander Ziaee 2026-04-02 03:07:28

982b3c5565ff72a584833b5dfe5e6f732fd70914 Konstantin Belousov 2026-04-04 06:30:30
posix_spawn.3: fix formatting of xref
Sponsored by: The FreeBSD Foundation
MFC after:      3 days
59e9a4c05a81a25aaf355cb18c24835abad96ff2 Konstantin Belousov 2026-04-02 07:42:16
src.conf.5: Regen after MK_CROSS_COMPILER=no change
8f34b6b84c958f24a2f717b13876d57cdac07fd9 Ed Maste 2026-04-01 19:19:31
mq_open(2): document sysctl limit EINVAL and ENFILE conditions
Document two missing error conditions for mq_open(2):

- EINVAL: returned when mq_maxmsg exceeds kern.mqueue.maxmsg or
  mq_msgsize exceeds kern.mqueue.maxmsgsize.
- ENFILE: add kern.mqueue.maxmq sysctl name to the existing entry.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243209
Reviewed by:    mhorne
MFC after:      1 week
Signed-off-by:  Kit Dallege <xaum.io@gmail.com>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2098
3e9f4fd6fc50300d052d5619d82a14d3488483d5 Kit Dallege 2026-04-02 17:37:49
posix_spawn_file_action_addopen.3: ignoring close failure is now approved
Reviewed by:  dim
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D56222
b7b485efac8c1b601b9c0ada39921bad0e342970 Konstantin Belousov 2026-04-02 08:06:52
RELNOTES: Document WITHOUT_BZIP2* removal
2d843b7c9758ad767216c1ae88c49157314857a7 Lexi Winter 2026-04-03 13:53:43
fmax.3: Add caveat for going beyond C std requirements
libm's fmax and fmin family of functions treat +0.0 as greater than
-0.0.  This is not required by the C standard, so the user may not see
this behaviour due to compiler optimization.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294214
Reviewed by:    fuz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56230
7764e9ca28a9702aed4ba7391e055ec2fcf35c41 Ed Maste 2026-04-02 21:59:42
RELNOTES: Make an entry for supporting an NFSv4 root fs
dc752c26b7e5013557dbc141644e4add1015351d Rick Macklem 2026-04-07 19:30:40
RELNOTES: Update the entry for commit 8b9775912cbc
cc2f8f3786d6e0ef01e2b2feadb804c1f86716da Rick Macklem 2026-04-07 20:04:36
lockf.1: Organize and provide error numbers
Add error numbers to the exit codes so that readers can decode them
without having to use a separate utility. Organize exits by error code.
Mark up the error constants with the error constant macro, even though
this is really not very helpful because people will search for the error
code, the macro is explicitly for the constants and not the codes.

While where, align and alphabetize the options list as well, fix
misaligned padding in an example, and a one-sentance-per-line error.

MFC after:              3 days
Reported by:            Antranig Vartanian <antranigv@freebsd.am>
Differential Revision:  https://reviews.freebsd.org/D48470
dd201e407e48ba59bdfa1f71d41acfdac1a9c562 Alexander Ziaee 2026-04-08 20:08:43
RELNOTES: catchup on changes I have made
5dc4da1a408b2219b622c498d53c58580e58132d Baptiste Daroussin 2026-04-09 06:44:08
arcmsr.4: Improve HARDWARE introductory sentence
MFC after:    3 days
ff32dbb1d14f05bf77e356ae68c82c048c88888f Alexander Ziaee 2026-04-10 15:26:29
msun/math.3: reference new functions f{max,min}imum{,_num,_mag}()
See also:     D55834, D56236
MFC after:      1 month
47ca491ca425d0d3d8e2a8a3cac40d6565d8ab6a Robert Clausecker 2026-03-31 16:55:11
nfsv4.4: Document setup of a NFSv4 root fs
Commit 8b9775912cbc added support for an NFSv4 mounted
root file system.  This patch documents how to set this
up.  It also includes some minor updates and fixes
some formatting.

This is a content change.

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56317
Fixes:  https://cgit.freebsd.org/src/commit/?id=8b9775912cbc ("nfs_diskless: Add support for an NFSv4 root fs")
6698596cd2abd9eae3ac02efe1c257766da5d24a Rick Macklem 2026-04-11 19:36:56
fork.2: note that all methods to pre-resolve symbols have consequences
Reviewed by:  imp
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56362
660498986a8e56025d9d2f9c6a0813c09a27ba8e Konstantin Belousov 2026-04-12 09:16:13
ifconfig.8: Add geneve(4) parameters
Add geneve parameters to ifconfig manual.

Reviewed by:    ziaee
Differential Revision: https://reviews.freebsd.org/D55181
b0ef03f0c4bc2a7715e4b8ea4ead8dd73dffdd95 Pouria Mousavizadeh Tehrani 2026-04-13 12:38:53
timeout.1: Document non-POSIX options
MFC after:            3 days
Reviewed by:            Aaron Li <aly@aaronly.me>, ziaee
Differential Revision:  https://reviews.freebsd.org/D56090
b1bc748430b5ee79ae103c464dbf5ebc8802f782 Artem Bunichev 2026-04-13 01:15:41
ciss.4: List all devices supported by ciss(4)
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285744
Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56285
54f5d20492d231b5c2ddc6f1d94dbffa1707d820 Michael Osipov 2026-04-06 18:21:48
libthr.3: describe what we mean by C runtime environment.
Reviewed by:  emaste
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D56384
fa912e3b9b5c074793bb1899f8256ea4baf72631 Konstantin Belousov 2026-04-14 00:10:49
libthr.3: describe SIGTHR
Explain how SIGTHR is used and that it should be not touched by user
code.  Note about SIGLIBRT.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D56384
934a35ac2bbbcf8cd65d8824fa824eb5c6170c88 Konstantin Belousov 2026-04-13 23:42:51
Bourne shell -> POSIX shell
The FreeBSD shell is a POSIX compatible shell. It evolved over several
decades from the Almquist shell, which was preceeded a decade before
that by the Bourne shell. Most readers today have never seen a Bourne
shell. If someone wants to learn to use our shell, they need to look for
tutorials on the POSIX shell. Align descriptions through out the tree
with this reality, consistent with it's manual and common parlance.

We made a similar change to the doc tree in b4d6eb01540fe.

MFC after:              3 days
Reviewed by:            carlavilla
Differential Revision:  https://reviews.freebsd.org/D56382
dc140a9fc151f3717bce2157f49070daafa13ec0 Alexander Ziaee 2026-04-14 13:02:53
freebsd-base.7: Break examples into subsections
Break the examples into subsections, so that we can have multi-step
examples.

MFC after:              3 days (to 15 only)
Discussed with:         ivy
Differential Revision:  https://reviews.freebsd.org/D55526
5f922bd20d81af4b5759b8f104d5c22ee3e5cd1b Alexander Ziaee 2026-04-14 13:20:38
freebsd-base.7: Add an example for unregistering
MFC after:            3 days
Reviewed by:            ivy, emaste
Discussed with:         bapt, des, emaste, ivy, phk, pi
Differential Revision:  https://reviews.freebsd.org/D55458
998d501ae61a3e3c800e6d102d8ab5253c7c1b91 Alexander Ziaee 2026-04-14 13:21:50
sockstat: Unbreak SEE ALSO section
MFC after:    1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=7b35b4d19630 ("sockstat: add libxo support")
a6bd704850a615ae81076855a2083c7ab6481df1 Dag-Erling Smørgrav 2026-04-15 09:36:40
sysctl.3: Correct kern and kern.proc type descriptions
Fix several incorrect sysctl.3 type and mutability descriptions so the
manpage matches the actual kern and kern.proc interfaces.

Signed-off-by: Tyler Waddell <tyler.waddell112@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2128
32cc01e75aabc117c2c19c25291aa25eb1ec3cef brothersw 2026-04-07 18:45:08
newsyslog.conf(5): use "rotated" instead of "trimmed"
The man page used "trimmed" to describe log rotation, which is
misleading as it suggests the file is truncated to a specific
size rather than being rotated (renamed and a new file created).
Replace all instances of "trimmed" with "rotated" to match the
actual behavior and the terminology used elsewhere in the page.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278671
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp,ziaee
Pull Request: https://github.com/freebsd/freebsd-src/pull/2099
e0b22342f52b22b1762b09ab16bbc520cf0f2882 Kit Dallege 2026-03-27 04:25:35
rc.conf.5: Document virtual_oss(8)
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56225
a3094f522fec70f9e5cf3f12dc6e7a9b5f706459 Christos Margiolis 2026-04-16 14:51:06
pkru.3: Remove a qualifier
Now that i386 kernels are deprecated, we don't really need to mention
this limitation.  It's also a bit dated since PKRU is supported with
5-level paging as well.

Reviewed by:    alc, kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56415
fe6bf738aaeb3d5fd74aabfcbf01eba827df6594 Mark Johnston 2026-04-16 17:46:05
pkru.3: Note that the kernel may not respect PKRU protections
There are cases where the kernel will be able to access memory covered
by a PKRU key which nomially prohibits accesses.  I believe regular
copyin()/copyout() are subject to the contents of PKRU, but memory
accesses via uiomove_fromphys() will not be.  This can arise when
performing fault I/O, for instance.  I didn't test, but I suspect AIO is
another case.

Update the man page to acknowledge this.

Reviewed by:    alc, kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56416
fa77fecb0e06ec697e3d7a9ed899e568f1d2090c Mark Johnston 2026-04-16 17:46:11
ntp_adjtime.2: Increase visibility
+ s/ntp/ntpd/ for correctness + apropos results in document description
+ silence a linter warning by escaping a period with a zero-width space

MFC after:      3 days
b49b3ccd40bda02f530c679f23f42ba9e0e4b2e2 Alexander Ziaee 2026-04-17 00:30:38
ippool(5): Correct example in man page
The example provided puts the semicolon in the wrong place. It must
come after the file:// specification, not in it.

MFC after:      1 week
f5d0b30e4af1163bdc18a893b17236517b67790a Cy Schubert 2026-04-17 04:05:59
virtual_oss.8: Remove CPU performance example
See also:     https://github.com/freebsd/virtual_oss/issues/2
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
788d71e73f1b4fdac572dae72d3eac5cfb0f9f18 Christos Margiolis 2026-04-17 20:47:16
README: Update and harmonize
MFC after:    1 week
Reviewed by:    imp, markj, jhb
Differential Revision:  https://reviews.freebsd.org/D56499
480ba21efdc7df5d972083e64c88c39357877c0b Dag-Erling Smørgrav 2026-04-18 14:12:32
Doxygen subsystem config: exclude the content of the .git directory
315f665fe1ac97ea2ca946e51ced24f7b21fb22e Alexander Leidinger 2026-04-19 12:46:35
pdfork.2: correct pdrfork's HISTORY section
Since pdrfork will be included in FreeBSD 15.1

Reviewed by:    kib
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D56513
9d39213d222395eb40323102db018cbedf773ddf Alan Somers 2026-04-19 15:26:50
pfctl: clarify usage of load option flags
`pfctl -A`, `-N`, `-O`, and `-R` restrict which rule types and options
are loaded. The man page language ("Load only...") does not make it
clear that these options can be combined to (re)load multiple rule types
and/or options without reloading the entire packet filter.

Add language to make it explicitly clear that these flags combine.

Reviewed by:    kp
Signed-off-by:  Ross Williams <ross@ross-williams.net>
19eecf94fa16aac6f90a4610d2f342f70060674a Ross Williams 2026-04-17 15:19:23
membarrier.2: document MEMBARRIER_CMD_GET_REGISTRATIONS
Reviewed by:  markj, Ricardo Branco <rbranco@suse.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56507
324b3c2892a53e5fd9b1d8795a31a59ee835c5de Konstantin Belousov 2026-04-18 18:47:02
geom manuals: Clarify units
The gpart manual says that sizes are specified in blocks, unless an SI
unit suffix is provided. This confuses new operators because GEOM uses
binary bytes, a large difference at modern storage pool sizes. Rewrite
suffixes in all GEOM manuals to consistently clarify this, matching what
we and the rest of the industry have been doing in other documentation.
While here, use non-breaking spaces between numbers and units, unless
they are already written with a hyphen.

MFC after:              3 days
Reviewed by:            fuz
Reported by:            bbaovanc <bbaovanc@bbaovanc.com>
Differential Revision:  https://reviews.freebsd.org/D56534
975e3605ebb15cbaf5a25c1c9d1f51aed41291d0 Alexander Ziaee 2026-04-20 17:21:23
bsdinstall.8: Document DISTRIBUTIONS defaults correctly
Some targets override the default value of DISTRIBUTIONS.
Document that in the manual page.

Reported by:    Nia Alarie <nia@NetBSD.org>
Reviewed by:    jlduran
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56528
4029e765436ff1633139c1afe1bc25185a0f4ef1 Mateusz Piotrowski 2026-04-20 15:52:25
src.conf.5: Regenerate
Last time I generated this, there were many copies of WITH_CASPER for
reasons unknown.

Sponsored by:           Netflix
e8156a7e5fffd0bf8dc09df542d9329b19bffecc Warner Losh 2026-04-21 15:23:58
tests.7: Provide better examples
Previous authors appear to have prioritized brevity over clarity.  This
unfortunately resulted in a manual page that left its reader with the
false impression that Kyua is difficult to use.  Attempt to correct
this by providing more and simpler examples with longer explanations.

While here, correct outdated information about where Kyua stores its
logs and results.

MFC after:      1 week
Reviewed by:    ziaee, ngie
Differential Revision:  https://reviews.freebsd.org/D56475
3d00db6b8b73ef7f89654a2928d247d62d39ee29 Dag-Erling Smørgrav 2026-04-22 08:19:32
src.conf(5): rebuild after introduction of WITHOUT_PKGCONF
Sponsored by: The FreeBSD Foundation
Reviewed by:    bapt, philip
Approved by:    philip (mentor)
57db556be43b5abb3dfb406fead6e0a9091f7531 Pierre Pronchery 2026-04-17 17:19:22
Commit group #4: build.7
build.7: Improve make delete-old example

Be more explicit that deleting old files and libraries needs to be
really after you're rebooted a third time and you're really actually
sure your applications aren't using old libs, following irc discussion.

Also adjust an example slightly to fit on 80 character console.

MFC after:              3 days
Discussed with:         emaste, fuz, jhb
Differential Revision:  https://reviews.freebsd.org/D54079
1d69c8e4ac7da648f63a830b23b872582469ba37 Alexander Ziaee 2026-04-22 17:24:38

build.7: Explain packaging a custom kernel

MFC after:              3 days (to 15 only)
Requested by:           vermaden
Discussed with:         emaste, ivy, Mark Millard <markmi_dsl-only.net>
Differential Revision:  https://reviews.freebsd.org/D56217
1bcd2e2f8311b737170e4bae8381dcb7de2c4413 Alexander Ziaee 2026-04-22 17:26:45

build.7: Explain specifying multiple KERNCONFs

MFC after:              3 days
Reviewed by:            ivy, mhorne
Differential Revision:  https://reviews.freebsd.org/D56281
b183dae4a9934ed9bb91763b5f9d9d4e4d4120a2 Alexander Ziaee 2026-04-22 17:31:04
freebsd-base.7: Add a caveat about dev branches
MFC after:            3 days (to 15)
Discussed with:         bapt, emaste, ivy
Differential Revision:  https://reviews.freebsd.org/D56389
886610c1003e0d0e270531f5a75b0f2c2b5eb2b8 Alexander Ziaee 2026-04-22 17:35:50
Explain relationship between file storage size and EOF.
32b0dfb326593b8dae31cc2bdc1e2d08ea70e9d7 Greg Lehey 2026-04-24 02:14:20
cam: Document kern.cam.max_high_power.
Sponsored by:         Netflix
Differential Revision:  https://reviews.freebsd.org/D56463
334adacbc1b26cd2fdfd6d8734b1066a862ef58b Warner Losh 2026-04-24 18:31:23
security(7): fix `mandoc -T lint` complaints
- Add `.Nm` section for securelevel(7) to match corresponding MLINKS entry.
- Fix the spelling for mac(4) (the actual subsystem manpage is spelled out in
  lowercase.

MFC after:      1 week
573a9e5764df04d2dbfb0cf174458936b0a97095 Enji Cooper 2026-04-24 04:12:00
hosts.equiv.5: correct nits to fix `mandoc -T lint` issues
- Rename `.Nm .rhosts` to `.Nm rhosts` to match the MLINK for the
  manpage.
- Use `.Pa` instead of `.Nm` when discussing the paths for `.rhosts` and
  `hosts.equiv.5` for explicitness and clarity.

Bump .Dd for the change.

MFC after:      1 week
af864dd4a2df50021f8a48c218a1f5968dbbb0c1 Enji Cooper 2026-04-24 04:50:01
split.1: grammar
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294757
Reported by:    Ulrich Eduard
MFC after:      1 week
c0c7d1e1af4e42deb9c5a95c735602100c3cc1f2 Maxim Konovalov 2026-04-25 02:15:37
loader.efi(8): Document LoaderEnv and NextLoaderEnv EFI variables
Describe how the LoaderEnv and NextLoaderEnv variables can be used.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293054
Reviewed by:            imp
Sponsored by:           Wiesbaden Hackathon 202604
Differential Revision:  https://reviews.freebsd.org/D56633
4137c673fa963fdf409eba2f48d615350c988ffe Paarth Shirsat 2026-04-25 15:10:27
Fix reversion introduced in commit 32b0dfb326593b8dae31cc2bdc1e2d08ea70e9d7
Noted by: mckusick
1316cf5094a603981bab10764ebb29780299d1f3 Greg Lehey 2026-04-26 01:45:11
init.8: document init_path among loader tunables
Reviewed by:  imp, jilles
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56536
9e6ae89d831a4ddce0925ac3682d602a71f1b26d Konstantin Belousov 2026-04-26 10:20:16
init.8: add RECOVERING section
Reviewed by:  imp, jilles
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56536
e378d97eeb2b8961f312cc04d4751579a7b70741 Konstantin Belousov 2026-04-26 10:28:05
chroot.2: "filedescriptors" => "file descriptors"
"filedescriptors" is the odd one out when looking at other manual pages.

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
4c6d8aa069f2ac22f801fa69add61085631b3356 Olivier Certner 2026-04-27 10:16:30
intro.7: Reference groups.7
0f91468c040eb2129618e5ac251afc2529edb462 Alexander Ziaee 2026-04-28 13:56:23
build.7: Explain update-packages repo signing
MFC after:            3 days
Reported by:            kevans
Reviewed by:            kevans, ngie
Differential Revision:  https://reviews.freebsd.org/D56607
ab98fd3234304ea10db3dee70205828d372c443a Alexander Ziaee 2026-04-28 16:55:11
reallocarray.3: Fix formatting
c1650792b8dd354c964b55999a712f5ae2ad6c0b Mark Johnston 2026-04-28 17:30:46
group.7: spell priority
d5db883af2cc46bf884ba3fd067cec68f44fc66d Maxim Konovalov 2026-04-28 17:44:40
RELNOTES: Add an entry for recent improvements to multicast routing
Reviewed by:  kevans
Sponsored by;   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D56710
6c09b7608905af2eaff4b5dfa6cbbd42ce286db6 Mark Johnston 2026-04-29 14:22:41
kerneldoc: also ingest .md (markdown files)
The doxygen tooling has supported ingesting markdown files for a number
of years.  Adding this option allows them to be ingested into the
subsys builds.

Reviewed by:    netchild
Differential Revision:  https://reviews.freebsd.org/D56652
4c99836ac72abb3ec64ee801ac5758ae70cf9a9b Adrian Chadd 2026-04-29 14:58:19
debug.sh.8: Add FILES section
Which contains only the source code file.

While here, remove trailing empty lines in the end of the page.

Reviewed by:    mhorne
Differential Revision:  https://reviews.freebsd.org/D56659
0ed292531e0457f271b838dd9dc99a86534d3a99 Artem Bunichev 2026-04-30 13:49:14
fexecve(2): call out a scenario where you want !O_EXEC
We note a reason why you might need it, but there's an equally important
reason you may need to omit it: interpreted programs.  Add a note
accordingly, along with the workaround configuration if there's reason
you can't help it.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294780
Reviewed by:    Jan Bramkamp <crest_freebsd_rlwinm.de>, kib
Differential Revision:  https://reviews.freebsd.org/D56704
9c18d55a768a3e60ecaba1325e9a3e00a25dee26 Kyle Evans 2026-05-01 03:02:55
man/math.3: mention fmaximum_mag_num, fminimum_mag_num
9f98195ff615417f7af875b65cdaf220239206db Robert Clausecker 2026-05-02 14:53:08
ports.7/FILES: Expand and refactor into 3 tables
Add make.conf, CHANGES, CONTRIBUTING.Md, UPDATING, and Tools/scripts.
Refactor the FILES section of the ports reference manual into a bigger
table with three sections separated by root directory. Remove preceeding
article from all but "the big Kahuna", and root dirs where reasonable.

MFC after:              3 days
Relnotes:               yes
Reported by:            adamw, arrowd, linimon
Differential Revision:  https://reviews.freebsd.org/D55441
28deec9b7e2b08b00160eb39de84ade6f27eb125 Alexander Ziaee 2026-05-03 17:25:41
nvram.8: Align option list and tag SPDX
MFC after:    3 days
33fbfceeb4d9daf1145089a10ce7b25110d8840f Alexander Ziaee 2026-05-03 17:39:27
man: Kill off MANSUBDIRs
Three architecture dependent manuals are installed to MANSUBDIRs,
creating at least two empty manual page directories on everyone's
boxxen. Move those manuals to their canonical area, enhancing clarity,
grepability, removing useless inodes, and increasing consistency with
the rest of the architecture dependent manuals which are unconditionally
installed, and noted at the top of the rendered manual.

MFC after: 3 days
809504f331fd3588e36b54255196379bdb59890a Alexander Ziaee 2026-05-03 17:53:25
ocs_fc.4: Cleanup
+ more consistent document description
+ enumerate available options in synopsis in vt.4 style
+ tag spdx
+ tweak list rendering
+ cleanup HARDWARE
+ reflow excessively long lines silencing linter warnings
+ fix link macros

MFC after:              3 days
Reported by:            michaelo (hardware notes)
Differential Revision:  https://reviews.freebsd.org/D56753
dd97c3d83f9a92bbeb9740ceff4c1c74c451293e Alexander Ziaee 2026-05-03 18:27:05
vis.3: Try to better describe VIS_SAFE
The current text fails to draw the reader's attention to the fact that
VIS_SAFE essentially exempts certain characters from being encoded.

While here, fix some markup nits.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56716
8acc4c16c6635c3cd8871d0ee1221b62d48d71b9 Dag-Erling Smørgrav 2026-05-04 12:08:10
zone.9: Add a missing newline
MFC after:    3 days
c295f026376035fee1a9e44efa2af30d46b7884a Mateusz Piotrowski 2026-05-04 18:28:36
freebsd-base.7: Document adding a local repo
MFC after:            1 day
Discussed with:         bcr, ivy, kevans, ngie
Differential Revision:  https://reviews.freebsd.org/D56608
c4af3f13a4e9932968d92872aaf22312a6e79e4e Alexander Ziaee 2026-05-06 21:23:52
cam: Cross-reference dtrace_cam.4 and cam.4
While here, remove empty sections from cam.4.

MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=1a7151f79664 cam: Add probes for xpt actions
640af0d9067bee6e8f300c158f0cf928e666977c Mateusz Piotrowski 2026-05-07 13:11:13
d.7: Document macro variables
MFC after:    1 week
2b9301a22bc677239d3c0dc783d970f17e7ca294 Mateusz Piotrowski 2026-05-07 14:20:46
smartpqi.4: Document runtime debug_level sysctl
Update smartpqi(4) to document the dev.smartpqi.<unit>.debug_level
sysctl for runtime debug level changes, and note that device
add/remove and controller event messages always appear in dmesg
regardless of the debug_level setting.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294161
Reviewed by:    imp
Approved by:    imp
MFC after:      2 weeks

Differential Revision:  https://reviews.freebsd.org/D56832
e9912b7e88e7d66c0ab5fec1cfe61dcd18377166 John Hall 2026-05-04 22:14:28
gpart(7): Fix reference to the zfsprops man page
6499888ca741bf3db90d7fd352d5480f7314337f Paarth Shirsat 2026-05-09 13:58:36
spkr.4: Reflect latest changes and add history
- speaker(4) was recently modernized to lock the driver per-playback
  instead of per-open. Update the man page to explain this change.

- added a reference to MML and SMX in the historical context to make
  it easier for users to find additional documentation online.

Signed-off-by:  Raphael Poss <knz@thaumogen.net>
Reviewed by:    ziaee
Closes:         https://github.com/freebsd/freebsd-src/pull/2183
e26b5e0749340d4e4557881b6634b044bce3fa61 Raphael 'kena' Poss 2026-05-08 13:10:29
libc/ctime.3: timegm() is in C23.
See also:     D53951, https://wiki.freebsd.org/C23
MFC after:      1 week
68251761c77b2f5ff927cf19bba7d4efa88799de Robert Clausecker 2026-05-14 10:24:30
libc/timespec_get*.3: expose STANDARDS section
We now have .St -isoC-2023, so the STANDARDS section can go live.

Fixes:          https://cgit.freebsd.org/src/commit/?id=9b5d724cad10087e34165199e55f15f2df744ed5
MFC after:      1 week
aa92784fcb8a375231058d67f7ccaeaa3e42ed33 Robert Clausecker 2026-05-14 10:32:11
RELNOTES: Add an entry for commit b92b9da33006
074c42ade353caedca05e3234c3cb20f28bf5231 Rick Macklem 2026-05-14 23:04:26
bhyve.8: Fix formatting of -G's "w" prefix
"w" is a command modifier, not an argument. Use Cm.

Fixes:  https://cgit.freebsd.org/src/commit/?id=2cdff9918e79 byhve: add option to specify IP address for gdb
MFC after:      3 days
7abddbb3cdeeff0d4d991aee52e92382e847e8a2 Mateusz Piotrowski 2026-05-15 09:48:43
bhyve.8: Improve readability by not breaking -f's synopsis
MFC after:    3 days
e0c3d21e3b43c664fbec3b070612c17a72c39482 Mateusz Piotrowski 2026-05-15 09:49:43
p9fs.4: Cross-reference mount(8)
MFC after:    3 days
ae0fd05a333b0ab9e6f020b07a0e483e6f85538a Mateusz Piotrowski 2026-05-15 10:11:29
man: iwlwifi/rtw88/rtw89: update man pages for Linux v7.0 based updates
For all:
- harmonize Copyright/license section according to style.9 and used
  SPDX only.
- mention that the current generation of the driver is based on
  Linux version 7.0.
- make linuxkpi.4 and linuxkpi_wlan.4 .Xr as the man pages do exist
  these days.

iwlwifi: update the card/chipset names supported (while we still can)
iwlwififw: leave a comment only that we can no longer update the
  man page and it will be removed in the future.
rtw88: update supported chipsets and add note to BUGS sections
rtw89: update supported chipsets and add note to BUGS sections

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    ziaee
Differential Revision: https://reviews.freebsd.org/D57019
0a2f7683bf0cbd57d7cdba0713a3e30b24cbf9b4 Bjoern A. Zeeb 2026-05-15 16:29:48
route.8: Describe weight modifier
Describe `-weight` argument in the route manual.

Reviewed by: glebius, ziaee
Differential Revision: https://reviews.freebsd.org/D56246
355989b21712cbb7173cbec4a036c541e6f08c0e Pouria Mousavizadeh Tehrani 2026-04-14 07:49:29
locking.9: warn about using sleepable lock address as a sleep channel
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D57012
56bc43f5d02bd0745d597db44c285bf78d083762 Konstantin Belousov 2026-05-15 11:05:45
Commit group #5: nlist.3: Replace a.out(5) Xref with elf(5)
nlist.3: Replace a.out(5) Xref with elf(5)

ELF support was added to nlist() in 1997, and a.out support was removed
in 2020.  The man page was not updated for either of these changes.

Fixes: https://cgit.freebsd.org/src/commit/?id=77909f597881 ("Initial elf nlist support, ...")
Fixes: https://cgit.freebsd.org/src/commit/?id=86cfa7e70b2b ("nlist: retire long-obsolete aout support")
Sponsored by: The FreeBSD Foundation
876a17321c896427d70de94101df4d888a19189b Ed Maste 2026-05-18 14:50:22

nlist.3: Add stab(5) Xref

Commit 876a17321c89 removed the a.out Xref as nlist(3) no longer
supports a.out, but this left nlist(3) without a reference to a page
documenting struct nlist.

struct nlist is documented in both a.out(5) and stab(5), so add an Xref
to the latter.

Reported by:    brooks
Fixes: https://cgit.freebsd.org/src/commit/?id=876a17321c89 ("nlist.3: Replace a.out(5) Xref with elf(5)")
762e451b318c8cbfddbcaaa92a218e8b45306eb9 Ed Maste 2026-05-19 00:11:39
Commit group #6: nlist.3
nlist.3: Clarify which symbol table is used

nlist() requires section headers, and currently fetches symbol names
only from SHT_SYMTAB,

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57065
cd6bf930eafe850dc631feeaf8332832601f4225 Ed Maste 2026-05-18 14:59:14

nlist.3: Add discouraged use notice

It is a relic from a.out days and is poorly specified. Although ELF
support was added to nlist, there are better ways to access ELF data.

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57078
94b7a335683abcbcd76e8b67d37e21271d81590c Ed Maste 2026-05-17 14:29:29

nlist.3: Move deprecation notice after intro

Its more clear and good practice for the first sentence of a description
to describe what something is, because there are a lot of different use
cases for documentation.

Fixes:          https://cgit.freebsd.org/src/commit/?id=94b7a335683a ("nlist.3: Add discouraged use notice")
Reviewed by:            emaste
Differential Revision:  https://reviews.freebsd.org/D57128
c796cc5afff2dffd542880c5f624439b25d74402 Alexander Ziaee 2026-05-20 15:06:31
d.7: Document no support for ddi_pathnam(), getmajor(), and getminor()
MFC after:    3 days
d04da19acbef62f8aee36f5350470dcbf5ba2931 Mateusz Piotrowski 2026-05-20 12:36:40
crypto driver manuals: Add crypto to search index
While here, tag spdx and sync the drivers in crypto(4)/SEE ALSO.

MFC after:              2 days (add back hifn)
Differential Revision:  https://reviews.freebsd.org/D57060
9096a8b1c89c7e98df0d5a27cf1a5f4c6e8ddf19 Alexander Ziaee 2026-05-20 13:25:21
cap_net.3: Clarify monotonic reduction in permitted operations
Reviewed by:  markj, oshogbo
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57141
59601a75d6fb1300b1aec2977eaa6adeb0300684 Ed Maste 2026-05-20 20:27:49
rtnetlink.4: Add RTA_PRIORITY
Add metric implementation of netlink to manual.

Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D56324
b9a246a9179777d28567c33a9a0f4b5f6055ab73 Pouria Mousavizadeh Tehrani 2026-05-02 21:14:46
route.8: Describe metric modifier
Describe `-metric` argument in the route manual.

Discussed with: ziaee
Differential Revision: https://reviews.freebsd.org/D57025
d87e5b28b763f1f0d73fd0ba0ce7f4eee30a8fca Pouria Mousavizadeh Tehrani 2026-05-15 22:02:09
mac_do.4: Jail parameter takes 'new', not 'enable'; uid_t/gid_t are 32-bit
MFC after:    1 minute
Sponsored by:   The FreeBSD Foundation
21df76d01fce35b0398cf38c31928c6f47111d55 Olivier Certner 2026-05-21 18:52:37
man: Stop referring to non-existing manpage strlcpy(9)
Reviewed by: ziaee, mhorne, kevans
03c410ba172426aa7f2a1cc19b94250686e5c8bd Martin Cracauer 2026-05-21 20:08:08
lib/libc/gen/fts.3: use 'options' consistently in fts_set() description
The RETURN VALUES section used "instr" to describe the fts_set()
argument, while the SYNOPSIS and all other references use "options".
Fix the inconsistency.

MFC after:      1 week
Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    asomers
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2213
e030e4e73fe77f3626f6468e89219deed316553d Jitendra Bhati 2026-05-21 01:51:45
mdoc.7: Revert upstream changes to Lb/LIBRARY
Since this manual describes the mdoc syntax throughout the ecosystem,
I had to blend what we had before with what upstream is doing now.

Thanks:         adrian
MFC after:      3 days (we shipped this doc in 15.0/14.4)
Reviewed by:    ivy, mhorne, des, adrian
Discussed with: arch@
Differential Revision:  https://reviews.freebsd.org/D56153
4e2bf6e90a65bee317e4dd379e098ba2eb5d8c0d Alexander Ziaee 2026-05-22 18:09:23
mrsas.4: Use Broadcom/LSI consistently
Reviewed by:  ziaee (via IRC)
MFC after:      immediately
Differential Revision:  https://reviews.freebsd.org/D57211
f30b1df048f00cd84f46b798c67234e7c3009962 Michael Osipov 2026-05-23 19:02:51
mfiutil.8/mrsasutil.8: Use Broadcom/LSI consistently
Both tools support controllers from both companies, so document it.

Reviewed by:    ziaee (via IRC)
MFC after:      immediately
Differential Revision:  https://reviews.freebsd.org/D57212
c74645b0c8df1307cb6f13d835012f88883dff3a Michael Osipov 2026-05-23 19:08:09
fcntl.2: clarify arg use for F_SETFD
Sponsored by: The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D57162
db513f3a55d59339055e6033829964738b879501 Konstantin Belousov 2026-05-22 04:01:20
lpd: Reorder option list in manual page
MFC after:    1 week
Reviewed by:    ziaee, markj
Differential Revision:  https://reviews.freebsd.org/D57182
8e917789732ae02a480e8756899d3bc6d99fe5d8 Dag-Erling Smørgrav 2026-05-25 16:51:39
RELNOTES: Add entries for various commits through early March 2026
Reviewed by:  markj
Differential Revision:  https://reviews.freebsd.org/D56485
9823698a48d33ba70323bb0448b5274d791e58f2 John Baldwin 2026-05-26 15:52:18
acpi.4: Update sysctl descriptions with new stype names
Sponsored by: The FreeBSD Foundation
071d82d9973660742e771b23365a82eb8dd2dd0f Aymeric Wibo 2026-05-27 08:44:12
login.conf(5): Add missing resource limits
While here, reorder the table.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295618
MFC after:      1 week
Reviewed by:    olce
Differential Revision:  https://reviews.freebsd.org/D57258
e9346d1d1383e8c1dced50a3aceb28edd5a4a5e2 Dag-Erling Smørgrav 2026-05-27 13:10:35
pcm.4: Document dev.pcm.%d.eq*
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
98a62ccab6ac30d13c2dbcdc7468af8f87df4ec9 Christos Margiolis 2026-04-17 15:47:44
mac_do.4: Document executable paths, default jail values and consistency
While here, fix the bug of mentioning 'enable' as a possible value for
the 'mac.do' jail parameter whereas it is 'new' instead.

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
39818654ae879788807d3a87c2d75cc700cc7113 Olivier Certner 2026-05-20 16:23:33
fts: Improve the description of FTS_NOSTAT
Note that we still need to stat directories and the roots.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57325
dce6aff90b13f30fcb4c1fa263868607ccda8041 Dag-Erling Smørgrav 2026-05-29 17:45:10
assert.3: Update as per C23
Signed-off-by:        Faraz Vahedi <kfv@kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
c115aad996d52f5270ccd22b27d1f34b4f0f4160 Faraz Vahedi 2026-05-20 07:22:19
rand(3): Normalize function ordering
Align ordering between NAME & SYNOPSIS sections.

Obtained from:  https://github.com/apple-oss-distributions/libc
Sponsored by:   Klara, Inc.
eda74fe47993f1d62e7c110850def6960b55291e Aymeric Wibo 2026-05-30 19:00:02
open.2: document O_PATH behavior for bindat/connectat
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57370
5d36fcc53d3d1c05a3bbac45e9d5409156e216f1 Konstantin Belousov 2026-06-02 13:46:37
install.1: Document options incompatible with -s
Reported by:  des
Reviewed by:    ziaee
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57409
b49021b49a78ca6a9e3a1a59c5aa6f2fec503afb Ed Maste 2026-06-03 15:35:59
install.1: Convert link flags to a table
The five link flags get lost in prose.

Reviewed by:    ziaee
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57418
248dd56d2dea03e4723e8225b890d02fcc10973f Ed Maste 2026-06-03 17:50:51
dhclient.conf.5: Correct crossreference
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285614
Reviewed by:    ziaee, michaelo, jrm
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D49489
f4424a2733867ec5f12ecd196011ce8df096f522 Jim Brown 2026-06-05 14:59:32
arch.7: arch.7: Add wchar_t signedness
Most architectures have the same signedness for char and wchar_t, but
powerpc has the unusual combination of unsigned char and signed wchar_t.

Reviewed by:    des, jhb, markj
Sponsored by:   The FreeBSD Foundation
5805fadd0dd756ce28b0662dc6588f295916340e Ed Maste 2026-06-05 16:14:26
Commit group #7: arch.7: Remove 32-bit powerpc from tables
arch.7: Remove 32-bit powerpc from tables

Most 32-bit architecture support has been deprecated for FreeBSD 16.

Reviewed by:    des
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57472
2ea49bb595df216f4374d5e1035ab2c818d3ceef Ed Maste 2025-08-26 17:45:28

arch.7: Restore (non-SPE) 32-bit powerpc to MD tables

powerpc is still relevant for lib32.  powerpcspe cannot use lib32 so
remains removed.

Reported by:    Minsoo Choo <minsoo@minsoo.io>
Reviewed by:    Minsoo Choo <minsoo@minsoo.io>
Sponsored by:   The FreeBSD Foundation
Fixes: https://cgit.freebsd.org/src/commit/?id=2ea49bb595df ("arch.7: Remove 32-bit powerpc from tables")
Differential Revision: https://reviews.freebsd.org/D57473
c2631d1623f45df4379c7373f1c639c575679785 Ed Maste 2026-06-05 17:00:45
fts: Correct description of fts_set
MFC after:    1 week
Sponsored by:   Klara, Inc.
Fixes:  https://cgit.freebsd.org/src/commit/?id=e030e4e73fe7 ("lib/libc/gen/fts.3: use 'options' consistently in fts_set() description")
Differential Revision:  https://reviews.freebsd.org/D57326
77fdeba18c07e243ea1e20916ee0dc31b9d6ac32 Dag-Erling Smørgrav 2026-06-05 16:46:49
nuageinit: update documentation for phone_home and final_message
bad3c15dffea69ea84f95489d26a86ad0498d942 Baptiste Daroussin 2026-06-06 06:17:04
qsort.3: Document mergesort() behaviour on size overflow
Signed-off-by:        Faraz Vahedi <kfv@kfv.io>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2243
Reviewed by:    fuz
MFC after:      1 week
26a1180cd1521e4c438ac95a57b134e27ea0a72d Faraz Vahedi 2026-06-02 09:12:59
mount_udf.8: Alphabetize and align options
While here, remove "The following UDF specific options are available:".
It is unused and does not appear to have ever been used.

MFC after:      3 days
05f132adc530cd53203b9cd09d7e1b211d2babc4 Alexander Ziaee 2026-06-08 22:22:32
iconv.3: Fix formatting of the error section
MFC after:    1 week
c491c2db2f37399eba7a356c4bfa298d64012101 Mark Johnston 2026-06-08 22:46:08
stats: Reference zpool-iostat(8) instead of zpool(8)
MFC after:    3 days
c0ec8ffb46ab337dcf726fcdf8083f62859d0ae6 Mateusz Piotrowski 2026-06-09 08:37:13
examples: Update COPTFLAGS in make.conf
We've been using -O2 for about fifteen years.

Reported by:    Jan Stary <hans@stare.cz>
MFC after:      1 week
2ab18d3286f5e1ea08cd86e234377b673245ec15 Dag-Erling Smørgrav 2026-06-09 11:29:13
tests.7: Remove an unused configuration variable
No existing tests require it, and I cannot understand what kinds of test
scenarios are supposed to require it.  Just remove it.

While here, improve the documentation of test variables a bit.

Reviewed by:    ngie
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56604
6bd97b5f3778aa36bcf89ff870bb1483b301a9be Mark Johnston 2026-06-09 21:00:23
du(1): document --si option
The --si option (human-readable output with SI units based on
powers of 1000) was implemented but missing from both the SYNOPSIS
and the options list.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265199
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2104
82780af43b113ab16a1a4fab5bf085b2b159f81e Kit Dallege 2026-03-27 04:30:11
cp(1): fix -P documentation to reflect it works without -R
Since commit 97e13037915c, the -P flag works without -R as
required by POSIX. Update the man page to state that only -H
and -L are ignored without -R, while -P can be used independently.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289959
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2102
2c5fd7d9a7ed36cf15dd538d9533e7835c7f8555 Kit Dallege 2026-03-27 04:25:44
mail(1): fix temporary file path in FILES section
The FILES section listed /tmp/R* but the source code uses
/tmp/mail.R* (e.g. mail.RsXXXXXXXXXX, mail.ReXXXXXXXXXX,
mail.RxXXXXXXXXXX) as the mkstemp template prefix.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289980
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2103
05a02d395d6e9de099c4be3ead222d36ca29e0a5 Kit Dallege 2026-03-27 04:23:47
diskless(8): remove references to deleted clone_root script
The clone_root script was removed from the tree in commit
7736786b08e8 but the diskless(8) man page still referenced it
in two places. Remove both references.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292231
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2101
f8c8875add6946b09ea8cf1f7bbdbd90fe5b1f17 Kit Dallege 2026-03-27 04:25:41
bsdconfig(8): add missing vt(4) console commands
Add documentation for the vt_font, vt_keymap, vt_repeat, vt_saver,
vt_screenmap, and vt_ttys commands which are available at runtime
but were not listed in the man page.

Also clarify that the existing syscons_* commands are for the
syscons(4) console driver and remove stale commented-out entries.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291051
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2100
e7bdf44da75a3f877c90dbbb9ff3db730937bc96 Kit Dallege 2026-03-27 04:25:38
re(4): document jumbo frame support for 8168/8111 chips
The man page only mentioned jumbo frame support for the 8169, 8169S,
and 8110S chips. The 8168 and 8111 family also support jumbo frames,
with varying MTU limits depending on the chip revision (6K for C
variants, 9K for D and later). Update the documentation to reflect
the actual driver capabilities.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=160399
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2097
473fa0f7a11ebecc50dfbd2997c8bdebbaad6541 Kit Dallege 2026-03-27 04:25:29
etherswitchcfg(8): document atu commands
Add documentation for the ATU (Address Translation Unit) commands
that were implemented but not documented in the man page:

- atu dump: display the MAC address table
- atu flush all: clear all dynamic ATU entries
- atu flush port <n>: clear ATU entries for a specific port

Also add atu to the SYNOPSIS section.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275413
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2096
3a71a24bbeae3b72c91fd7c0b212ee607f18cba6 Kit Dallege 2026-03-27 04:25:27
hcreate(3): fix incorrect claim that hdestroy frees keys
The man page incorrectly stated that hdestroy() calls free(3) for
each comparison key. The implementation (hdestroy_r.c) only frees
the internal table structure, not the user-provided keys or data.
This matches POSIX, which says hdestroy "shall dispose of the
search table" without mentioning key deallocation.

Update the description to clarify that the caller is responsible
for freeing any memory associated with table entries.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291240
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2095
ab8ceaaa86baa077fcdc020a0c05ccf88fcd54d1 Kit Dallege 2026-03-27 01:57:10
amdsmu(4): Small improvements
Suggested by: olce
Sponsored by:   The FreeBSD Foundation
ee13bfb694844df90b06c7246781212d3133e81c Aymeric Wibo 2026-06-11 21:17:39
bhyve: Document vCPU range pinning
This change documents the recently introduced changes to -p
that allow users to specify CPU ranges instead of having to
specify each individual mapping.

While we're here, move the -p examples to the EXAMPLES section.

Reviewed by:    bcr
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57480
23c99b64918eddb6084ffe4347faf95f82661c47 Bojan Novković 2026-06-05 17:31:01
loader.efi.8: Address mandoc -Tlint errors
MFC after:    3 days
8e1f5baa62d7f442a6cbd62d84dd4b4c80920153 Mateusz Piotrowski 2026-06-12 12:27:04
loader.efi(8): the amd64 loader doesn't do protected mode
The amd64 UEFI loader executes in long mode, not protected mode.

Reviewed by:    kib
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57568
f771deb193d5743e74515614b7cec40d68ab02ca Ahmad Khalifa 2026-06-14 16:26:16
loader.efi(8): document the ia32 loader
Reviewed by:  kib
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57569
2e1f5b78976ad09bee41e602e75e79a0c3892e59 Ahmad Khalifa 2026-06-14 16:26:30
groups.7: Document audio group
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    emaste
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/35
7f2d790824692b16ab2bf64a9b1e176f192cf319 Christos Margiolis 2026-05-21 18:42:25
symlink.7: Clean up markup and tag SPDX
Also unwind some parentheticals.

MFC after:      3 days
e821152cc71dbd09f5bd28be86499165c553f3ae Alexander Ziaee 2026-06-12 15:47:54
loader.efi.8: hw.uart.console is explained in uart
a641aa1c80f80e44cd9212b95e6584db9533712c Caleb Harper 2026-06-15 22:51:05
Commit group #8: sh: Improve function documentation
sh: Improve function documentation

* Mention that the function body can be in parentheses.  It is already
  implied since the function body can be any valid statement, but it may
  not be obvious to a reader who has only ever seen functions that used
  curly brackets and assumes that they are part of the function syntax.

* Remove the incorrect claim that a local statement may only occur at
  the top of a function.

* Show that a value may be assigned to a variable in a local statement.

* While here, replace unpaired double quotes with \(dq to avoid
  confusing syntax highlighters.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296050
MFC after:      1 week
Reviewed by:    ziaee, jilles
Differential Revision:  https://reviews.freebsd.org/D57596
556e793d803e12e9ad9361c6c53ed0433151f41e Dag-Erling Smørgrav 2026-06-16 20:23:18

sh: Belatedly bump manual page date

Fixes:          https://cgit.freebsd.org/src/commit/?id=556e793d803e ("sh: Improve function documentation")
09bb0b0d13968163c7394e9168491b16607fc2e7 Dag-Erling Smørgrav 2026-06-20 19:01:24
daemon(3): Note about environment after calling daemon()
While here, fix missing comma typo.

Reviewed by:    0mp, ziaee
Approved by:    0mp, ziaee
MFC after:      3 days
Obtained from:  https://github.com/apple-oss-distributions/libc (partially)
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D57384
bb14ba3777bb201abd6d4dfbf67d70b81f9c1e97 Aymeric Wibo 2026-06-17 19:51:39
rmdir.1: Document non-POSIX -v option
MFC after:            3 days
Reviewed by:            ziaee
Differential Revision:  https://reviews.freebsd.org/D57675
b3dfd5d59c4a776abfa9b48babf08fb56e986dd7 Artem Bunichev 2026-06-19 19:57:19
thunderbolt.4: Explain what driver does in manpage
Reviewed by:  ziaee, ngie
Approved by:    ziaee
Fixes:  https://cgit.freebsd.org/src/commit/?id=2f7a796b590e ("thunderbolt.4: Initial manual for HW Relnotes")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57668
9fd0c7c520a4427e1de5a8b733851deca561b79c Aymeric Wibo 2026-06-19 18:48:38
adjtime(2): document that delta can be NULL
The current verbiage somewhat indicates that always adjusts the time,
which hasn't been true as far back as I had the energy to `git blame`.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D57676
8ed580b1d3811e73e25db3d8a9fd235156c65387 Kyle Evans 2026-06-20 13:55:26
mem*.3: stop refering to strings
POSIX and the C standard now refer to objects and sequences rather
than confusingly revering to strings.

Also update bcopy(3) and bzero(3).

Reviewed by:    emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57680
015b890e28b87f182212230de35c9b061ff71258 Brooks Davis 2026-06-21 16:43:48
libusb: Bump manual date for multiple changes
Sponsored by:   The FreeBSD Foundation
d928113eaadaeb9ab821a2a5b6f08159f1ce8d76 ShengYi Hung 2026-06-22 13:32:23
acpi_ibm.4: Fix mic_led sysctl name
Fixes:        https://cgit.freebsd.org/src/commit/?id=707347f88649 ("Add missing documentation for dev.acpi_ibm.0.mic_led added in r335304")
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
b9d6497bd1f16e906f4dc6e600368b86d3fe0317 Aymeric Wibo 2026-06-22 14:22:01
acpi_ibm.4: Remove extraneous .Tn
As flagged by mandoc linter.

Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
8de929962a38855c8c38d117d20b71d7c9eaee77 Aymeric Wibo 2026-06-22 14:50:52
etcupdate: Recommend building when bootstrapping
Since building is no longer the default, add -b to the bootstrapping
examples as they are likely to be run with a tree that hasn't been
built.

MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=ddf6fad0295a ("etcupdate: Make nobuild the default")
Reviewed by:    jhb
Differential Revision:  https://reviews.freebsd.org/D57643
1ca439a216a0415e409218c1ebbcbbd4ff89d75c Dag-Erling Smørgrav 2026-06-22 18:59:23
kqueue.2: knote is activated as the first action of tdsendsignal()
Sponsored by: The FreeBSD Foundation
MFC after:      3 days
df8ca3f89aa2b2c374886cc39b24c76796d7db9a Konstantin Belousov 2026-06-22 19:07:19
virtual_oss.8: Use `.Pa` macro to refer to devices
Suggested by: christos
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
31461c8bc9c16004feae9cc17b89fd5213a09ae0 Aymeric Wibo 2026-06-24 14:33:41
virtual_oss.8: Document `/dev/bluetooth/` prefix magic
Without this one could be led to believe they should have an actual
`/dev/bluetooth/xxx` device in devfs from just reading the examples.

Event:          Halifax Hackathon 202606
Reviewed by:    christos
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57818
7ecd9afd3b28b9e1a112b5925a8f5902e121b128 Aymeric Wibo 2026-06-24 13:54:02
iostat.8: Expand -w description
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194781
MFC after:      3 days
Reviewed by:    ziaee
Event:          Halifax Hackathon 202606
4d299a767acce2841ded288e789a9c36620b57d7 Mathias Eggers 2026-06-23 20:09:24
arch.7: used title case for .Ss headings
Do capitalize "size".  Don't gratutiously capitalize "char" any more
than we do "make" further down.

Reviewed by:    emaste
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D57820
00b0ea95dfb3052ab94b5e9bf268f2b941b3f874 Brooks Davis 2026-06-25 10:05:28
build.7: explain how to build KBI-compatible standalone module
Reviewed by:  imp, kevans
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D57859
d946a88e0ce347a9a6fdbfdae0b23ef192b9bddc Konstantin Belousov 2026-06-26 00:21:36
cdefs(9): encourage __nodiscard over __result_use_check
__nodiscard is closer to (and sometimes expands to) [[nodiscard]] from
C23 and C++17 so prefer it to the homegrown __result_use_check.

When __nodiscard does expand to [[nodiscard]] it must appear entierly
before the function declaration (or between the function name
and argument list) so relocate as appropriate.  This differs from
__attribute__((__warn_unused_result__)) used by __result_use_check which
is more flexible.

Reviewed by:    imp, markj, emaste
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D57881
2515e3f6776a3f95c888be5e58b28df0ffbe3dd8 Brooks Davis 2026-06-26 16:41:40
netlink.4: Document missing socket options
Add descriptions for NETLINK_GET_STRICT_CHK, NETLINK_MSG_INFO.

Reviewed by:    ziaee, obiwac
Differential Revision:  https://reviews.freebsd.org/D57520
7fff1f194e075716c9be79dab68c1ab1816563ef Zishun Yi 2026-06-26 18:39:49
system(3): Use plural form of 'command'
Pick the plural form in the sentence about running arbitrary commands in
the security consideration section.

PR:         https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294497
Event:      Halifax Hackathon 202606
Location:   Couch
dcc684ddccd60d1079eefec06266de04641e319b Mathias Eggers 2026-06-26 19:16:20
padlock.4: Update slightly for 64-bit hardware
- Change the document description to "Via and Zhaoxin CPU crypto driver"
- Add a HARDWARE section mentioning these in the hardware release note

This manual still needs desperate help, but just this little bit could
have saved a lot of confusion. I'd write more if I had information.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295517
Fixes:          https://cgit.freebsd.org/src/commit/?id=14b8531c4ccb8 (Restore padlock_rng the the amd64 build)
MFC after:      3 days (to 15 only)
Reviewed by:    bcr, asomers
Differential Revision:  https://reviews.freebsd.org/D57920
380c6f59c4f87dbc45a67983d927700ca7e22be2 Alexander Ziaee 2026-06-28 21:27:35
ntsync.4: be explicit about the effect of automatic vs manual event on waiters
Sponsored by: The FreeBSD Foundation
MFC after:      3 days
65251c43415aa0993b7d43962cbb71d772870c83 Konstantin Belousov 2026-06-29 06:09:17
ctfmerge.1: Import ENVIRONMENT from NetBSD
Import the ENVIRONMENT section from NetBSD, minus the variable that our
ctfmerge does not have. Alphabetize them, polish grammar and alignment,
and add the variables to the man database. While here, remove whitespace
from the end of some lines to quiet linter.

MFC after:      3 days
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291186
Co-authored-by: Alexander Ziaee <ziaee@FreeBSD.org>
Obtained from:  NetBSD (christos <christos@NetBSD.org>, 8a0c0d8)
Differential Revision:  https://reviews.freebsd.org/D54054
32cf24b725fdf899fb642c47004b69fcfae9b9db Wolfram Schneider 2026-06-30 13:20:41

Hardware support

Hardware drivers and architecture-specific code.

bce: Fix SYSCTL_IN error check in bce_sysctl_nvram_write()
The condition after SYSCTL_IN was inverted: success (error == 0) returned
immediately and skipped the NVRAM write path, while failure fell through.
Return only when SYSCTL_IN fails.

Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2113
f3b59bf28504f901f4fcb568004a92c02fa371ed Weixie Cui 2026-03-31 13:51:46
pmap: Do not use PMAP_LOCK_INIT with kernel_pmap
The kernel_pmap lock is a bit special: it does not need the DUPOK flag,
and it really belongs to a different lock class.  If it belongs to the
same class as regular pmap locks, then witness may report warnings when
performing UMA allocations under a regular pmap lock, if the allocation
triggers a pmap_growkernel() call.

Replace instances of PMAP_LOCK_INIT(kernel_pmap) with inline mtx_init()
calls to silence some witness warnings for harmless behaviour I see with
some uncommitted test programs.

Reviewed by:    alc, kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56185
c6a1c1260f02e44b7f44b1e3735ce5dbd785544d Mark Johnston 2026-04-01 09:15:26
acpi_spmc: Fail probe if acpi_spmc device already attached
We cannot have more than one SPMC device.

Reviewed by:    olce
Approved by:    olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56062
0307db7744d4cfe0d610ebece226dd20fdcc4ed5 Aymeric Wibo 2026-04-01 11:54:57
acpi_spmc: Call new MS turn on display DSM
Microsoft added a new function index (turn on display, 9) to their DSM
set. This revision calls this, which fixes S0ix on certain machines,
such as the Lenovo Yoga Slim 7i Aura, who's ECs use this method as a
trigger to restore power to certain devices.

See commit 229ecbaac6b3 ("ACPI: x86: s2idle: Invoke Microsoft _DSM
Function 9 (Turn On Display)") on Linux.

Also see the following:
https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/modern-standby-firmware-notifications#turn-on-display-notification-function-9

Reviewed by:    olce
Approved by:    olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56062
683f7a8374ff67417ac45949bd56a12c23781232 Aymeric Wibo 2026-04-01 11:56:03
splash: add shutdown splash
This commit adds a shutdown splash to the existing kernel startup splash(4)
screen feature. It can be customized by providing a PNG image to the
shutdown_splash directive loader.conf(5).

Sponsored by:   Defenso
MFC after:      2 weeks
Reviewed by:    vexeduxr, ziaee, manu
Differential Revision:  https://reviews.freebsd.org/D55140
4b862c713ac5556ab4bd1828b47c5eb9cb28e067 Quentin Thébault 2026-04-02 16:38:47
virtio: use modern mode for transitional device by default
This patch changes the default value of the loader tunable
hw.virtio.pci.transitional to 1. This means, virtio uses the
modern mode for transitional devices by default.

The return values of vtpci_modern_probe() and vtpci_legacy_probei()
were chosen to prefer modern mode, but hw.virtio.pci.transitional=0
prevents modern mode.
Setting hw.virtio.pci.transitional to 1 by default seems a better fit.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D55894
0b39d72d0491c77e3e9883015b1fac46663c71de Timo Völker 2026-04-04 14:49:54
Commit group #9: sound
sound: Mark some snd_fmt* functions as static

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56238
f369d4148b93410fe7f8ea989f66790403d23ce8 Christos Margiolis 2026-04-07 15:44:15

sound: Retire unused CHN_N_* defines

These still haven't been implemented by the original author, and there
doesn't seem to be much use for them anyway.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56239
2d84c8a3d3d673081c803f8aadc4eae8f6a221d8 Christos Margiolis 2026-04-07 15:44:21

sound: Simplify parts of chn_notify()

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56240
8b18fc456bb136112e166508a9182718cdd44be2 Christos Margiolis 2026-04-07 15:44:29

sound: De-macro array definitions in chn_calclatency()

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56263
66a82f5fa471b8eda018b7566c3725a6742dfc0c Christos Margiolis 2026-04-07 15:44:34

sound: Make chn_reset() control flow clearer

I think this is cleaner than playing around with return values.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56264
8007a78bfe1f41b7055f8677f8ac9ae4cc2fbc7c Christos Margiolis 2026-04-07 15:44:39

sound: Expose EQ by default

The dev.pcm.%d.eq* sysctls and mixer "bass" and "treble" controls are
exposed only if hint.pcm.%d.eq is set. However, there is no good reason
why we shouldn't at least expose the controls, and let the user
enable/disable/bypass equalization through the sysctl.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
a0011c74f8f026e04803b9815198a56f50c247e6 Christos Margiolis 2026-04-16 14:26:25

sound: Retire FEEDEQ_BYPASS

In effect, this is the same as the disable state. There is a comment
that says the bypass state skips EQ altogether, which is what the
disable should be. The disable state according to the comment disables
EQ but keeps the EQ preamp (dev.pcm.%d.eq_preamp), however after testing
it seems that the preamp does not really take effect, because with EQ
disabled, feeder_eq is non existent, so we never execute any EQ code in
the first place.

Make things simpler and clearer and have 2 states; enable and disable,
and do what they should do intuitively.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
54a03b44ae386e26d29df6eece3fadb5c0d1105a Christos Margiolis 2026-04-17 14:45:40

sound: Remove dead EQ FEEDEQ_DISABLE code

If EQ is disabled, we never reach those code paths in the first place.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
6f130b220d7ce64ce65f076a21edea034d14482b Christos Margiolis 2026-04-17 15:05:33

sound: Retire FEEDEQ_DISABLE

We can do this more efficiently by just using the SD_F_EQ* flags. In
fact, the dev.pcm.%d.eq handler will (un)set SD_F_EQ_ENABLED and this is
what we actually test with when choosing to creating the EQ feeder or
not, so setting the state to FEEDEQ_DISABLE does not really an effect in
the first place.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
f5d6e5cb5c3e0593d24c90671d72654aa59cdd1a Christos Margiolis 2026-04-17 15:14:46

sound: Retire EQ states

The SD_F_EQ_ENABLED does the same thing, and is actually what we test
against in order to create the EQ feeder.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
88bc1d7325aa97520f7a308d70a5fcb39acdc5d2 Christos Margiolis 2026-04-17 15:23:38

sound: Retire hint.pcm.%d.eq_preamp

It wasn't documented in the first place, but it is easier to just use
the sysctl.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
3a3cb16ad4181700d787e6b24bedafe85c791901 Christos Margiolis 2026-04-17 16:14:44

sound: Start each channel individually

Unlock all members before starting any of them. Holding multiple channel
locks while calling chn_start() on a virtual channel can trigger the
parent, which acquires PCM_LOCK() while other virtual channels are still
locked -- a lock order reversal.

Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D57399
47ae0a869c7db693ffb1ac058d63dcb79c4e68a8 Goran Mekić 2026-06-17 10:34:05

sound: Include more information in kevent returned from the kernel

Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D57362
fe13f70b95a762e19c38d1152eac6312d8578f84 Goran Mekić 2026-06-17 10:35:07

sound: Adjust mmap example to use kqueue

Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D57410
a48bbef5eb32508a8d7b3b986c9b1d28176d1694 Goran Mekić 2026-06-17 10:36:12
arm64/apple: Fix malloc size for per-CPU arrays in AIC attach
sizeof(*sc->sc_ipimasks) * mp_maxid + 1 is parsed as
(sizeof(*sc->sc_ipimasks) * mp_maxid) + 1, so the buffers were one byte
short of a full (mp_maxid + 1) element count.  Multiply by (mp_maxid + 1)
for sc_ipimasks and sc_cpuids.

Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
Reviewed-by: kevans, ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2112
e8053023e7c07214a7b0a97f0f087ba02b329157 Weixie Cui 2026-03-31 10:24:08
hwpstate_amd: Expose nodes as much as possible in legacy pstate
Reviewed by:    olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55606
095cbb1bb7f7b4f742b0a500aa2c61a8c97d4b41 ShengYi Hung 2026-04-08 07:45:11
acpi: Parse _S3D in s2idle instead of _S255D
Previously, when entering s2idle, we were parsing the _S255D object to
get the shallowest D-state supported by device, as
acpi_stype_to_sstate() returns -1 for s2idle.

Instead, we should read _S3D.

Relevant document:
https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/07_Power_and_Performance_Mgmt/device-power-management-objects.html#s3d-s3-device-state

Reviewed by:    olce
Tested by:      emaste, olce
Approved by:    olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55118
19ab46cc66045ea936475f1a1e08763eb2fd663e Aymeric Wibo 2026-03-04 13:09:14
dpaa2: Extract frame-specific routines to dpaa2_frame.[h,c]
As soon as we need information from the hardware frame annotation to
make sure that checksums of the ingress frames were verified by the
DPAA2 HW, I've decided to make a preparation and extracted all of the
frame related routines into the separate dpaa2_frame.[h,c] along with
some clean up and improvements, e.g. no more dpaa2_fa, but dpaa2_swa
and dpaa2_hwa structures to describe software and hardware frame
annotations respectively, dpaa2_fa_get_swa/dpaa2_fa_get_hwa to obtain
those annotations from the frame descriptor. The next step is to
implement dpaa2_fa_get_hwa.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292006
Approved by:    tuexen
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56315
8e994533806d8aa0ae4582a52d811ede2b19bb26 Dmitry Salychev 2026-01-25 16:53:57
virtio_blk: Fix initialisation of dump request structure
Commit c8c37141 ("virtio_blk: Use bus_dma for command/ack buffer
allocations") failed to update initialisation of the dedicated dump
request structure. This caused a panic on attempting to dump core to a
virtio_blk device.

Reviewed by:    asomers
Sponsored by:   Arm Ltd
Pull Request:   https://reviews.freebsd.org/D56156
f54209510b1b30b1445792db7d33401f7c7a97d6 Sarah Walker 2026-04-09 10:52:05
hwpmc: Fix compile warning
.../sys/dev/hwpmc/hwpmc_mod.c:4640:1: warning: unused function 'pmc_is_multipart' [-Wunused-function]
 4640 | pmc_is_multipart(struct pmc_sample *ps)
      | ^~~~~~~~~~~~~~~~
1 warning generated.

Reviewed by:    mhorne
Fixes:          https://cgit.freebsd.org/src/commit/?id=e51ef8ae490f - main - hwpmc: Initial support for AMD IBS
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56296
2f3dcbb5ef27edfee1d560395fda3c2c7fd5e5cd Navdeep Parhar 2026-04-07 20:02:06
hwpmc: Fix bug when stopping ibs-op
In ibs_stop_pmc I accidently cleared the fetch max count value rather
than the op max count value, when stopping the op counter.  This
mitigates a bug in early pre-zen processors, but breaks using both
counters simultaneously.  I also found that the max op count mask needs
to be extended for recent zen processors.

Reported by:    Andre Fernando da Silva
Reviewed by:    mhorne
Sponsored by:   Netflix
Fixes:  https://cgit.freebsd.org/src/commit/?id=e51ef8ae490f ("hwpmc: Initial support for AMD IBS")
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2120
7a1aaca06c3384f90202dafa60440081d67d00fd Ali Mashtizadeh 2026-04-04 21:30:03
hwpmc: prevent IBS fetch from getting stuck
Both fetch and op IBS sampling have the same problem where we need to
rewrite the control MSR to ensure sampling continues at the correct
rate.  I also like this because it resets the counter reducing the
chances that we collect a sample inside the NMI handler.

Reported by:    Aalok Agarwal
Reviewed by:    mhorne
Sponsored by:   Netflix
Fixes:  https://cgit.freebsd.org/src/commit/?id=e51ef8ae490f ("hwpmc: Initial support for AMD IBS")
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2130
f86ba3eec5961c0217b5458663e0eae5bbad314e Ali Mashtizadeh 2026-04-07 23:33:03
ix(4): Add support for firmware logging for E610 adapters
This is part 3 of the support for the new Intel Ethernet E610
family of devices

The ix driver now enables firmware logging on Intel E610 devices
for debugging with Customer Support. Logs are enabled by default
and generated in binary format that requires decoding by support
teams. The collected data is firmware and hardware related for
debugging purposes only.

When the driver loads, it creates a fw_log sysctl node under the
debug section. Events are organized into categories (modules) for
targeted logging, and users can adjust verbosity levels as needed.

This adds sysctl support for the firmware logging feature and
updates the ix(4) manual page with documentation.

Signed-off-by: Yogesh Bhosale <yogesh.bhosale@intel.com>
Co-developed-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Reviewed by:    ziaee, kbowling
Tested by:      Mateusz Moga <mateusz.moga@intel.com>
MFC after:      1 weeks
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D53973
6b58d10fc6d51ddcf5ee81628ead74d3dadb9bf6 Bhosale, Yogesh 2026-04-09 18:05:29
nvme: Allow larger user request sizes
We have a small buffer for pages on the stack, but if the user wants to
do an I/O larger than this we currently fail w/o a way for the user to
know the max size. It's not hard to allocate an array for the uncommon
case of very large I/Os, and the performance advantage of the array is
small in that case anyway. In addition, this allows firmware upgrades
using the full transfer size of the device as a happy accident too.

Sponsored by:           Netflix
Reviewed by:            chs, chuck
Differential Revision:  https://reviews.freebsd.org/D55638
82ff1c334b97e5b68e6330e90f0aa6ae0f6af9aa Warner Losh 2026-04-09 16:18:31
x86: Add zen identifier helper function
Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56330
2358492b0347b11178fb594069330820f11ec81f ShengYi Hung 2026-04-09 08:14:57
rge: add Wake-on-LAN support for magic packet
Advertise IFCAP_WOL_MAGIC when PCI power management is available
and enable it by default.  On suspend or shutdown, rge_setwol()
enables the WOL_MAGIC and WOL_LANWAKE bits in CFG3/CFG5, disables
the RXDV gate, and enables PM so the NIC stays powered to watch
for magic packets.

Move hardware-specific WOL register configuration into
rge_wol_config() in if_rge_hw.c to keep hardware-specific
functions in sync with OpenBSD.

Update rge.4 to document WoL support.

Tested on FreeBSD 16.0-CURRENT bare metal with Realtek RTL8125
on a Gigabyte B650 Gaming X AX motherboard.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D56259
fc68534a9ad93f6df1756ffa8e707c30a35ce4d7 Christos Longros 2026-04-10 17:31:38
qcom_gcc: migrate the MSM8916 support to qcom_gcc
* migrate the MSM8916 (snapdragon 410) support to qcom_gcc
* add the full qcom_gcc / qcom_clk list to files.arm64, replacing
  the MSM8916 stub in sys/arm64/qualcomm .

Differential Revision:  https://reviews.freebsd.org/D49706
4e3fdced7f78c067e048c4d9ec42341c30b7899d Adrian Chadd 2026-04-10 22:09:58
ixgbe: Fix MRQC register value.
Focus on the MRQE field of the MRQC register, which is 4 bits wide,
and we use these 3 types of values.

  - IXGBE_MRQC_RSSEN 0x1  (non VF mode)
  - IXGBE_MRQC_VMDQRSS32EN 0xA (less than 33 VFs)
  - IXGBE_MRQC_VMDQRSS64EN 0xB (less than 65 VFs)

If we always take a bitwise OR with IXGBE_MRQC_RSSEN,
IXGBE_MRQC_VMDQRSS32EN will never be chosen.
Select these 3 types of values for the proper case.

Signed-off-by: Yuichiro NAITO <naito.yuichiro@gmail.com>

MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2132
938c076b9b0bc458a3877b52535527d37199fc09 Yuichiro NAITO 2026-04-07 15:25:09
hid: Change Usage Page names to match documentation
According to "HID Usage Tables FOR Universal Serial Bus (USB)"
Usage Page ID range 0x93-0xF1CF is "Reserved" and Usage Page ID range
0xFF00-0xFFFF is "Vendor-defined".

MFC after:      1 week
2ba6ce584a8cab75262cb86a5daf310d6706890c Vladimir Kondratyev 2026-04-12 18:09:22
bcm5974(4): Fix pre-2015 Apple touchpad support
These devices appeared to stop sending reports via mouse USB interface
after switching to RAW mode. Fix it with changing Usage of Top Level
Collection to one found in HID report descriptor of proper interface.

MFC after:      1 week
d6477cd3a5c3aec6a3492c8423852b09239583a3 Vladimir Kondratyev 2026-04-12 18:09:22
bcm5974(4): Do not handle pressure on non-ForceTouch devices
They always report it value as zero breaking pressure-driven drivers
like moused(8) and xf86-input-synaptics.

MFC after:      1 week
9d0404cfe92c18b7697b3e4ad4a5790b12d2261e Vladimir Kondratyev 2026-04-12 18:09:23
wsp(4): Do not handle pressure on non-ForceTouch devices
They always report it value as zero breaking pressure-driven drivers
like moused(8) and xf86-input-synaptics.

MFC after:      1 week
dc5a94962e21a267550a2c20a0c4707d06843942 Vladimir Kondratyev 2026-04-12 18:09:23
wsp(4): Make evdev interface operational if sysmouse one is not opened
Before this change evdev interface sent only copy of data sent through
the sysmouse interface. It worked as /dev/wsp0 device node was
automatcaly opened by devd(8) with starting of moused(8).
Starting with 15.0 moused(8) does not open sysmouse interface by default
thus making wsp(4) device dysfunctional.
Fix it with adding extra checks of interfaces state.

MFC after:      1 week
817e6995a19cb6f35851d0191bb1099a73d98bb9 Vladimir Kondratyev 2026-04-12 18:09:23
nvme_ctrlr_linux_passthru_cmd: correct size of upages_small array
The size broke when upages was converted from array to double pointer.

Reported by:    gcc -Wsizeof-pointer-div
Reviewed by:    imp
Fixes:          https://cgit.freebsd.org/src/commit/?id=82ff1c334b97 ("nvme: Allow larger user request sizes")
Differential Revision:  https://reviews.freebsd.org/D56368
8085c5a5c1e50eb478fb7b59fae201d9ab4207f0 Ryan Libby 2026-04-12 23:39:41
arm64: Add a cmap page to pmap
When modifying mappings in pmap we may need to perform a
break-before-make sequence. This creates an invalid mapping, then
recreates it with the changes.

When modifying DMAP mappings we may be changing the mapping that
contains its own page table then after breaking the old entry we are
unable to create the new entry.

To fix this create a map that can be used & won't be affected by the
break-before-make sequence.

Reviewed by:    kib
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56306
c208439cdb588d91aead9403cec3d4acf4a8bebf Andrew Turner 2026-04-13 11:50:32
arm64: Handle changing self-referential DMAP pages
Support changing the property of a DMAP page that holds it's own page
table entry.

Because we need to perform a break-before-make sequence to change the
properties of pages a page that also holds it's own page table entry
will fault in the make part of the sequence.

Handle this by mapping the page with a temporary mapping as we already
do when demoting a superpage.

Reviewed by:    kib
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55943
5809584275363d6b2f44981d8561a126a1344360 Andrew Turner 2026-04-13 11:50:47
Commit group #10: arm64
arm64: mte: cleanup cache register definitions

Cleanup the definitions in armreg.h for the CSSIDR_EL1, CLIDR_EL1 and
CSSELR_EL1 system register to prepare for additional bitfeilds for
Memory Tagging Extension (MTE).

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Signed-off-by:  Harry Moulton <harry.moulton@arm.com>
Differential Revision:  https://reviews.freebsd.org/D55944
7e718b9a8eec6b5ed86b3b5509fb09dd590a3b60 Harry Moulton 2026-04-13 11:52:10

arm64: mte: add system register definitions

Add system register and bit field definitions for Memory Tagging
Extension (MTE) in ARMv8.5.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Signed-off-by:  Harry Moulton <harry.moulton@arm.com>
Co-authored-by: Andrew Turner <andrew@FreeBSD.org>
Differential Revision:  https://reviews.freebsd.org/D55945
aa555b6004d605ff0fd48832340b0c32f14d51d4 Harry Moulton 2026-04-13 11:53:37

arm64: mte: configure initial state for system registers

The fields in SCTLR_EL1 and HCR_EL2 for enabling MTE are set, and if the
ID_AA64PFR1_EL1 register shows MTE is present, the GCR_EL1 register is
also configured, and the two TFSR registers which hold pending tag check
faults are cleared.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Signed-off-by:  Harry Moulton <harry.moulton@arm.com>
Differential Revision:  https://reviews.freebsd.org/D55946
58de79153622145cb6fc57bc92c4de678876992f Harry Moulton 2026-04-13 11:54:38

arm64: Add a comment about HWCAP values

They must be identical to Linux. Document this requirement to allow
userspace to depend on this.

Sponsored by:   Arm Ltd
48da01ad0b165b4dd38a4c22449216c1babc068b Andrew Turner 2026-05-14 15:04:32

arm64: Support changing the DMAP memory type

When MTE is enabled we will use the DMAP to manage tags. To be able to
read/write them we need to change the memory attribute to
VM_MEMATTR_TAGGED.

Support changing the DMAP memory type to values known to have
equivalent cache properties.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55949
a780d21eab9724b0667df84b02074994595d51c7 Andrew Turner 2026-05-15 15:16:57

arm64: Manage the MTE state like pointer auth

Add the same group of functions we use to manage pointer authentication
in userspace threads.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55951
5a6ae4230b046854641b8f80bff0f77fc0e5caae Andrew Turner 2026-05-15 15:27:53

arm64: Check for MTE tag failures on kernel entry

When entering the kernel from userspace we need to check for MTE tag
failures when using asynchronous MTE. This is done by checking if either
tag fault check types that have asynchronous checks are enabled, and
if so check the register the result is stored. It then sets a flag the
kernel can later use to raise a signal.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55952
5cb511e62763621cf7672db4294002411c3e897d Andrew Turner 2026-05-15 16:13:33

arm64: Add support for per-page flags

We need to store some extra information about a page, e.g. the state of
the MTE tags. Add a MD flags field to each page.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55953
d63a62fb3504df36457cac5718073a12d10e6cdc Andrew Turner 2026-05-18 09:01:19

arm64: Support building sys/sysl instructions

Add support to build system instructions from a macro. These are based
on the existing support for msr/mrs instructions with adjustments for
the different instruction format.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D57017
a9e12d3ec8bde29e97227757bc08cb1a0a93afa9 Andrew Turner 2026-06-18 13:34:04

arm64: Add FEAT_ALWAYS_ENABLE to cpu_feat

A use for it has been found in the GICv5 driver where we need to read
the Interrupt Affinity ID early in the boot on the secondary CPUs.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54249
cd94485281f3fc6ae5414180420527ce11846742 Andrew Turner 2026-06-18 13:34:47

arm64: Add an initial GICv5 driver

Add an initial driver for the GICv5 interrupt controller.

This provides host-only support for the GICv5 interrupt controller. It
is specified in the ARM-AES-0070 document & based on version 00eac0.

In the GICv5 there are 3 interrupt spaces: PPI, SPI, and LPI. Unlike
previous interrupt controllers they don't share a single interrupt
ID range, so PPI IRQ 1 and SPI IRQ 1 are different interrupts. There
is a common irqsrc stricture that encodes this information as it is
common across the interrupt types.

Unlike previous GIC versions there are no software generated interrupts
that can target a configurable collection of CPUs. These have been
replaced with LPIs, where each CPU will have one allocated for each
IPI type.

This driver handles the CPU interface and interrupt routing service
(IRS). The CPU interface provides the interface to manage and handle
interrupts, while the IRS handles routing LPIs and SPIs to the target
CPU.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54250
c84261da6f6ca6ae6d66eebb86da02467da3dd95 Andrew Turner 2026-06-18 13:30:01

arm64: Add an initial GICv5 ITS driver

Add a driver to support the GICv5 interrupt translation service (ITS).
The ITS is responsible to handling ITS events & translating them to an
interrupt to be delivered to the interrupt routing service (IRS).

An example event is a MSI or MSI-X is delivered. The ITS will generate
an LPI depending on which device sent the interrupt and the value the
device wrote.

This is a similar concept to the GICv3 ITS, however the implementation
details are different so it needs a new driver.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54251
06d64ee0ecc2ed25315b1afa20fea63c51b78abb Andrew Turner 2026-06-18 13:50:54

arm64: Add an initial GICv5 IWB driver

Add a driver to support the GICv5 interrupt wire bridge (IWB). The IWB
translates the change in state of an input wire and sends a MSI to
the interrupt translation service (ITS) to be translated to an LPI.

Unlike other MSI sources each wire has a fixed Event ID value it will
write in the MSI data.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54252
cbef29bde7ce8f2bac4bff831a21e9e54ae51d20 Andrew Turner 2026-06-18 13:52:18
nvme: Use passed in max_pages.
Noticed by: jhb
Sponsored by: Netflix
2b954770ddd7a4246c2100373d86ef5316becd81 Warner Losh 2026-04-13 23:30:24
x86: Mark LOCORE to prevent build failure on i386 platform
PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294468
Reported by:    dan.kotowski@a9development.com
Tested by:      dan.kotowski@a9development.com
Discussed with: kib
Fixes:  https://cgit.freebsd.org/src/commit/?id=9289df1949cd ("x86: Add zen identifier helper function")
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56377
43d632779b7d1df6c96a5cc0f506c13e09a845f3 ShengYi Hung 2026-04-13 14:46:43
sound examples: Add mmap example
This example opens separate OSS capture and playback channels in mmap
mode, places them into a sync group, and starts them together so both
ring buffers advance on the same device timeline. It then monitors the
capture mmap pointer with SNDCTL_DSP_GETIPTR, converts that pointer into
monotonic absolute progress using the reported block count, and copies
newly recorded audio from the input ring to the matching region of the
output ring.

The main loop is driven by an absolute monotonic frame clock rather than
a fixed relative usleep delay. Wakeups are scheduled from the sample
rate using a small frame step similar to the SOSSO timing model, while
the audio path itself stays intentionally simple: just copy input to
output, with no explicit xrun recovery or processing beyond ring
wraparound handling.

MFC after:      1 week
Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D53749
3524d4ebbe1f562dd76dc553c085386aadfd2682 Goran Mekić 2026-04-14 10:57:53
acpi_apm: Don't recurse on ACPI_LOCK in apmreadfilt
The lock is already held by the caller since it is used as the knlist
lock.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293901
Reported by:    Jiaming Zhang <r772577952@gmail.com>
Fixes:          https://cgit.freebsd.org/src/commit/?id=cc2715cf1f86 ("acpi_apm: Narrow scope of ACPI_LOCK")
8c941e313e3925b17e49b093244c159db7a112f8 John Baldwin 2026-04-14 13:25:37
asmc: add raw SMC key read/write interface
This patch adds a debugging interface to read and write arbitrary
Apple SMC keys by name through sysctl, enabling hardware exploration
 and control of undocumented features.

The interface provides four sysctls under dev.asmc.0.raw.*:
  - key - Set the 4-character SMC key name (e.g., "AUPO")
  - value - Read/write key value as a hex string
  - len - Auto-detected key value length (can be overridden)
  - type - Read-only 4-character type string (e.g., "ui8", "flt")

Implementation includes a new asmc_key_getinfo() function using SMC
command 0x13 to query key metadata. The interface automatically
detects key lengths and types, uses hex string encoding for
arbitrary binary values, and is safe for concurrent access via
CTLFLAG_NEEDGIANT.

This interface was essential for discovering that the AUPO key
enables Wake-on-LAN from S5 state, and for mapping all 297 SMC keys
on Mac Mini 5,1.

Reviewed by:    ngie, adrian, markj
Differential Revision:  https://reviews.freebsd.org/D54441
3e27114a7f961aac49d75a663a55332375d0bef3 Abdelkader Boudih 2026-04-15 04:20:52
thunderbolt: Support generic USB4 NHIs
Check a PCI device's class, subclass, and progif to figure out if it is
a USB4 NHI. nhi_identifiers is completely removed as only these generic
USB4 NHIs are supported anyway, and all remnants of ICM-supporting code
are removed too. All devices now use the HCM.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290827
Reviewed by:    jhb, ngie
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52861
bb36c457ea49d80ca3109ef25ca41a614f9738b8 Aymeric Wibo 2026-04-15 12:04:17
appleir: Add Apple IR receiver driver
HID driver for Apple IR receivers (USB HID, vendor 0x05ac).
Supports Apple Remote and generic IR remotes using NEC protocol.

Supported hardware:
- Apple IR Receiver (0x8240, 0x8241, 0x8242, 0x8243, 0x1440)

Apple Remote protocol (proprietary 5-byte HID reports):
- Key down/repeat/battery-low detection
- 17-key mapping with two-packet command support
- Synthesized key-up via 125ms callout timer

Generic IR remotes (NEC protocol):
- Format: [0x26][0x7f][0x80][code][~code]
- Checksum: code + ~code = 0xFF
- Default keymap with 8 common codes
- See: https://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol

Output via evdev with standard KEY_* codes.
Raw HID access available at /dev/hidraw0 for custom remapping.

Based on protocol reverse-engineering by James McKenzie et al.
Reference: drivers/hid/hid-appleir.c (Linux)

Tested on Mac Mini 2011 (0x05ac:0x8242).

Differential Revision:  https://reviews.freebsd.org/D55472
a85c4ab626ef52530400ace1957daaa35dd07534 Abdelkader Boudih 2026-04-14 02:29:43
asmc: add support for MacBookPro13,1
This commit adds support for the MacBookPro13,1 (late 2016, 13-inch). The SMC
keys were collected from https://logi.wiki/index.php/SMC_Sensor_Codes. Two
temperature keys are omitted because they fail to be read: TI0P (IO Proximity)
and Ta0P (Ambient Air).

Note that the with this model the `dev.asmc.0.fan.0.minspeed` setting only
applies when the fans have been activated by the system. In my testing, the fans
did not spin up until CPU temperatures hit about 80C. At lower temperatures, the
fans will happily ignore the minimum speed and remain at 0 rpm.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2137
b5b9c65a689457e608cc31831ed690d303d63ffa Marcus Gartner 2026-04-11 02:03:18
asmc: correctly label ASMC_KEY_FANMINSPEED as read-write
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2137
31744051c8a1c8baca219d93ace6e3e1a5463a45 Marcus Gartner 2026-04-11 02:02:52
Fix xhci detection on Raspberry Pi 400
If you use the FreeBSD pre-build Raspberry Pi image, it does not include
the specific .dtb file for the Raspberry Pi 400. On this hardware, it
will fall back to attempting to load the Raspberry Pi 4 .dtb file
instead.

The Pi 4 .dtb file reports the board compatible name as
"raspberrypi,4-model-b" The Pi 400 .dtb file reports the board
compatible name as "raspberrypi,400" However, it's even better to
use the generic name.

When using the official Pi 400 .dtb file from the Raspberry Pi Firmware
collection, the FreeBSD xhci driver currently fails to recognize this,
and thus fails to initialize the xhci device. This means no external
USB, or internal USB (which feeds the build-in keyboard)

The official Raspberry Pi FreeBSD image has been working on the Pi 400
"on accident" simply because it didn't include the Pi 400 .dtb file
prior to this. But the Stratipi Builder uses the full Raspberry Pi
firmware suite and hit this bug.

As a note: this is probably also a bug on the Compute Module 4 (CM4),
but I don't own one of these devices in order to test/validate it.

MFC After: 5 days
Reviewed by: imp, Ali Mashtizadeh
Pull Request: https://github.com/freebsd/freebsd-src/pull/2115
7634043970078f63eea03bb8975bd3fe1e883130 Vince 2026-04-02 01:28:50
uvscom: Fix baud rate validation in uvscom_pre_param()
The switch fell through from the supported B150–B115200 cases into default
and returned EINVAL for every speed.  Break out before default so valid
rates return success, matching uvscom_cfg_param().

Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
Reviewed by: imp,aokblast
Pull Request: https://github.com/freebsd/freebsd-src/pull/2110
75e7709f4f3c9e1576af45715730c286c1ec3b24 Weixie Cui 2026-03-31 10:17:28
libpmc: surface raw TSC in pmclog events
The pmclog record header carries the raw TSC for each event. Export it
in struct pmclog_ev, fix JSON output to emit it unsigned, and preserve
the installed header ABI by overlaying pl_tsc with the legacy pl_ts
storage.

Update pmclog(3) to document the TSC semantics and the legacy alias.

Sponsored by: AMD
Signed-off-by: Andre Silva <andasilv@amd.com>
Reviewed by: imp, mhorne, Ali Mashtizadeh
Pull Request: https://github.com/freebsd/freebsd-src/pull/2085
fbbf71f5813b041526c4d439d9961e8a8281d291 Andre Silva 2026-03-31 20:28:04
acpi: Return "unknown D-state" in acpi_d_state_to_str() if unknown
Some ACPI debugging prints call acpi_d_state_to_str() on unset D-states
(i.e. ACPI_STATE_UNKNOWN), so return a string explicitly saying "unknown
D-state" instead of just panicking.

Fixes:          https://cgit.freebsd.org/src/commit/?id=84bbfc32a3f4 ("acpi_powerres: D3cold support")
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
dc9ff9e5d078fd923adc3dc5426b5f219156ea43 Aymeric Wibo 2026-04-16 07:12:33
hwpstate_amd: Cache cpuid
Reviewed by:    olce
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56305
e48e9794589993da039a2f4d1c66f8fdd6421155 ShengYi Hung 2026-04-08 12:58:34
Commit group #11: ofw: bool-ify OF_hasprop()
ofw: bool-ify OF_hasprop()

Adjust the function signature and the few callers that don't treat it
this way already.

This is style only; no functional change intended.

Reviewed by:    andrew
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56203
b60cd486a652f0427e525b4482ac598be5460459 Mitchell Horne 2026-04-16 14:12:41

OF_getprop.9: update OF_hasprop() signature

The return type has been converted to a bool.

Reported by:    manu
Sponsored by:   The FreeBSD Foundation
Fixes:          https://cgit.freebsd.org/src/commit/?id=b60cd486a652 ("ofw: bool-ify OF_hasprop()")
47b0ac1cadc91eee5e98813169b590c443135fbc Mitchell Horne 2026-04-16 15:57:48

raspberry_virtgpio: fix OF_hasprop() usage

The function returns a bool. This driver was merged recently (by me) and
I missed this instance.

While here, adjust the ofw_bus_status_okay() call similarly. This
function still returns an int, but this usage is more widely used in our
drivers.

No functional change intended.

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Fixes:          https://cgit.freebsd.org/src/commit/?id=b60cd486a652 ("ofw: bool-ify OF_hasprop()")
ce6b4973ba8c6503d3b6dc12d9e6b42ce274d912 Mitchell Horne 2026-04-16 16:05:25
clk_fixed: quiet a warning message
Frequently there are some unused/unspecified fixed clocks present in a
device tree. Each one emits a warning before it fails to attach, which
results in (sometimes many) repeated messages which are not
user-actionable.

Put this warning behind the bootverbose flag.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56204
8728e21bd694dbb813c149206c5c89290f9c32f5 Mitchell Horne 2026-04-16 14:13:04
arm64: mte: add tagged memory attribute
Add the Normal-Tagged memory attribute introduced with MTE.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55948
aa2d89cb4263f5d638b150efb4a2e6adab4ee9d6 Harry Moulton 2026-04-16 13:30:15
mlx5e: Ensure rx timestamps are monotonically increasing
The clock calibration routine currently can result in rx timestamps
jumping backwards, which can confuse the TCP stack.
Ensure they are monotonically increasing by estimating what
we'd calculate as the next timestamp and clamp the calibration
so new timestamps are no earlier in time.

Reviewed by: kib, nickbanks_netflix.com
Tested by: nickbanks_netflix.com
Differential Revision: https://reviews.freebsd.org/D56427
Sponsored by: Netflix
ce33f96fcf2f2d0d49c406274bcc64df72fe530e Andrew Gallatin 2026-04-16 16:26:07
Commit group #12: etherswitch: Add minimal support for mv88e6170 switch
etherswitch: Add minimal support for mv88e6170 switch
680e6e30c02019c2a18c2ecfef3723b9adaa9ce5 Justin Hibbits 2026-04-16 22:35:32

e6000sw.4: Mention MV88E6171

Fixes:  https://cgit.freebsd.org/src/commit/?id=680e6e30c020 (etherswitch: Add minimal support for mv88e6170)
Reviewed by:            jhibbits
Differential Revision:  https://reviews.freebsd.org/D56455
b2aea7a042b6b6e6f1f4922e7e32b6d350a81327 Alexander Ziaee 2026-04-17 15:21:05
e6000/fdt: Ignore disabled switch ports
Instead of trying to parse a bogus node, just skip it if marked
disabled.
2fc58102426ebb3a662675da2600591922a21082 Justin Hibbits 2026-04-16 22:35:45
powerpc/pmap: Add support for page sizes found on E6500
E6500 cores (MMUv2) support all powers-of-2 page sizes from 4k to 1TB,
not just powers of 4.  By using the other page sizes (8k, 32k, etc) we
can save on TLB1 space, saving up to ~1/3 of used TLB1 entries.
1fc50a4e68a1635f76d24694fc6ea8b94193c087 Justin Hibbits 2026-02-01 03:44:21
mpc85xx: Support timebase sync on T-series devices
Freescale T-series QorIQ devices use a different register to twiddle the
timebase enable.
603a29b9b3126763c934afbed64fc43bf539469b Justin Hibbits 2026-04-16 22:36:54
powerpc/intr setup: Don't check intr name for IPI
Since whether or not the irq is an IPI is passed into
powerpc_setup_intr_int(), use this as the check for IPI instead of
checking the name string.
a249ddf07873be97967dd83df4d098ea95d0c92a Justin Hibbits 2026-04-16 22:37:01
asmc: add automatic voltage/current/power/ambient sensor detection
Apple SMCs contain numerous undocumented voltage, current, power,
and ambient light sensors. This change adds automatic detection
and registration of these sensors as sysctls.

New sysctl trees:
  dev.asmc.0.voltage.*  - Voltage sensors (millivolts)
  dev.asmc.0.current.*  - Current sensors (milliamps)
  dev.asmc.0.power.*    - Power sensors (milliwatts)
  dev.asmc.0.ambient.*  - Ambient light sensors

Implementation:
- Scans all SMC keys at attach time via asmc_key_dump_by_index()
- Identifies sensors by key prefix patterns:
  - Voltage: VC*, VD*, VG*, VP*, VI*
  - Current: I{C,D,G,M,N,O,H,P,B,A,L}*
  - Power:   P{C,D,N,S,T,H,F,Z,z}*
  - Light:   ALV*, ALS*
- Dynamically creates sysctls for detected sensors
- Supports 8 fixed-point SMC data types:
  - sp78, sp87, sp4b, sp5a, sp69, sp96, sp2d, ui16
- Auto-converts all values to milli-units (mV, mA, mW)

On Mac Mini 5,1, detects:
- 7 voltage sensors
- 18 current sensors
- 27 power sensors
- 2 ambient light sensors

Enables power consumption monitoring, voltage rail debugging,
and ambient light detection without hardcoding model-specific
sensor lists.

Tested on:
  - Mac Mini 5,1 (2011) running FreeBSD 15.0-RELEASE
  - 54 sensors auto-detected and exposed via sysctl
  - All sensor types verified with multimeter readings
  - Fixed-point conversions validated against known values
  - Memory management tested (malloc/free on detach)

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D55807
aae9068404947dd9ffd8522359d0f9dffaa70414 Abdelkader Boudih 2026-04-17 02:31:21
rge: add disable_aspm tunable for PCIe power management
Add a per-interface loader tunable dev.rge.%d.disable_aspm to
disable PCIe ASPM (L0s/L1) and ECPM on the RTL8125/8126/8127.

Disabling ASPM reduces latency at the cost of higher power
consumption. Default is off (ASPM left as configured by BIOS).

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D56103
4390c37b5c94b6de4cb4bdbcc3967efe74fa7517 Christos Longros 2026-04-17 02:34:55
ixgbe: improve MDIO performance by reducing semaphore/IPC delays
Each MDIO transfer takes 8ms, and all of that is spent in a set
of DELAY() calls, which is consuming a LOT of CPU.

* Change the timeout in ixgbe_hic_unlocked() - doing IPC to the
  on-chip firmware - to a 1uS delay and bump timeout appropriately.
  This seems to finish in a couple of microseconds on my local
  test devices.

* Change the 2ms sleep in ixgbe_release_swfw_sync_X540() to 2ms
  for EEPROM/flash, and 10uS otherwise.  10uS seems to work fine
  on my local testing, but the config EEPROM doesn't read right
  without this extra delay.

The first change shouldn't change the driver behaviour, but the
latter change is more intrusive and needs some wider testing.
(My guess here is that there SHOULD have been some completion
check somewhere in the EEPROM/flash IO path, and these sleeps
are masking them.)

Locally tested:

* C3558 (Denverton) w/ X553 backplane

Reviewed by:    kbowling
Differential Revision:  https://reviews.freebsd.org/D50295
f46d75c90f5feb87259635134dde4da328282842 Adrian Chadd 2026-04-17 17:11:53
powerpc64: fix builds
Oops, I missed 'device ix' in here, and it now requires mdio.
b4be4a7890e7f3a94acc08440e28d480434f5bb8 Adrian Chadd 2026-04-17 19:32:23
uart/pci: recover ADL AMT device after FIFO size probing
When the Alder Lake Serial-over-LAN device is put into loopback mode and
repeated writes are performed to the data register it results in the device
ending up in a non-functional state afterwards.

Recovering the device to a working state requires re-writing the LCR
register with it's current value (no effective change).  This should be
harmless on all other devices.

Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D56107
Reviewed by: imp
45c8ddc874bb9149ed20cb46b6ef8bdd0567714c Roger Pau Monné 2026-03-27 09:55:02
uart/pci: use different probe return values
For PCI devices listed in pci_ns8250_ids return BUS_PROBE_SPECIFIC, while
for generic UART devices not explicitly listed in pci_ns8250_ids return
BUS_PROBE_GENERIC.  This allows more specific drivers to take over those
devices, and the generic UART PCI driver will only be used as a fallback.

This fixes an issue where the UART PCI driver would attach to multiport PCI
UART devices, that instead need to use the puc(4) driver to multiplex the
device.

Reported by: markj
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D56467
Reviewed by: markj imp
2ac5b9bd0b132ac0fb69800724dbfcab45ccc35c Roger Pau Monné 2026-04-17 12:46:39
Commit group #13: acpi_spmc(4): Small probe improvements/fixes
acpi_spmc(4): Small probe improvements/fixes

Remove the test on presence of an ACPI handle, this is implied by
ACPI_ID_PROBE() succeeding.

Set 'sc->dev' early, so that acpi_spmc_check_dsm_set() using
device_printf() will print the driver name.

Add a missing newline after printing that more DSM functions are
implemented then expected.

Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56483
bd05b47fbd8b7301983dc4ceaf0498fb8d5ca9f2 Olivier Certner 2026-04-10 14:15:09

acpi_spmc(4): Remove redundant setting of 'sc->dev' on attach

Should have been part of the previous commit (but PEBCAK).

Reviewed by:    obiwac
Fixes:          https://cgit.freebsd.org/src/commit/?id=bd05b47fbd8b ("acpi_spmc(4): Small probe improvements/fixes")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56483
0a764beb6215f067787fba1723f211b7ef0eeeb0 Olivier Certner 2026-04-17 21:02:06
kshim/usb: Add build option.
Add WITH{,OUT}_LOADER_USB to build the kshim usb library. Nothing
in-tree uses it, but this will make it easier to keep building. Updated
src.conf.5 with a few extra changes...

Sponsored by:           Netflix
4ed20e0236dd0ce64aa4d79659288a56e1b1344b Warner Losh 2026-04-18 02:41:26
dpaa2: Extract checksum statuses on ingress
In order to enable RX checksum offloading we need to check the
meta-information for the (good) frames to see if the L3/4 checksums
were calculated and if there was an error.

The way the buffere are setup, the needed frame meta-information is
already requested. All we have to do is make sure it is really part
of the RX frame, that it is valid, and if the respective bits are set.

Also do not forget to set the (dummy) csum_data as otherwise upper
layers will just be cranky. An artefact of the past which likely
should disappear.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292006
Reviewed by:    bz, tuexen
Tested by:      bz, tuexen
Approved by:    tuexen
Obtained from:  bz (initial version, D55320)
MFC after:      3 days
Sponsored by:   Traverse Technologies (providing Ten64 HW for testing)
Differential Revision:  https://reviews.freebsd.org/D56383
4a6d7fc1a00b69925b3edc39acef0391487a8e3e Dmitry Salychev 2026-04-13 12:46:49
nvmf_che: Don't leak a socket if an error occurs finalizing the socket
If soreserve() or sosetopt() (to set TCP_NODELAY) fails after claiming
the socket from the file descriptor, explicitly close the socket
before returning failure.

Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55493
505f381cb96ee25bcf0df11cfaf15a601d969500 John Baldwin 2026-04-20 17:18:04
amd64: fix INVLPGB range invalidation
AMD64 Architecture Programmer's Manual Volume 3 says the following:

> ECX[15:0] contains a count of the number of sequential pages to
> invalidate in addition to the original virtual address, starting from
> the virtual address specified in rAX. A count of 0 invalidates a
> single page. ECX[31]=0 indicates to increment the virtual address at
> the 4K boundary. ECX[31]=1 indicates to increment the virtual address
> at the 2M boundary. The maximum count supported is reported in
> CPUID function 8000_0008h, EDX[15:0].

ECX[31] being what we call INVLPGB_2M_CNT, signaling to increment the
VA by 2M.

> This instruction invalidates the TLB entry or entries, regardless of
> the page size (4 Kbytes, 2 Mbytes, 4 Mbytes, or 1 Gbyte). [...]

Combined with this, my interpretation of the current code is: if
<va> is aligned on a PDE boundary, we'll use INVLPGB_2M_CNT to try and
invalidate <cnt> PDEs with a single call, but that only works if <va> is
the start of at least <cnt> 2M pages.  Otherwise, if <va> or any of the
subsequent PDEs isn't actually a superpage, then we would actually only
invalidate the *first* page within the PDE before skipping to the next
PDE, leaving the remainder of the 4K pages in between as they were.

The implication would seem to be that we would need to inspect the range
that we're trying to invalidate if we're planning on using
INVLPGB_2M_CNT at all, so this patch just simplifies it to a series of
4K invalidations.  My gut feeling is that we likely still come out on
top vs. the TLB shootdown we're avoiding.

This seems to explain some issues we've seen lately with fdgrowtable()
and kqueue on recent Zen4/Zen5 EPYC hardware, where we'd experience
corruption that we can't explain.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293382
Reviewed by:    alc, kib, markj
Differential Revision:  https://reviews.freebsd.org/D56458
1b8e5c02f5c07521129e06ff8ab7c660238fd75c Kyle Evans 2026-04-20 20:18:17
dpaa2: ni: add more stats and link information
In addition to the locally generated statistics counters, dpaa2 ni
provides a larger set of counters than we currently export via
sysctl.  Add (most of) the missing counters and descriptions.
Around Page 3/4 there are some things left to do if we want.
Also the manual was not clear on the descriptions of 3/0 and 3/1.

The second half of the change adds another sysctl note which exports
the link-state, speed, and capabilities set as a text-blob.  This is
especially interesting in case the "ni" stops passing packets.
From what I have found in that case the (internal) link state of the
ni goes DOWN but we do not see an interrupt for a link-state change.

Being able to diagnose the state helps to (manually) fix it for now
by changing the media status to 10BaseT or none and then back to auto.
That usually brings the internal link state back UP.

MFC after:      3 days
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279352
Reviewed by:    dsl, tuexen
Differential Revision: https://reviews.freebsd.org/D55321
c8cd633d78d04ff535960002ac9d1ab20f74b201 Bjoern A. Zeeb 2026-02-17 03:04:41
hwpmc: Implement IBS process sampling
This change enables process-wide sampling to work with IBS by ensuring
that read/write only gets or sets the current counter.

Reviewed by:    mhorne
Sponsored by:   Netflix
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2131
fd45987f1f66fe01b0cecede9e90c8aea5cae87e Ali Mashtizadeh 2026-04-07 23:30:51
ure: add USB device IDs for additional RTL8152/RTL8153 adapters
Add device IDs for several USB Ethernet adapters that use
RTL8152 and RTL8153 chips but are not yet recognized by ure(4).
This includes adapters from Cisco/Linksys, D-Link, Lenovo,
Microsoft Surface, Realtek, Samsung, and TP-Link.

All added devices use chip revisions already handled by
ure_read_chipver().

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D55748
76c082180719f42481289eb837e44b055efc003a Christos Longros 2026-04-21 14:14:09
powerpc: remove dead code call into x86 perfmon
FreeBSD and NetBSD has copied these lines from the x86 architecture when
porting to other machines and forgetting to delete them.

Reviewed by:    mhorne
Sponsored by:   Netflix
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2154
0ac31026e1e0fb4e4b8a2eaa8ce2ead6a945dc6e Ali Mashtizadeh 2026-04-20 22:23:57
linux: make sysent for membarrier
Regenerate linux syscall prototypes for membarrier(2).

Signed-off-by:  Ricardo Branco <rbranco@suse.de>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281691
Reviewed by:    kib, pouria
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2147
81f60a964a50b9c22361bb811be9ca089561e80c Ricardo Branco 2026-04-18 10:18:12
hkbd/ukbd: sysctls to swap macbook kbd modifiers
Many applications, desktop environments, window managers & text editors
favor the usage of Alt or Ctrl over Super (Cmd). On a Macbook it is
quite annoying that the Super (Cmd) key gets pride of place by the spacebar.

The standard MacBook Cmd key location only really makes sense for macOS
or maybe in some tiling wm if Mod4/Super is your main modifier.
For most mainstream desktops and window managers, having Alt or Ctrl
in that location makes much much more sense.

This patch adds two sysctls for swapping either Opt(Alt) or Ctrl with Cmd(Super).

Linux has similar sysctls to this; allowing a user to make an Apple
keyboard more "orthodox"/useful at a level that takes effect independent
of typing context - ie) tty, Xorg and/or wayland.

Having a sysctl to do these swaps means that a user doesn't have to faff
about with both creating a custom vt keymap AND figure out which magic
setxkbmap incantation one needs to make one's keyboard behave as desired
across environments.

Signed-off-by: ~Not Toby <0x2b@0xff.art>

Reviewed by:    wulf
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2141
c0e26f7b29ddd2d081ac113d64807849e87737a2 ~Not Toby 2026-04-23 05:10:05
sound: Do not check for NULL before deleting ac97_info->methods
It is allocated with M_WAITOK in ac97_create().

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/17
aba2523261c1e541debe674c059c1ac16210fc04 Christos Margiolis 2026-04-18 10:33:58
arm64/vmm: Enable 16-bit VMIDs when in use by pmap
pmap_init always uses 16-bit VMIDs when supported, but we never enable
them in VTCR_EL2 (for ASIDs, locore enables them in TCR_EL1 and
pmap_init keys off whether they've been enabled, but the order in which
pmap_init and vmmops_modinit run is reversed). As a result, although the
full 16-bit value can be stored to VTTBR_EL2 and read back, the upper 8
bits are treated as 0, and so VMIDs that our VMID allocation believes
are distinct end up aliasing.

In future this interface may change such that vmm decides on the VMID
width and tells the pmap to use that, with appropriate support for
unloading and reloading vmm, but that can come as a follow-up change, as
this is a more minimal bug fix.

Reviewed by:    markj
Obtained from:  CheriBSD
Fixes:          https://cgit.freebsd.org/src/commit/?id=47e073941f4e ("Import the kernel parts of bhyve/arm64")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55860
44e4f45aec4469440af434098e61bd13982bbbc0 Jessica Clarke 2026-04-23 15:40:33
ahci(4): Add another device ID for Marvell 9128 SATA controller: 0x91a3
This was encountered on a Gigabyte GA-P55A-UD4 motherboard identifying itself
as:
ahci0@pci0:2:0:0:       class=0x01018f rev=0x11 hdr=0x00 vendor=0x1b4b device=0x91a3 subvendor=0x1458 subdevice=0xb000
    vendor     = 'Marvell Technology Group Ltd.'
    class      = mass storage
    subclass   = ATA

The physical chip has "88SE9128-NAA2" printed on it.

Similar code has been in Linux for a long time:
https://github.com/torvalds/linux/commit/50be5e3657cd2851a297dc0b3fd459f25829d29b

Co-authored-by: Michael Osipov <michaelo@FreeBSD.org>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288526
Reviewed by:    jhb
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56464
c72edc2b2eb283450df8db05cf9321aee7de0bcb John W 2025-07-28 05:17:32
riscv: Switch the address argument to cpu_dcache_* to a pointer
No functional change, but this is friendlier for CHERI.

Effort:         CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
ef159bdd54cada6db8b0af6380fa9269d0f26a04 John Baldwin 2026-04-23 17:05:53
pmap_map_io_transient: Use void * instead of vm_offset_t for vaddr array
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
ec3a0b2a02ee2aa459aa72d751f6670b7f813f31 John Baldwin 2026-04-23 17:05:54
gve: Convert a couple of structure members from vm_offset_t to char *
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
025b39b854202b316f4c5ec3e00d727115ac0eaa John Baldwin 2026-04-23 17:05:54
powerpc aim64: Return vm_paddr_t from moea64_bootstrap_alloc
Consistently use vm_paddr_t for the type returned from
moea64_bootstrap_alloc and avoid temporarily smuggling it via a
pointer.  Instead, be explicit in the places that assume a 1:1
mapping.

Effort:         CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
c49cbf849dee9121ed3b972df56d240068d0423e John Baldwin 2026-04-23 17:05:54
amd64/aarch64 pmap: Switch type of pmap_preinit_mapping.va to void *
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
496453e9de3f27f84b6c68d2377f5e525d132967 John Baldwin 2026-04-23 17:05:55
pseries/llan: call init when ioctl sets interface UP
This should fix dhcp on an unitialized interface.  This solution was
found while comparing against another driver, SIOCSIFFLAGS is used by
dhclient to force the interface up before it has an IP address.
However, all setup work is done in llan_init(), so the interface would
not be enabled if configured via only the SIOCSIFFLAGS ioctl.  By
running llan_init() when the interface is forced up via SIOCSIFFLAGS,
the interface is initialized properly.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292164
74dff310698b9a4da9804ed0ded00428b0aebbe8 Justin Hibbits 2026-04-23 03:12:37
pmc: Implement the feature bits for recent Zen 4/5
Ensure that the optional MSRs and the user flags are guarded by the
cpuid feature flags.  This prevents the user from triggering undefined
behavior or crashes on AMD processors where some of these features are
not present.  As part of this, I added the branch target and DATA4 MSRs
to the IBS op state as those are only present on a subset of the Zen
chips that I have tested.

Reviewed by:    mhorne
Sponsored by:   Netflix
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2133
576c6e9620dff3e92f3c5d1e5be4d92c9eb29828 Ali Mashtizadeh 2026-04-08 05:36:53
i386: Remove perfmon performance monitoring facility
Remove the perfmon performance monitoring facility that was for Intel
Pentium and Pentium Pro processors.

Reviewed by: imp,mhorne,emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/2155
70ae0c4524d2c5d0aae3339e95f6bd4f3c480b6e Ali Mashtizadeh 2026-04-20 22:06:30
speaker(4): Update outdated comments
The comments in tone() were referring to pre-2000 logic that does not
exist any more. This patch updates them.

Signed-off-by: Raphael Poss <knz@thaumogen.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
03a515e9890b0c6844457254e26dc34333b85127 Raphael Poss 2025-12-10 19:53:21
speaker(4): drop NEEDGIANT
When the frequency configuration logic was moved to clock.c in 2008, a
mutex lock was added there (timer_spkr_setfreq) to serialize accesses
to the I/O register.

Since then, no more calls to disable/enable_intr were needed in spkr.c
than they were needed in the other callers to the same timer_spkr
functions in syscons / kern_cons, that is, not at all. This is because
there are no other accesses remaining in the kernel to the i8254
timers after boot than through clock.c.

For context, see commits
e46598588587b4897f6604489364f83fffd4d033
and
93f5134aaf829826dbcbea457bfeb27389761854.

Signed-off-by: Raphael Poss <knz@thaumogen.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
43b7cf42d425abc84a1313b7eed933438804a051 Raphael Poss 2025-12-10 20:12:22
speaker(4): make spkropen thread-safe
Signed-off-by: Raphael Poss <knz@thaumogen.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
a80ec2b51ac6b8f2588b927913e40c7a3d2862e6 Raphael 'kena' Poss 2026-01-01 16:34:44
speaker(4): one ioctl / write at a time
If two processes are holding a spkr fd, we want orderly access to the
allocated tone buffer and the speaker itself.

Signed-off-by: Raphael Poss <knz@thaumogen.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
e2199dc33f16332b3e138da3059ba57c25ef713d Raphael 'kena' Poss 2026-01-01 16:45:45
speaker(4): enable concurrent opens from different threads
Prior to this patch, a thread would get EBUSY on open(2) if another
thread had the speaker open.

With this patch, two or more threads/processes can use the speaker
device at the same time. When two or more threads write to the speaker
concurrently, individual melodies--single strings, as written by
write(2) or ioctl(2) with command SPKRTONE/SPKRTUNE--are played
atomically.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
d76523a318d79767225ae020422a8f10046084af Raphael 'kena' Poss 2026-01-11 21:47:43
speaker(4): move static data to text
Make this data const (it doesn't change) which will also move it to
a text section.

Signed-off-by: Raphael Poss <knz@thaumogen.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
f31e6b198faa98c4f8a7b681b4e01218f8468411 Raphael 'kena' Poss 2026-01-11 21:07:35
ena: Adjust ena_[rt]x_cleanup to return bool
The ena_[rt]x_cleanup functions are limited internally to a maximum
number of packets; this ensures that TX doesn't starve RX (or vice
versa) and also attempts to ensure that we get a chance to refill
the RX buffer ring before the device runs out of buffers and starts
dropping packets.

Historically these functions have returned the number of packets which
they processed which ena_cleanup compares to their respective budgets
to decide whether to reinvoke them.  This is unnecessary complication;
since the precise number of packets processed is never used, adjust
the APIs of those functions to return a bool indicating if they want
to be reinvoked (aka if they hit their limits).

Since ena_tx_cleanup now only uses work_done if diagnostics are
enabled (ena_log_io macros to nothing otherwise) eliminate that
variable and pass its value (ENA_TX_BUDGET - budget) to ena_log_io
directly.

No functional change intended; this will simplify a future commit.

Reviewed by:    akiyano
Sponsored by:   Amazon
MFC after:      6 days
Differential Revision:  https://reviews.freebsd.org/D56478
f6d2c8591c10d87050c358ef20428f13c19554ca Colin Percival 2026-04-17 17:13:44
ena: Budget rx descriptors, not packets
We had ENA_RX_BUDGET = 256 in order to allow up to 256 received
packets to be processed before we do other cleanups (handling tx
packets and, critically, refilling the rx buffer ring).  Since the
ring holds 1024 buffers by default, this was fine for normal packets:
We refill the ring when it falls below 7/8 full, and even with a large
burst of incoming packets allowing it to fall by another 1/4 before we
consider refilling the ring still leaves it at 7/8 - 1/4 = 5/8 full.

With jumbos, the story is different: A 9k jumbo (as is used by default
within the EC2 network) consumes 3 descriptors, so a single rx cleanup
pass can consume 3/4 of the default-sized rx ring; if the rx buffer
ring wasn't completely full before a packet burst arrives, this puts
us perilously close to running out of rx buffers.

This precise failure mode has been observed on some EC2 instance types
within a Cluster Placement Group, resulting in the nominal 10 Gbps
single-flow throughput between instances dropping to ~100 Mbps as a
result of repeated rx overruns causing packet loss and ultimately
retransmission timeouts.

To correct this, switch from processing up to ENA_RX_BUDGET (256)
packets to processing up to ENA_RX_DESC_BUDGET (256) descriptors (or
slightly more, if we hit the limit in the middle of a packet).  This
ensures that, even with jumbos, we refill the ring before processing
most of a ring worth of descriptors, and returns the throughput to
expected levels.

Note that theoretically up to ENA_PKT_MAX_BUFS (19) descriptors can be
used for a single packet, in which case even 54 packets would exhaust
the default rx buffer ring; it's not clear if this ever occurs in
practice, but this fix will address that case as well.

Reviewed by:    akiyano
Sponsored by:   Amazon
MFC after:      6 days
Differential Revision:  https://reviews.freebsd.org/D56479
0f7b8f79f67b25cb0727c7b7d604eb1eec91fef1 Colin Percival 2026-04-17 17:40:00
vt_core: delay the shutdown splash event handler
Even though the functions are currently executed in the correct order,
there's no garuntee that this will always be the case.

Reported by:    kevans
Discussed with: kevans
Fixes:          https://cgit.freebsd.org/src/commit/?id=4b862c713ac5556ab4bd1828b47c5eb9cb28e067
MFC after:      3 days
e72c59315e7a2bedd654ac7c6e82dd3ceba30ed2 Ahmad Khalifa 2026-04-20 20:11:27
vt_core: make sure the driver's functions exist
These are NULL if they're not implemented. Make sure all the functions
we need are there before doing anything.

Also invert the first if statment to lessen the indentation a bit.

Reported by:    Quentin Thébault <quentin.thebault@defenso.fr>
MFC after:      3 days
d1854272b646306de6546f8e5702e8072051d7f6 Ahmad Khalifa 2026-04-20 20:15:00
vtnet: remove loader tunable fixup_needs_csum
Removes the deprecated loader tunable fixup_needs_csum. Removes also
the sysctl counter rx_csum_bad_offset that is no longer in use.

Reviewed by:            tuexen
Event:                  Wiesbaden Hackathon 2026
Differential Revision:  https://reviews.freebsd.org/D55588
1bfd392b9e4dcddef3d80efaa517fafa648cd0b1 Timo Völker 2026-04-26 09:42:38
x86/ucode: fix gcc uninitialised warning
This fixes the case where selected_size is never set to anything
in the loop.  Whilst here, also set selected_fw to NULL so the case
of "no firmware" correctly sets everything to NULL/0.

```
  --- ucode_subr.o ---
  /workspace/src/sys/x86/x86/ucode_subr.c: In function 'ucode_amd_find':
  /workspace/src/sys/x86/x86/ucode_subr.c:237:25: warning: 'selected_size' may be used uninitialized [-Wmaybe-uninitialized]
    237 |         *selected_sizep = selected_size;
        |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
/  workspace/src/sys/x86/x86/ucode_subr.c:105:16: note: 'selected_size' was declared here
    105 |         size_t selected_size;
        |                ^~~~~~~~~~~~~
```

Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D55439
92e5f6e1995acb10628ab210cc9f19dbf74f2948 Adrian Chadd 2026-04-26 23:03:02
amd64: ia32_fetch_syscall_args() does not need to check params != NULL
Whatever params pointer is, it does not matter.  copyin() handles any
values.  In fact, params cannot be ever NULL.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56630
912f9dfca451e359dda7cdf45539b7c19764f54d Konstantin Belousov 2026-04-25 09:46:50
amd64 ia32_syscall(): only allow for ILP32 processes
64bit processes can issue INT $0x80 instruction, and get the syscall
dispatched through ia32_syscall().  This works because syscall argument
fetch and result return are selected from the process sysent.

But, ia32_syscall() does not verify some conditions and does not perform
some actions which are considered unnecessary because the caller is
supposed to only access lower 4G.  The INT syscall path breaks this
assumption.

We never supported such hack, so disable it.  Send the offending thread
SIGBUS as if #GP was issued by hardware due to IDT vector 0x80 having
not numerically high enough DPL value.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56630
bd8edba0792b71be3f8ed5dea9c22287e95c986a Konstantin Belousov 2026-04-25 09:49:08
if_awg: Add missing awg_poll() prototype
The function awg_poll() was missing a prototype, which causes the build
to fail if DEVICE_POLLING is enabled, which it is in the ARMADAXP config.

MFC after:      2 weeks
Reviewed by:    tuexen, mmel, adrian
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56651
c73cd9ca3ff875a65b6969b7183eb7fcdb23857c Lexi Winter 2026-04-27 06:57:13
virtio_net: Use bus_dma for rxq/txq buffers
While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.

The virtio buffers are marked as coherent; this should ensure that sync
calls are no-ops in the common cases.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55492
c16c95192f01237a876eb7bc336e3bbda9310171 Sarah Walker 2026-02-16 14:19:13
virtio_net: Use bus_dma for command/ack buffers
While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.

The virtio buffers are marked as coherent; this should ensure that sync
calls are no-ops in the common cases.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55564
b5bad6df467cc95bea641afe674c55cd5b9f1510 Sarah Walker 2026-02-27 14:17:15
arm64: Stop using cpu_tlb_flushID in kexec
It will be removed soon & replaces with pmap_s1_invalidate_all_kernel.
This allows us to handle errata that cpu_tlb_flushID is missing
workarounds for.

Sponsored by:   Arm Ltd
4bdbb6f7f7c6913d6296279a856a0bb229ecb83f Andrew Turner 2026-04-27 11:34:56
arm64: Remove cpu_tlb_flushID now it's unused
Reviewed by:  alc
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D52185
04e4268f60e432097427e3d757aac6bc0ae24044 Andrew Turner 2026-04-27 10:57:32
arm64: Ditch arm64-specific unsound PCPU optimisation
The current arm64 PCPU implementation uses a global register asm
variable to use x18, which we reserve with -ffixed-x18, from C. Inside a
critical_enter() or sched_pin(), it is vital that any PCPU reads use the
right PCPU pointer, as often the whole point of the critical_enter() or
sched_pin() is to ensure consistent PCPU use (e.g. for SMR it relies on
zpcpu giving the same SMR state). critical_enter() and sched_pin() both
include atomic_interrupt_fence(), i.e. asm volatile("" ::: "memory"),
barriers to ensure that memory accesses don't get moved by the compiler
outside the critical section, which on most architectures will also
order the read of the PCPU pointer itself (whether due to the read being
another asm volatile statement, or due to using a segment-relative
memory access as on x86). However, this approach on arm64 is in no sense
a memory access, and therefore the register access is not ordered with
respect to the the critical_enter() or sched_pin(), or more specifically
the curthread->td_critnest++ / curthread->td_pinned++ within.

In practice upstream today this works out ok because the read of x18 is
inlined into the actual PCPU_GET/ADD/SET memory accesses (i.e. you will
get something like ldr xN, [x18, #imm-or-xM] for PCPU_GET, etc.), and
since *that* instruction is ordered properly due to being a memory
access, the x18 ends up being read in the right place. However, that is
not in any way guaranteed, it just relies on the hope that compiler
optimisations will be perfect at inlining the use. Moreover, PCPU_PTR is
definitely not a memory access in this world, it's just pointer
arithmetic on x18, and so that has nothing ordering it. This can be
observed with the following test function compiled into the kernel:

    void
    pcpu_test(void)
    {
            extern void __weak_symbol use_pcpu_ptr(void *);
            critical_enter();
            use_pcpu_ptr(PCPU_PTR(curthread));
            critical_exit();
    }

Obviously, this is a bit contrived as you could just read curthread
directly via its atomic definition that bypasses any worries about PCPU
atomicity, but it illustrates the point. With the in-tree LLVM*, this
ends up being compiled for me to:

    paciasp
    stp     x29, x30, [sp, #-0x10]!
    mov     x29, sp
    ldr     x8, [x18]
    ldr     w9, [x8, #0x4fc]
    mov     x0, x18
    add     w9, w9, #0x1
    str     w9, [x8, #0x4fc]
    bl      use_pcpu_ptr
    ...

Note that, although the PCPU_PTR was within the critical section in the
C source, the read of x18 into x0, the argument register passed to
use_pcpu_ptr, has been hoisted to before the str, which is storing the
new, incremented, value of td_critnest to curthread, and so there is a
window within which we have to hope the thread is not preempted and
migrated to a different CPU, otherwise it will pass a pointer to the
wrong CPU's pc_curthread PCPU member.

Initially it would seem as though the solution to this would be to add
an additional barrier to critical_enter() / sched_pin() to ensure the
register reads could not be hoisted like this. However, I have not been
able to find a sequence that works reliably across both GCC and Clang,
independent of optimisation level. Using inline asm with x18 marked as a
clobber, using "=r"(pcpup), and using "+r"(pcpup) all run into various
issues; some combinations don't actually seem to be a barrier, and for
Clang at -O0 some combinations will actually generate writes to x18**,
at which point you then have to hope that the kernel is compiled with
optimisations, and that the redundant writes are optimised away such
that x18 is just passed through. But that just gets us back to hoping
optimisation works, which isn't a solution to the problem, it just
trades one point of fragility for another.

In talking to GCC developers, who seemed rather horrified by the
implications of trying to do this (which is effectively "register
volatile", a combination that's explicitly forbidden), we could not find
a solution to this, and so I have concluded that the only reliable to
have a sound PCPU implementation is to ditch this optimisation and
follow other non-x86 architectures in using inline asm in one form or
another; specifically, this adopts riscv's approach of just calling
get_pcpu(), which, curiously, was already implemented in inline asm here
on arm64, rather than reading pcpup.

Anyone who feels strongly enough about PCPU performance is welcome to
try to find a working approach, but such proposals should be heavily
scrutinised to be certain that they won't come back to bite us in
future. In particular, this caused a lot of problems downstream in
CheriBSD's experimental compartmentalised kernel, which is trialling
interposing on PCPU accesses in order to restrict access within
compartments. As a result, even PCPU_GET/SET/ADD can look like PCPU_PTR,
as they pass an opaque PCPU reference to wrapper functions, and so this
case gets hit all over the kernel, giving highly-confusing panics with
locks that aren't owned by the current thread or SMR use allegedly not
within an smr_enter().

The ia64 port encountered the same issue and reached the same conclusion
in e31ece45b7a4 ("Fix the PCPU access macros."), though went to the
trouble of trying to fold the offset into the inline assembly (assuming
it fit, with no fallback if not, since it's using the add pseudo-op that
will be expanded to either adds with a 14-bit immediate or, if somehow
that doesn't fit, addl with a 22-bit immediate). Curiously though it
left pcpup around as a footgun. sparc64 had similar code but was never
fixed. It also defined a curpcb in the same manner which was presumably
similarly broken, but looks to have been entirely unreferenced from C,
only referenced in actual assembly files. Alpha also had the same
design, but it was removed whilst critical_enter() was extern rather
than static inline so uses of the pointer could not have been hoisted,
and whilst sched_pin() didn't have any form of atomic_interrupt_fence()
to even try to make PCPU well-ordered.

 * At time of writing, when that was LLVM 19, not verified at time of
   commit with LLVM 21.

** For "+r"(pcpup), Clang's initial code generation is to do:

       mov xTtmp1, x18
       mov x18, xTmp1
       /* asm (empty) */
       mov xTmp2, x18
       mov x18, xTmp2

   since its interpretation of what that means is "read the value of
   pcpup, and make sure that value is in x18 for the duration of the
   assembly due to the asm("x18") on pcpup", and similarly for the output
   side.

Reviewed by:    andrew, jhb
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56601
551d47c5677a5eaf0a1ed2ea3b2b1406b192764d Jessica Clarke 2026-04-27 12:53:29
Commit group #14: qcom_tlmm
qcom_tlmm: prepare for supporting multiple TLMM platforms

* Create a set of callbacks implementing the hardware specific
  GPIO bus operations
* Migrate the IPQ4018 TLMM setup code into qcom_tlmm_ip4018.c

Differential Revision:  https://reviews.freebsd.org/D56349
20baee6bfed2f39008955dce1f0ce31eb10805f3 Adrian Chadd 2025-02-10 00:49:45

qcom_tlmm: extend the IPQ4018 pinmux function mask to 4 bits

It's 4 bits, not 3. Oops.

Differential Revision:  https://reviews.freebsd.org/D56350
fedc032e110aea98cc976f71ef934c564fc0a8ad Adrian Chadd 2026-04-07 10:08:20

qcom_tlmm: add i2c pull up strength config option

The X1E and others have a separate configuration bit to increase the
pull-up drive strength for i2c busses.

Add the plumbing; it doesn't do anything just yet.

Differential Revision:  https://reviews.freebsd.org/D56351
f65a4854bf82f60002e268928614e379da852005 Adrian Chadd 2026-04-07 10:09:44
ena: Report RX overrun errors
Extract rx_overruns from the keep alive descriptor reported by
the device and expose it via sysctl hw stats.

RX overrun errors occur when a packet arrives but there are not
enough free buffers in the RX ring to receive it.

MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D56640
e3f4a63af63bea70bc86b6c790b14aa5ee99fcd0 David Arinzon 2026-04-15 12:13:56
ena: Update driver version to v2.8.3
Features:
* Report RX overrun errors via sysctl hw stats

Bug Fixes:
* Budget rx descriptors, not packets, to fix jumbo frame throughput

Minor Changes:
* pmap_change_attr void * API change for FreeBSD 16.0+
* Adjust ena_[rt]x_cleanup to return bool

MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D56641
af7911d3b732b8e0d4254c5d0bf60d74ced89157 Arthur Kiyanovski 2026-04-25 18:47:26
Commit group #15: bnxt_en
bnxt_en: Add core SR-IOV infrastructure

Introduce the foundational building blocks for SR-IOV Virtual Function
support on Broadcom NetXtreme-C/E adapters.

* Add bnxt_sriov.h: defines the extended bnxt_vf_info structure (per-VF
  firmware FID, MAC addresses, VLAN, flags, DMA command buffers, resource
  counts), the bnxt_resc_map helper, flag macros (BNXT_VF_TRUST,
  BNXT_VF_SPOOFCHK, etc.), and prototypes for all SR-IOV functions.

* Add bnxt_sriov.c: implements the SR-IOV attachment sequence
  (bnxt_sriov_attach), the iflib IOV callbacks (bnxt_iov_init,
  bnxt_iov_uninit, bnxt_iov_vf_add), VF resource allocation and
  firmware configuration helpers (bnxt_alloc_vf_resources,
  bnxt_cfg_hw_sriov, bnxt_hwrm_func_vf_resc_cfg, bnxt_hwrm_func_buf_rgtr,
  bnxt_hwrm_func_vf_resource_free), and the per-VF parameter helper.

* Extend bnxt.h: include bnxt_sriov.h; extend bnxt_pf_info with VF-
  tracking fields (vf array, firmware FID/MAC, resource-reservation
  strategy, DMA page management, sysctl context); replace the upstream
  bnxt_vf_info stub with the full definition from bnxt_sriov.h; extend
  bnxt_func_qcfg with allocation counters required by the VF resource
  configuration path; add vf_resc_cfg_input and sriov_lock to bnxt_softc.

* Update Makefile to build bnxt_sriov.c and include bnxt_sriov.h.

* Wire up PCI-IOV device methods (pci_iov_init / pci_iov_uninit /
  pci_iov_add_vf) and iflib IOV callbacks (ifdi_iov_init / ifdi_iov_uninit
  / ifdi_iov_vf_add) in if_bnxt.c; call bnxt_sriov_attach() from
  bnxt_attach_post() on P5+ Physical Functions.

MFC after:      1 month
Reviewed by:    ssaxena
Differential Revision: https://reviews.freebsd.org/D56197
f2f831b2c151a9d989a94fc7c894118c802ef348 Chandrakanth Patil 2026-03-31 16:59:00

bnxt_en: Add VF load path and PF/VF context differentiation

Teach the driver to distinguish a Physical Function from a Virtual
Function at probe time and configure each appropriately.

* Introduce bnxt_is_vf_device() to identify all known VF device IDs
  (NetXtreme-C/E Gen1-3, Thor1/2, Hyper-V variants).  Add corresponding
  PVID entries to bnxt_vendor_info_array.

* Refactor the iflib shared context: rename bnxt_sctx_init to
  bnxt_sctx_template, add a Thor2-specific bnxt_sctx_template_p7, and
  build per-call PF/VF instances via bnxt_init_sctx_variants(); the VF
  instance carries IFLIB_IS_VF.  bnxt_register() selects the correct sctx.

* bnxt_attach_pre(): replace the hard-coded NPAR/VF switch with
  bnxt_set_flags_by_devid(); on a VF call bnxt_approve_mac() to request
  PF approval for the firmware-assigned MAC address.

* bnxt_hwrm_func_qcaps(): populate fw_fid and MAC for PF and VF contexts
  separately; for PF call iflib_set_mac() and record max_msix_vfs; for VF
  handle the case where the PF has not yet assigned a MAC.

* bnxt_hwrm_func_qcfg(): populate the new alloc_* counters used by the VF
  resource configuration path; record registered_vfs for PF and VLAN/trust
  state for VF.

* bnxt_init(): call bnxt_update_vf_mac() on VFs after each bring-up.

MFC after:      1 month
Reviewed by:    ssaxena
Differential Revision: https://reviews.freebsd.org/D56198
a5bedb41e5d6b3680981f109c3e89fb5ffd8eee1 Chandrakanth Patil 2026-03-31 16:59:01

bnxt_en: Add VF forwarded HWRM request handling

Enable the Physical Function to proxy HWRM commands issued by Virtual
Functions through the firmware forwarded-request mechanism.

When a VF issues a command that requires PF arbitration, the firmware
delivers a CMPL_BASE_TYPE_HWRM_FWD_REQ completion to the PF async ring.

* bnxt_process_async_msg() recognises CMPL_BASE_TYPE_HWRM_FWD_REQ,
  identifies the originating VF by its firmware function ID, sets the
  corresponding bit in pf.vf_event_bmap, and raises
  BNXT_HWRM_EXEC_FWD_REQ_SP_EVENT to schedule deferred processing.

* bnxt_sp_task() dispatches to bnxt_hwrm_exec_fwd_req(), which iterates
  over all pending VF bits and calls bnxt_vf_req_validate_snd() for each.

* bnxt_vf_req_validate_snd() inspects the encapsulated request type:
  HWRM_FUNC_VF_CFG (MAC change) is handled by bnxt_vf_configure_mac()
  which enforces trust/existing-MAC rules; HWRM_CFA_L2_FILTER_ALLOC is
  handled by bnxt_vf_validate_set_mac(); HWRM_FUNC_CFG is forwarded
  as-is; all other commands are rejected.

All forwarded-request code is guarded by #ifdef PCI_IOV.

MFC after:      1 month
Reviewed by:    ssaxena
Differential Revision: https://reviews.freebsd.org/D56199
fcf100da9b381ad9d81f94499fdadea15ae2b431 Chandrakanth Patil 2026-03-31 16:59:01

bnxt_en: Add per-VF trust, spoof-check and promiscuous controls

Expose per-VF policy knobs via the FreeBSD sysctl tree and enforce
them at the data-path level.

Trust (dev.bnxt.<unit>.vfN.trusted):
  bnxt_set_vf_trust() sets/clears BNXT_VF_TRUST and sends
  HWRM_FUNC_CFG with FLAGS_TRUSTED_VF_ENABLE/DISABLE.
  bnxt_create_trusted_vf_sysctls() / bnxt_destroy_trusted_vf_sysctls()
  manage the sysctl lifetime with VF creation/teardown.

Spoof-check (dev.bnxt.<unit>.vfN.spoofchk):
  bnxt_set_vf_spoofchk() issues HWRM_FUNC_CFG with
  SRC_MAC_ADDR_CHECK_ENABLE/DISABLE.

Promiscuous gating:
  bnxt_is_trusted_vf() queries firmware via HWRM_FUNC_QCFG.
  bnxt_promisc_ok() returns false for untrusted VFs, preventing them
  from entering promiscuous mode.  bnxt_promisc_set() is updated to
  gate the PROMISCUOUS and ANYVLAN_NONVLAN mask bits on bnxt_promisc_ok().

bnxt_iov_vf_add() applies the initial trust/spoof-check policy from the
nvlist schema.  bnxt_iov_init() creates the sysctl trees after
bnxt_cfg_hw_sriov() succeeds.  bnxt_iov_uninit() tears them down.

MFC after:      1 month
Reviewed by:    ssaxena
Differential Revision: https://reviews.freebsd.org/D56200
ea4ab7e36ed9cf153c374782be446254a7d11822 Chandrakanth Patil 2026-03-31 16:59:01

bnxt_en: Re-enable SR-IOV after firmware reset

When the firmware undergoes a hot-reset and the driver re-opens the
device, previously active Virtual Functions lose their resource
configuration.  bnxt_reenable_sriov() restores that configuration by
replaying bnxt_cfg_hw_sriov() with the saved resource parameters.

The function is called from bnxt_fw_reset_task() in the
BNXT_FW_RESET_STATE_OPENING state, guarded by #ifdef PCI_IOV.
Because bnxt_cfg_hw_sriov() is a no-op when active_vfs is zero the
call is safe on any PF regardless of whether VFs were ever created.

MFC after:      1 month
Reviewed by:    ssaxena
Differential Revision: https://reviews.freebsd.org/D56201
8743209350cb4b7db6d367df99da0a7ae3bc5d39 Chandrakanth Patil 2026-03-31 16:59:02

bnxt_en: VF ring reservation, HWRM registration, and PF-only operation guards

VFs require separate HWRM commands for ring reservation and async
completion ring setup, so a common PF/VF dispatcher is introduced and
the async CR path is extended to handle both.  The PF must populate the
VF request forwarding bitmap during driver registration so the firmware
correctly forwards VF-originated HWRM commands.  VF reservation strategy
and min-guaranteed capability flags are now parsed for correct resource
partitioning, and PF-only operations (DCB, NVM, package version sysctl)
are guarded against VF invocation.

The short command buffer allocation is also reordered before the function
reset to ensure extended HWRM messages are available when needed, a
prerequisite uncovered during VF bring-up.

MFC after:      1 month
Reviewed by:    ssaxena
Differential Revision: https://reviews.freebsd.org/D56232
c972c5acbac472a5dc797856f39f478862b6c6ea Chandrakanth Patil 2026-04-02 23:04:45

bnxt_en: Address review comments for core SR-IOV support

This patch addresses the code review comments provided for:
https://reviews.freebsd.org/D56197

* P7 VF PCI ID: rename NETXTREME_E_P7_VF to E_P7_VF (P7/Thor2 line drops the
  Netxtreme name in product strings; other VF device IDs are unchanged).
* Use the return value of bnxt_vf_parse_schema() in bnxt_iov_vf_add() to
  decide when to call bnxt_set_vf_admin_mac(); make parse_schema() return
  bool and remove the has_admin_mac field.
* In bnxt_free_vf_resources(), fix indentation after dma_free_coherent() so
  the NULL assignment is clearly separate from the call.
* In bnxt_hwrm_func_vf_resource_free(), use first_vf_id/last_vf_id in the
  HWRM_FUNC_VF_RESC_FREE loop.

MFC after:      1 month
Reviewed by:    ssaxena
Differential Revision: https://reviews.freebsd.org/D56644
7c450d1127c7f08361f848c0ac57189910da8d3b Chandrakanth Patil 2026-04-26 18:11:31

bnxt_en: add bnxt_sriov.c to sys/conf/files for built-in kernel builds

The SR-IOV series added bnxt_sriov.c and listed it in sys/modules/bnxt/bnxt_en/Makefile,
but kernels that build bnxt into the image only compile sources named in sys/conf/files.
Add bnxt_sriov.c next to the other bnxt_en entries so built-in bnxt (including LINT)
links the SR-IOV implementation and avoids undefined symbols referenced from if_bnxt.c.

Fixes: https://cgit.freebsd.org/src/commit/?id=f2f831b2c151 ("bnxt_en: Add core SR-IOV infrastructure")

MFC after:      1 month
Reviewed by:    ssaxena
Differential Revision: https://reviews.freebsd.org/D56688
c21c63fb565f1bc7f9564dbf12068c864f8891d8 Chandrakanth Patil 2026-04-28 14:10:13
amd64: Make EFI runtime faults look less like panics
EFI runtime faults may be mistaken for kernel panics, and do not
necessarily represent actual problems.  Try to differentiate them some
more by printing "EFI runtime trap" rather than "Fatal trap".

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291193
Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56309
ddabf7f3ea4f0497dc5a5ffcbbb1d852ea77a4cd Ed Maste 2025-11-26 19:28:13
hwpmc: Add IBS capability control policy
Reject unsupported AMD IBS and PMU control bits before programming the
MSRs.

Initialize IBS fetch/op allow masks from CPUID feature bits and validate
user-provided IBS control values against those masks. Keep the
load-latency filter dependency on L3MissOnly, but avoid decoding fields
that are already constrained by the mask.

Apply the same reserved-bit policy to the AMD PMU raw-config path by
checking core, L3, and data fabric configs against subclass-specific
masks.

Fix the IBS CPUID feature bit definitions used by the policy.

Reviewed by:    mhorne, Ali Mashtizadeh <ali@mashtizadeh.com>
Sponsored by:   AMD
Signed-off-by:  Andre Silva <andasilv@amd.com>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2140
39f48829a045e22c39e7099fa39c1a8b7d3fa7f4 Andre Silva 2026-04-23 19:45:26
hwpmc: Add extra_mask sysctls per counter type
Expose kern.hwpmc.{ibs_fetch,ibs_op,amd_core,amd_l3,amd_df}_extra_mask
as RWTUN uint64s that OR into the CPUID-derived allow mask at
validation time. Default 0, so the strict policy applies unless an
administrator opts bits back in — intended for testing the wrmsr_safe
path in PR #2157.

Reviewed by:    mhorne, Ali Mashtizadeh <ali@mashtizadeh.com>
Sponsored by:   AMD
Signed-off-by:  Andre Silva <andasilv@amd.com>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2140
146b30bad9f65a098e6c09ae93bb1da2ff59616d Andre Silva 2026-04-23 19:27:06
arm64: Support some per-thread sctlr_el1 fields
This will be used to enable MTE from userspace.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55950
01ff0fa77d33dde6b6f6a0ff83b0028f76243796 Andrew Turner 2026-04-29 11:34:39
arm64: Fix a MTE check
It should be for FEAT_MTE2 as the registers aren't implemented for
FEAT_MTE.

While here fix the style of the comment explaining the check.

Reported by:    markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=58de79153622 ("arm64: mte: configure initial state for system registers")
Sponsored by:   Arm Ltd
2783fb7e7321911b4159d7f41d1c80cae40a7552 Andrew Turner 2026-04-29 11:34:49
netmap: check for possible out-of-bound write with options
Submitted by: hari.thirusangu@sophos.com
MFC after:      2 weeks
0216ea8598af7d4170a8660f48981fb12b7b1d67 Vincenzo Maffione 2026-04-29 20:59:17
Commit group #16: powerpc/pic: Add a PIC_AP_INIT() to set up AP PIC info
powerpc/pic: Add a PIC_AP_INIT() to set up AP PIC info

pc_cpuid may not match the PIC's idea of a given CPU.  Since openpic
has a WHOAMI register, we can use that to get the PIC's idea of the CPU.
This needs to be done on each AP, so add a PIC_AP_INIT device method so
the PIC can perform any AP-specific initialization at AP bootstrap time.

This fixes SMP on e6500, which is still lacking SMT support.

Differential Revision:  https://reviews.freebsd.org/D56421
40bcad56f1b8b3a0eed9af68de5535a784c004d9 Justin Hibbits 2026-04-30 00:12:18

powerpc/pic: fix the openpic CPU logic to work on powermac

Earlier work (40bcad56f - powerpc/pic: Add a PIC_AP_INIT() to
set up AP PIC info) broke booting my dual G5 powermac.

After much digging, jhibbits@ and I discovered that the openpic
implementation for the memory/bus controller used in the G5 CPUs
doesn't implement /all/ of the openpic specification.
Notably it sticks the WHOAMI register in a different location.
This is reading 0x0 back for all the PICs which is .. very not great.

So to restore the previous behaviour, use a quick for now that jhibbits@
can set appropriately to trust WHOAMI.

I've tested this on my dual G5 PPC and it boots/runs fine.

Fixes: https://cgit.freebsd.org/src/commit/?id=40bcad56f

Reviewed by:    jhibbits
Differential Revision:  https://reviews.freebsd.org/D56751
6a0610cb50181d1797d1a8c5d60ad76c666a625e Adrian Chadd 2026-05-01 00:07:48
powerpc/openpic: Increase the maximum number of IRQs allowed
The Freescale MPIC supports up to 2048 IRQs, but since we only build an
array of 768 interrupts in intr_machdep, clamp the max at 512.  The most
any Freescale PowerPC chip actually supports is 452 on the T4240, so 512
is sufficient.

As part of this, increase the vector mask to the full openpic vector
mask, and use this limit as the terminator for the dispatch loop,
instead of a hard-coded 255.

Differential Revision:  https://reviews.freebsd.org/D56422
605f53705d6dc57ed391353cecf3ce84a4283740 Justin Hibbits 2026-04-30 00:13:11
iicmux: Return the right error codes
I2C subsystem errors belong in the IIC_* error space.  It's pretty clear
this is what is intended in the code.
0a705587e4720cdb0317efb80e9452d236c5cfcf Justin Hibbits 2026-04-22 22:49:16
mpc85xx/msi: Add compat string for T208x/T4xxx SoCs
59a844b9cea7bbe92b3899805acd1699c5006ed7 Justin Hibbits 2026-04-16 01:48:21
asmc: replace hardcoded model table with universal probing
Probe SMC keys at attach time to detect hardware capabilities,
supporting all Intel Apple machines without per-model entries.

Sensors are discovered by scanning sorted SMC key ranges for
known prefixes and types. Capabilities such as SMS, fan safe
speed, and ambient light are detected by key presence.

A global key description table provides human-readable names
for well-known temperature sensors.

Tested on:
 - MacBook Pro (Early 2007, Mid 2014, Mid 2015)
 - MacBook Air (Early 2015, Mid 2017)
 - iMac (Mid 2011, Late 2013)
 - Mac mini (Mid 2011)

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D56405
e7f4269dbfad02119934c35d523cb33ff8c93493 Abdelkader Boudih 2026-04-30 00:38:38
dev/ichsmb: disable block buffer if supported
In order to improve the efficiency of block read/write calls, Intel has
introduced a block buffer. Instead of generating an interrupt after
receiving/sending a single byte, the data is buffered in the block buffer. It
allows the SMBus controller to generate a single interrupt for the whole
transfer. At the moment, we don't support that and don't expect the SMBus
controller to behave in that way. Unfortunately, BIOS code can also access the
SMBus controller and may enable the block buffer. Poorly written BIOS code may
also keep the block buffer enabled breaking our driver. Therefore, we should
check if the device supports a block buffer and disable it for every request
because we don't know if some BIOS code has reconfigured the SMBus controller
in between.

Reviewed by:            emaste
MFC after:              1 week
Sponsored by:           Beckhoff Automation GmbH & Co. KG
Pull Request:           https://github.com/freebsd/freebsd-src/pull/2161
226b37dc3ad5641c18f8542c18baea3ea641c5af Corvin Köhne 2026-03-30 09:33:20
snd_uaudio: Support Roland UA-33
Apply the appropriate quirk. Also, introduce a new uaudio_vendor_audio
table, similar to uaudio_vendor_midi, which includes non-standard USB
audio devices. The Roland UA-33 needs this, bceause it comes with
bInterfaceClass = 0xff (vendor-specific), so snd_uaudio(4) doesn't
detect it.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294814
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    emaste
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/24
549e740619873716b796a841a10f56fae3c3ad49 Christos Margiolis 2026-04-28 16:39:45
sound: Retire unused snddev_info->bufsz
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
5e9f2a6aefabec01c587a169fd5efe3a2720a8e5 Christos Margiolis 2026-04-30 18:45:20
mfi(4)/mrsas(4): Set sysctl name for driver versions consistently
Instead of printing the driver version over and over again if multiple
controllers are used, set a sysctl name for the used driver version.

Approved by:    imp, ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56110
ea1764e5fcf0fc11680dc104e663ae3d1d0fd7be Michael Osipov 2026-02-25 19:48:34
amdsmu: Add Krackan Point support
Reviewed by:  obiwac, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56619
9c77fb6aaa366cbabc80ee1b834bcfe4df135491 Tom Jones 2026-04-24 12:47:04
Remove extraneous tab characters at EOL in various _stdint.h files
MFC after:    3 days
daeab702f9adbbb718ecf48e17de8dd619cfe7b8 Dimitry Andric 2026-05-01 18:08:26
Define stdint.h macros unconditionally
Similar to glibc, define all the stdint.h macros such as `SIZE_MAX`,
`UINT64_C`, etc unconditionally. I.e. no longer check whether
`__STDC_CONSTANT_MACROS` or `__STDC_LIMIT_MACROS` are defined. See also
<https://sourceware.org/bugzilla/show_bug.cgi?id=15366>.

This is part of reverting base 00bee6fcd77f, which reverted an upstream
libc++ commit that eliminated libc++'s stdint.h wrapper header.

Submitted by:   Nikolas Klauser <nikolasklauser@berlin.de>
MFC after:      1 week
Reviewed by:    imp
Differential Revision: https://reviews.freebsd.org/D56746
966fb94cb3575ccd39da211165d0858fd0eb0ef2 Dimitry Andric 2026-05-01 18:07:11
Commit group #17: powerpc
powerpc: initial straight port of busdma_machdep.c -> busdma_bounce.c

This is a straight port of the code and doesn't yet handle
different implementations (which will be in a subsequent commit.)

Locally tested:

* G5 SMP (2x PPC970mp)
* power8 / power9 pseries QEMU VM
* power8 powernv

Differential Revision:  https://reviews.freebsd.org/D55313
3bcb7c2a33206d52cecb349b77b2a631728bc7d1 Adrian Chadd 2026-02-14 17:03:27

powerpc: create a tag with the parents implementation if supplied

If a parent tag is supplied then use its implementation.

Differential Revision:  https://reviews.freebsd.org/D55314
330e4f6acbdc360c0dc466f4d54bc63e663d307a Adrian Chadd 2026-02-15 02:10:31

powerpc: add in some busdma domain setup

* Implement the basic tag domain set routine
* Set the domain to the parent domain if provided

This is just plumbing for eventual work to re-allocate things into
the currently configured domain.

Differential Revision:  https://reviews.freebsd.org/D55315
df3bd7201efc88b0518c9fe7997f3dbf656eccd5 Adrian Chadd 2026-02-15 02:28:07

powerpc: refactor common busdma tag setup

Refactor the common busdma tag setup code into busdma_machdep.c

Locally tested:

* qemu VM, pseries-9 / power9
* qemu VM, pseries-8 / power8

Differential Revision:  https://reviews.freebsd.org/D55340
00ec88d2aa8d8267b1e80991d5e632bb9f012b07 Adrian Chadd 2026-02-18 06:50:12

powerpc: use local flags for bounce buffers instead of common flags

Migrate to using local flags for bounce buffers instead of the
common flag field.

Differential Revision: https://reviews.freebsd.org/D56208
7c57d2499ceee81aa386430d4d9e6d9080d50f94 Adrian Chadd 2026-04-01 00:04:28

powerpc: busdma declaration shuffling

Shuffle some of the declarations around to match other implementations.
Expected to be a no-op.

Differential Revision: https://reviews.freebsd.org/D56243
c7040d3eaa03a9dd27fde69ccf585a76dfbb2c6c Adrian Chadd 2026-04-01 00:23:56

powerpc: refactor dmamap setup; free dmamap in error paths

* refactor the dmamap allocation / setup path for future code changes
  to align with arm64 busdma code;
* free the dmamap allocation if the dma segment list can't be allocated;
* free the dmamap allocation during the busdma dmamem allocation path
  if the actual memory allocation itself fails.

Locally tested:

* POWER9 ppc64le native boot, Raptor Engineering Blackbird
* POWER8 ppc6le, IBM POWER S822LC

https://reviews.freebsd.org/D56244
0de6295af231aa5c13e1da2f40b29106962b6363 Adrian Chadd 2026-04-01 05:21:15
vt_core: don't draw the splash if a panic occurred
The shutdown splash draws over all the useful info if ddb(4) is
disabled. Don't draw the splash screen if we're rebooting because of a
panic.

MFC after:      3 days
bc83f414583ccaf337ef3b7c019df7727d6a3aae Ahmad Khalifa 2026-05-03 13:18:38
iicbus/rtc: Add driver for the Ricoh rs5c372 RTC
This RTC chip supports 2 alarm timers in addition to RTC functionality,
but this driver only supports the RTC at this time.
d22051b18e9b7512c5cf033d7b6eee2df03c985b Justin Hibbits 2026-04-22 02:15:02
Commit group #18: dpaa
dpaa: Migrate from NCSW base to a home-grown driver

The NCSW reference base requires tuning for each target, and currently
is configured for FMANv2.  This doesn't readily work on FMANv3 devices,
such as the T-series powerpc, or the LS1043 ARM.  Since Freescale/NXP
abandoned the NCSW driver a decade ago, it makes sense to abandon it
ourselves as well.  This new driver uses a combination of the NCSW
driver and the Linux driver (BSD/GPL dual licensed) as a reference, but
contains no actual code from them.

The DPAA (Data Path Acceleration Architecture) subsystem consists of the
following components:

* BMan -- Buffer Manager.  Manages buffer pools of different sizes (one
  size per pool, up to 64 pools)
* QMan -- Queue Manager.  Manages the interfaces between DPAA-based
  components and the CPU(s).
* FMan -- Frame Manager.  Responsible for all ethernet-related
  processing.  Consists itself of the following components:
  * Ports -- interfaces to the QMan.  An ethernet interface consists of
    2 ports.
    Ports use "Next-invoked action" (NIA) descriptors to form a pipeline
    for processing on receive and transmit.
  * Parser -- performs protocol header parsing and validation.  Both
    hardware and software parsers are available.
  * KeyGen -- Key generator, used to start the classification process
    (for the Policer), generating FQIDs and other keys based on the
    frame input.
  * Policer -- performs traffic shaping and classification
* MAC -- SoC specific ethernet MAC (dTSEC, TGEC, mEMAC).  Currently
  supports dTSEC and mEMAC, along with their MDIO blocks.

Additional components not yet handled:
SEC -- Security engine (crypto)
RE -- RAID engine
RapidIO
DCE -- Decompression/Compression engine, supports ZLIB, DEFLATE, and
GZIP, as well as base64 encoding and decoding.

BMan and QMan are accessed via cache-coherent portals, using ring
buffers as I/O.  The intent is for portals to be per-CPU (core/thread)
to reduce locking contention and improve performance.  This driver pins
interrupt handlers to the CPU "owning" a given portal, and uses critical
sections to prevent switching while accessing the portal.
fd8d34ce272ba40f3e0218198ba542a29c390a4a Justin Hibbits 2026-04-24 03:38:19

dpaa: Enable checksum offloading for IPv4 and IPv6

Enable the FMan hardware parser to take advantage of some offloading.
This enables receive and transmit checksum offloading for both IPv4 and
IPv6.

Additional offloading capabilities the DPAA supports include:
* vlan parsing
* Transmit rate limiting
* IEEE-1588 timestamps
* Soft parsing for custom protocol checking
* Congestion handling
6464974c5a56a9f899f8a673385711253f9fcbd0 Justin Hibbits 2026-04-25 20:50:34

dpaa: Support jumbo frames as multi-buffer frames
9d423705db8b4188ed7c02d31b93393f0f8e680e Justin Hibbits 2026-04-29 20:22:56
dpaa: Fix copyright headers
Reported by:  ziaee@
Fixes:  https://cgit.freebsd.org/src/commit/?id=fd8d34ce27 ("dpaa: Migrate from NCSW base to a home-grown driver")
7a40b8a89e7da2a7e8d8e132bc37885b22e9bfb1 Justin Hibbits 2026-05-04 01:43:44
rs5c372a: Fix copyright header
Reported by:  ziaee@
Fixes:  https://cgit.freebsd.org/src/commit/?id=d22051b18 ("iicbus/rtc: Add driver for the Ricoh rs5c372 RTC")
7b5a23b12451a71a8377c7ef674b716a54751e92 Justin Hibbits 2026-05-04 01:45:11
asmc: rename wol sysctl to auto_poweron
Older SMC firmware exposed AUPO as a Wake-on-LAN control. On updated
firmware, the key controls automatic power-on when AC power is restored
after a power loss; WoL is handled by the GBE controller instead.
Rename the sysctl to reflect the current semantics. No compatibility
alias is provided as the sysctl has not appeared in any release.

Reviewed by:    ziaee, adrian
Differential Revision:  https://reviews.freebsd.org/D56747
36b399f55e3fa16063188b6f8ad8eaaf8c2215ab Abdelkader Boudih 2026-05-04 14:26:44
mii: Fix SMSC name
The LAN8700 / LAN8710 PHYs were Standard Microsystems Corporation (SMSC)
parts.  I presume SMC was chosen as an abbreviation, but the company
always used SMSC as its short name.

SMSC was acquired by Microchip in 2012.  I kept the pre-acquisition
name, as NetBSD (from where we obtained miidevs) uses SMSC.

Reviewed by:    adrian
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56819
89c883c09ab5e0fdca7ac5dfe74fcc46b7669eb5 Ed Maste 2026-05-04 23:13:44
acpi_panasonic: acquire serial lock before calling hkey_sound_mute in shutdown
acpi_panasonic_shutdown() calls hkey_sound_mute() without holding
the ACPI serial lock. Every other call site holds
`ACPI_SERIAL_BEGIN(panasonic)` before calling it, as the locking
model is caller-owned.

This seems to affect the whole Panasonic Toughtbook lineup btw.

Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D56718
7619d14d08a0036a07dce670f55b9568f8133b38 Abdelkader Boudih 2026-05-05 19:49:01
smsc: Add missing newline to PHY timeout error printf
0979bfb0ec804590a782ea33b787ec0989c1f1a4 Ed Maste 2026-05-05 23:50:46
ichsmb: add Ice Lake-LP (0x34a3) and Ice Lake-N (0x38a3) SMBus device IDs
Add PCI device IDs for two Ice Lake PCH SMBus controller variants:
- 0x34a3 (Ice Lake-LP), previously listed as the generic "Ice Lake" entry (ID_ICELAKE), renamed to ID_ICELAKELP for clarity.
- 0x38a3 (Ice Lake-N), a separate PCH variant not previously supported.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D56732
081d3ab24e03d271a0de3b173802fbe71f52e8aa Abdelkader Boudih 2026-05-05 23:59:10
mlx5en: destroy TIR before DEK during TLS RX teardown
Reorder the TLS RX teardown sequence so the TIR is destroyed before
the DEK.  DESTROY_TIR for a TLS-enabled TIR issues a TRA RX fence
that drains all in-flight packets from the crypto pipeline.  If the
DEK is destroyed first, packets still in flight hit a TPT encryption
error (vendor syndrome 0x55) because the key they reference is
already gone.

Reviewed by:    kib
Sponsored by:   Nvidia networking
MFC after:      1 week
bf636accdde4bb9af2c6c07af5420dffffd82332 Ariel Ehrenberg 2026-04-15 21:45:07
virtio_p9fs: Fix kernel panic on module unload
The virtio_p9fs module event handler can be invoked multiple times.
Previously, this caused p9_init_zones() and p9_register_trans() to be
executed multiple times, leaking UMA zones and corrupting the transport
list. During module unload, p9_destroy_zones() was also called multiple
times on the same zone pointers, triggering a duplicate free kernel panic
in uma_zdestroy().

This patch introduces a static reference counter in vt9p_modevent() to
ensure the zones and transports are only initialized and destroyed exactly
once, aligning with the approach used by other virtio drivers like vtnet.

Reviewed by:    kib, markj
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D56497
3fe5069ce2bf5b2702f3be6531ce6a05c584e64d Alex Richardson 2026-05-07 04:21:23
smartpqi: Add runtime sysctl for debug_level and log device state changes
The smartpqi driver did not log device add/remove or controller events
to syslog, and hw.smartpqi.debug_level could only be set at boot via
loader.conf with no runtime sysctl interface.

Add a read-write sysctl at dev.smartpqi.N.debug_level for runtime
debug level changes. Add device_printf calls for device addition,
removal, and controller events (hotplug, hardware, physical/logical
device, AIO state/config changes) so state changes always appear in
dmesg. Add DBG_DISC logging for discovery state transitions. Fix
spelling errors in strings and comments across the driver.

Bump driver version to 14.4691.1.2000 / 15.2.1.2000.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294161
Reviewed by:    imp
Approved by:    imp
MFC after:      2 weeks

Differential Revision:  https://reviews.freebsd.org/D56832
0d48d6d7bba77d6c3736ce56ea5667bfbde89705 John Hall 2026-05-04 21:43:27
cxgbe(4): Updates to the hw and fw headers and config file
MFC after:    1 week
Sponsored by:   Chelsio Communications
1bef5535c1f191055e545cad029eabe939d93d24 Navdeep Parhar 2026-03-09 18:19:49
hwpstate_amd: Initialize CPPC driver type
Assign the driver type instead of preserving uninitialized stack data

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294899
Reviewed by:    aokblast
072f79d0a287528b11da866d6115f726a69eca0d Laurent Chardon 2026-04-30 12:08:30
pci: use uint32_t for eecp
eecp holds the extended capability offset. If that offset is larger
than 0xff, storing it in uint8_t truncates it, which can make the
early EHCI/XHCI capability walk read the wrong location and loop during
boot.

Seen on AMD device 1022:151e, where HCCPARAMS1 = 0x0118ffc5 and the
first xHCI extended capability offset is 0x460. Widen eecp to uint32_t
in xhci_early_takeover(), matching xhci_pci_take_controller().

Signed-off-by: Gisle Nes <gisle@gisle.net>
Reviewed by:    zlei, aokblast
MFC after:      3 days
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2127
Closes:         https://github.com/freebsd/freebsd-src/pull/2127
555ffd9022de0c497881bafc413e3e1d05af10d4 Gisle Nes 2026-04-07 16:48:15
rge: add the Intel Killer E5000 PCI ID
This and the E3000 are both handled by the r8169 driver in Linux, and
reportedly this is infact just a straight re-brand of the RTL8126.

Tested by:      "Sinetek" on Discord
Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D56917
92f623e4a98876c897669be0f1220887c996918e Kyle Evans 2026-05-11 15:26:03
smart: Connect contrib/smart to build
Reviewed by:  fuz, jrm
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D56638
25942dddc8a81a338d4615db99b8e7cbb8550449 Chuck Tuffli 2026-04-28 16:55:50
Commit group #19: riscv: IOMMU support
riscv: IOMMU support

Support for RISC-V IOMMU spec v1.0.1 (ratified)
  https://github.com/riscv-non-isa/riscv-iommu

Supports translation for PCI devices only.
Supports 1 or 2-level device-directory-table (DDT).
Supports SV39 and SV48 virtual memory system (on per-device basis).
Supports both "standard" and "extended" device-context (DC) structure.
Supports "bypass" mode to disable translation for a particular device.
Supports WSI (Wire-Signalled Interrupts) only.

This includes both PCI-bus and FDT attachment drivers.

Note in case of PCI-bus attachment, interrupts are not available. In this
case no error report is provided in case of translation fault. Otherwise
interrupts are not needed.

Differential Revision:  https://reviews.freebsd.org/D55922
bcecad2c24aa500913559c00f1be8b364a3ff150 Ruslan Bukin 2026-05-12 10:09:04

riscv: Add IOMMU to NOTES

Reported by:    bz, ivy
Fixes:          https://cgit.freebsd.org/src/commit/?id=bcecad2c24aa ("riscv: IOMMU support")
5f60d8a8f2978f998da55d4e3cd0cb0e073bfc21 Dag-Erling Smørgrav 2026-05-16 18:32:25
if_eqos_starfive: Read MAC address from device tree
u-boot/opensbi determines the ethernet MAC address from ROM and passes
it to the OS in the device tree. This change sets the correct MAC
address from this source. This prevents the eqos class driver from
generating random MAC addresses at each boot.

Tested on Starfive VisionFive 2, riscv64 SBC.

Reviewed by:    mhorne
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56782
351fad05e075c388dece4cd6dd8613494b870bad Brian Scott 2026-05-11 16:54:04
Commit group #20: g_part,mkimg: Add additional GPT partition types
g_part,mkimg: Add additional GPT partition types

Add the hifive-fsbl, hifive-bbl, and xbootldr aliases to mkimg(1).
Add the xbootldr alias to geom(4), and thus gpart(8).

The "hifive" partition types are defined and used by various RISC-V SBCs
for locating firmware.

"xbootldr", or the Extended Boot Loader Partition is defined here:
https://uapi-group.org/specifications/specs/boot_loader_specification/

Reviewed by:    emaste, markj, mhorne
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56784
dab8138e13dea539a387c458979403980a137bf2 Brian Scott 2026-05-11 16:24:46

gpart.8: add entry for xbootldr partition type

Reviewed by:    emaste, markj
Sponsored by:   The FreeBSD Foundation
Fixes:  https://cgit.freebsd.org/src/commit/?id=dab8138e13de ("g_part,mkimg: Add additional GPT partition types")
Differential Revision:  https://reviews.freebsd.org/D56969
54d0ae979d9596399f33dc7d7245866f86ab7f8e Mitchell Horne 2026-05-12 14:13:12
vt: Clear cut-paste selection if the area intersects with the filled region
* cut-paste buffer stays unchanged

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260069
Reported by:    emaste

Reviewed by:    imp
Approved by:    imp (mentor)
Differential Revision:  https://reviews.freebsd.org/D56922
8db0553ed6d8636d82a26896237099526b93be19 Aleksandr Rybalko 2026-05-12 15:56:20
Commit group #21: arm64: Add RSI detection for CCA
arm64: Add RSI detection for CCA

Detect the presence of the Realm Services Interface (RSI). This detection is
performed early in bootup; PSCI initialisation has been moved to initarm() to
faciliate this.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56598
76a2904c352b497b32fc902523e3e485f7b06ffd Sarah Walker 2026-05-12 11:27:13

arm64: Fix the includes for rsi.c

This depended on header pollution only present when FDT is defined. As
FDT isn't check for in this file we can remove opt_platform.h and
include the correct set of vm header files.

Reported by:    ivy
Fixes:  https://cgit.freebsd.org/src/commit/?id=76a2904c352b ("arm64: Add RSI detection for CCA")
Sponsored by:   Arm Ltd
b8606c3406eab69637be616260c977c9a8f14ff3 Andrew Turner 2026-05-14 08:31:06
arm64: Load SOCDEV_PA as a literal rather than an immediate
When EARLY_PRINTK is used in a realm environment, the UART physical
address must be in the unprotected address space. The resulting
physical address will not generally fit in an immediate, so use a
literal instead.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56600
a6add87b5e174702261f3b8e8022791ed4ab9898 Sarah Walker 2026-05-12 12:15:49
u3g: Add Telit LM960A18 LTE modem
The patch in the PR failed to apply, so I manually applied the same
changes.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295231
Submitted by:   Mike Tancsa <mike@sentex.net>
Reviewed by:    emaste
eacf4f50bfb19aa0278db5e8982d73c6d77ca24c Ed Maste 2026-05-12 19:52:16
Commit group #22: acpi_spmc(4)
acpi_spmc(4): Fix comments on constraints storage

The fields themselves are not unused, we actually fill them, but once
filled we indeed do not use their values (yet).  See the '#ifdef notyet'
section in acpi_spmc_check_constraints().

No functional change.

Reviewed by:    emaste, obiwac, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56798
a652d97630599c089a722d4cb881e2731c5336a8 Olivier Certner 2026-05-04 11:38:58

acpi_spmc(4): Remove XXX from a comment about retrieving constraints

There is really nothing we can do about a DSM function that works on
first call but fails on subsequent calls, except calling it only once,
which we already do.

While here, soften the comment message, as failure was observed with
some specific machines only.

No functional change.

Reviewed by:    emaste, obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56799
beca41dfb55f0b83612fe8a2aec508944c4b2138 Olivier Certner 2026-05-04 11:56:52

acpi_spmc(4): Constraints: Rename the Intel-format parser

...from acpi_spmc_get_constraints_spec() to
acpi_spmc_get_constraints_intel(), as really there is no ACPI
specification proper and parsing the constraints is done according to
some *Intel* specification (even if it is true that, by contrast, AMD
has none).

No functional change (intended).

Reviewed by:    obiwac, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56800
704b96509d3c720be382f13d3d020b40acc21e31 Olivier Certner 2026-05-04 12:57:05

acpi_spmc(4): Factor out code to test for a DSM's presence

...through a new function has_dsm(), which slightly simplifies reading.

No functional change (intended).

Reviewed by:    obiwac, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56801
a648c45c9dc13de0457ea51d1ebd333b06ccff8e Olivier Certner 2026-05-04 13:16:08

acpi_spmc(4): Clear confusion between DSMs and their functions

Stick to the ACPI specification's terminology where DSM means "device
specific method", but is in fact a set of multiple functions (actually,
there is one set of functions per DSM revision, with the set for some
revision in theory including those of the previous revisions), by
renaming some of the fields of 'struct acpi_spmc_softc' and local
variables accordingly.

To this end, rename appropriate structures, fields, parameters and
variables, mechanically.

No functional change (intended).

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56802
27d99ff07908a0333774b4c364a798154ae9fa8c Olivier Certner 2026-05-04 14:48:10

acpi_spmc(4): Introduce supports_function()

For better readability and because this stance will be used in many
more places in a subsequent commit.

No functional change (intended).

Reviewed by:    imp (older version), obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56803
f77731ee95c179cede7dec0e87bc8146a2c546bc Olivier Certner 2026-05-04 14:52:31

acpi_spmc(4): softc: Remove unused 'obj'

No functional change (intended).

Reviewed by:    imp (older version), obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56804
868f50f649808320e9433ab321f450fa22bcddba Olivier Certner 2026-05-04 15:03:05

acpi_spmc(4): Factor out printing DSM call error, delineate function

Introduce failed_to_call_dsm(), which prepends "function" before the
function index for better clarity.  For now, it prints the function
number, as before, but will soon print a human-readable name.

Reviewed by:    imp (older version), obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56805
3c2d2bcc6f5d6e7819f0675afb8464e525c87cb3 Olivier Certner 2026-05-04 15:40:46

acpi_spmc(4): Human-readably print supported DSMs and their functions

To this end, revamp how DSMs and their functions are represented.
Replace enumerations, which only bring minimal advantages, with plain
macros, allowing to get rid of 'union dsm_index' and in passing the associated bug
that an underlying type smaller than 'int' is aliased to an 'int', which
assumes little-endian architectures.  Associate to each function
a printable name, in the form of a per-DSM array that maps a function
index into a string.  Make sure that every used array and their number
of items are sized at compile-time and are declared constant, and that
as little code as possible depends on the particular set of present DSMs
and associated functions.

Since the set of DSMs and sets of per-DSM functions are represented as
bitsets, introduce print_bit_field() to print such sets.  This new
function is akin to printf("%b", ...) but with more flexibility.  It
takes a function associating a name to some bit index and an opaque
pointer, allowing to leverage existing structures containing names
instead of imposing the use of a separate string containing all names to
be printed.  It also provides a default name to bits without an explicit
name, composed of a common prefix and the bit index as a suffix.

Reviewed by:    imp (older version), obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56756
cc628a66b4c4d8423830491ebfd69333f7d02378 Olivier Certner 2026-05-04 15:54:40

acpi_spmc(4): Rename functions parsing constraints

Rename acpi_spmc_get_constraints_intel() and
acpi_spmc_get_constraints_amd() ("get" => "parse") to reflect that they
are actually just parsing the constraints passed by
acpi_spmc_get_constraints().

No functional change (intended).

Reviewed by:    imp, obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56806
ee00031940d647962457d64e86a2e433a2f7a2ed Olivier Certner 2026-05-04 11:35:23

acpi_spmc(4): Constraints: Simplify some assertions

While here, capitalize their messages.

Reviewed by:    imp, obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56807
98ad729f3e98b75ae79cd4b539fe2767f8a6f89e Olivier Certner 2026-05-04 11:48:16

acpi_spmc(4): Constraints: Clearer message on handle retrieve error

Currently, the "failed to get handle for ..." log messages on attach are
a bit alarming and no context is provided.  Print out that these are
retrieved when trying to match constraints and that such failures are
ignored, which should make administrators worry less.

While here, remove duplicated handle retrieving code in
acpi_spmc_check_constraints() because:
1. As is, it is dead code: We 'continue' if the handle is NULL, i.e.,
   not already resolved, before trying to resolve it again.
2. This code is called after device suspension, which might make some
   objects disappear from the ACPI namespace.  In any case, it seems
   unlikely that, suddenly, new objects would appear.

Reviewed by:    imp, obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56808
a78c9a2a47f2209328bd25e527bd20cfab6d3665 Olivier Certner 2026-05-04 12:00:39

acpi_spmc(4): Stop pretending that all constraints are verified

We do not check these constraints (yet), so stop printing that they are
verified.

While here, make the (not compiled in at the moment) "constraint
violated" message more terse, and move the warning it contains to
outside of the loop (no need to print it repeatedly if multiple
constraints are violated).

While here, bail out early if there are no constraints to avoid printing
(in the future) that constraints are respected even when there are none.

Reviewed by:    imp (older version), obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56809
0cef5efbbf939c3ca89bd29047a230cbedb2c9bb Olivier Certner 2026-05-04 12:04:08

acpi_spmc(4): Check DSMs only on attach, do not return 0 on probe

Once we have recognized a device by PNP ID, declare support
unconditionally on probe, and only check for DSMs in attach.

We do this for these reasons:
1. PNP0D80 is de-facto a device supposed to hold DSMs related to
   suspend-to-idle, so we assume it cannot be used for other purposes.
   And if that changes, we need another architecture anyway (e.g., have
   a new driver claiming those devices and behaving like a bus, to which
   this driver would be a sub-driver).
2. If there are no DSMs that we support on such a device, then a new DSM
   was added that the driver does not know about and which "replaces"
   (in terms of functionality) the known ones, or the firmware is buggy.
   In both cases, failing the attach instead of the probe is reasonable,
   as that leads to printing some error which we (and probably users
   too) would like to know about.
3. This is a step to enable multiple instances of this driver (just to
   be a good citizen, and also to be future proof against weird
   firmwares that would, e.g., implement the Microsoft DSM on another
   device than the Intel one).

Reviewed by:    imp (older version), obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56810
6bd543f7a82a3cbb10db3a79590d5179be403660 Olivier Certner 2026-05-04 12:40:44

acpi_spmc(4): Print supported functions after DSMs

This makes things more top-down, as expected when probing devices.

Reviewed by:    imp, obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56811
ebad66abbc1f25a761add6481de99abf474b2d87 Olivier Certner 2026-05-04 16:19:31

acpi_spmc(4): INVARIANTS: Do not panic on getting constraints failure

Just continue without constraints checking in this case.

To this end, remove the 'constraints_populated' field from 'struct
acpi_spmc_softc' and any reference to it.

However, we introduce another boolean, 'sc->get_constraints_succeeded',
in order to check (under INVARIANTS) that acpi_spmc_get_constraints() is
called only once on success.  Calling that function another time after
a success would leak memory.  It would be easy to change that function
to support multiple calls (e.g., by adding a call to
acpi_spmc_free_constraints() near its start), however trying to retrieve
the constraints again simply looks like wasted time as the same results
are expected to be returned on each call.

Reviewed by:    imp, obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56812
e5615cd8094f75a17572b3dae810f48ae8401d6c Olivier Certner 2026-05-04 19:10:25

acpi_spmc(4): Gracefully support a standalone Microsoft DSM

In acpi_spmc_get_constraints(), stop assuming that if there is no AMD
DSM, then the Intel one is present.  Although this is likely to be the
overwhelming majority of cases on amd64, there is no technical reason
nor constraint in our code that really needs assuming that.  On (so far
hypothetical) machines with only the Microsoft DSM, this assumption
would cause a cryptic and irrelevant error message (and, prior to the
previous commit, a panic on INVARIANTS).

Warn the user if both the Intel and AMD DSMs are present, and use the
constraints reported by the Intel one (see the comment for why).

Reviewed by:    imp (older version), obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56813
921a6d6c38f5b099b1290a614689d70df2e0f0d4 Olivier Certner 2026-05-04 19:17:21

acpi_spmc(4): In-kernel strdup() cannot fail, remove dead code

No functional change (intended).

Reviewed by:    imp, obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56814
0813dc0325476599841268f405d4bce8b341b2db Olivier Certner 2026-05-04 19:41:14

acpi_spmc(4): Constraint parsing: Clearer error messages

Reviewed by:    imp, obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56815
ee13d62417f28ee22331ab81ecac2ed3457ea1e1 Olivier Certner 2026-05-04 19:42:40

acpi_spmc(4): Global message on constraints parsing failure

...in order to indicate to users that power state constraints will not
be checked at all.

Reviewed by:    imp, obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56816
5ba100a35cc5999d86a975fea9383d279f12e177 Olivier Certner 2026-05-04 19:49:32

acpi_spmc(4): Enable multiple instances

Support the (so far hypothetical) case of a machine with multiple
instances of the PNP0D80 device (e.g., if multiple DSMs are not
implemented on the same device), by allowing multiple instances of the
device to co-exist.

This is achieved by moving 'supported_functions' from 'struct dsm' into
the softc, so each instance has its own view of which functions are
supported.

Consequently, the check on the instance unit on probe can be removed.

Reviewed by:    imp (older version), obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56817
310cbb8924fa8f0ace9c5f555cf74b7c1e4396a2 Olivier Certner 2026-05-04 20:19:40

acpi_spmc(4): acpi_spmc_probe_dsm(): Remove passing superfluous handle

The handle is already held by the softc, which is also passed.

No functional change (intended).

Reviewed by:    imp, obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56818
f56201cee3e8f90dd17ec287b43997983d23fdfe Olivier Certner 2026-05-04 20:21:41

acpi_spmc(4): Add a sysctl knob to request verbosity

The driver will be more verbose on this knob being non-zero or
'bootverbose' being set.  The corresponding variable is typed as an
integer to leave room for expansion.  To be used in subsequent commits.

Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56875
37c59fdc3b4d25304982a4d39931da5c2ec4c2e6 Olivier Certner 2026-05-07 15:59:37

acpi_spmc(4): Be less verbose by default

Do not print by default details of failures that are unlikely to help
a normal user and to have a crucial influence on whether suspension
works correctly.  Do so only on a verbose boot or if requested
explicitly by the user via 'debug.acpi.spmc.verbose'.

In particular:
- On an Intel Framework laptop, the Microsoft DSM only reports the
  SLEEP_ENTRY and SLEEP_EXIT functions.  That makes some sense since,
  according to its specification, all functions of a Microsoft DSM
  except these two are in fact redundant with Intel DSM's ones (also,
  that of AMD DSM's ones).  Those functions being missing are only
  a potential problem if there is no other DSM than Microsoft's (yet to
  be observed in the field).
- The details of malformed/unapplicable constraints or ones with a newer
  format the driver does not know about are not readily actionable
  pieces of information, but rather debug/developer-oriented ones.  When
  verbosity is not requested, only print the details of the first such
  failure to encourage reporting and at the same time avoid cluttering
  the output.
- Detecting and printing unknown DSM functions is not directly
  actionable either, and the driver not using these functions may not
  prevent suspending (but might, e.g., prevent reaching deeper sleep
  states).

Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56876
6da01f06ef7964f8a58369e7d1605ce10a49b82c Olivier Certner 2026-05-05 12:36:57

acpi_spmc(4): acpi_spmc_run_dsm(): Rename, rename parameters, constify

This function actually runs a function of a given DSM.  Remove the
'_dsm' suffix to remove the inaccuracy and make things simpler.

Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56877
d765d209c3dc5d1eca781cab97c8579969b1e7d5 Olivier Certner 2026-05-06 12:02:25

acpi_spmc(4): Factor out testing for present DSMs/functions

Since we are now keeping in the softc the information about which DSM
functions are available (in supported_functions[]), the 'dsms' field
there is somewhat redundant.

Make it completely redundant by keeping the bit representing the
enumeration function itself in each element of supported_functions[],
and then remove the field.

As a result, convert has_dsm() to rely on supports_function().

Adapt acpi_spmc_dsm_check_functions() so that it does not take into
account the enumeration function bit.

While here, use the self-explanatory stance
IDX_TO_BIT(DSM_ENUM_FUNCTIONS) instead of a hardcoded 1.

Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56878
ba4f05b55fb4b006f1bbe26d3ad3527f48e85939 Olivier Certner 2026-05-06 09:31:19

acpi_spmc(4): Only run DSM functions reported present

Examination of the DSDT in a Framework laptop generally hints at
firmware designers sometimes providing ACPI methods for convenience
(e.g., same firmware for multiple models) but not using them (or not
expecting them to be used) depending on tweaks or the actual hardware
platform.

On an Intel Framework laptop, we specifically observe the presence of
a Microsoft DSM that just reports availability of the SLEEP_ENTRY and
SLEEP_EXIT (7 and 8) functions although the Microsoft specification
requires other functions, whose purpose is similar to corresponding
Intel DSM's ones (such as DISPLAY_OFF).  However, we currently always
call the latter even on the Microsoft DSM.  On that laptop, fortunately,
the way the code is structured in the _DSM method leads to nothing being
executed on this call.

Given the similarity of intent between most functions from the Microsoft
DSM on one side and those of ADM and Intel on the other, it is
imaginable that other firmware developers could use a strategy where
functions are in fact aliased, in which case insisting on calling the
Microsoft's DSM function even if not enumerated would cause the action
to be performed twice (because we also call the corresponding function
on the Intel/AMD DSM), which may or may not cause other problems and in
any case seems a waste.

So, by default, do not try to run any function that is not enumerated,
as that looks like the safest approach.  Add a debug sysctl(8) knob to
revert to the previous behavior, just in case
('debug.acpi.spmc.force_call_expected_functions').

acpi_spmc_run() now checks if a DSM/function combination has been
enumerated, and skips the actual call if it does not.  This allows to
remove all checks from the acpi_spmc_*_notif() functions, making the
code much more compact.

acpi_spmc_get_constraints() now checks whether
DSM_GET_DEVICE_CONSTRAINTS is supported in order to determine which DSM
to use and whether to call the function at all.

Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56879
65ecfb4a66f377ca72569d7a96de0347b4541b52 Olivier Certner 2026-05-06 11:53:02

acpi_spmc(4): softc: Move supported functions into a DSM info structure

This is in preparation to adding the revision as a probed information.

Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56880
b092ee520618a8e8df7f4d7fb095e8940dd0d305 Olivier Certner 2026-05-06 13:15:27

acpi_spmc(4): Trivial simplification in detach function

Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56881
b82e41d394054fdc357bc9e03b9a48a2e6983a91 Olivier Certner 2026-05-07 07:53:36

acpi_spmc(4): Auto-detect DSM revisions by default

Which revisions to use for the Intel and AMD DSMs is unclear.  For the
Intel one, the written specification indicates only 0, but Linux uses
1 (possibly an oversight).  For the AMD one, for which there is no
specification, Linux uses 0, but at least on the Framework 13 AMD 7040
series, the "enumerate functions" function only returns a mask that
covers all the functions we expect when called with revision 2.

Introduce an auto-detection strategy where each revision starting from
0 is tried in turn up to some limit (included; default: 15).  As soon as
a revision implements all expected functions, we stop the loop and use
that one, in effect selecting the minimum revision that implements all
we need, which should avoid potential backwards-compatibility problems.
If no revision implements all expected functions, the highest available
revision in the checked range is selected, but higher revisions that do
not bring new functions are discarded (see the explanatory comment in
acpi_spmc_probe_dsm()).

The revision policy is still tunable using the same existing sysctl(8)
knobs 'debug.acpi.spmc.intel_dsm_revision' and
'debug.acpi.spmc.amd_dsm_revision'.  They have been extended so that
a negative value indicates to use the auto-detection mechanism up to
a revision of minus the value.  As before, a 0 or positive value
requests a specific revision.  A new knob is introduced for the
Microsoft DSM just in case ('debug.acpi.spmc.ms_dsm_revision').

Since now the revision can be auto-detected, and thus depends on
a particular device instance, move it into 'struct dsm_info' on the
softc.  This also enables finishing the split between static and
dynamic/tunable information, allowing to constify all the DSM
descriptors.

Print the revision eventually used along with the supported functions.

Tested on an Intel Framework laptop.

Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56882
69a303ace76f42630ca07bcc5d2d090774a0364d Olivier Certner 2026-05-07 08:22:13

acpi_spmc(4): If verbose, print called functions

...as a debugging aid, in order to be able to check that some functions
are effectively called and to identify them quickly if they cause
a hang.

Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56883
91d3fb31e858404f62d4a3afae2e209796968c3d Olivier Certner 2026-05-07 16:15:21

acpi_spmc(4): Update copyright

Sponsored by:   The FreeBSD Foundation
23005ed3a1c8f6c111dff71b17daa6549b59a98a Olivier Certner 2026-05-12 15:10:34
cxgbe(4): Query and report IPsec offload related parameters
MFC after:    2 weeks
Sponsored by:   Chelsio Communications
e03c00b47b1af560b280c32576e7fc06b0a58224 Navdeep Parhar 2026-05-12 18:04:55
arm64/vmm: Enforce a data barrier before tlbi for non-VHE
Exception entry does not include an implicit, architectural data
barrier.

Reported by:    Ben Simner <ben.simner@cl.cam.ac.uk>
Reviewed by:    andrew
Fixes:          https://cgit.freebsd.org/src/commit/?id=5577bb2f67ff ("arm64/vmm: Support tlbi from VHE")
Differential Revision:  https://reviews.freebsd.org/D56855
04987aa1d8099e5f8f5dd8c68e65f315b3f1fd6c John Baldwin 2026-05-13 16:33:52
usbdevs: Add TP-Link UB500 (RTL8761BUV) USB ID
This device is not yet supported.

Unfortunately some recently purchased UB400 dongles also contain this
Realtek IC.

Sponsored by:   The FreeBSD Foundation
4cdcacb9b2969b681b9547da61535b09e9e67478 Ed Maste 2026-05-14 13:32:45
sound: Fix lock order reversal in dsp_poll()
chn_poll() may hold both rdch and wrch channel locks while calling
chn_trigger(rdch).  chn_trigger() switches the lock order from
"channel -> dsp dev" to "dsp dev -> channel" by temporarily dropping
the channel lock before acquiring the dsp lock.

However, only rdch was unlocked during the transition while wrch
remained locked. Since wrch is also a channel lock and witness had
already established the lock order requirement:

    dsp dev -> channel

witness reports a lock order reversal when pcm_lock() is acquired while
wrch is still held.

Avoid holding rdch and wrch simultaneously during chn_trigger()
lock-order switching by only keeping the channel locks when needed.

The issue can be reliably reproduced by starting pipewire,
pipewire-pulse, and pavucontrol.

Reviewed by:    christos
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57009
776584319fb4d66cdb1c2f91bed154dfe6a74e5e ShengYi Hung 2026-05-15 08:43:47
sound: Improve hw.snd.compat_linux_mmap
- Reject PROT_EXEC in all cases when Linux support is not compiled in.
- Define sysctl only when Linux support is compiled in.
- Document better.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    emaste
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/29
b9c10eeb380b3ba629421062af8658e79a9171cd Christos Margiolis 2026-05-15 14:07:59
sound: Force-disable hw.snd.compat_linux_mmap by default
Eventually this hack will be removed, so start by disabling it by
default.

Sponsored by:   The FreeBSD Foundation
MFC after:      12 months
Reviewed by:    emaste
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/29
9354e204f5ac797cbf1ef8e05294703c378bc9b6 Christos Margiolis 2026-05-15 14:47:10
wtap: use typed rssi and noise floor values
Adjust the rssi and nf arguments to typed int8_t and adjust the maths
for rssi to be consistant with what net80211 expects.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    lwhsu, adrian
Differential Revision: https://reviews.freebsd.org/D57020
d201e4e8491901d1de6bcaeb581a0bf958bf86f2 Bjoern A. Zeeb 2026-05-13 21:14:39
thunderbolt: make code -Wunused clean
This change modifies code paths and uses `__diagused` to address `-Wunused`
issues that occur when `THUNDERBOLT_DEBUG` == `0`.

MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D55575
1836330791789f18d0c9f0a63322a7f33b373c5b Enji Cooper 2026-02-26 08:06:49
riscv: fix GENERIC-NODEBUG build
Reported by:  bz
7eb71fd267c6cab43650720b9ed89f72cdcc5a3b Ruslan Bukin 2026-05-16 20:17:44
x86: remove sys/mount.h from genassym.c
The header is not needed, and causes some issues with build because it
requires vnode_if.h generated due to transient dependency from vnode.h.

While there, remove unneeded explicit sys/cdefs.h and sys/param.h usage.

Reported and tested by:         thierry
Fixes:  https://cgit.freebsd.org/src/commit/?id=1d5e4020e36e ("vnode: add VIRF_KNOTE flag")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
72ab129799a231e322b119de3f9c1263e76527b8 Konstantin Belousov 2026-05-16 19:27:40
intelhfi: Add IA32_PM_ENABLE bit flag define
Reviewed by: Minsoo Choo <minsoo@minsoo.io>
Differential Revision: https://reviews.freebsd.org/D56919
436f47a80c20a4d8395d30f81684b2d5dd35991e Koine Yuusuke 2026-05-17 15:58:41
qcom_tlmm: remove annoying debugging
Yes this printf is for local debugging and not required at all on anything.

Pointed out by: andrew@
32f854663d76ea06529ca8990ec0d116c8acb32b Adrian Chadd 2026-05-18 17:03:20
pci: Add is_pci_device helper function
This returns true if a given device is a PCI device (child of a PCI
bus).

Reviewed by:    bz, kib
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56996
ffcf5e356644252f2f6c89ba01057af45c216559 John Baldwin 2026-05-18 18:50:39
sys: Use is_pci_device instead of checking device or devclass names
Reviewed by:  bz, imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56998
be4f245e1e4fe60d43aaff5b11b45f2a9a66a51c John Baldwin 2026-05-18 18:52:39
iwx: clean up / document noise floor and RSSI fetching
* Document what iwx_rxmq_get_signal_strength() is doing in a comment,
  noting what the firmware returns and what math is being done on it
  to turn it into a dBm value.

* Document what iwx_get_noise() is supposed to do, that we can't just
  go do math with log numbers like we're doing, but also that we're
  seeing zeros in this firmware (AX210), which may mean we're decoding
  using the wrong structs.

* Swizzle around the RSSI calculation as a function, add min/max RSSI
  values, and calculate RSSI against the noise floor.

* And handle the lowest noise floor value - it can't be -127dBm as
  that will throw things off.  Cap it at -100dBm which is a little
  lower than the thermal noise floor at 20MHz (-98dBm), but it matches
  IWX_MIN_DBM.

Differential Revision:  https://reviews.freebsd.org/D53780
e56f7becc7efe05acbb08162961dca574b152720 Adrian Chadd 2025-11-16 03:13:59
snd_hda: Reassign duplicate HDMI/DP pin sequences instead of disabling
Some firmware (e.g. Apple EFI on Sandy Bridge Mac hardware) programs all
HDMI/DP output pins in an association with identical sequence numbers.

The existing code disables the entire association on the first
duplicate, leaving HDMI/DP audio non-functional.

For digital output pins (HDMI/DP) with seq=0 duplicates, search for the
next free sequence slot and reassign the duplicate rather than
disabling.

The seq=0 restriction targets the known Apple firmware pattern; any
other duplicate sequence is more likely a genuine firmware error and the
association is still disabled.

Update first after reassignment so that hpredir is not left pointing at
a stale sequence. Non-digital and input associations retain the existing
disable behaviour.

MFC after:      1 week
Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D55473
65341ec3172936804b081c8ceca9bae88f5c7192 Abdelkader Boudih 2026-05-19 12:24:14
powerpc: Remove stale include line from MPC85XX
The stale include line caused config -m to fail with an error trying
to parse the config file during make universe/tinderbox which in turn
caused universe/tinderbox to abort without building any powerpc
kernels (or subsequent architectures such as riscv64) with the error:

make[2]: freebsd/main/Makefile:767: Target architecture for powerpc/conf/MPC85XX unknown.  config(8) likely too old.
        in .for loop from freebsd/main/Makefile:761 with kernel = MPC85XX
        in make[2] in directory "freebsd/main"

make[2]: stopped making "universe_kernels" in freebsd/main
*** Error code 1

Reported by:    npn, many others
Fixes:          https://cgit.freebsd.org/src/commit/?id=fd8d34ce272b ("dpaa: Migrate from NCSW base to a home-grown driver")
d84a691a3590c85a4068dd23644efa478c368a03 John Baldwin 2026-05-19 19:53:46
i2c/sensors: Add driver for W83793 hardware monitor
The Winbond/Nuvoton W83793G system monitor chip includes many features
not currently supported by this driver.  The following are currently
supported:

* Up to 6 temperature sensors, 4 of which have 10-bit resolution
  (8.2),two with 8-bit resolution (no decimal component)
* Up to 12 fans
  - Fans 0-4 (1-5 on the datasheet) are always enabled.  The remaining 7
    fans are individually enabled.
* Multiple voltage sensors, reading up to 10 voltage sources.  Sysctls
  are labeled to match the datasheet.
* Chassis open detection.

The W83793AG is a feature-reduced version, which lacks 3 thermal diodes
and 2 voltage monitors.  Since there is no way to tell the difference
between the W83793AG and W83793G programmatically, sensors reported on
the W83793AG will report strange values.

Temperature sensors and 7 of the fans can be individually enabled on the
chip, but currently not configured by this driver.  The driver only
reports what was configured by the firmware.  Additionally, this driver
numbers the sensors and fans according to the datasheet, so even if, for
instance, fan 8 is disabled, it would skip from fan 7 to fan 9, it does
not renumber.  This makes it easier to follow for hardware debugging
purposes.

Missing features:
* Smart Fan support
* Fan PWM control
* ASF (Alert Standard Format)

Only Bank 0 registers are used at this time.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D56776
cd3cc6e910c0f739925c57e42fae6781d693db02 Justin Hibbits 2026-05-20 02:04:30
amd64/vmparam: Fix KASAN shadow map size in comment
The address range 0xfffff78000000000 - 0xfffff7bfffffffff spans exactly 256GB
(0x4000000000 bytes), not 512GB.

For a 2TB kernel map, based on the KASAN 1:8 shadow map ratio, the required
shadow map size is indeed 256GB. The current comment incorrectly states 512GB,
which can be misleading and cause confusion.

Reviewed by:    markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57129
b36fd09a834be586fbc1630294e17554e1f76175 Zishun Yi 2026-05-20 14:34:08
netmap: Drain selinfo sleepers in nm_os_selinfo_uninit()
Approved by:  so
Security:       FreeBSD-SA-26:19.file
Security:       CVE-2026-45251
4c09834afad02f97f7daeabc3c281784a04880a3 Mark Johnston 2026-05-19 00:09:54
Add audio group
To be initially used by virtual_oss(8) loopback devices.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    emaste
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/26
6024e3f99a1e3f5e52fd50c26789fc2dc98fd9c1 Christos Margiolis 2026-05-06 16:00:38
xhci: Do not drop and add bits in xhci
Drop and Add bits reset the data toggle for high-speed devices in XHCI.
The toggle bit represents the sequence number in USB 2.0 transfers. However,
a device can only recognize that the toggle bit has been reset while in
the HALT state. As a result, the host and device toggle values may
become mismatched, causing xHCI to reject the packet. This issue was
observed while testing the EZ-USB FX2 device.

The transfer may then return to the original value after a
bi-directional TD because the toggle field is only one bit wide. This
explains the reson that we can only receive packets bi-transfer in some
case. Therefore, we do not reset the toggle bit here.

Reviewed by:    adrian
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57146
28d85db46b484589e2ee74cf4b270db066821de1 ShengYi Hung 2026-05-21 12:49:42
sound: Remove SV_ABI_LINUX ifdef
This ifdef does not do anything, SV_ABI_LINUX is a flag.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    ivy, brooks
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/37
3a3b0545913625360e38b30dba10c74dae71bbcc Christos Margiolis 2026-05-22 10:57:59
acpi_spmc: Remove useless __DECONSTs
Sponsored by: The FreeBSD Foundation
0b2df683672e3b5792aa552a3700da86617f9d90 Aymeric Wibo 2026-05-22 11:11:39
amd64/vmm: Fix ppt_unmap_mmio() after commit 36b855f18925
Fixes:                https://cgit.freebsd.org/src/commit/?id=36b855f18925 ("amd64/vmm: Lock global PCI passthrough structures")
MFC after:      3 days
Reported by:    bz
b133353310920aa823b1b5f83a308d0762f3bba3 Mark Johnston 2026-05-22 22:18:05
hwpmc: Avoid panic on AMD cpus where IBS is not available
The recent IBS work intruduced a bug on older CPUs where the
IBS handler will be called on NMIs even when IBS is not initialized.
Work around this in the IBS handler by checking to see if ibs_pcpu
is NULL before accessing it.
b97ee5e9ce7b5598be596ef51872c1136b20cf88 Andrew Gallatin 2026-05-25 20:33:52
snd_hda: Patch Dell WYSE 7040
https://forums.freebsd.org/threads/dell-wyse-7040-thin-client-intel-i5-6500te-built-in-sound-alc255-mini-how-to.102656/

Reported by:    razif (on the forum)
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
c6cefcbbbb3fd5bbe9e0c36c8c553364d444e2d8 Christos Margiolis 2026-05-25 11:40:05
acpi: On /dev/power suspend, trigger userspace notifications
On a suspend request via ioctl(), /dev/acpi (and compatible /dev/apm)
both call acpi_ReqSleepState() instead of directly calling
acpi_EnterSleepState().  The former does more checks, returns success if
the machine is already suspending, and notifies user space (via devd(8))
about the impending suspend.  In other words, it seems to have been
designed for user consumption more than the latter function.

So, use acpi_ReqSleepState() in place of acpi_EnterSleepState() in
acpi_pm_func(), which is ultimately called by power_pm_suspend(), itself
called by power_ioctl().  Other callers of power_pm_suspend() (such as
the console drivers) are also user-facing facilities, so should also
benefit from this change.

Reviewed by:    mhorne, imp
Tested by:      mhorne
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57239
44eb2883134e465c28468213f79567c64fe26de1 Olivier Certner 2026-05-25 16:01:10
amd64: Drop segment descriptor details from trap messsages
Segment descriptor contents are fixed on amd64 and not very interesting
compared to the other values that are displayed.

While here, include both the thread and process details of the current
thread and drop redundant output of the trap number.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D56989
00b96a777845d9b558b2303cbef03ba5197b593a John Baldwin 2026-05-26 17:27:40
padlock: Restore padlock_rng to the amd64 build
Revert 88a53301e19 and d1ca01059d5 .  They removed padlock_rng from the
amd64 build under the mistaken belief that this device was available on
32-bit processors only.  But it's also available on the 64-bit Via Nano,
Nano X2, and some Zhaoxin CPUs.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295517
Fixes:          https://cgit.freebsd.org/src/commit/?id=88a53301e19 ("padlock.4: only install on i386")
Fixes:          https://cgit.freebsd.org/src/commit/?id=d1ca01059d5 ("padlock(4)/nehemiah: move i386-only entropy")
MFC after:      1 week
Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D57215
14b8531c4ccb836d755ce8a4f1b384164b5d9d94 Alan Somers 2026-05-24 00:19:13
zzz: Rewrite to use new power device
Previous script called acpiconf(8) (or apm(8) if ACPI wasn't supported,
although this was anyway redundant because APMIO just uses ACPI now).

Since a new generic power management interface was introduced, this isn't
sufficient, as this would only work for ACPI systems and for ACPI S3 suspend
(so no way to select suspend-to-idle). Rewrite in C to take advantage of the
new power interface.

We may want to add a switch to manually override the kern.power.suspend sysctl,
which is otherwise what the power device uses to decide which suspend type to
switch to (suspend-to-idle or firmware suspend), but this will require us to
amend the power interface.

Reviewed by:    olce, imp, mhorne, ziaee
Tested by:      mhorne
Approved by:    olce, imp, mhorne, ziaee
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56918
aba599a6cc550bf209b42a81a3cdb3f6e94d0613 Aymeric Wibo 2026-05-10 08:48:03
acpi: Update s2idle strings to new name
Reviewed by:  obiwac, emaste, olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57232
e4328c1398e5ea47d039fbcffffe1a64ed92b981 Tom Jones 2026-05-27 08:16:49
arm64: Adjust the kernel stack pointer at the end of fork_trampoline
All other paths that return from the kernel to userspace pop the user
trapframe off of the kernel stack pointer before returning to
userspace in restore_registers.  fork_trampoline was missing this, so
all of the user faults after fork pushed another trapframe leaving a
trapframe's worth of wasted space on the kstack.

This would be fatal after a future change to remove duplicate
initialization of td_frame in cpu_fork() as without this fix each time
a thread was recycled it would "lose" another trapframe's worth of
space.

Reviewed by:    kib, andrew
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
a1e07f21dc7458d85bd0d04c294f0389d4591666 Alfredo Mazzinghi 2026-04-22 23:46:14
arm64: Remove unneeded declaration from <machine/pcpu.h>
Reviewed by:  kib, andrew
Sponsored by:   AFRL, DARPA
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
d01e5afbbf9bc879e570f59dddc147c0efa8b990 John Baldwin 2026-03-25 15:17:27
amd64: Don't set an initial FPU state save size
This used to be needed to initialize the pcb pointer when the pcb was
allocated on the kstack.

Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
860aaecf1bb659d8cc6023aaa2d27273823faa75 John Baldwin 2026-03-26 17:09:59
cpu_fork: Remove redundant assignments to td_pcb and td_frame
cpu_thread_alloc() already sets these fields anytime td_kstack changes.

Reviewed by:    kib, andrew (arm changes)
Sponsored by:   AFRL, DARPA
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
187b46e1c4d761efe2e92f662d68c0f49cd04b44 John Baldwin 2026-03-26 17:39:52
amd64/i386: Remove dead code to clear XSAVE header
If XSAVE is being used, the XSAVE header will be overwritten either by
copying it from the parent thread in copy_thread for user threads, or
by a fresh copy from fpu/npx_initialstate on the first use of the FPU
for kernel threads.

Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
59d67f2868b17dc6ae897a3afd3ec4d96301e160 John Baldwin 2026-03-28 11:19:10
cpu_thread_new_kstack: Introduce new MD callback
Previously, the cpu_thread_alloc callback was invoked each time a
kernel stack was allocated for a thread.  This included thread
creation, but it was also invoked if a recycled thread had to allocate
a new kstack.  This means that cpu_thread_alloc could be called
multiple times for a single thread, but cpu_thread_free is only called
once.  Not only that, but the cpu_thread_alloc callback can't tell if
it is being invoked on a new thread object, or a recycled thread.
Calling *_alloc multiple times on an object is also atypical for
kernel APIs.

As a result of this confusion, amd64 was potentially leaking an XSAVE
buffer each time a new kstack was allocated for an existing thread,
since cpu_thread_alloc for amd64 always allocated a new XSAVE buffer.
In practice, this edge case is probably rare.  A process object needs
to be recycled where either the new or old process is a kernel process
with a non-default kernel stack size.

Nevertheless, to ease the confusion, redefine cpu_thread_alloc to only
be called once when a new thread is allocated.  The new callback,
cpu_thread_new_kstack is invoked each time a kstack is allocated for a
thread, including both at thread creation time and if a recycled
thread allocates a new kstack.  The new callback should set any fields
whose value is dependent on td_kstack (e.g. the user frame in
td_frame, or td_pcb if the PCB is allocated on the kstack).

Reviewed by:    kib, andrew (arm changes)
Sponsored by:   AFRL, DARPA
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
2893bb741b4bb67bde9ee27e5f18ea5715e3f0e9 John Baldwin 2026-03-28 13:56:24
amd64: Inline set_top_of_stack_td into cpu_thread_new_kstack
Reviewed by:  kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
f7524d8fcbd76a432c163200a7c77ce964805beb John Baldwin 2026-05-05 14:43:10
sys: Consistently use ptoa() with td_kstack_pages
Suggested by: kib
Reviewed by:    kib, andrew (arm changes)
Sponsored by:   AFRL, DARPA
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
dcae0f7d7aa67ed6ec6b8da5e1b444a828898595 John Baldwin 2026-04-27 19:05:54
arm64: Move pcb out of kstack into a new UMA zone
This is similar to commit 5e921ff49ea8bb70506248a4675894729cdad8c2
which moved the pcb for amd64, but a bit different.  arm64's pcb is
much larger (over 1KB!) than amd64's since it still embeds FP
registers.  Moving the pcb out of the kstack frees up that much
additional kstack space.  Unlike amd64 however, embedding the pcb in
struct mdthread is not practical as the resulting struct thread would
grow such that UMA would now store 1 thread per 4k page instead of 2
threads per page.  By using a separate UMA zone for pcbs, 2 struct
threads can continue to fit in a single 4k page, and 3 pcbs can fit in
another 4k page.

Reviewed by:    kib, jrtc27, andrew
Sponsored by:   AFRL, DARPA
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
d0b10df718e3560cd041ba9ddb157591ac7fa886 John Baldwin 2026-03-25 15:18:05
riscv64: Move pcb out of kstack into a new UMA zone
Similar to arm64, riscv's pcb embeds a copy of the floating point
registers and is too large to store directly in struct mdthread as is
done on amd64.  Instead, use a separate UMA zone for pcbs.  riscv's
floating point state is not as large as arm64's, so its pcb is also
somewhat smaller and a single 4k page can hold 6 pcbs.

Reviewed by:    kib, jrtc27
Sponsored by:   AFRL, DARPA
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
4f876cec30afca1a32d0187fc81d6c3ffd1abc30 John Baldwin 2026-03-28 15:19:53
arm64: Add vm_page_t MTE flags
To track which pages have MTE tags. Add a flag field to md_page. We
can then use this in MD code to mark which pages have MTE tags.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55954
bb9497a2d462e668455d0a561bd5677f447b4acf Harry Moulton 2026-05-18 09:09:23
arm64: mte: copy/save tags on copy-on-write
On a copy-on-write, copy the memory tags from the source pages to the
destination pages so the forked process can continue to use MTE.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Signed-off-by:  Harry Moulton <harry.moulton@arm.com>
Differential Revision:  https://reviews.freebsd.org/D55955
7bb6b62394d3036567cf1453395d9e8b63d3dda1 Harry Moulton 2026-05-18 09:29:03
Commit group #23: sound
sound: Update feeder_eq.c LICENSE header

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
dfa52e8ed5b5c00f0a587f02258c90e407e5bf6b Christos Margiolis 2026-04-17 16:54:03

sound: Retire M_MIXER

Even though harmless, it is not really useful, as there is essentially
only one allocation with M_MIXER.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
e8ea97602ca97166a0729fdc32c84c9016fe7b0c Christos Margiolis 2026-04-15 23:39:23

sound: Retire mixer_ioctl_channel()

This function never succeeds when it is not called from the same process
that has opened the file descriptor (e.g., mixer(8)). The reason is that
the CHN_FOREACH() loop tries to match the pid of each channel with the
pid of the process performing the ioctl, which will not be the same,
unless it's the same process that both opened the channel and performed
the ioctl.

In the case that the same process opens the channels and performs the
ioctl, however, we still do not need to worry, because mixer_ioctl_cmd()
essentially does the same thing anyway. Additionally, this scenario
should be quite rare, given that most applications do not open both
/dev/dsp* and /dev/mixer*, and in fact, it is actively encouraged by the
official OSSv4 specification not to do that.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
f61e65e1b2ac74034bfc5d1230ae23ea4b9faa60 Christos Margiolis 2026-04-16 11:00:16

sound: Retire unused hw.snd.vpc_mixer_bypass

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
8e804f3dd6298d6aa8cbaf0f2a0267c6207ac8f7 Christos Margiolis 2026-04-16 11:25:20

sound: Remove unused "from" mixer_ioctl_cmd() argument

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
22730c4b10ba391859a06966ea3e429aaf43cd09 Christos Margiolis 2026-04-16 11:32:03

sound: Use and lock only the appropriate channel in dsp_mmap_single()

dsp_mmap_single() mmaps one of the channels associated with a
dsp_cdevpriv, based on the nprot argument. PROT_WRITE and
PROT_READ|PROT_WRITE select the output channel for mmaping, and
PROT_READ the input one. Instead of locking and modifying the flags of
all dsp_cdevpriv channels, do it only for the one we actually use.

While here, retire the now unused dsp_lock_chans() and
dsp_unlock_chans().

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj, kib
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/30
bbb37ddf3669f77d78446b9f1e37f58c63dc0a1c Christos Margiolis 2026-06-12 06:14:05

sound: Re-arrange a calculation in dsp_mmap_single()

This makes it easier to read. No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj, kib
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/30
0c8147ae3bc1c7db95098fcc92fc2e86111f59d3 Christos Margiolis 2026-06-12 06:14:57

sound: Handle CHN_F_MMAP_INVALID after cdev_pager_allocate()

We drop the channel lock to execute cdev_pager_allocate(). By the time
we pick up the lock again, CHN_F_MMAP_INVALID might be set, so make sure
we fail and free the vm handle.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj, kib
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/30
47efa8128268c35ac8f0a552d7a7ce43cd1c5925 Christos Margiolis 2026-06-12 06:19:07
Commit group #24: snd_uaudio: Do not use snd_mixer->lock as mixer_lock
snd_uaudio: Do not use snd_mixer->lock as mixer_lock

In similar fashion to c234740c9d34 ("snd_uaudio: Do not use
pcm_channel->lock to protect uaudio_chan"), stop this layering
violation, and introduce a snd_uaudio(4)-internal mixer_lock.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
9a00e0b8ca566b6942874eb08c03baf035a17702 Christos Margiolis 2026-04-16 12:15:21

snd_uaudio: Lock usbd_transfer_start() in uaudio_mixer_ctl_set()

This section would be previously locked by sound(4)'s mixer lock (see
e87654db5a09 ("snd_uaudio: Stop using mixer_get_lock()")), but
snd_uaudio(4) no longer uses it. This particular code path was missed
during testing, because my sound card does not reach it.

Fixes:          https://cgit.freebsd.org/src/commit/?id=9a00e0b8ca56 ("snd_uaudio: Do not use snd_mixer->lock as mixer_lock")
Reported by:    netchild
Tested by:      netchild
Sponsored by:   The FreeBSD Foundation
MFC after:      6 days
fc9dc848239652ec1e4135adb4833a5f002cef0f Christos Margiolis 2026-05-28 09:31:52
snd_uaudio: Stop using mixer_get_lock()
There is no reason to lock snd_mixer->lock here, since the only thing we
are doing with snd_mixer is to call mix_getdevinfo() and mix_get_dev(),
which are one-line getters, which are needed to eventually call
uaudio_get_child_index_by_dev().

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
e87654db5a0923856afbaace9bd0975331782044 Christos Margiolis 2026-04-16 12:30:25
Commit group #25: sound
sound: Remove all remaining uses of mixer_get_lock()

These functions are called from sound(4) through MIXER_SET() in
mixer_set(), but nothing mixer-related is used or needs to be locked in
these cases.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
1e72608a3c6a60b76938c5ded2a290d0b9ff6456 Christos Margiolis 2026-04-16 12:41:13

sound: Retire unused mixer_get_lock()

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
6a3a42c57cf45874294105419f5c5de6602db3f8 Christos Margiolis 2026-04-16 12:46:48

sound: Do not lock before destroying snd_mixer->lock

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
7485519d56346909c4db595ab0342128353d5b8d Christos Margiolis 2026-04-16 12:51:56

sound: Retire snd_mixer->enuminfo

Instead of caching this when mix_setrecdevs() is called (which many
drivers never call), calculate it when we need it. After all, it is
quite rare that this structure is used by applications.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
5589a7499add5912a88e9424b0aec843e099fb60 Christos Margiolis 2026-04-17 17:31:00

sound: Retire MIXER_SIZE and use correct size in DEFINE_CLASS

I am not sure why this hack was needed, but the size should be
sizeof(struct snd_mixer). Unfortunately, we have to expose snd_mixer,
but it should be better than relying on a hack.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
64ebbb1d74415cb93445cc625da63449f01ac8c5 Christos Margiolis 2026-04-18 10:29:39

sound: Update mixer.c LICENSE header

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
773bbfc57328f0a7947f2ad9a30de6a45ccce758 Christos Margiolis 2026-04-17 17:33:00
bcm2835_sdhci: Clean up DMA resources on attach failure
bcm_sdhci_attach() allocates a DMA channel with bcm_dma_allocate()
before creating the bus_dma tag and map.  If a later initialization
step fails, the common error path releases the interrupt and memory
resources, but leaves the DMA channel allocated.

Call bcm_dma_free() for cleanup, as it already performs the required
internal checks and can therefore be invoked directly.

Signed-off-by:  Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Reviewed by:    mhorne
MFC after:      3 days
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2241
d1488cd762bee79240a715bf04f3d30e9a121b26 Haoxiang Li 2026-05-27 02:42:43
rk_gpio: implement PIC masking methods and mask unhandled IRQs
The Rockchip GPIO controller implements PIC operations for the INTRNG
framework but is missing four masking methods that INTRNG calls during
the filter/ithread handoff: pic_disable_intr, pic_enable_intr,
pic_pre_ithread, pic_post_ithread.

Without them, level-sensitive interrupt sources connected to a
Rockchip GPIO pin re-fire continuously while their ithread runs.  On
a RockPro64 with a FUSB302B Type-C controller (i2c) attached to
gpio1 INT_N, the system enters a ~210 kHz interrupt storm the moment
the fusb302 driver attaches and INT_N goes low.

Two complementary changes:

1. Add the four pic_disable_intr/pic_enable_intr/pic_pre_ithread/
   pic_post_ithread method bodies.  Each toggles the pin's
   RK_GPIO_INTMASK bit so the source is masked during the in-flight
   ithread window and unmasked on return, honouring the generic
   INTRNG mask/unmask sequence.

2. When the GPIO IRQ filter dispatches a pin and finds no consumer
   registered, mask the pin at the controller (INTMASK=1, INTEN=0)
   before continuing.  Level-triggered sources keep asserting until
   acked, so a single stuck pin used to flood the console with
   thousands of "Interrupt pin=N unhandled" lines per second.  The
   mask survives until something re-attaches and re-enables the IRQ
   via the standard pic_enable_intr path.

Affects all level-triggered IRQs on Rockchip GPIO banks; edge-
triggered IRQs were already self-acking and unaffected.

Signed-off-by:  Kyle Crenshaw <B1nc0d3x@gmail.com>
Reviewed by:    mhorne
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2197
ccda002ca10f9fb88e65d4bc27f0676e6f97d16d Kyle Crenshaw 2026-05-14 21:07:42
uart: Tidy the compat tables
No functional change intended.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    royger
Differential Revision:  https://reviews.freebsd.org/D57269
40c846dc07943df7cdebf091de09d5680a3f3606 Dag-Erling Smørgrav 2026-05-27 20:14:58
ucode: Fix validation on Intel platforms
The check for the extended signature table was backwards, so we always
ignored it.

We should verify that the extended signature table fits within the total
image size.

Reviewed by:    jrm, kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57209
0beb172898499fff51eed4df3d9284cd1094afbb Mark Johnston 2026-05-27 20:18:05
ucode: ucode_error can be defined with static
MFC after:    1 week
96256587b06cfcdbeb1789145f5e427831b3d732 Mark Johnston 2026-05-27 20:41:15
if_ffec: correctly trim 2 bytes from the beginning
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=283315
Tested by:      tuexen
MFC after:      3 days
b29842622dcb9c9c9515fc04dc5826a8717537b1 Mike Belanger 2026-05-28 11:09:52
amd64: extract uiomove_mem() from memrw()
Reviewed by:  markj
Tested by:      aokblast
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D49566
67d61d18bb8debb4ffc51ef2248aa37ed0bfb8f5 Konstantin Belousov 2026-05-24 11:48:45
sound: Centralize and improve hot-swapping
Introduce pcm_hotswap(), which is responsible for sending devctl
SND/CONN notifications.

There are two user-visible improvements with this patch:

First, in pcm_unregister(), instead of just sending a SND/CONN/NODEV
notification when all devices have detached, we also switch to the new
default device if the previously default one has detached, but there are
more left.

Second, in pcm_register(), if the device happens to also be the new
default device, we hot-swap to it. Additionally, if hw.snd.default_auto
is set to 2, then we will essentially be hot-swapping to the newest
attached device.

The latter is especially useful for laptops like the Framework 16, which
comes with a built-in snd_hda(4) speaker-microphone-only device, and
headphones can work with the Framework Audio Expansion Card, which does
not extend the snd_hda(4) device, but is in fact a separate
snd_uaudio(4) device. To achieve automatic audio redirection between
headphones and speakers in this case, there has to be a way to switch
between different devices. The way the Audio Expansion Card works is by
having snd_uaudio(4) attach to it when the headphones are plugged, and
detach when unplugged, so this patch, along with hw.snd.default_auto=2,
can pick up those attach events and switch automatically. Combined with
the pcm_unregister() update, it becomes possible to switch back and
forth between headphones and speakers.

While here, be more robust and lock around snd_unit reads.

In collaboration with:  jrm
Sponsored by:           The FreeBSD Foundation
MFC after:              1 week
9fb56421425fa35e56ce294284c08b09852052a5 Christos Margiolis 2026-05-21 12:22:38
usb: Add missing mtx lock and unlock in pushing dma queue
Accessing usb_xfer_queue requires bus lock, we added this missing lock
in here to prevent racing issue.

Reviewed by:    adrian
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57293
df5e9e3da5b9b3fe63ed4aaaa19b824fd18ae0f2 ShengYi Hung 2026-05-28 08:42:11
x86: for wrmsr_early_safe(), catch all exceptions, not only #GP
Reviewed by:  olce
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57264
0a02a47fd94a8326e84ac0a6cb857342b59671f8 Konstantin Belousov 2026-05-27 08:21:10
cxgbe(4): Improvements to the slow interrupt handler
* Add a flag to indicate that an INT_CAUSE should not be cleared
  automatically in the generic handler.  This is to ensure correct
  operation of some INT_CAUSEs that are related to each other and must
  be cleared in a certain order.
* Add decode for many more INT_CAUSE registers.

MFC after:      1 week
Sponsored by:   Chelsio Communications
a172f9e5b3cf41882f087f6c5311dc068d9d6b54 Navdeep Parhar 2026-05-28 07:12:20
bnxt: Fix build / load error for bnxt(4) in kernels without PCI_IOV
This change removes the hard-forcing of  PCI_IOV and adds shims to
allow the driver to compile and work when the kernel is missing
PCI_IOV support.

Fixes: https://cgit.freebsd.org/src/commit/?id=7c450d1127c7
Reviewed by: sumit.saxena_broadcom.com
Differential Revision: https://reviews.freebsd.org/D57300
Sponsored by: Netflix
3118f1b99f23431235c202d9aadbe3d183bcc259 Andrew Gallatin 2026-05-29 12:52:44
rtwn/usb: add ID for D-Link DWA-121 rev B1 to rtwn RTL8188EU
Add the device ID to the usbdevs table in order to be able to use
it in the rtwn/usb driver for the RTL8188EU attachment.

(I adjusted the name to B1 compared to the original submission)

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291839
MFC after:      3 days
49b413c4b07016de4ee166779386f0f99b5aac6b Bjoern A. Zeeb 2026-05-30 21:29:09
ukbd: fix SET_REPORT wValue always using report ID 0 for LED output
ukbd_set_leds_callback() built the SET_REPORT control request with
USETW2(req.wValue, UHID_OUTPUT_REPORT, 0) before the loop that
determines the actual HID report ID from sc_id_numlock,
sc_id_scrolllock, or sc_id_capslock.  The data payload was already
correctly prefixed with the real report ID when id != 0, but the
control request's wValue told the device to set report ID 0, which
does not exist on devices that use non-zero report IDs for LED output.

Apple Internal Keyboard / Trackpad (0x05ac:0x0274) uses report ID 1
for LED output.  The mismatch caused the device to STALL every
SET_REPORT request, so the capslock LED could never be updated.

Move the USETW2 call to after the LED-detection loop so that wValue
carries the correct report ID.

Signed-off-by:  Joshua Rogers <Joshua@Joshua.Hu>
Reviewed by:    wulf
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2210
8809ea46f105b71e87e17c46bce133860f2bf643 Joshua Rogers 2026-05-31 11:29:15
linux_ntsync: linux compat shim for ntsync(9)
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57038
510ee6698d377f4a9a4eeb08d9dc17bdc72ad5ab Konstantin Belousov 2026-05-19 02:23:33
pmc: add sapphire rapids model
This commit adds the sapphire rapids CPU model to hwpmc_intel.c,
allowing hwpmc to be used on this CPU family.

Reviewed by:    mhorne
MFC after:      3 days
Sponsored by:   Stormshield
Differential Revision:  https://reviews.freebsd.org/D57263
03c69dd90122c4ffa91a749f668a2ac8fa6843a2 Anaelle Cazuc 2026-05-28 16:28:32
amd64: explain in more details why the slop is needed
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
963a92d63b7443d27588fb4260bd4226f7525117 Konstantin Belousov 2026-05-31 19:15:37
Commit group #26: ig4iic: Add PantherLake IDs
ig4iic: Add PantherLake IDs

MFC after:      2 weeks
Sponsored by:   Framework Computer Inc
Signed-off-by: Daniel Schaefer <dhs@frame.work>
39e297bf54a57a17d8b44c20e502d6f2c6db08f6 Daniel Schaefer 2026-05-31 11:18:31

spi: Remove incorrect pci id

This id is for SPI flash instead of spi bus

Fixes: https://cgit.freebsd.org/src/commit/?id=39e297bf54a5 ("ig4iic: Add PantherLake IDs")
MFC after:      2 weeks
Sponsored by:  The FreeBSD Foundation
Sponsored by:  Framework Computer Inc
4ccbceefeb0f2898e2e4bb951862125d0bc5ce34 ShengYi Hung 2026-06-01 08:41:12
amd64: do not switch back and restore UEFI IDT in wrmsr_early_safe_end()
The memory where the pre-OS IDT was located might be already consumed by
kernel.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57321
606d3cb1be5fd594c1f51addd063e7c13e16bdbc Konstantin Belousov 2026-05-29 07:32:41
amd64: there is no reason to copy ucode around in ucode_load_bsp()
PR:   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294630
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differrential revision: https://reviews.freebsd.org/D57368
16f21c5af35002b8361ffb2e83ff3c92cd899a3a Konstantin Belousov 2026-05-30 15:57:46
hwpstate_intel: Disable package control on hybrid CPU
In package control mode, the performance of all cores depends on the
most recent value written to the request field. If the last write comes
from an E-core, all cores are forced to align with the E-core
performance level, resulting in significant performance degradation.
Therefore, package control is disabled on hybrid-core systems.

Reviewed by:    olce
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Framework Computer Inc
Differential Revision: https://reviews.freebsd.org/D57377
7b26353a59d66dc1bc611fd042a49b9e3bd13699 ShengYi Hung 2026-06-01 09:46:37
linux: Add linux_pt_fpregset and bsd_to_linux_fpregset() for amd64
Add struct linux_pt_fpregset, the amd64 Linux NT_PRFPREG payload,
corresponding to user_i387_struct in Linux. The struct describes
the 512-byte FXSAVE area as exposed by PTRACE_GETREGSET.

Add bsd_to_linux_fpregset() to translate from FreeBSD's struct fpreg
to struct linux_pt_fpregset. Fields are extracted from the fpr_env[]
array which stores the FXSAVE environment packed as four 64-bit words.
The FP and XMM register banks are bulk-copied as opaque byte arrays.

Signed-off-by:  Ricardo Branco <rbranco@suse.de>
Reviewed by:    kib
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2165
b84d31ee74535a0026ff83f2a34c07b7557f9785 Ricardo Branco 2026-04-26 14:43:59
asmc: add MMIO backend for T2 Macs
T2 Macs (2018+) expose the SMC via memory-mapped registers instead of
I/O ports. Add asmcmmio.c/asmcmmio.h implementing the MMIO transport:
key read/write, getinfo, getbyindex, and a poll-based wait with
exponential backoff.

The driver probes for MMIO at attach time by checking the LDKN firmware
version key; if MMIO is available it is used, otherwise the standard
I/O port backend is used.

T2 fan speeds use IEEE 754 floats instead of fpe2 fixed-point.
Per-fan manual mode uses F%dMd keys instead of the FS! bitmask.
Battery charge limit is exposed via dev.asmc.N.battery_charge_limit.

Tested on:
  MacBookPro16,2 (A2251, iBridge2,10)
  MacBookPro15,4 (A2159, iBridge2,8)
  MacBookAir8,2  (A1932, iBridge2,5)
  Mac mini 8,1   (A1993, iBridge2,7)
  iMac20,2       (A2115, iBridge2,16)
  iMacPro1,1     (A1862, iBridge1,1)

MFC after:      2 weeks
Reviewed by:    ngie, adrian
Differential Revision:  https://reviews.freebsd.org/D57086
a48b900300ebdbd5c47e664b4cc06e705da91bd8 Abdelkader Boudih 2026-06-03 05:57:49
Commit group #27: cxgbe(4)
cxgbe(4): Use backdoor access to read SGE context on T7

This avoids a firmware bug where it crashes when accessing SGE context
on a secondary core.

MFC after:      1 week
Sponsored by:   Chelsio Communications
c029d04671e904ce7e194fb441704b6a814f40f5 Navdeep Parhar 2026-06-03 05:07:31

cxgbe(4): Do not read indirect INT_CAUSE registers directly

Some of the registers added in a172f9e5b3cf are not directly accessible
and should be avoided.

Fixes:          https://cgit.freebsd.org/src/commit/?id=a172f9e5b3cf cxgbe(4): Improvements to the slow interrupt handler
MFC after:      1 week
Sponsored by:   Chelsio Communications
4b6887e3863881ff3be447c00fa2ae0c563550c5 Navdeep Parhar 2026-06-01 23:36:36

cxgbe(4): Use correct FID in KTLS tx work requests

MFC after:      1 week
Sponsored by:   Chelsio Communications
309fc9f765917fa032cdae7043bafffb6da5713b Navdeep Parhar 2026-06-03 05:16:13
kern: ofw: provide ofw_bus_destroy_iinfo to teardown interrupt-map
For symmetry with ofw_bus_setup_iinfo, the next commits will use it to
properly cleanup on failure in bcm2838_pci.

Reviewed by:    andrew
Differential Revision:  https://reviews.freebsd.org/D56895
b230a7b9a52c0fc948f4f1dcd1225a94674073f6 Kyle Evans 2026-05-09 02:42:50
pci: pci_host_generic: provide cleanup methods outside of detach
If device_attach() fails, we're expected to actually cleanup after
ourselves because device_detach() will not be called.  Factor out the
cleanup bits that don't rely on attach having actually succeeded so
that we can cleanup properly in bcm2838_pci.

Reviewed by:    andrew, imp
Differential Revision:  https://reviews.freebsd.org/D56896
31a94ec32b53ebf6227bc868ce4f7aa07650680d Kyle Evans 2026-05-09 02:46:24
pci: bcm2838: cleanup on attach failure to fix devmatch panic
Specifically on the RPi CM4, we currently don't set the controller up
right and it never moves into the ready state (we don't observe the link
active bit).  Failure to cleanup here actually results in a panic not
long after, due to a use-after-free in the rman bits.  Further down in
pci_host_generic, we have some rman stashed in the softc that are
initialized and placed onto the rman tailq, then the softc is later
freed without an rman_fini() to pull them off of the tailq properly.

Note that PCIe on this board won't come up at boot without something
plugged in, so it currently can't be booted with an empty slot with the
intent to hotplug a supported card.  Some issues with controller startup
have been observed with Broadcom NICs in the wild, but no problems have
been observed with other NICs and a variety of different PCIe cards.

Shout-out to Vince <git@darkain.com> for the extensive debugging and
analysis to arrive at this conclusion.

Reviewed by:    andrew, imp
Differential Revision:  https://reviews.freebsd.org/D56897
a05af6ddf9016e4ea4f0b361aa674e7ece6fe7ec Kyle Evans 2026-05-09 02:49:35
arm64: Expose ESR in mcontext
At present, the exception syndrome register (ESR) is not accessible via
the user context on FreeBSD AArch64, which makes it difficult to
determine the cause of an exception. For example, a signal handler might
get a `SIGSEGV` with `SEGV_ACCERR`, but it can't know whether that
occurred due to a bad read or write. The change implemented here
includes ESR in `struct __mcontext`, thereby allowing access via
`ucontext_t` for use by signal handlers, sanitizers, debuggers, etc.

Note that this addition consumes one of the seven spare 64-bit slots in
`struct __mcontext`.

Signed-off-by: Alex Arslan <ararslan@comcast.net>
Reviewed by:    andrew
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2053
0b862a795a3500b07aa757ce7b457c9bf198e2b1 Alex Arslan 2026-02-27 21:51:28
linux: Drop unneeded PHOLDs
There's no point in acquiring a hold if the proc lock isn't going to be
dropped.

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57468
2404d8d741f281e445233f86b0734d6dcf02c173 Mark Johnston 2026-06-05 16:28:18
vt: Avoid integer overflow in CONS_HISTORY ioctl
Reviewed by:  markj, vexeduxr
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57250
0ae946e7223df5ef3f7980af1d774d7f593f6421 Ed Maste 2026-05-26 16:19:47
APEI: Provide more info on fatal hardware errors
This change refactors fatal error delivery via APEI and prints more info:

- Makes the NMI handler call into the ge handler to establish a common
        code flow, no matter how the error is delivered
- Adds the FRU to the panic string so as to provide more information than
        just "APEI Fatal Hardware Error!" such as
        "APEI Fatal Hardware Error: PcieError"
- Prints more details about fatal pcie errors.  Note that we skip acquiring
        Giant on fatal errors
- Hexdumps the full GED data on fatal errors, so as to facilitate
        offline data analysis

Reviewed by: imp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D57417
16e5abf415baf801c6d7c7948a742aeda75e2237 Andrew Gallatin 2026-06-06 00:07:03
fix(fwe): add missing net epoch around ether_input
Wrap the if_input() call in fwe_as_input() with NET_EPOCH_ENTER/EXIT.
The network stack requires epoch protection when delivering packets
via if_input, and fwe was missing it.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57459
a620746da173d1583b342b096419297e33d0ed15 Abdelkader Boudih 2026-06-06 20:08:59
firewire: clean up XXX comments
Remove stale and misleading XXX comments throughout firewire.c.
Most were from the original 2002 codebase and either described
correct behavior or noted aspirational improvements that never
happended.

Two actionable items retained as TODO: config ROM CRC validation
and pending xfer cleanup on detach.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57466
4a299ef19c7ed20aca6593a1c01b2dc16d9af1a0 Abdelkader Boudih 2026-06-06 20:17:18
firewire: Fix watchdog_clock aliasing and fw_tl2xfer UAF race
Two bugs in the firewire bus layer that affect all consumers (
if_fwip, sbp):

watchdog_clock was a static local in firewire_watchdog(), shared across
all firewire_comm instances.  With two controllers (e.g. built-in +
Thunderbolt Display), both advance the same counter, so the second
controller's 15-second boot-time timeout guard expires prematurely.

fw_tl2xfer() released tlabel_lock before returning the xfer pointer.

Reviewed by:    zlei, adrian
Differential Revision:  https://reviews.freebsd.org/D57496
a9519f7821c066c393690603eab33043f3804a0c Abdelkader Boudih 2026-06-08 14:30:29
usb: Add missing unsetup while detaching uchcom
Reviewed by:    christos
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57329
2934783fa80de2854d9527ae11db85c47ac65a91 ShengYi Hung 2026-05-29 15:09:52
if_axge: remove AXGE_RX_MII_ERR from packet dropping criteria
Packets received with the following configuration are associated with
AXGE_RX_MII_ERR, which looks legit since there's no AXGE_RX_CRC_ERR
or AXGE_RX_DROP_PKT attached:

        axge0: <ASIX Elec. Corp. AX88179, rev 2.10/1.00, addr 3> on usbus0
        miibus0: <MII bus> on axge0
        rgephy0: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 3 on miibus0
        rgephy0: OUI 0x00e04c, model 0x0011, rev. 5
        rgephy0:  none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow

Without this, 'dhclient ue0' never gets valid lease as all the DHCP
replies are dropped by the driver.

This behaviour is align with the reference driver provided by the
vendor(ASIX_USB_NIC_Linux_Driver_Source_v3.5.0.tar.bz2).

MFC after:      2 weeks
8011f6b0d8ba2ee18a60f3bd719f950081a474b3 Tai-hwa Liang 2026-05-15 14:32:03
sound: Check for offset overflow in dsp_mmap_single()
Approved by:  so
Security:       FreeBSD-SA-26:27.sound
Security:       CVE-2026-45258
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
1bb8212df1878845f0a02e0375f1c4847b11e326 Christos Margiolis 2026-05-27 15:50:33
sound: Fix software buffer lifetime issues
The channel buffer mapped by dsp_mmap_single() may be freed when the
device handle is closed, but the mapping persists beyond that, allowing
userspace to read or write memory owned by a different consumer.

Fix the problem by adding a reference counter to the sound buffer.
Define pager ops for the VM object returned by dsp_mmap_single() and use
them to manage the extra reference.

Add a regression test.

Approved by:    so
Security:       FreeBSD-SA-26:27.sound
Security:       CVE-2026-49417
Reported by:    Lexpl0it, 75Acol, Liyw979, Rob1n
Reviewed by     kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57393
1b775b9ea4c1f4eb375c4309f8d6e90edb269844 Mark Johnston 2026-06-01 21:57:40
arm64: Workaround the following errata
 - ARM C1-Premium erratum 4193780
 - ARM C1-Ultra erratum 4193780
 - ARM Cortex-A76 erratum 4193800
 - ARM Cortex-A76AE erratum 4193801
 - ARM Cortex-A77 erratum 4193798
 - ARM Cortex-A78 erratum 4193791
 - ARM Cortex-A78AE erratum 4193793
 - ARM Cortex-A78C erratum 4193794
 - ARM Cortex-A710 erratum 4193788
 - ARM Cortex-X1 erratum 4193791
 - ARM Cortex-X1C erratum 4193792
 - ARM Cortex-X2 erratum 4193788
 - ARM Cortex-X3 erratum 4193786
 - ARM Cortex-X4 erratum 4118414
 - ARM Cortex-X925 erratum 4193781
 - ARM Neoverse-N1 erratum 4193800
 - ARM Neoverse-N2 erratum 4193789
 - ARM Neoverse-V1 erratum 4193790
 - ARM Neoverse-V2 erratum 4193787
 - ARM Neoverse-V3 erratum 4193784
 - ARM Neoverse-V3AE erratum 4193784

These are all variants on an erratum where TLBI+DSB instructions on
one CPU may incorrectly complete early leading to stores to an updated
address using an incorrect translation on another CPU.

In all cases the workaround is to add a second TLBI+DSB.

Approved by:    so
Security:       FreeBSD-SA-26:31.arm64
Security:       CVE-2025-10263
Sponsored by:   Arm Ltd
9c0a62df50de990230a48827ca0bb85b41d4e839 Andrew Turner 2026-05-28 09:25:30
hwpmc: Disable AMD PMCs if in an unsupported VM
AMD does not have a CPUID bit to indicate the lack of K8 PMCs.  If all
other PMC features are not present we should test an event selector to
see if it stores and returns a value.  If the VM is implemented
correctly, this should result in a #GP on the initial wrmsr_safe.  Bhyve
and a few other VMs ignore writes, so I got one step further and test
that it retains the OS and USR bits.

Tested on Zen 5 native and a Zen 5 Bhyve virtual machine.  This code
should not run on any recent hardware, except in a VM, as it checks that
the core counter extension is missing.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268943
Reported by:    Sandipan Das, John F. Carr <jfc@mit.edu>
Reviewed by:    mhorne, imp
Sponsored by:   Netflix
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2272/changes
dded0ab415cc09eed506968366e383d406834823 Ali Mashtizadeh 2026-06-05 23:48:53
watchdog: Fix a couple type issues
* Force the type of the literal `1` passed to nstosbt() to ensure it's a
  64-bit type (or larger).  Otherwise it gets inconveniently typed to
  int, resulting in truncation.
* Use `flsll()` when converting sbt to power-of-2-nanoseconds to fix
  32-bit compatibility.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292616
Obtained from:  Hewlett Packard Enterprise
Fixes:  https://cgit.freebsd.org/src/commit/?id=26d6617f3 ("watchdog: Convert to using sbintime_t format")
MFC after:      3 days
d08cb1dc17486920c1506f175d77259e0ac3f3a3 Justin Hibbits 2026-06-10 13:50:14
powerpc/booke: Add watchdog driver
The Book-E watchdog is effectively a state machine based around an AND
mask of the timebase register.  A single bit (0-63) is watched in the
timebase register, and when it transitions (by counting *or* by
programmatically setting) an exception is triggered.  The first
exception triggers a core interrupt.  The second is programmable.
In our case, we panic on the first and reset on second.
4bdcff55436859420e090afb0e6932bab794baa4 Justin Hibbits 2026-06-10 03:09:10
sys/arm64: fix return values of freebsd32_{set,swap}context()
This patch aligns the return values of freebsd32_{set,swap}context()
with their counterparts on amd64 and powerpc64, fixing the setcontext()
and swapcontext() calls in armv7 applications running on aarch64.

In particular, this fixes random crashes in armv7 Ruby applications
running on aarch64 hosts.

Tested by:      fuz
MFC after:      1 week
92ae21e8a155734f73589b7ef9fa19a6bb6d042f Piotr Kubaj 2026-06-11 11:41:29
virtio-scsi: handle device capacity change event
This feature is utilized when updating storage capacity in capable hypervisors such as QEMU.

Reviewed by:    imp
Approved by:    imp(mentor)
Obtained from:  Fudo Security
MFC after:      2 weeks
Sponsored by:   Fudo Security
Differential Revision:  https://reviews.freebsd.org/D57247
f056e84e5b46acd33c5e872f384683718313bad8 Aleksandr Rybalko 2026-05-26 14:49:21
usb: implement attach kernel driver feature
FreeBSD's USB framework supports detaching kernel drivers to allow
user space applications to exclusively claim USB interfaces. However,
it lacked support for reattaching the kernel driver afterward.

This commit adds the missing functionality, enabling user space
to return control of the device back to the kernel.

Reviewed by:    lwhsu
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52122
ff46acfd521e7b7b3761a395c8fa0a929e49e5d7 ShengYi Hung 2025-08-22 14:24:19
hwpmc_ibs: Add Zen6 IBS ctl2 filters and alternate disable
Add kernel and userland support for Zen6 IBS extensions per AMD pub
69205 (rev 1.00, March 2026): alternate fetch/op disable via ctl2[0],
fetch latency filtering, virtual address bit 63 filtering, and
streaming-store filtering.  Decode the new IbsOpData2 StrmSt and
RmtSocket bits. Update libpmc, pmcstat and manpage.

Pre-Zen6 systems work unchanged with ibs_ctl2 == 0.

Signed-off-by:  Andre Silva <andasilv@amd.com>
Reviewed by:    Ali Mashtizadeh <ali@mashtizadeh.com>, mhorne
Sponsored by:   AMD
Differential Revision:  https://reviews.freebsd.org/D56914
0aa4c25f3e836e98da419a37526bd51c9e04427b Andre Silva 2026-06-11 14:15:35
vt: Do not lock request comming from terminal
only those originated by mouse.  Because the terminal surrounds
requests to vt(4) with locking.

Reported by:    bz, adrian
Reviewed by:    adrian, glebius
Approved by:    glebius (mentor)
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57442
1f68ca5802db91bd9725bcdbf55932e104dbe95d Aleksandr Rybalko 2026-06-11 13:33:49
ice(4): Add support for new E810-XXV-2 adapters
Add two new subdevice IDs for E810-XXV-2 and E810-XXV-2 for OCP 3.0.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Reviewed by:    kbowling, erj, mateusz.moga_intel.com
Sponsored by:   Intel Corporation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54069
bea6f7d02dfbef8f8209f0ca5f1d76877d549f46 Krzysztof Galazka 2026-06-12 11:37:01
ice(4): Fix link speed after changing cable type
When interface was connected to a link partner with a cable
type limitting maximum supported speed, e.g. SFP+ cable
in 25G port, driver incorrectly saved a supported speed
as the user configured speed. This prevented interface
from using all supported speeds after switching cable to SFP28.
Link was established at 10G as supported by previously used
SFP+ cable. Don't set user requested speed unless actually
configured by an user, to allow automatic selection of highest
available speed. Only when user sets custom config
using advertise_speed sysctl save it and try
to apply after cable is changed.

Also don't save initial supported speeds if FW supports
reporting default PHY config.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Reviewed by:    kbowling, erj, mateusz.moga_intel.com
Sponsored by:   Intel Corporation
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D53611
310145642312e1c5fb3d8efa8321cf905d0354c4 Krzysztof Galazka 2026-06-12 11:56:15
linux_ntsync(9): check the file type before calling native ntsync(9)
Reported by:  Alex S <iwtcex@gmail.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
59b0df3441a9c71580445fed579d4432dce95115 Konstantin Belousov 2026-06-14 04:11:08
evdev: add devnum sysctl
Add a sysctl entry for the evdev device number (devnum) to allow
libudev-devd to populate the corresponding device information
fields (MAJOR and MINOR) when running in a jail with no input devices
exposed through devfs.

Signed-off-by: Quentin Thébault <quentin.thebault@defenso.fr>

Reviewed by:    wulf
Sponsored by:   Defenso
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56968
746c374aa94b46712e6defb3ab56dd2d6ad8db64 Quentin Thébault 2026-06-14 16:34:51
arm: allwinner: Fix A10 INTC MMIO resource cleanup
Do not jump to the resource release path when bus_alloc_resource_any()
fails, since no MMIO resource was allocated. If a10_intr_pic_attach()
fails after the MMIO resource has been allocated, release it before
returning.

Signed-off-by:  Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Reviewed-by:    vexeduxr
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2253
39217ebb8a4e0e89b823887759e80e63f723ca2d Haoxiang Li 2026-06-02 09:08:00
arm/bcm2835: Release mailbox resources on attach failure
Also remove the rid variable since it was unused.

Signed-off-by:  Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Reviewed-by:    vexeduxr
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2255
836d0d341aa84adb0d80c704203c30a0c488bc53 Haoxiang Li 2026-06-09 08:37:06
nvme: add Apple T2 ANS2 NVMe quirks
The Apple T2 (ANS2, PCI 106b:2005) requires several quirks:

- 128-byte submission queue entries (CC.IOSQES = 7)
- Single MSI vector, one IO queue
- Admin and IO queues share a CID table; IO CIDs offset by
  adminq.num_trackers to avoid overlap
- No async event support
- IDENTIFY CNS >= 2 rejected to avoid firmware confusion

Tested-on:
- MacBookPro16,2 (A2251)
- Mac mini 8,1 (A1993)
- Multiple Non-Apple computers

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D57087
5e0ba47aa00ed82a4a06cc45f0d1b34b6948e47f Abdelkader Boudih 2026-06-14 20:43:57
apple_bce: add Apple T2 Buffer Copy Engine driver
DMA ring transport between the host and the T2 coprocessor.
Provides mailbox handshake, queue setup, and firmware keepalive
for higher-level T2 services (VHCI, audio, etc.).

Tested-on: MacBookPro16,2 (A2251), Mac mini 8,1 (A1993)

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57088
6fd2ad9aa39db916bf2da9607653fb133f8fa078 Abdelkader Boudih 2026-06-14 20:54:03
apple_bce/vhci: add T2 virtual USB host controller
Implements a VHCI driver on top of the BCE transport:
- Virtual USB bus registration via usb_controller
- Port discovery and device enumeration
- Control, interrupt, and bulk endpoint support
- Firmware event handling with taskqueue
- Suspend/resume via BCE mailbox

Provides keyboard, trackpad, and Touch Bar access on T2 Macs.

Tested-on: MacBookPro16,2 (A2251), Mac mini 8,1 (A1993)

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57089
9f90536c74b8172fc67cd977e5451f37a12462d5 Abdelkader Boudih 2026-06-14 20:54:28
asmc: fix asmc_key_dump() page fault on T2 MMIO backend
asmc_key_dump() used I/O port macros (ASMC_DATAPORT_WRITE/READ,
asmc_command()) unconditionally. On T2 Macs, sc_ioport is NULL
(MMIO backend is used instead), causing a page fault when
ASMC_DEBUG triggers asmc_dumpall() during attach.

Add an MMIO guard at the top of asmc_key_dump(): delegate to
asmc_key_dump_by_index() + asmc_key_read() for MMIO devices,
consistent with the rest of the T2 code paths.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D56748
e37e49bfaa2763f0ce522a3e54de9b494e346465 Abdelkader Boudih 2026-06-14 20:55:12
bge: read MAC from loader hint for boards without NVRAM/EEPROM
BCM57766 on Apple T2 Macs (Macmini8,1) has no dedicated EEPROM and the
chip firmware handshake fails (the T2 intercepts PCI config space),
leaving the SRAM mailbox unpopulated.  All four existing MAC retrieval
paths (SRAM mailbox, NVRAM, EEPROM, firmware stub) fail, causing bge to
abort attach with "failed to read station address".

Work around this with two changes:

  1. Tolerate EEPROM read failure on BCM57766.  The chip is copper-only
     so hwcfg=0 is correct; skip the fatal error that aborts attach
     before bge_get_eaddr() is ever called.

  2. Implement bge_get_eaddr_fw() to read a "hint.bge.N.mac" string
     (e.g. "f0:18:98:f4:1e:2f") from loader(8) tunable / kenv.

This is a workaround until the T2 BCE API is understood well enough to
either poke the chip firmware into completing its handshake or read the
MAC from the T2 directly.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57090
142cba958b7a6dd11e4257740db03d335475ede8 Abdelkader Boudih 2026-06-14 20:55:33
mwl: return ENOMEM when rx buffer allocation fails
The malloc() failure path returned error, which is 0 at this point,
so callers would treat the allocation failure as success.
Return ENOMEM instead to correctly propagate the out-of-memory condition.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D42282
fa75c1cc242665d123ef5bf2f4ced2e076b35450 Kevin Lo 2026-06-15 01:43:57
Commit group #28: if_bnxt/bnxt_re: add support for driver snapdump
if_bnxt/bnxt_re: add support for driver snapdump

Add a logging module which helps to log and collect the driver`s
various events and state of device data structures.
APIs help modules like l2, RoCE etc. to register and
add logs into thg buffers. A segment header is added to the
data available in buffers.

The final log messages are arranged in following fashion

|SegHeader0|Data0|SegHeader1|Data1|
Logging module provides two different kinds of buffers:
a) A large contiguous memory chunk is used to form circular buffers.

Module need to provide a number of buffers while registering to
the logging module.Please note that, since memory for the
buffers remains with the module as long as it is registered, memory
footprints of the driver could be higher so the modules should
allocate an appropriate number of buffers. Also, due to limited
space, modules should only log important events/messages into
the buffer.
Modules  must use bnxt_log_add_mssg() to add the message into the
list.
b) Live buffer - They are allocated during coredump retrieval and

freed after the coredump data is returned to the user. This helps
to collect live data from the driver. Modules must use the
bnxt_log_live() function to add the log messages.
When coredump is retrieved all the messages available in above buffers are
copied into the coredump buffer.

Test Plan:
Generate the coredump using below niccli command
./niccli.freebsd -i 1 debug --coredump

and then verify the coredump contents using the Broadcom's Coredump decoder.

MFC after:      2 weeks
Reviewed by:    gallatin, ssaxena
Differential Revision: https://reviews.freebsd.org/D56682
f85e66e655c9293ea049814e21ed67ab246a7305 Sreekanth Reddy 2026-06-15 09:40:30

if_bnxt: Add Firmware crashdump collection support

This patch adds support for DDR-based firmware coredump memory handling.
It detects firmware coredump capability, allocates host DDR (DMA) memory
for crash dumps, and programs the firmware with the allocated memory during
attach. The allocated memory is released during driver detach.

Also, This patch adds functions to retrieve crash dump data from host DDR
memory. The implementation handles data copying from page tables and
checks dump availability. Main function bnxt_get_coredump() copies
stored crash dump data from DDR memory to the application buffer.

MFC after:      2 weeks
Reviewed by:    gallatin, ssaxena
Differential Revision: https://reviews.freebsd.org/D56684
03839879a2dd2505eab80b99211b0637ebdc9d32 Sreekanth Reddy 2026-06-15 09:46:51

if_bnxt: add bnxt logger module files to sys/conf/files for built-in kernel builds

The bnxt snapdump and coredump support patches added bnxt_log/{_data}.c. and listed it in
sys/modules/bnxt/bnxt_en/Makefile, but missed to add these files in sys/conf/files.

Fix up the issue by adding bnxt_log/{_data}.c in sys/conf/files.

Fixes: https://cgit.freebsd.org/src/commit/?id=f85e66e655c9 ("if_bnxt/bnxt_re: add support for driver snapdump")
03676cafa882c471a29436aae76c8751d451dd07 Sumit Saxena 2026-06-15 12:22:25

if_bnxt: add few source files to version control

Commits- f85e66e655c9 ("if_bnxt/bnxt_re: add support for driver snapdump")
and 03839879a2dd ("if_bnxt: Add Firmware crashdump collection support")
missed to add few files under version control, those files are
added now:

sys/dev/bnxt/bnxt_en/bnxt_log.c
sys/dev/bnxt/bnxt_en/bnxt_log.h
sys/dev/bnxt/bnxt_en/bnxt_log_data.c
sys/dev/bnxt/bnxt_en/bnxt_log_data.h
sys/dev/bnxt/bnxt_en/bnxt_coredump.c
sys/dev/bnxt/bnxt_en/bnxt_coredump.h

bnxt_coredump.c entry is added in sys/conf/files as well.

Fixes: https://cgit.freebsd.org/src/commit/?id=f85e66e655c9 ("if_bnxt/bnxt_re: add support for driver snapdump")
Fixes: https://cgit.freebsd.org/src/commit/?id=03839879a2dd ("if_bnxt: Add Firmware crashdump collection support")
9931dc5bf3831146c08a381c42ecbfcedb8ac7f1 Sumit Saxena 2026-06-15 14:30:26
if_bnxt/bnxt_re: Update hsi headers
Update hsi headers

MFC after:      2 weeks
Reviewed by:    gallatin, ssaxena
Differential Revision: https://reviews.freebsd.org/D56683
308784bebe796cbdaccf7ef259caf7d87f874d02 Sreekanth Reddy 2026-06-15 09:43:01
Commit group #29: if_bnxt
if_bnxt: Fix the Unknown command 0x80000000 ioctl command error

With the latest niccli version, user will observe below
Unknown command command error when try to list the devices.

if_bnxt: Unknown command 0x80000000

Here, niccli is issuing command opcode as 0x80000000 but
driver is expecting 0x20000000 command opcode.

So, replaced _IOW(0,0,0) with the _IOC(IOC_IN,0,0,0).

Fixes: https://cgit.freebsd.org/src/commit/?id=d53d7b4 ("bnxt: Fix up ioctl opcodes to support IOC_VOID along with IOC_IN")

MFC after:      2 weeks
Reviewed by:    gallatin, ssaxena
Differential Revision: https://reviews.freebsd.org/D56685
3987058a3a943c461c27dbebf10dad555b1bb2fa Sreekanth Reddy 2026-06-15 09:48:34

if_bnxt: Add support for HWRM passthrough with multiple DMA buffers

Added support for HWRM passthrough commands with multiple DMA buffers.

Also, changed the mgmt_lock to sleepable exclusive lock.

MFC after:      2 weeks
Reviewed by:    gallatin, ssaxena
Differential Revision: https://reviews.freebsd.org/D56686
9d87ca8b9f60bdec0bbc1733920df250a08beb0c Sreekanth Reddy 2026-06-15 09:49:40
Commit group #30: ntsync(9)
ntsync(9): properly handle timeouts

Reported by:    Alex S <iwtcex@gmail.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
96759ab67a42226679675e24e35549aea2aa49e0 Konstantin Belousov 2026-06-15 00:59:46

ntsync(9): free wait state on error from copyin of the object's array

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
281e350942b26b054ba5bc820c6aae4ae0e03a38 Konstantin Belousov 2026-06-15 04:31:03

ntsync(9): do not double-free obj when finstall() failed

Reported by:    Alex S <iwtcex@gmail.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
1491ab351b45b1c727eeed40027f7b5074b19ff5 Konstantin Belousov 2026-06-15 04:41:53
if_tsec: Free entire mbuf chain on failure
Reviewed by:  bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57478
39e2fe23238f4d49cd6f2c3ce9d0d9c1c3bcbedd Ed Maste 2026-06-05 21:05:34
sound: Create all device nodes with GID_AUDIO
Commit 6024e3f99a1e ("Add audio group") introduced GID_AUDIO, initially
for virtual_oss(8) loopback devices. Now make all of them with
GID_AUDIO.

Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Reviewed by:    emaste
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/35
a6aa95eba6ee2dd199d6cb8063dbaccd8a6f7512 Christos Margiolis 2026-05-21 18:03:31
Commit group #31: uvideo
uvideo: import uvideo(4) driver from OpenBSD

Port the uvideo(4) driver from OpenBSD. This provides
native USB Video Class (UVC) support for webcams and video capture
devices.

The main changes are adaptation for:
- USB transfer callback model
- isoc data extraction via usbd_copy_out(),
- V4L2 struct alignment for ABI compatibility with v4l_compat.

Note that this implementation can coexist with webcamd.

Reviewed by:    manu
Differential Revision:  https://reviews.freebsd.org/D56960
b711ef9c75ba71d6258d028aaf7b119ccfffaa0a Baptiste Daroussin 2026-05-05 20:29:47

uvideo: add kqueue support

Add EVFILT_READ kqueue filter so applications using kqueue/kevent
can efficiently wait for video frames instead of polling.

Reviewed by:    manu
Differential Revision:  https://reviews.freebsd.org/D56961
54df18cbb400e6394edad8abab0e5cb3a97e4df3 Baptiste Daroussin 2026-05-06 16:22:07

uvideo: add Camera Terminal controls

Implement UVC Camera Terminal (CT) controls per UVC 1.5 specification
Table A-12. This adds support for camera-specific controls that are
separate from the Processing Unit controls already supported.

Reviewed by:    manu
Differential Revision:  https://reviews.freebsd.org/D56962
d0450cbec7e66ee56fd48c6482fd3bd9fb6549dc Baptiste Daroussin 2026-05-06 16:28:27

uvideo: add missing formats to be in par with webcamd's uvcvideo
8bc06ffbbd80533eda0784d2a6f5a1476f9d550c Baptiste Daroussin 2026-05-18 20:17:34

uvideo: increase isochronous transfer depth for throughput

Increase NFRAMES_MAX from 40 to 128 and IXFERS from 3 to 5 to keep
more packets in flight on the USB bus.  This brings throughput from
~13.5 MB/s to ~21 MB/s (for comparison on the same camera webcamd
provided ~20MB/s.

The linux driver also uses 5 IXFERS (but only 32 NFRAMES_MAX)

Tested by:      manu
3b6f833c95eb65b29a9f506928467236a11d5169 Baptiste Daroussin 2026-05-18 21:44:27

uvideo.4: Initial manual page

Fixes:                  https://cgit.freebsd.org/src/commit/?id=b711ef9c75ba (import uvideo)
Reviewed by:            0mp, bapt, kevans
Differential Revision:  https://reviews.freebsd.org/D57622
fd1ee28bd01429aa8c38199d5fc069e8b0b75442 Alexander Ziaee 2026-06-18 13:48:09
rge: fix VLAN hardware tagging
Set the correct value in the TX descriptor for the vlan header.

PR: kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295175
76f9bb488e77ae4cc220b0bbbc53f1a7315ef977 John 2026-06-16 13:06:40
wtap: Remove bogus NULL check in wtap_transmit
The node pointer is guaranteed to be non-NULL by the net80211 stack.

The original check was also ineffective as it dereferenced ni->ni_vap before the NULL check.

Reviewed by:    bz
Differential Revision:  https://reviews.freebsd.org/D54547
9ef75e05ba91b72c10a411fdd21fa5ca98efa0c9 EN-WEU WU 2026-06-16 14:34:39
wtap(4): Implement STA/HostAP mode and support WPA/WPA2
Below is the commit message:
```
Wtap originally only supported mesh/ad-hoc mode, and cannot be combined
with wpa_supplicant(8) and hostapd(8) since it's unaware of encryption/decryption.
This commit adds support for hostap and sta mode with WPA/WPA2, thus wtap(4)
can now be used with hostapd(8) and wpa_supplicant(8).
```

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D36243
d4de0a69a92e560c77df83d7b342566ce353792c EN-WEU WU 2026-06-16 14:35:20
wtap(4): implement monitor mode and handle radiotap
Implement monitor mode by simply adding IEEE80211_C_MONITOR to ic->ic_cap.

To get additional informations when capturing 802.11 frames, radiotap is
 inserted by wtap_tx_tap() when TX and wtap_rx_tap() when RX.

There are some type faults in struct wtap_rx_radiotap_header which are
 mainly mistakenly store unsigned values into signed integers.
I have fixed them (wtap(4)) by complying with the types defined
 in https://www.radiotap.org/fields/defined.

Becuase the struct wtap_rx_radiotap_header comes from ath(4),
there may be another patch to fix the type faults in ath(4).

Differential Review: https://reviews.freebsd.org/D36469
93c6906e36a4e60e59279b6b6e18403ea23d56e1 EN-WEU WU 2026-06-16 14:54:05
GENERIC: enable extended error strings on all archs
This follows commit 3296fda0c309c873ae37a0a4e25ded3ae04b421c.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289236
Reviewed by:    kib
MFC after:      3 days
f38cbefef8090f3363e5685c5a3b30ffbf1d3ad0 Siva Mahadevan 2025-07-15 16:45:24
acpi: Fix panic when reading 'hw.acpi.suspend_state' knob on S1/S2
The 'hw.acpi.suspend_state' sysctl knob was re-introduced with a bug.
Its handler, acpi_suspend_state_sysctl(), expects the ACPI softc in
'arg1', but the knob was registered with NULL there.  This causes
a panic (NULL dereference) when reading the knob if the suspend state
has been set to S1 or S2 or equivalently the suspend sleep type to
STANDBY.

Fix it by passing the ACPI softc as 'arg1' when registering the knob.

Reviewed by:    obiwac
Fixes:          https://cgit.freebsd.org/src/commit/?id=9e1e29bd5ec6 ("acpi: Add back `hw.acpi.suspend_state` sysctl")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57412
6a2c4f0c0d9a9b93b26a1ad76f3a3fcbc590140c Olivier Certner 2026-06-03 08:43:27
acpi: Move supported states arrays into the softc
This is done in preparation of having some machine-dependent code access
these arrays through the softc.

Before this change, these arrays were static.  We chose to make them
part of the softc, instead of just exporting them ('acpi_quirks' remains
a known offender; some better way forward is to declare the whole ACPI
softc as static).

Some sysctl handlers now need to be passed the softc to access the
arrays, and some already needed to be passed a pointer to a field in the
softc.  As sysctl handlers are provided with a single pointer (arg1) and
a single integer (arg2), and now that the softc has to be passed into
the pointer argument (arg1), point indirectly to the wanted softc's
field by passing its offset in the integer argument (arg2).

To preserve the statically sized array in the signature of
power_pm_register(), and consequently avoid constructing such a dummy
array in early initialization (after this change, we can't pass
acpi_supported_stypes[] anymore as there is no existing ACPI softc at
this point), just remove the early ACPI registration via
power_pm_register().  This existed in the past as a hack to ensure ACPI
would be registered in priority, but for a long time now ACPI has been
the only subsystem that registers itself to the generic power
infrastructure, so this early registration has not been needed.

Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57413
ea44698a74ce0395231fe9e25e74e620d02b60f9 Olivier Certner 2026-06-02 19:51:54
mtw: Fix firmware loading and memory leaks
- Skip firmware reload if MCU already initialized
- Fix firmware_put() memory leaks on error paths
- Increase MCU init timeout to 15 seconds
- Use debug macros instead of device_printf for verbose output
- Remove unused 'ret' variable
- Fix space indentation to tabs per style(9)

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57597
f981fa12b760a5f0983eeec8065a4dec5295ab24 Abdelkader Boudih 2026-06-17 14:30:21
est: prevent divide-by-zero in est_msr_info
When hw.est.msr_info=1 is set, est_msr_info() extracts the bus clock
from MSR_PERF_STATUS upper bits. On secondary CPUs, the MSR may
contain zero in the frequency ratio field, causing a
divide-by-zero panic.

Observed in pre Skylake Intel cpu.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57614
021a190c88fc41f981a79fe6822bdafbcda14e99 Abdelkader Boudih 2026-06-17 14:49:52
est: gate "not recognized" message behind bootverbose
On modern Intel CPUs that use HWP (hwpstate_intel: /usr/src/sys/x86/cpufreq/hwpstate_intel.c) instead of EST,
this message prints unconditionally during probe even though it is
expected and harmless. Gated behind bootverbose to reduce console
noise on systems where EST is present but considered legacy.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57616
85814f5912618808ebe5b7065b70344675c98b5b Abdelkader Boudih 2026-06-17 14:50:48
Commit group #32: nvme: Use newbus to ask if a device is storage
nvme: Use newbus to ask if a device is storage

As NVMe is in more places, it has a variety of attachments. On non PCI
busses, we assume we're a storage device. For PCI, we look at the
interface ID. Add newbus glue to make this happen.

Sponsored by:           Netflix
Discussed with:         jhb
Reviewed by:            adrian
Differential Revision:  https://reviews.freebsd.org/D56994
949804c819096b40210e0b0729e54ba10b79c2e8 Warner Losh 2026-06-17 15:03:31

nvme: Move default is_storage method to nvme_private.h

Since CODE entries wind up in the nvme_if.c file, we got warnings when
it wasn't used (which is always). Move it into nvme_private and change
its name to nvme_is_storage_default to put it into the nvme_ namespace.

Fixes: https://cgit.freebsd.org/src/commit/?id=949804c81909
Sponsored by: Netflix
64b805d52eec795c6436def24cec508404b5bfdc Warner Losh 2026-06-20 17:44:27
mlx5: Add support for 800Gbit/s and 400Gbit/s with 2 lanes
Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
MFC after:      1 week
Sponsored by:   NVIDIA Networking
3e4cbdebfc9bcb2f2c64acc8ee8f67c3383cd676 Slava Shwartsman 2026-05-13 14:22:48
mlx5: Add PCI IDs for ConnectX-9.
- Add descriptions for ConnectX-9.
- Add ConnectX-9 for libmlx5

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 week
741f489ed09ab1d9172d1f61aa341004b5c3e968 Slava Shwartsman 2026-05-04 07:29:18
mlx5: Add missing speeds translation
Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 week
49b78368c5ed9cf41dedfc1c02a597fd49468537 Slava Shwartsman 2026-05-18 11:22:43
mlx5en: guard against empty eth_proto_oper mask
eth_proto_oper is used to derive the active media mode, but an empty
mask leaves no valid bit for ilog2() to consume. Treat this as an
invalid carrier update, reset the active media state, and report the
unexpected PTYS value.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
MFC after:      1 week
Sponsored by:   NVIDIA Networking
17cf7760a98a87c33d0415e2d2e1d4b24dd69e4d Slava Shwartsman 2026-06-10 16:43:08
virtio_net: Use bus_dma for rxq/txq buffers
While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.

The virtio buffers are marked as coherent; this should ensure that sync
calls are no-ops in the common cases.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55492
8193fa3b8e1a9425bd8ac8b707cab565816b8584 Sarah Walker 2026-02-16 14:19:13
virtio_net: Use bus_dma for command/ack buffers
While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.

The virtio buffers are marked as coherent; this should ensure that sync
calls are no-ops in the common cases.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55564
ea130fa32099ea7e0c03702efdec28e745ea6ef1 Sarah Walker 2026-02-27 14:17:15
thunderbolt: do not enable in GENERIC
The thunderbolt implementation is not 100% complete and causes some
suspend/resume issues. Comment out the device until it is better
fleshed out and some of the core issues with it are resolved.

MFC after:      1 week
Requested by:   obiwac
Differential Revision:  https://reviews.freebsd.org/D57650
92bdcb08113c05ec18ad420a4d84dd858e7f5e64 Enji Cooper 2026-06-18 20:02:01
uart: Add support for the Intel XScale controller
The ns8250 driver avoids clearing IER bit 0x10 to account for the
split "receiver time-out interrupt enable" bit, but it never sets
it in `ier_rxbits` even though a comment in `ns8250_init` implies so.

Fix this by setting `IER_RXTMOUT` if we've matched an XScale uart.

Differential Revision:  https://reviews.freebsd.org/D57629
Reviewed by:    imp
MFC after:      2 weeks
1665954e508f74588108e96c30b90d1a88807faa Bojan Novković 2026-06-18 02:03:55
firewire: extract shared helpers from fwe and fwip
Add fw_net.h with common inline helpers used by both if_fwe and
if_fwip: ISO chunk init, TX xfer allocation, xferlist free,
send queue drain, and DEVICE_POLLING ioctl handling.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D57615
9919c1a8ebd7da0aa86c6475446a7af255ecb17a Abdelkader Boudih 2026-06-19 19:01:12
powerpc64le: switch long double to IEEE binary128
Change powerpc64le's long double from 64-bit double to IEEE 754
binary128 (quad, 113-bit mantissa), matching aarch64 and riscv64.

Gated on FreeBSD 16 and powerpc64le only.

Differential Revision: https://reviews.freebsd.org/D57388
Reviewed by:    adrian
Relnotes:       yes
255538cd906045095d0c2113ae6c4731ce36c0cf Piotr Kubaj 2026-06-15 15:37:26
efirt(9): in verbose mode, announce the attachment and fw spec version
Reviewed by:  emaste, imp
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57710
43fb5b33b00f3b66ec03ab3e0ea002afd16cb7b3 Konstantin Belousov 2026-06-20 13:52:09
sound: Retire SD_F_VPC and related settings
VPC is enabled by default, and the only way to turn it off is through a
loader hint. That being said, there is no benefit to turning it off in
the first place, because VPC provides more fine-grained volume control,
as well as access to the SNDCTL_DSP_[SET|GET][REC|PLAY]VOL ioctls and
dsp_ioctl_channel().

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
f70a687bb071cdee60dc7420d75fa1dd122af51a Christos Margiolis 2026-06-20 17:32:21
efirt(9): carefully destroy efi_lock
efi_init() might return error after initializing the mutex, in which
case MOD_UNLOAD() is not processed, and the mutex is not destroyed.
Similarly, efi_uninit() skips any processing if efi_runtime was left as
NULL, leaving mutex not destroyed.

Initialize the mutex in MOD_LOAD case, and destroy in MOD_UNLOAD, also
handling errors.

Reviewed by:    imp
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57704
8edcb37dd0753dc7e50044d9ccf0e991392a3d84 Konstantin Belousov 2026-06-20 12:20:38
aq(4): Fix RSS indirection table OOB write and queue distribution
Two related fixes to `aq(4)`'s RSS indirection table handling:

1. Fix an out-of-bounds stack write in `aq_hw_rss_set()`.  RSS table entries are 3 bits (8 queues max), but with more than 8 RX rings `rss_table[]` holds larger values; the 32-bit write then spills one `uint16_t` past `bitary[]` and corrupts the stack, so the NIC never links or the kernel panics.  Mask each value to 3 bits and pack 16 bits at a time to keep the write in bounds.

2. Build the indirection table in `aq_if_attach_post()` with a modulo over `min(rx_rings_count, HW_ATL_RSS_INDIRECTION_QUEUES_MAX)` instead of `i & (rx_rings_count - 1)`, which assumed a power-of-two ring count.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57240
57f5252ff8a17aa837f677638cce5885b8a5fb3b Nick Price 2026-06-20 19:02:22
aq(4): interrupt model and queue-count correctness
Rework the MSI-X and queue-count handling to use the standard iflib
interrupt model and to keep every ring serviced.

- Cap isc_n{tx,rx}qsets_max at the RSS indirection-table size
  (HW_ATL_RSS_INDIRECTION_QUEUES_MAX, 8) instead of HW_ATL_B0_RINGS_MAX.
  RSS only steers RX traffic to eight rings, so on hosts with more CPUs
  the surplus TX rings never make progress: iflib flowid-steers TCP
  flows across every TX ring, and a flow landing on a surplus ring has
  its segments queued but never transmitted, hanging the connection.

- Add a TX-specific ifdi_tx_queue_intr_enable that reads
  tx_rings[txqid]->msix.  It was wired to the RX handler, which indexes
  rx_rings[] with the qid; safe only while tx_rings_count ==
  rx_rings_count, otherwise the lookup walks past rx_rings[] and feeds a
  garbage msix value into the IRQ mask register.

- Fix three MSI-X / admin-IRQ bugs: the TX softirq was attached to
  rx_rings[i]->irq (overwriting the RX handle and leaving the TX handle
  uninitialized); the admin-IRQ failure path dereferenced
  rx_rings[rx_rings_count], one past the end; and aq_linkstat_isr cleared
  the admin interrupt by writing the raw vector number instead of
  BIT(vector).

- Allocate one IFLIB_INTR_RXTX vector per RX/TX queue pair like every
  other in-tree iflib driver (em/ix/igc, vmxnet3) instead of an
  IFLIB_INTR_RX vector per RX ring plus a hand-wrapped IFLIB_INTR_TX
  softirq per TX ring.  iflib's iflib_fast_intr_rxtx() then services TX
  completions on the shared vector through isc_txd_credits_update().

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57434
b065af196fdcab18d36caae214c905467723b3f1 Nick Pricenull 2026-06-20 19:02:34
aq(4): adopt native FreeBSD errno convention
Convert the driver's internal error-handling chain from the Linux
negative-errno convention to FreeBSD positive errno everywhere.

- All `return (-EXXX)` become `return (EXXX)`, `int err = -EXXX` loses
  the sign, and `if (err < 0)` checks become `if (err != 0)` across
  aq_fw.c, aq_fw1x.c, aq_fw2x.c and aq_hw.c.
- mac_soft_reset_flb_ returns ETIMEDOUT/0 instead of a bool so it
  matches its RBL sibling.
- The ETIME and EOK aliases in aq_common.h are removed; all sites use
  ETIMEDOUT and 0 directly, and the `rc = -rc` sign flips in
  aq_if_attach_pre are dropped.

Turn AQ_HW_WAIT_FOR into a statement expression evaluating to 0 on
success or ETIMEDOUT on timeout, assigned explicitly at all seven call
sites, instead of silently assigning ETIMEDOUT to a variable named err
in the caller scope.  A statement expression rather than an inline
function because every call must re-evaluate its condition each
iteration -- one even assigns hw->mbox_addr as a side effect.

Fix two correctness bugs surfaced by the conversion:

- fw1x_get_stats gated its stats copy with `if (err >= 0)`, correct
  under negative errno but accepting every positive errno after the
  flip.  Change to `if (err == 0)`.
- fw2x_reset returned 0 regardless of capability-download failure,
  silently leaving fw_caps = 0.  Return the real err.

Harden aq_if_attach_pre: bit_alloc(4096, M_AQ, M_NOWAIT) was unchecked,
so under OOM a later `ifconfig vlanN create` would NULL-deref the
bitstring; check for NULL and fail with ENOMEM.  The fail label's
hardcoded `return (ENXIO)` becomes `return (rc)` so each error path
reports its real errno.

Remove the dead error checks in aq_hw_offload_set: the
`if (err != 0) goto err_exit` blocks after the void tpo_/rpo_/tdm_
register-write helpers were unreachable (err is never set), and the real
error capture is the aq_hw_err_from_flags call at the function tail.
Drop the now-orphaned err_exit label.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57435
40accc7235c2f0d2072f051099d183e7f21c2731 Nick Price 2026-06-20 19:02:42
aq(4): RX/TX and HW-path correctness and hardening
Independent correctness fixes, plus robustness against a non-responding
device, malformed descriptor writeback, and torn MMIO reads, and the move
to the FreeBSD bus_space(9) register abstraction.

Correctness:
- aq_hw_ver_match returned true if any of major/minor/build was >=
  expected; compare lexicographically so e.g. 2.0.1 is correctly seen as
  older than 2.1.0.
- The VLAN hardware-filter iteration used the vlan tag directly as the
  bitstring index; use vlan_tag + 1 so the active-VLAN bookkeeping lines
  up with the table.
- aq_initmedia only registered IFM_AUTO in full-duplex/pause variants, so
  a bare "ifconfig aq0 media autoselect" matched no entry and returned
  ENXIO.  Add the bare IFM_ETHER|IFM_AUTO entry, matching ix/em/igc/ixv.
- Convert the per-ring diagnostic counters to counter(9): per-CPU,
  tear-free, no atomics on the increment path, fixing a data race and a
  32-bit torn read against the locklessly-read sysctls.  Drop three
  counters that were never populated (jumbo_pkts, tx_drops, tx_queue_full).

Hardening and modernization:
- Implement aq_hw_err_from_flags (previously a stub returning 0 that left
  ~24 call sites as no-ops): detect a non-responding device in the
  register read path (all-ones, confirmed against reg 0x10) and latch a
  sticky AQ_HW_FLAG_ERR_UNPLUG -> ENXIO; aq_if_init clears it so a
  transient detection cannot permanently wedge the device.
- Bound the RX fragment loop in aq_isc_rxd_pkt_get (EBADMSG once i reaches
  isc_rx_nsegments) so a malformed never-EOP stream cannot write past the
  fragment array.
- Bound the TX completion count in aq_isc_txd_credits_update against the
  raw HW head pointer (reject head >= tx_size) so a glitched head cannot
  make iflib free still-in-flight TX mbufs.
- Remove the dead hardware-RSC branch in aq_isc_rxd_available; it followed
  wb.next_desp, a raw device value used as an index, but RSC is never
  enabled so rsc_cnt is always 0.  Advance sequentially like the other
  in-tree iflib drivers; this drops the last raw-hardware-pointer
  dereference in the RX path.
- Flush MMIO after interrupt-status acks (AQ_HW_FLUSH) so the write lands
  before the vector is re-armed under auto-mask-clear; retry the high word
  in read64_ against a torn lo/hi pair; document the non-atomic IMR
  read-modify-write in itr_irq_map_en_{rx,tx}_set.
- Replace the raw-pointer MMIO (the Linux readl/writel idiom) with
  bus_space(9): store the BAR tag and handle in struct aq_hw and route
  AQ_READ_REG/AQ_WRITE_REG through bus_space_read_4/write_4.  No functional
  change on amd64.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57436
619934a5c165869604810ece91c2f2cb734fc3eb Nick Pricenull 2026-06-20 19:02:52
Commit group #33: aq(4)
aq(4): enable jumbo frames, software LRO, and suspend/resume

- Configure the RX buffer size from the interface MTU and enable jumbo
  frames up to 9000 bytes, replacing the fixed standard-frame setup.

- Advertise IFCAP_LRO so iflib coalesces received TCP segments with its
  software tcp_lro(9), like every other in-tree iflib driver
  (ix/igc/em/vmxnet3); aq does no hardware LRO.  iflib builds the
  per-RX-queue LRO context unconditionally, so the capability bit is all
  that is required; enabled by default via isc_capenable, toggle at
  runtime with ifconfig.

- Add suspend/shutdown/resume handlers, replacing the unimplemented-
  function placeholders.  aq_if_shutdown/aq_if_suspend stop the interface
  and deinitialize the hardware; aq_if_resume re-resets the F/W, re-reads
  the mailbox address and re-selects fw_ops via aq_hw_mpi_create() before
  iflib re-inits, because the runtime init path (aq_hw_init) reuses the
  cached mailbox/fw_ops and a D3 power cycle can clear them.  iflib calls
  IFDI_RESUME unconditionally, so this also covers resuming while the
  interface was administratively down.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57437
b64408358d7f27a69b84d9fd1e23e239e8bd00fc Nick Price 2026-06-20 19:03:00

aq(4): modernize and de-Linuxify the vendor driver

Dead-code removal, device_printf(9) logging, style(9) de-Linuxification,
const F/W-ops tables, and readability cleanups.  No change for valid
traffic.

Dead code and logging:
- Remove the sub-gigabit TSO-masking block in the link-state ISR: it
  cleared IFCAP_TSO from the static isc_capabilities record (read only at
  attach / SIOCSIFCAP, never on the datapath), so it never gated TSO and
  only corrupted the validation mask.  The Atlantic has no sub-gigabit TSO
  erratum.
- Tidy the RX buffer-size handling: drop the dead switch(MCLBYTES) in
  aq_if_rx_queues_alloc, rename rx_max_frame_size -> rx_buf_size, and bound
  the per-fragment length from the wb.pkt_len writeback (EBADMSG on
  underflow or a final fragment longer than the RX buffer).
- Drop every __FreeBSD__/__FreeBSD_version branch (FreeBSD 14.0 baseline);
  the pre-13 arms used pre-opaque-if_t APIs since removed and one never
  built.
- Route all log messages through device_printf(9) (MAC via %6D), adding a
  device_t to struct aq_hw; drop the dead AQ_XXX_UNIMPLEMENTED_FUNCTION and
  aq_log_error macros and the per-ring init console spam.
- Minor: comma -> semicolon in aq_if_attach_pre; (uint64_t) -> (uint32_t)
  TX high-word cast; MODULE_VERSION(atlantic, 1); remove unused/duplicate
  #includes.

style(9) and types:
- Remove all typedef'd struct/enum/union types (aq_dev_t, the speed/fc/
  debug enums, the volatile RX/TX descriptor types, the firmware-file
  types) in favor of bare tags; for the DMA descriptors the volatile
  qualifier moves to the pointer/use sites.  Drop the _s/_e tag suffixes
  and the "#define aq_hw_s aq_hw" alias.  Rename the OOP-style *self
  parameter to hw.  Replace usec_delay/msec_delay/ARRAY_SIZE/LOWORD with
  FreeBSD equivalents (BIT kept).  __attribute__((__packed__)) -> __packed.

F/W-ops vtable:
- Rename the leftover hal parameter to hw; make aq_fw1x_ops/aq_fw2x_ops
  const (read-only data); drop the always-true "fw_ops &&" and
  always-present dispatch guards (only led_control, absent in F/W 1.x,
  keeps its NULL check).

Readability:
- aq_isc_rxd_pkt_get: fold the four identical RX-error blocks into one
  rx_err: label.  aq_isc_rxd_available: hoist the shared descriptor advance
  out of the EOP test and drop the redundant continue.  aq_hw_offload_set:
  drop the dead "int err = 0".  Fix a stale "10 ms" comment on a 50 ms
  DELAY and the redundant literal parentheses.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57438
5409e03a0ef1f2d71da94bedd433fbaa7b6b21f2 Nick Price 2026-06-20 19:03:09

aq(4): take F/W statistics off the iflib core lock (kick-and-read)

The once-per-second statistics refresh ran the whole F/W-mailbox
transaction under iflib's CTX (sx) lock: fw2x_get_stats toggled the MPI
STATISTICS control bit and busy-polled the state register for the
acknowledgement (up to ~25 ms) before downloading the counters, so a slow
F/W response blocked datapath reconfigure / ioctls for the duration.

The per-cast and error counters have no direct-register source -- the
reference Linux atlantic driver and our port both read them out of the
F/W mailbox, and the MSM registers the chip exposes are never used for the
periodic counters.  So rather than poll, adopt the kick-and-read shape the
iflib peer with the same constraint uses (vmxnet3): consume the snapshot
the F/W produced for the *previous* request, then toggle the bit to
request the next one -- no wait.  The F/W finished that previous refresh
~1 s ago, so the download needs no poll, and the toggle write stays
serialized against set_mode by the CTX lock exactly as before.  This
removes the 25 ms poll (and the toggle_mpi_ctrl_and_wait_ helper) from
under the lock; only the fast 16-dword download remains.

Cost: the counters lag one 1 s cycle, invisible for monitoring, and a torn
read is already rejected by aq_update_hw_stats' monotonic-delta check.

Validated on AQC107: a fixed 500 MiB RX transfer advances good_octets_rcvd
by 549.6 MB -- 500 MiB plus the ~4.8% Ethernet framing overhead -- with
rx_err=0 and traffic at line rate.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57439
a10151fa662c1d370861154e2f83e88a20be149c Nick Price 2026-06-20 19:03:18

aq(4): add a runtime dev.aq.N.debug trace control

The trace_* family (trace/trace_error/trace_warn/trace_detail, used in the
F/W and init/config paths) was gated behind the compile-time
AQ_CFG_DEBUG_LVL, which is 0, so the dbg_level_/dbg_categories_ runtime
variables were dead and tracing could only be enabled by recompiling.

Decouple trace_base_ from AQ_CFG_DEBUG_LVL so it is always compiled and
gated purely at runtime on dbg_level_/dbg_categories_, make those two
variables writable (no longer const, default level 0 = off), and expose
them as dev.aq.N.debug (verbosity) and dev.aq.N.debug_categories
(subsystem mask) sysctls.

The datapath-heavy AQ_DBG_ENTER/PRINT/DUMP macros and the trace_aq_*_descr
descriptor dumps stay behind AQ_CFG_DEBUG_LVL (still 0), so the per-packet
paths are untouched -- trace_* is only used off the datapath.  The two
variables are global (the trace macros reference them directly), so the
per-device sysctls share one backing store, which is fine for a debug
knob.

Validated on AQC107: dev.aq.0.debug defaults to 0 with no trace output;
setting it to 6 emits the F/W init/reset/capabilities traces on the next
F/W operation; setting it back to 0 silences them; traffic unaffected at
line rate, rx_err=0.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57440
76d0a25be3976634631bab975f4c2ddbc98f72a2 Nick Price 2026-06-20 19:03:28

aq(4): naming and exposure

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57656
e44579e23430ff2084b03c9b3d486f05e617e04f Nick Price 2026-06-20 19:03:37
ig4: unconditionally un-idle the controller core on resume
On controllers with the LPSS "additional registers" (Skylake and later,
IG4_HAS_ADDREGS), ig4iic_suspend() places the controller in the device
idle state (IG4_DEVICE_IDLE) and asserts core reset.  While idle the
DesignWare core is power-gated: its register bank reads back as zero and
writes are dropped until the core is taken out of the idle state again.

ig4iic_set_config(), called from ig4iic_resume(), only performs that
un-idle handshake when it observes IG4_RESTORE_REQUIRED set in
DEVIDLE_CTRL.  Some platforms (e.g. Intel Alder Lake-P) do not raise
that status across suspend-to-idle (S0ix).  The core is then left gated:
set_config()'s register writes have no effect, it nevertheless returns
success, and every subsequent transfer fails with IIC_ETIMEOUT, leaving
child I2C-HID devices (touchpad, touchscreen) dead after resume.

Give ig4iic_set_config() a force_restore argument and pass it from
ig4iic_resume() so the un-idle handshake runs unconditionally for
IG4_HAS_ADDREGS controllers, regardless of the RESTORE_REQUIRED status.
This keeps the handshake and its reset/restore sequence in one place
instead of duplicating it in the resume path.

The DesignWare core's register bank stays inaccessible (reads back as
zero) until it leaves reset, which happens when ig4iic_set_config()
deasserts the core reset.  Rather than waiting a fixed, guessed
interval, poll the fixed component-type signature (IG4_REG_COMP_TYPE ==
IG4_COMP_TYPE) immediately after that deassert and continue as soon as
the core is ready.  On Alder Lake-P the core is ready with no measurable
delay; the bounded poll keeps this correct on slower parts, and warns if
the core never leaves reset.

While integrating these I2C-HID touch devices, also raise hid(4)'s
MAXLOCCNT from 2048 to 4096: the report-descriptor parser truncates any
variable main item whose usage count exceeds MAXLOCCNT, silently
dropping the trailing report fields.  Some contemporary touch devices
declare variable items with more than 2048 entries, so part of their
input reports was being discarded.

Reviewed by:            adrian
MFC after:              2 weeks
Differential Revision:  https://reviews.freebsd.org/D57673
a4ed783cee2a10629db7a6c254712f96bd820288 Devin Teske 2026-06-19 17:24:58
amd64: do not restore fsbase/gsbase for 32bit processes
There is no WRFSBASE and WRGSBASE 32bit variants at all. As such, the
fsbase and gsbase must always be equal to the bases in the corresponding
segment descriptor, same as on real i386.

If a 32bit program reloads either %fs or %gs using setcontext(9) or
sigreturn(9), restoring bases from the syscall entry time is wrong.
In all other cases, hardware already does the right action when the
segment register is loaded, and the bases for the ufssel/ugssel in GDT
are updated on the context switch.

Reviewed by:    markj (previous version)
Tested by:      terehovv@mail.ru
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57611
c7e5802ab6e6230a5782a09c914585d055eb5223 Konstantin Belousov 2026-06-16 21:44:00
pmap: prefer memcpy over bcopy
Alter pmap_copy_page(s) to use memcpy rather than the deprecated bcopy.
We'll be adding non-provenance preserving versions for CHERI support and
would like to avoid introducing variants of deprecated APIs just to
maintain symmetry.

Reviewed by:    kib
Suggested by:   emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57687
2ee2ef607f6087757efd62b814cbf2400ef58ef2 Brooks Davis 2026-06-21 15:47:23
powerpc/booke: Extend TID register bits to the max
Some Book-E cores (at least e6500) can have much larger PID fields, up
to 14 bits.  Extend the PID mask space to the full space, and future
changes may take advantage of this extended space.
9006774e46dfe0859500ce18e1691c75846a884d Justin Hibbits 2026-06-21 20:28:55
powerpc/pmap: Use variable-sized TID
e6500 core supports 14-bit TIDs (16384), while all earlier cores support
only 8 bit TIDs.  Dynamically allocate the tidbusy array at bootstrap
time so that it stays in the TLB1, but is sized appropriately for the
core.  With MAXCPU of 32, a e6500 tidbusy would be (8 * 32 * 16384), or
4MB for this array, while e5500 would use (8 * 32 * 256), or 64kB.
9faeaac936aea78f9b5ce1a8ad3d27e2632d4e37 Justin Hibbits 2025-12-17 03:20:55
powerpc/booke: Save watchdog context to "critical" save area
Watchdog interrupt is a "critical" interrupt, so save the correct
registers (CSSRn, into critical save area).
b3249ed3a6edb993b9acea6358c103d591afb08b Justin Hibbits 2026-06-21 21:58:44
firewire: NULL check on malloc in fw_busreset()
fw_busreset() allocates newrom with M_NOWAIT from interrupt context.
If the allocation fails, crom_load() dereferences a NULL pointer.

Skip the config ROM comparison on allocation failure so the next bus
reset will retry.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57728
51f4e90ce7ef3b8d036a9d34ab464f4152ca4bab Abdelkader Boudih 2026-06-22 00:30:53
x86/ucode.c: supposedly fix i386 compilation
Fixes:      https://cgit.freebsd.org/src/commit/?id=16f21c5af350 ("amd64: there is no reason to copy ucode around in ucode_load_bsp()")
PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295926
Submitted by:   Martin Birgmeier <d8zNeCFG@aon.at>
MFC after:      3 days
f4cd99131c70e8be2a793d939b644e20bbbd3374 Konstantin Belousov 2026-06-22 00:48:11
acpi: Forbid requesting S4 when S4BIOS is not supported
Pending the OS-supported hibernate functionality, prevent requesting S4
when S4BIOS is not supported.

To this end, make sure that acpi_supported_stypes[] indicates that
POWER_STYPE_FW_HIBERNATE is not supported if 'acpi_s4bios_supported' is
false, even if S4 is supported by the platform (which is only
a power-down-like state, without any support to save the system image by
itself).  This will cause requests to enter S4, which are translated to
POWER_STYPE_FW_HIBERNATE before reaching
acpi_ReqSleepState()/acpi_EnterSleepState(), to fail in this case.

Retire the 'hw.acpi.s4bios' sysctl knob, as having it to 0 by default
(S4BIOS not supported) or setting it to 0 (default is 1 when S4BIOS is
supported) could only lead, on a S4 request, to a power down without any
possibility to restore the system (and, since a recent commit, it has
not been possible anymore to force it to 1 when S4BIOS is not announced
supported in the FACS table, which would cause a failure or a crash).

When OS-supported hibernate is introduced, it will become the default
hibernate method over S4BIOS, as we have not heard of any semi-recent
hardware platform implementing it (and when it is, it usually needs
a sufficiently large dedicated slice/partition, and does not use FreeBSD
swap slices/partitions).  Then, for people still wanting to use S4BIOS
on older platforms that support it, the tentative plans are to modify
acpiconf(8) to accept '4BIOS' as an argument to '-s', or modify zzz(8)
so that one can pass a specific suspension method.

Reviewed by:    obiwac
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57414
fc6d7a7520d00943ab167544b145f404c10b406a Olivier Certner 2026-06-02 16:04:55
acpi_ibm(4): Refer to "mic *mute* led" instead of "mic led"
Event:                Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
40ab0a05640051eed02ccbf1c5150e97e8cc27da Aymeric Wibo 2026-06-22 14:42:55
amdsmu(4), acpi_spmc(4): Fix ordering of calls
The AMD SMU is supposed to be notified of suspension the SPMC has been,
and conversely on resume, as expressed in comments.

Fix the EVENTHANDLER(9) priorities used so that they match the
comments. Lower values indeed indicate higher priority in this
subsystem.

Reviewed by:    obiwac
Fixes:          https://cgit.freebsd.org/src/commit/?id=2c60fce365f4 ("amdsmu: Sleep entry/exit hints for PMFW")
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
5bec087167e3934d7df06b4f98ed18c82349ddd2 Olivier Certner 2026-06-04 15:07:47
acpi: Constify thanks to AcpiGetHandle() taking a constant pathname
Make the ACPI interface's functions evaluate_object() and get_property()
take a constant pathname (by substituting ACPI_STRING with 'const char
*').

This allows to remove some __DECONST().

No functional change (intended).

Reviewed by:    obiwac
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://github.com/OlCe2/freebsd-src/pull/8
a12d069ef37fd60538b6f46372b194e6cf117250 Olivier Certner 2026-06-03 20:30:22
Commit group #34: acpi
acpi: Suffix acpi_sleep_enable() with '_locked'

For clarification.  This function assumes that the acpi mutex is held,
contrary to acpi_sleep_disable().

No functional change (intended).

Reviewed by:    obiwac
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://github.com/OlCe2/freebsd-src/pull/8
3b3911aaf834824f2de0db9fc7d0b9e2b3c089b4 Olivier Certner 2026-06-04 07:10:29

acpi: Button sleep/wake callbacks: Expose true argument types

This makes the interface composed of the
acpi_event_{power,sleep}_button_{sleep,wake}() functions more accurate
and clears the risk of calling them with a wrong object (such as a wrong
softc).

Reviewed by:    obiwac
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://github.com/OlCe2/freebsd-src/pull/8
660a491c41a2b90c35fe121c0b6a046b9af3cc00 Olivier Certner 2026-06-04 09:48:33

acpi: Sleep event handler: Remove a wrong comment

No functional change.

Reviewed by:    obiwac
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://github.com/OlCe2/freebsd-src/pull/8
c08c52e39e6e825000663ff602b219f03623d408 Olivier Certner 2026-06-04 10:05:40

acpi: Sleep/wake event handlers: Expose first argument's true type

This is for clarification and to slightly simplify code.

At present, the EVENTHANDLER(9) subsystem does not check that the first
argument to the event handler, registered via EVENTHANDLER_REGISTER(),
is of the right type with respect to the type declaration passed to
EVENTHANDLER_DECLARE(), so in that infrastructure no additional safety
is gained by this change.

No functional change (intended).

Reviewed by:    obiwac
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://github.com/OlCe2/freebsd-src/pull/8
6cce86c9bcd9656af6d3f5fddd600b40a3ab127c Olivier Certner 2026-06-04 10:15:37

acpi: Export handler invoke helpers, use them in acpi_lid

Removes duplicated code.

No functional change (intended).

Reviewed by:    obiwac
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://github.com/OlCe2/freebsd-src/pull/8
5ca875f3be030eb8ac80d8fb1b8f8018dc5eeb09 Olivier Certner 2026-06-04 10:55:45

acpi: Set 'acpi_sstate' closer to setting 'acpi_stype'

Makes on-going modifications for hibernate easier.

No functional change (intended).

Reviewed by:    obiwac
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://github.com/OlCe2/freebsd-src/pull/8
95ff2acb5555c6b165e7a32249c403cd339697d8 Olivier Certner 2026-06-04 07:37:57
x86: Harmonize GENERIC and MINIMAL
* Reorder MINIMAL so everything is in the same order as in GENERIC.

* Wherever comments diverged, except for the explanatory comment at
  the top, copy the GENERIC version to MINIMAL.

* Add KDTRACE_FRAME to i386 GENERIC; it was already in MINIMAL, and
  adding it to GENERIC seemed like the more correct move.

With these changes, MINIMAL is a strict subset of GENERIC, apart from
the identifier and the explanatory comment at the top.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D57729
01c8644093c28d09f0d41fb522dc53f1ab696a7e Dag-Erling Smørgrav 2026-06-23 07:51:01
hwpmc_amd: Avoid using PMCs if in use by firmware
Some firmwares use the PMCs to monitor OS performance.  We can't be
certain that the BIOS would detect any change to the counters if we
reprogram them.  In cases where the firmware is using the PMCs to
control power management this could have dangerous side effects or
unexpected performance effects.

During initialization, detect if any of the counters are enabled and
fail if so.

Reported by:    Sandipan Das
Reviewed by:    mhorne
MFC after:      1 week
Sponsored by:   Netflix
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2277
cf469ab83012ee47d06bc89874b6c109f49446e0 Ali Mashtizadeh 2026-06-10 23:20:16
hwpmc_ibs: Add more IBS register definitions
Small change to add additional IBS register definitions for the new pmc
tools.  Most of the definitions are for Zen 4 and above where we get
detailed information regarding the source of a completed memory
operation.

Reviewed by:    mhorne
Sponsored by:   Netflix
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2292
ed4f5e590ee643d784af12541df3f13768937485 Ali Mashtizadeh 2026-06-22 16:30:15
bnxt: Report actual link speed, rather than hard-coded 100Gbs
We need to report the actual link speed, rather than a hard-coded
100Gbs for a variety of reasons, but most importantly, as reporting
100Gbs on a 10g link breaks lacp when this NIC is in an LACP bundle
with other vendors' NICs after e98ed8d99fd4 (lacp:
Simplify lacp_compose_key()), as the fake 100g puts this nic
into a different aggregation group.

Sponsored by: Netflix
Reviewed by: glebius
Tested by: glebius
fdca6b70aa7ebbc95b544cec6e155ea5b1041899 Andrew Gallatin 2026-06-23 16:13:40
arm64: Fix build of gicv5 driver without SMP
Fixes:                https://cgit.freebsd.org/src/commit/?id=c84261da6f6c ("arm64: Add an initial GICv5 driver")
9522100a172466913cf6580b250101bfaa483460 John Baldwin 2026-06-24 00:56:41
riscv: Vector Extension (RVV) support.
RVV is a scalable SIMD (Single Instruction, Multiple Data) extension
designed to accelerate data-intensive workload such as AI, machine-learning
and DSP.

RVV exposes vector-length agnostic (VLA) execution and programming model,
with implementation defined vector register file size, dynamic vector
length selection, flexible register grouping, and rich instruction
semantics, serving as the foundation for portable, high-throughput
data-parallel acceleration.

Spec: https://github.com/riscvarchive/riscv-v-spec

RVV extends a base scalar RISC-V ISA with 32 vector registers and seven
unprivileged control-status registers (CSRs) to control the engine. Each
vector register could be up to 2^16 bits in length, depending on
implementation.

- Detect the extension during boot time ("v" letter in the ISA string)
- Implement RVV management code in the machine-dependent interfaces that
  handle CPU and thread state
- Add memory-management code for vector state save area. The allocation for
  save area in thread's PCBs has to be dynamic as the length of registers
  varies across implementations
- Save and restore RVV state on context-switch, fork(), scheduler entry
- Enable the extension usage on the first instruction trap from userspace
  ("lazy" enable)
- Implement ucontext.h POSIX API

Differential Revision:  https://reviews.freebsd.org/D56414
d7a393095cfd51d473a7c6b5e369e69a172f0c37 Ruslan Bukin 2026-06-24 07:48:58
riscv: Use namespace-safe type __uint64_t to not depend on sys/types.h
34397aec163cacf179991fc3606273093be6df2e Ruslan Bukin 2026-06-24 09:09:05
sound: Retire unused SD_F_EQ_PC
This flag is neither set anywhere, nor is there a way to set it from
userland, so it is effectively useless, and currently the effect is that
EQ can only be enabled for primary playback channels.

Retire the flag and keep this behavior, and think later whether we want
to allow virtual channels to get their own EQ feeder as well.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
ede0236d3b34a89bae7795f0f45696d4d94ce138 Christos Margiolis 2026-06-24 13:47:05
sound: Rename SD_F_EQ_ENABLED to SD_F_EQ
No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
a3d65cde7775818fb78afe935a4616a31f137c3d Christos Margiolis 2026-06-24 13:54:41
Commit group #35: acpi_ibm: Report mic mute key evdev events
acpi_ibm: Report mic mute key evdev events

While here, make the naming of micmute_led more consistent.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296140
Event:          Halifax Hackathon 202606
Reported by:    David Lundqvist
Reviewed by:    olce
Tested by:      David Lundqvist, Oleksandr Kryvulia
Co-authored-by: David Lundqvist
Sponsored by:   The FreeBSD Foundation
7e7f8b2c66410bcc6408482be73bd9c059e2bbe2 Aymeric Wibo 2026-06-20 21:29:49

acpi_support/acpi_ibm.c: move the 'key' definition to the block that uses it

This eliminates a warning from compilation of kernels without
EVDEV_SUPPORT.

Fixes:  https://cgit.freebsd.org/src/commit/?id=7e7f8b2c6641 ("acpi_ibm: Report mic mute key evdev events")
Sponsored by:   The FreeBSD Foundation
31b7d80016a37e4de10f166bc7ff353c7d1ef534 Konstantin Belousov 2026-06-24 15:23:12
Commit group #36: hwpstate_intel: Use ipi instead of thread_lock + sched_bind
hwpstate_intel: Use ipi instead of thread_lock + sched_bind

Reviewed by:    olce
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55628
29b8220b179bf0ce93c0034ec5d9f46db9092353 ShengYi Hung 2026-02-26 04:59:04

hwpstate_intel(4): Fix recent copyright formatting

Add an "empty" (comment) line between copyright and the Foundation text.

Fixes:          https://cgit.freebsd.org/src/commit/?id=29b8220b179b ("hwpstate_intel: Use ipi instead of thread_lock + sched_bind")
Event:          Halifax Hackathon 202606
Location:       jrm@'s living room
Sponsored by:   The FreeBSD Foundation
0143a40f5712de0938c34e88b352b85399f88b19 Olivier Certner 2026-06-24 20:20:47

hwpstate_intel(4): Fix error tests

How I failed to notice this during the review will remain a mistery.

Fixes:          https://cgit.freebsd.org/src/commit/?id=29b8220b179b ("hwpstate_intel: Use ipi instead of thread_lock + sched_bind")
Event:          Halifax Hackathon 202606
Location:       jrm@'s bathroom
Sponsored by:   The FreeBSD Foundation
f6cb220172b14b435364b3e2e61e9465ec11afcb Olivier Certner 2026-06-25 01:54:28

hwpstate_intel(4): Fix uninitialized variable in debug dump sysctl

It can cause a "cannot read MSR" error to be reported although reading
actually worked.

Fixes:          https://cgit.freebsd.org/src/commit/?id=29b8220b179b ("hwpstate_intel: Use ipi instead of thread_lock + sched_bind")
Event:          Halifax Hackathon 202606
Location:       jrm@'s living room
Sponsored by:   The FreeBSD Foundation
486ef221b9350644d6ad9a6ad93603d93cef6712 Olivier Certner 2026-06-25 14:13:56

hwpstate_intel(4): Fix two MSR errors being conflated

HWP_ERROR_CPPC_REQUEST_WRITE and HWP_ERROR_CPPC_REQUEST_PKG had been
assigned the same number.

Fixes:          https://cgit.freebsd.org/src/commit/?id=29b8220b179b ("hwpstate_intel: Use ipi instead of thread_lock + sched_bind")
Event:          Halifax Hackathon 202606
Location:       jrm@'s living room
Sponsored by:   The FreeBSD Foundation
c0acab934a174761b4f0e94c263bbe90c0529fab Olivier Certner 2026-06-25 14:35:32

hwpstate_intel(4): Debug sysctl: Fix retrieving the pkg-level MSR

IA32_HWP_REQUEST_PACKAGE_CONTROL is never set in 'sc->req'.  Just
discriminate on 'hwp_pkg_ctrl', which indicates the hardware capability
as indicated by CPUID.

Fixes:          https://cgit.freebsd.org/src/commit/?id=29b8220b179b ("hwpstate_intel: Use ipi instead of thread_lock + sched_bind")
MFC after:      2 weeks
Event:          Halifax Hackathon 202606
Location:       Dalhousie CS Faculty building
Sponsored by:   The FreeBSD Foundation
9320b99017d598cb7295a1bf21f227aaaefcf9df Olivier Certner 2026-06-26 13:57:38

hwpstate_intel(4): Debug sysctl: Style

Introduce 'error', set it to the result of rdmsr_safe() and use 'error'
as the test expression.

No functional change (intended).

Fixes:          https://cgit.freebsd.org/src/commit/?id=29b8220b179b ("hwpstate_intel: Use ipi instead of thread_lock + sched_bind")
MFC after:      2 weeks
Event:          Halifax Hackathon 202606
Location:       Dalhousie CS Faculty building
Sponsored by:   The FreeBSD Foundation
8ea6d9f33ee3bb37b381d547517ae612ba1640db Olivier Certner 2026-06-26 14:03:51
virtio/p9fs: Define the channel list mutex as static
No functional change intended.

MFC after:      1 week
2586f9f459adc6610957ba0d74a167b85fe24ac7 Mark Johnston 2026-06-24 16:54:10
Commit group #37: hwpstate_intel: Use 8bit scale instead of percentage scale
hwpstate_intel: Use 8bit scale instead of percentage scale

Reviewed by:    olce
Relnotes:       yes
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55629
8452afeb5682052b2533363ee3351d6d0e183e60 ShengYi Hung 2026-02-26 06:26:06

hwpstate_intel(4): sysctl_epp_select(): Cache again new EPP value

This caching was removed inadvertently in the commit mentioned below.

Fixes:          https://cgit.freebsd.org/src/commit/?id=8452afeb5682 ("hwpstate_intel: Use 8bit scale instead of percentage scale")
Event:          Halifax Hackathon 202606
Location:       jrm@'s living room
Sponsored by:   The FreeBSD Foundation
39975c7778fd6ac56571ec64a2003b06a1ca8a52 Olivier Certner 2026-06-25 00:17:58
Commit group #38: hwpstate_intel(4)
hwpstate_intel(4): Comment the EPB to EPP computation

Explain why the '* 17' instead of '* 16', as suggested in revision
D55629.

Event:          Halifax Hackathon 202606
Location:       jrm@'s living room
Sponsored by:   The FreeBSD Foundation
66d48f02de0fbf4d8efb3d4edc69f37c54f130fd Olivier Certner 2026-06-24 20:14:12
hwpstate_amd(4): Rename remaining 'struct set_autonomous_hwp_data'
For consistency.

No functional change (intended).

Fixes:          https://cgit.freebsd.org/src/commit/?id=c6a0eb7ada62 ("hwpstate_amd(4): Rename '*set_autonomous_hwp*()' => 'enable_cppc*()'")
Event:          Halifax Hackathon 202606
Location:       jrm@'s living room
Sponsored by:   The FreeBSD Foundation
7b107346448a7df2446bc67bf0bc2a6acaef5cbf Olivier Certner 2026-06-25 01:01:41
asmc: Refactor sensor detection and sysctl registration
Replace repeated per-sensor-type blocks for voltage, current, power,
and ambient light sensors with table-driven loops.

Reviewed by:    ngie, adrian
Differential Revision:  https://reviews.freebsd.org/D57595
104b311a03e45ebb8fd7a93e4ac26644bbae9bae Abdelkader Boudih 2026-06-25 02:06:34
firewire: add shared helpers for ISO receive drivers
Add fw_helpers.h with common static inline helpers for FireWire ISO
receive drivers: async xfer wait with timeout and tlabel cleanup,
quadlet read/write, and ISO mbuf management.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57684
af20f017ec0b75456d9031059bc79be01f141c3b Abdelkader Boudih 2026-06-25 02:18:52
fwcam: add IIDC 1394 FireWire camera driver
Add fwcam(4), a driver for IIDC v1.30 (TA Document 1999023) digital
cameras over IEEE 1394.

Supports Format_0 (VGA) video modes with isochronous receive DMA,
feature control (brightness, exposure, gain, shutter, white balance,
focus, etc.), poll/kqueue, and hot-plug via bus reset handling.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57685
40e05479718460820cd24c22e59519a4f13eba3d Abdelkader Boudih 2026-06-25 02:14:22
acpi_cpu(4): Remove unused 'acpi_cpu_disabled' boolean
It is not used anywhere.  Disabling acpi_cpu(4) can be done through the
regular ACPI disable mechanism (using the 'debug.acpi.disabled' tunable,
see acpi_disabled()).

Reviewed by:    emaste, obiwac
Fixes:          https://cgit.freebsd.org/src/commit/?id=ac3ede5371af ("x86/xen: remove PVHv1 code")
MFC after:      3 days
Event:          Halifax Hackathon 202606
Location:       Dalhousie CS Faculty building
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57888
98a77972381c6bb5ceda375fd1db7dccb3a1c89e Olivier Certner 2026-06-26 14:40:50
acpi_hpet(4): Remove unused 'acpi_hpet_disabled' boolean
Same reason as for the previous commit to acpi_cpu(4).  This boolean is
not used anywhere.  Disabling acpi_hpet(4) can be done through the
regular ACPI disable mechanism (using the 'debug.acpi.disabled' tunable,
see acpi_disabled()).

Reviewed by:    emaste (implicit)
Fixes:          https://cgit.freebsd.org/src/commit/?id=ac3ede5371af ("x86/xen: remove PVHv1 code")
MFC after:      3 days
Event:          Halifax Hackathon 202606
Location:       Dalhousie CS Faculty building
Sponsored by:   The FreeBSD Foundation
25df388574ac1d295f4014825de0df1d65cbdc53 Olivier Certner 2026-06-26 15:12:58
acpi_timer(4): Remove unused 'acpi_timer_disabled' boolean
Same reason as for the previous commit to acpi_cpu(4).  This boolean is
not used anywhere.  Disabling acpi_timer(4) can be done through the
regular ACPI disable mechanism (using the 'debug.acpi.disabled' tunable,
see acpi_disabled()).

Reviewed by:    emaste (implicit)
Fixes:          https://cgit.freebsd.org/src/commit/?id=ac3ede5371af ("x86/xen: remove PVHv1 code")
MFC after:      3 days
Event:          Halifax Hackathon 202606
Location:       Dalhousie CS Faculty building
Sponsored by:   The FreeBSD Foundation
ad26a56cf2f55967cc73d04a6ea17c27892d3141 Olivier Certner 2026-06-26 15:21:41
iichid(4): Always release interrupt resource
Reviewed by:  aokblast
Event:          Halifax Hackathon 202606
Location:       Chair
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57886
0cedb626959c0bbab6497d1f042beddab059bdaa Aymeric Wibo 2026-06-26 18:52:25
tpm_tis: release TPM resources after reading response
Per TIS 1.3 section 5.6.12, write commandReady to TPM_STS after reading the
response so the TPM can free its ReadFIFO and other internal resources.
The subsequent tpmtis_go_ready() provides the second write the spec describes
and waits for the state transition.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295103
Reported by:    Benoit Sansoni <benoit.sansoni@gmail.com>
Reviewed by:    kevans
Approved by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57841
e4c50d86796d07cf90e6a683234e1c0e9ca5e03c Olivier Cochard 2026-06-26 19:20:30
hwpstate_intel(4): Debug sysctl: Rename struct/field
New names are better descriptions and match what is done in
hwpstate_amd(4).

No functional change (intended).

MFC after:      2 weeks
Event:          Halifax Hackathon 202606
Location:       Dalhousie CS Faculty building
Sponsored by:   The FreeBSD Foundation
9209e04d76c577863210dbc9faa94d4dd7498af6 Olivier Certner 2026-06-26 13:51:10
snd_dummy: advance pointers for both channels
Previously only the play pointer advanced each tick; the record channel
refilled the whole buffer with silence and left the DMA pointer at 0.
Advance the record pointer by one block per tick and fill that block
with silence, so the DMA pointer changes and mmap kqueue consumers can
track progress.

MFC after:      1 week
Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D57834
968e748c439a50ad0a1a4463f4753f58a2bdaf9f Goran Mekić 2026-06-27 13:41:57
sound: Use sx_assert instead of KASSERT(sx_xlocked())
It's redundant.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
72acd1720af365e6fd186cc1706994d72c43650a Christos Margiolis 2026-06-27 14:25:27
virtio_pci_modern: Remove endianness conversion for config space
The bus_* functions already handle converting from PCI endianness
(i.e. little-endian) to native endianness when accessing the config
space (see ofw_pcib_bus_get_bus_tag), so converting again with
virtio_htogX/virtio_gtohX undoes any byte-swapping and breaks
big-endian systems. They should only be used for operating on shared
memory.
Note part of this reverts commit fb53b42e36a9 ("virtio-modern: fix PCI
common read/write functions on big endian targets").

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294706
Reviewed by:            adrian, tuexen
Fixes:                  https://cgit.freebsd.org/src/commit/?id=fb53b42e36a9 ("virtio-modern: fix PCI common read/write functions on big endian targets")
Fixes:                  https://cgit.freebsd.org/src/commit/?id=9da9560c4dd3 ("virtio: Add VirtIO PCI modern (V1) support")
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D57392
07b5d1ca52b113cecad3cda73ff5e782d8f4d07d Timo Völker 2026-06-28 10:39:10
generic_ehci_fdt: fix driver softc size
This subclass declares its own softc structure adding necessary members
after the embedded ehci_softc_t. The full size of the struct must be
included in the driver declaration, otherwise the allocation backing the
softc is not guaranteed to be large enough.

Reported by:    KASAN
Reviewed by:    jrtc27, manu
Fixes: https://cgit.freebsd.org/src/commit/?id=7a58744fd0f1 ("Split out the attachment from the generic-ehci driver")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57951
d5332d3a904242cb82e7dbf35e4aeec7c2df4402 Mitchell Horne 2026-06-30 14:58:11
evdev: use a prometheus-safe label for ev_sysctl_tree
Prometheus doesn't allow spaces, let's normalize this to what we use
elsewhere for consistency.  The sysctl exporter could probably do this
itself, but let's decouple that from the immediate problem: matching the
label between the exported data and in-tree is nice for greppability.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296179
Reviewed by:    asomers, wulf
Differential Revision:  https://reviews.freebsd.org/D57966
cb8bda40695f5d402f334f48795b1ab27b72dce5 Kyle Evans 2026-06-30 16:51:57

Networking

Network-related commands, library, and kernel.

Commit group #39: ip6_mroute: FIBify
ip6_mroute: Fix the type name in sysctl_mfctable()

No functional change since apparently it's fine to compute the size of
a pointer type when the base type is undefined.

Fixes:  https://cgit.freebsd.org/src/commit/?id=0bb9c2b665d9 ("ip6_mroute: FIBify")
0dbbed21a643f6c95bebe23008a332ff68adb203 Mark Johnston 2026-04-01 11:13:05
ipfw_nptv6: fix handling the ifaddr removal event
The result of IN6_ARE_MASKED_ADDR_EQUAL() macro is not an integer, so
threat it as a boolean value.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294114
Reported by:    Peter Much <pmc citylink dinoex sub org>
MFC after:      1 week
d9d7b59486499615a5fdce54443ce62aecf557e8 Andrey V. Elsukov 2026-04-02 10:14:29
nd6: Fix delayed NA for proxy addresses
Delayed proxy addresses need special handling, since
they can use link-local ifa as their source address and
have different link-layer data in their response.

Fixes:          https://cgit.freebsd.org/src/commit/?id=f37fbe30f559
Reviewed by:    glebius, markj
Differential Revision: https://reviews.freebsd.org/D55850
cf275806b6eddd66a3d82be56b3672dc5afab525 Pouria Mousavizadeh Tehrani 2026-03-13 14:25:01
tcp: retire TF_SENTSYN
This TF_-flag is only used in the RACK stack and not really needed.
So replace it, since glebius@ needs a TF_ flag and right now all
of them are taken.
No functional change intended.

Reviewed by:            rrs, glebius, rscheff, Nick Banks
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D56025
32cc4beb0a8c3cadc0de4c255ba512fd7b196607 Michael Tuexen 2026-04-03 19:22:11
Commit group #40: ip_mroute: FIBify
Fix nooptions VIMAGE build

The recent FIBify commits deref struct thread without including
sys/proc.h, which can result in a compiler error.  This becomes
apparent when building with LINT-NOVIMAGE, as net/vnet.h includes
sys/proc.h.  Fix this by directly including sys/proc.h

Fixes: https://cgit.freebsd.org/src/commit/?id=4c486fe40267 ("ip_mroute: FIBify"), https://cgit.freebsd.org/src/commit/?id=0bb9c2b665d9 ("ip6_mroute: FIBify")
3f79bc9ca336f634e1afa262ccf5155882550a8a Andrew Gallatin 2026-04-04 23:10:45
ifnet: Add some sanity checks
To be more robust since the checking is now performed where the
interface is referenced.

While here, remove a redundant check from if_vmove_loan().

Reviewed by:    kp, glebius, pouria
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55875
00d96da231d007673a1672452748d8ea4f6788ae Zhenlei Huang 2026-04-07 04:33:05
netstat(1): '-w': Banners to appear before a new statistics line, not after
Recurring banners except the first are printed just after the latest
interval's statistics line, giving the false impression that the latter
are omitted.  It is also better to print a new banner only if it is
going to be followed by a new line of statistics, in case netstat(1) is
interrupted or we have reached the number of iterations specified by
'-q'.

Fix this by pushing printing these banners inside the loop producing
statistics lines, after having waited for the next interval.

The first banner is printed before the loop, as we want it to be printed
immediately at launch, even if at this point we do not have statistics
to display (we have to wait for an interval to compute these, as they
are based on a difference).

While here, remove the 'goto' spaghetti by putting banner printing into
its own private function and using a proper infinite loop in
sidewaysintpr().

While here, document the why of the 21 statistics line span between two
banners.

While here, check for the number of output lines of statistics once such
a line has effectively been printed.  This allows to remove the internal
incrementation performed when reading '-w''s argument, which was a hack
to compensate the misplaced check.

While here, in the manual page, simplify the description of the '-w'
mode and mention that passing 0 to '-q' means "no count limit".

Reviewed by:    glebius
Fixes:          https://cgit.freebsd.org/src/commit/?id=84c1edcbad7d ("Rewrite netstat/if.c to use ...")
Fixes:          https://cgit.freebsd.org/src/commit/?id=bf10ffe1d3a9 ("Add a new option, -q howmany, ...")
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56227
31749859525b2b79634dc7c066c3563be5b1e3fd Olivier Certner 2026-04-02 19:13:02
netstat: Add -F support for -g
This change adds the ability to examine the contents of multicast
routing tables for other FIBs without the need for executing
`netstat` with `setfib(1)`.

MFC after:      3 days
Sponsored by:   Klara, Inc.
Sponsored by:   Stormshield
Differential Revision:  https://reviews.freebsd.org/D56205
Reviewed by:    glebius, markj, zlei
cff675e83cdb6c9027e94df9d010439e42e27dee Bojan Novković 2026-03-26 09:39:10
ip6_mroute: VNETify counters
Commit a223d6c489c7 made most of the ip6_mroute state per-VNET, but
failed to do this for a couple of counter structures.  Make them
per-VNET too.

Reported by:    zlei
Reviewed by:    pouria, zlei
Fixes:          https://cgit.freebsd.org/src/commit/?id=a223d6c489c7 ("ip6_mroute: Start putting global variables into a structure")
Differential Revision:  https://reviews.freebsd.org/D56253
77df0240307ebbc606e17c9b83c0d940d33c2649 Mark Johnston 2026-04-08 04:20:04
nd6: Remove DRAFT_IETF_6MAN_IPV6ONLY_FLAG and EXPERIMENTAL options
The draft-ietf-6man-ipv6only-flag has been obsoleted by RFC 8925.
Remove the EXPERIMENTAL compile option from the kernel and remove
DRAFT_IETF_6MAN_IPV6ONLY_FLAG from userland.
This compile option was not enabled by default.
Also regenerate src.conf.5.

Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D56228
87bea33a67cad31661a6fb9ea4c62a5fc266cd98 Pouria Mousavizadeh Tehrani 2026-04-02 20:01:55
inpcb: use hashalloc(9)
While here remove ipi_lbgrouphashmask, as it is always has the same value
as ipi_porthashmask.

Differential Revision:  https://reviews.freebsd.org/D56174
8e1513dc67388b8551f202d19440815b8c9120e3 Gleb Smirnoff 2026-04-12 17:25:57
netinet: use hashalloc(9) for IP address hash
While here, slightly restyle ip_vnet_init() and use sparse initializer for
pfil_head_args.  There is no functional change wrt to pfil(9) hook
registration.

Differential Revision:  https://reviews.freebsd.org/D56175
adba114dfbfb02c6f332237abf070cbcc480f914 Gleb Smirnoff 2026-04-12 17:26:03
gif: use hashalloc(9)
Functional change is that on destruction INVARIANTS checks will run.  Also
the mask is no longer hardcoded, so makes it easier to make hash size a
tunable.

Reviewed by:            ae
Differential Revision:  https://reviews.freebsd.org/D56176
9992eb435829a910a2a25c564bf8d2ad7c6557b0 Gleb Smirnoff 2026-04-12 17:26:08
tcp lro: use hashalloc(9)
Reviewed by:          tuexen, rrs
Differential Revision:  https://reviews.freebsd.org/D56177
87ef3067acbddbf85f0bdef6d53bdde2b51cbc50 Gleb Smirnoff 2026-04-12 17:26:12
pf: use hashalloc(9) for key, id, src-node and udp-endpoint hashes
Reviewed by:          kp
Differential Revision:  https://reviews.freebsd.org/D56113
cd5ff4e841fb4236fa07da61b7c94531148881b8 Gleb Smirnoff 2026-04-12 17:26:16
Commit group #41: inpcb
inpcb: apply smr_advance(9)/smr_wait(9) trick only to reusable sockets

The protocols marked with PR_CONNREQUIRED can never go through pr_connect
after being disconnected.  This is a tiny improvement of fdb987bebddf0.

While here push clearing of the addresses under the same condition.
Although this clearing originates from pre-FreeBSD times, it actually
makes sense only for protocols that can reconnect.

Reviewed by:            pouria, markj
Differential Revision:  https://reviews.freebsd.org/D55661
202370905f11be4e2c7afa18e73d374204fda08e Gleb Smirnoff 2026-04-12 18:30:44

inpcb: retire the inpcbinfo list lock

With the SMR locking of inpcbs the use of this lock reduced down to the
global list and generation number.  It was used only on an inpcb creation
and destruction.  Use the inpcbinfo hash lock for this purpose.

Reviewed by:            pouria, rrs, markj
Differential Revision:  https://reviews.freebsd.org/D55966
2cfe62664ab74756e40e17f7b8692d7a07531b83 Gleb Smirnoff 2026-04-12 18:30:59

inpcb: retire the inpcb global list

The iteration over all pcbs is possible without the global list. The
newborn inpcbs are put on a global list of unconnected inpcbs, then after
connect(2) or bind(2) they move to respective hash slot list.

This adds a bit of complexity to inp_next(), but the storage scheme is
actually simplified.

One potential problem before this change was that a couple of pcbs fall
into the same hash slot and are linked A->B there, but they also sit next
to each other in the global list, linked as B->A.  This can deadlock of
course.  The problem was never observed in the wild, but I was able to
instrument it with lots of effort: just few pcbs in the system, hash size
reduced down to 2 and a lot of repetitive calls into two kinds of
iterators.

However the main motivation is not the above problem, but make a step
towards splitting the big hash lock into per-slot locks.

Differential Revision:  https://reviews.freebsd.org/D55967
ac5b9628002c7c97929984eb578918077d564be4 Gleb Smirnoff 2026-04-12 18:31:09

inpcb: make in_pcbdisconnect() acquire the hash lock internally

Should be no functional change.

Reviewed by:            pouria, markj
Differential Revision:  https://reviews.freebsd.org/D55968
0ba87ded9d072b7b0605d2f4e8a7232b33b8787e Gleb Smirnoff 2026-04-12 18:32:06
netinet6: remove INP_DROPPED checks from setsockopt(2)
The INP_DROPPED is going to become an internal flag for inpcb.  As of now
it means a TCP pcb that is in TCPS_CLOSED.  There is nothing wrong with
calling setsockopt(2) on such socket, although has no practical use.

This deletes a piece of code from 56713d16a06c5 / D16201.  There is no
description of the panic fixed, but I will speculate that the panic was
about in6p->in6p_outputopts being NULL as the inpcb already went through
in_pcbfree_deferred().  This also can be related to compressed TIME-WAIT,
that is also gone now.

With current locking this shouldn't be possible.  An inpcb goes through
in_pcbfree() only with pr_detach method, which is called from sofree(),
and the latter is called on losing the very last socket reference.  So, at
the point when in_pcbfree() is called, the socket has lost its file
descriptor reference and there can not be any running setsockopt() on it.

Leave the call to ip6_pcbopt() still embraced with INP_WLOCK(), since we
are modifying inpcb contents.

NB: the IPv6 setsockopt(2) definitely has room for improvement.  Several
memory allocations should be moved out of lock and made M_WAITOK.
Covering large piece of setsockopt(2) code with epoch(9) just because
ip6_setpktopts() calls ifnet_byindex() isn't correct either.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D56169
ce283e115b023514a8886c1c1f1c68df7cd5e9a9 Gleb Smirnoff 2026-04-12 18:32:15
Commit group #42: inpcb
inpcb: make in_pcbbind() acquire the hash lock internally

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D55970
8b4d0bec43116f5d4d1fba89d1b81f1d05805147 Gleb Smirnoff 2026-04-12 18:33:20

inpcb: make in_pcbconnect() acquire the hash lock internally

Reviewed by:            pouria, rrs, markj
Differential Revision:  https://reviews.freebsd.org/D55971
2c48736c55c2154327f7e9219d4d69224181ab72 Gleb Smirnoff 2026-04-12 18:33:30

inpcb: make in6_pcbsetport() acquire the hash lock internally

Reviewed by:            pouria, rrs, markj
Differential Revision:  https://reviews.freebsd.org/D55972
d7c409174d25f925c1e93f54957cdadb4545da3a Gleb Smirnoff 2026-04-12 18:33:41
udp: make in_pcbbind_setup() acquire the hash lock internally
Reviewed by:          pouria, rrs, markj
Differential Revision:  https://reviews.freebsd.org/D55973
acb79b56b1eb9ccd3efb519b6527116714ebf876 Gleb Smirnoff 2026-04-12 18:33:51
raw ip: remove extra argument to rip_dodisconnect()
No functional change.
1d0ea3dfb9cbc26e77491bacef1cbc5d72e0375d Gleb Smirnoff 2026-04-12 18:34:05
raw ip: move hash table manipulation to inpcb layer
The SOCK_RAW socket is a multiple receiver socket by its definition.  An
incoming packet may be copied to multiple sockets.  Thus, incoming packet
handling is expensive.  Systems with many thousands of raw sockets usually
have them connect(2)-ed to different destinations.  This allows for some
improvement of the input handling, which was introduced by 9ed324c9a588
back in 2008.  This optimization was made specifically for L2TP/PPTP VPN
concentrators based on ports/net/mpd5.

This change generalizes the idea of 9ed324c9a588, so that it potentially
can be used with IPv6 raw sockets.  This also eliminates last use of the
pcbinfo hash lock outside of in_pcb.c.

While here make a speculative design decision: put into the hash table
sockets that did only connect(2).  Previously, we were indexing only
sockets that were protocol bound, did bind(2) and did connect(2).  My
speculation is that only the remote IP provides some real entropy into the
hash and local address and proto are expected to be the same for majority
of the sockets.  My other speculation is that VPN concentrators other than
mpd5 may not bind(2) their sockets, thus not getting any use of the hash.

Differential Revision:  https://reviews.freebsd.org/D56172
ece716c5d34728a170f1dfe1b3389c267d6ddd1e Gleb Smirnoff 2026-04-12 18:35:13
ifnet: vnet_if_return(): Avoid unnecessary recursive acquisition of ifnet_detach_sxlock
vnet_if_return() will be invocked by vnet_sysuninit() on vnet destructing,
while the lock ifnet_detach_sxlock has been acquired in vnet_destroy()
already.

With this change the order of locking is more clear. There should be no
functional change.

Reviewed by:    pouria
Fixes:          https://cgit.freebsd.org/src/commit/?id=868bf82153e8 if: avoid interface destroy race
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56288
f1fae67afbb13a41d488d0e0ec66b1805925019c Zhenlei Huang 2026-04-13 04:38:43
ifnet: Move SIOCSIFVNET from ifhwioctl() to ifioctl()
SIOCSIFVNET is not a hardware ioctl. Move it to where it belongs.

Where here, rewrite the logic of checking whether we are moving the
interface from and to the same vnet or not, since it is obviously not
stable to access the interface's vnet, given the current thread may
race with other threads those running if_vmove().

MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55880
38bd7ef62f318f791e232e217855307a9d75efa0 Zhenlei Huang 2026-04-13 04:38:44
if_clone: Make ifnet_detach_sxlock opaque to consumers
The change e133271fc1b5e introduced ifnet_detach_sxlock, and change
6d2a10d96fb5 widened its coverage, but there are still consumers,
net80211 and tuntap e.g., want it. Instead of sprinkling it everywhere,
make it opaque to consumers.

Out of tree drivers shall also benefit from this change.

Reviewed by:    kp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56298
e9fc0c538264355bd3fd9120c650078281c2a290 Zhenlei Huang 2026-04-13 04:38:44
Commit group #43: ifconfig: Add support for geneve (netlink)
ifconfig: Add support for geneve (netlink)

This implementation is netlink only

Differential Revision: https://reviews.freebsd.org/D55184
688e289ee904fe625d92f93680a71753d03ba2ee Pouria Mousavizadeh Tehrani 2026-04-11 18:38:41

ifconfig: Fix printf on geneve for 32-bit architectures

Replace uint64_t type with uintmax_t in printf to fix warnings
on 32-bit architectures.

Reported by:    Jenkins
Fixes:          https://cgit.freebsd.org/src/commit/?id=688e289ee904 ("ifconfig: Add support for geneve")
Differential Revision: https://reviews.freebsd.org/D55184
bc793ad78734acc4833f8f38bfb505e810c52963 Pouria Mousavizadeh Tehrani 2026-04-13 16:55:26

ifconfig: Do not build geneve with WITHOUT_NETLINK_SUPPORT

geneve(4) is netlink-only, therefore, don't build it with
WITHOUT_NETLINK_SUPPORT=1 set.

Reported by:    kp
Fixes:          https://cgit.freebsd.org/src/commit/?id=688e289ee904 ("ifconfig: Add support for geneve (netlink)")
Differential Revision: https://reviews.freebsd.org/D55184
19887b9c4cec9c6468481ef415bbf94f68592856 Pouria Mousavizadeh Tehrani 2026-04-16 22:40:02
iflib: Fix panic observed while doing sysctl -a with if_bnxt unload
Observed below kernel panic calltrace while performing sysctl -a
operation while unloading the if_bnxt driver,

Fatal trap 9: general protection fault while in kernel mode

KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe02a7569940
vpanic() at vpanic+0x136/frame 0xfffffe02a7569a70
panic() at panic+0x43/frame 0xfffffe02a7569ad0
trap_fatal() at trap_fatal+0x68/frame 0xfffffe02a7569af0
calltrap() at calltrap+0x8/frame 0xfffffe02a7569af0

trap 0x9, rip = 0xffffffff80c0b411, rsp = 0xfffffe02a7569bc0, rbp = 0xfffffe02a7569be0 ---
sysctl_handle_counter_u64() at sysctl_handle_counter_u64+0x61/frame 0xfffffe02a7569be0
sysctl_root_handler_locked() at sysctl_root_handler_locked+0x9c/frame 0xfffffe02a7569c30
sysctl_root() at sysctl_root+0x22f/frame 0xfffffe02a7569cb0
userland_sysctl() at userland_sysctl+0x196/frame 0xfffffe02a7569d50
sys___sysctl() at sys___sysctl+0x65/frame 0xfffffe02a7569e00
amd64_syscall() at amd64_syscall+0x169/frame 0xfffffe02a7569f30
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe02a7569f30

Root Cause:
iflib adds per-device sysctl nodes under the device tree using the device
sysctl context. Some of those nodes are counter sysctl that point at fields
inside txq→ift_br. When the if_bnxt driver is unloaded, iflib_device_deregister
runs and calls iflib_tx_structures_free, which frees the txqs ift_br. The device
sysctl tree is only freed when the device is destroyed. If sysctl -a runs during
unload, it can still traverse the device tree and call sysctl_handle_counter_u64
for those nodes. The handler does counter_u64_fetch(*(counter_u64_t *)arg1).
By then arg1 can point into freed memory and leads to use after free type kernel panic.

Fix:
flib now uses its own sysctl context for all iflib-related nodes
instead of using device’s context. And iflib sysctl context is now
removed before any queue/ring memory is freed.

MFC after:      2 weeks
Reviewed by:    gallatin, ssaxena, #iflib
Differential Revision: https://reviews.freebsd.org/D55981
d2b96f654a672f6059c5c623c276dcd76841ed12 Sreekanth Reddy 2026-04-13 06:28:08
iflib: drain admin task and fix teardown order on register failure
When IFDI_ATTACH_POST() fails (or netmap attach fails), iflib tears down with
ether_ifdetach(), taskqueue_free(ifc_tq), and IFDI_DETACH(). CTX_LOCK is still
held after ether_ifattach. ether_ifdetach() and taskqueue_drain(admin) must not
run under CTX_LOCK.

Teardown ordering (match iflib_device_deregister):

- Free the per-interface admin taskqueue after IFDI_DETACH / IFDI_QUEUES_FREE, not before.
- Drop IFNET_WLOCK() across IFDI_DETACH / IFDI_QUEUES_FREE so driver detach can sleep in
LinuxKPI workqueue drain, then retake IFNET_WLOCK() before iflib_free_intr_mem and fail_unlock.

MFC after:      2 weeks
Reviewed by:    gallatin, kgalazka, #iflib
Differential Revision: https://reviews.freebsd.org/D56316
439132310ae1f623f6c0a3dc241d0a34e98e040b Sumit Saxena 2026-04-13 06:33:46
routing: Fix use-after-free in finalize_nhop
FIB_NH_LOG calls the `nhop_get_upper_family(nh)` to read
`nh->nh_priv->nh_upper_family` for failure logging.
Call FIB_NH_LOG before freeing nh so failures are logged
without causing a panic.

MFC after: 3 days
7d38eb720a8d8345949986d779e785984ae19ae0 Pouria Mousavizadeh Tehrani 2026-04-14 09:36:53
inpcb: remove last use of relic u_quad_t
76b90c1d31b9bbe803f1d521398e0c1a10553a3b Gleb Smirnoff 2026-04-14 16:02:00
Commit group #44: tcp_close: Use in6_pcbdisconnect for INET6 sockets
tcp_close: Use in6_pcbdisconnect for INET6 sockets

This also fixes the LINT-NOINET builds.

Fixes:          https://cgit.freebsd.org/src/commit/?id=40dbb06fa73c ("inpcb: retire INP_DROPPED and in_pcbdrop()")
4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 John Baldwin 2026-04-14 18:07:51

inpcb: make in6_pcbdisconnect() just like in_pcbdisconnect()

Allow to be passed with already unconnected inpcb.

Fixes:  https://cgit.freebsd.org/src/commit/?id=4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4
6b00c652db7f43c698e8e3a902f266025c3126ac Gleb Smirnoff 2026-04-14 23:23:26
in_pcb: Fix RIPCB_HASH in kernels without INET or INET6
Only use hashes for protocols that are enabled in the kernel
configuration.

Fixes:          https://cgit.freebsd.org/src/commit/?id=ece716c5d347 ("raw ip: move hash table manipulation to inpcb layer")
0b77f92575cdfecb9920041c7c1d4cc26245e2ec John Baldwin 2026-04-14 18:25:19
if_geneve: Fix build without INET or without INET6
f4e5b45b11628416f596b3aec2ccd3056800a171 John Baldwin 2026-04-14 18:28:31
ifconfig: add CMIS support for 400GbE optics
Add support for CMIS based optics, typically used by 400GbE
and faster ethernet optics.   The CMIS standard requires paged
support for i2c ioctls.

This has been tested on an Nvidia ConnectX-7 and Broadcom
Thor2 400GbE NIC, and I have verified that optics vendor information,
light levels, and temperatures match the information provided by
various vendor tools.

Differential Revision: https://reviews.freebsd.org/D56265
Reviewed by: kbowling, sumit.saxena_broadcom.com
Sponsored by: Netflix
963f1a5455c9f94457c1fa122d18ab9c059db834 Andrew Gallatin 2026-04-05 21:43:48
Commit group #45: lro: move pkt rejection checks to leafs to avoid queueing non-LRO'able pkts
lro: move pkt rejection checks to leafs to avoid queueing non-LRO'able pkts

When lro mbuf queuing is enabled, we should not queue easily
reject-able packets. Queuing them does a bit of extra work (sorting,
timestamps) and can potentially delay urgent packets such as LACP
PDUs. This change moves simple rejection tests from lro_rx_common()
into lro_rx and (more importantly) into tcp_lro_queue_mbuf().

Note this change only moves the easy checks on forwarding and packet
metadata, where the rejection criteria is already hot in cache. It
does not move parsing and looking inside the packet to verify the
ether protocol, ip protocol, etc. This could be done, but we risk
essentially doubling the cache misses per-packet by doing so.

Differential Revision: https://reviews.freebsd.org/D56337
Reviewed by: rrs, tuexen
Sponsored by: Netflix
f707cc00ed124828e367b020d6b417842321f641 Andrew Gallatin 2026-04-13 21:33:17

tcp lro: fix vnet handling

Reported by:            Shawn Webb
Reviewed by:            glebius, rrs
Fixes:                  https://cgit.freebsd.org/src/commit/?id=f707cc00ed12 ("lro: move pkt rejection checks to leafs to avoid queueing")
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D56420
2d13620c6e1be7f8136095f648a6b824158d0941 Michael Tuexen 2026-04-15 20:31:48
loopback: Account for packet drops
Make loopback packet drops more obvious by reporting them
in interface stats visable via netstat -ni
Since loopback uses netisr, packets can be dropped if the
netisr queue overflows.  These drops are visible via
netisr -Q, but its not an obvious place to look.

Differential Revision: https://reviews.freebsd.org/D56356
Reviewed by: glebius, tuexen
Sponsored by: Netflix
956acdce0505ca8028d287d3b44789c623c8f37e Andrew Gallatin 2026-04-14 19:43:28
routing: Make ip[6]_tryforward() FIB-aware for local traffic
`ip_tryforward()` and `ip6_tryforward()` checks whether the destination
address is local or not without considering if it belongs to the current FIB.
If the destination is local but not in our FIB, forward it instead
of returning it to ip_input().

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292319
Reviewed by:    zlei
MFC after:      1 week
MFC to:         stable/15
Differential Revision: https://reviews.freebsd.org/D56353
bf41d86df0d9dc4a1342c579f4e72db3c66b3443 Pouria Mousavizadeh Tehrani 2026-04-11 12:58:28
ip_mroute: Fix a lock leak in X_ip_mforward()
If a FIB does not have a router configured, X_ip_mforward() would leak a
lock.  Plug the leak.

The IPv6 counterpart did not have such a check.  It wouldn't send an
upcall to a non-existent router anyway due to the router_ver check, but
we should verify that a router is present anyway.

Add regression test cases to exercise these code paths.

Reported by:    Claude Opus 4.6
Fixes:          https://cgit.freebsd.org/src/commit/?id=0bb9c2b665d9 ("ip6_mroute: FIBify")
Sponsored by:   Klara, Inc.
Sponsored by:   Stormshield
18b7115cba2f698909a4801dc2cc1b04b1f4f210 Mark Johnston 2026-04-15 15:01:58
bpf: fix handling the read timeout on ppc64
On platforms other than amd64, BIOCSRTIMEOUT is equal to
BIOCSRTIMEOUT32. Therefore, running the COMPAT_FREEBSD32 code
basically clears tv_usec on big endian platforms. When tcpdump is
used, the timeout requested is 100ms, which gets cleared to 0 on
ppc64 platforms. This results in tcpdump showing the packets only
when the read buffer is full.
Thanks to kib for guiding me to the correct fix.

Reported by:            ivy
Reviewed by:            adrian, kib
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D56399
04b994d19eec68a6b5d27ff4b0fa223a05f00e1f Michael Tuexen 2026-04-15 19:24:05
nd6: Add support for route information (RFC 4191)
Implement RFC 4191 by handling received Router Adverisement (RA)
packets with route information option.
For default routes, use the route information's lifetime and
preference to overwrite the RA's lifetime/preference.
Also install and update more-specific route prefixes with the
option's lifetime and expire them when their lifetime elapses.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263982
Reviewed by:    markj
Tested by:      Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Relnotes:       yes
Differential Revision: https://reviews.freebsd.org/D55449
c8d25804f56ae7c35eaa492b6110807a2675d41a Pouria Mousavizadeh Tehrani 2026-04-16 14:23:49
in_mcast: Fix a lock leak in inp_set_source_filters()
MFC after:    3 days
Reported by:    Claude Opus 4.6
bebc1a5b09e358b420077a1b5c0f85f8e7f0812f Mark Johnston 2026-04-16 19:57:57
tcp: use RFC 6191 for connection recycling in TIME-WAIT
Implement the criteria specified in RFC 6191 for recycling TCP
connections in TIME-WAIT.

Reviewed by:            rscheff, Marius Halden
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D56321
3a54aa3b0911bef15e014b8a8185e116efb0a918 Michael Tuexen 2026-04-17 07:11:41
Commit group #46: pf
pf: fix error handling in pf_sourcelim_add()

There are two issues in pf_sourcelim_add() error path:
  - stale pointers are left in pf_sourcelim_id_tree_inactive when
    duplicate source limiter instance is found in pf_sourcelim_nm_tree

  - overload table may leak when insertion of new source limiter instance
    fails.

Both issues reported and patch submitted by:
    Renaud Allard <renaud () allard ! it>

OK sashan@

Obtained from:  OpenBSD, sashan <sashan@openbsd.org>, 32063577ec
Sponsored by:   Rubicon Communications, LLC ("Netgate")
05ac1013984ced5b8b57430fe92a7074e34054ce Kristof Provost 2026-04-16 13:49:26

pf: pf_frag_compare() should not be using subtraction to compare fragment IDs

Issues reported and patch submitted by:
    Renaud Allard <renaud () allard ! it>

OK sashan@

Obtained from:  OpenBSD, sashan <sashan@openbsd.org>, 747740863c
Sponsored by:   Rubicon Communications, LLC ("Netgate")
5b7192230a15bbf2378b8f74278d21d4766c5110 Kristof Provost 2026-04-16 13:51:54

pf: use correct address family in pfr_pool_get()

pfr_pool_get() in call to pfr_prepare_network()must use af
instead of hardcoded AF_INET

Issues reported and patch submitted by:
    Renaud Allard <renaud () allard ! it>

OK sashan@

Obtained from:  OpenBSD, sashan <sashan@openbsd.org>, 8e156a5ebe
Sponsored by:   Rubicon Communications, LLC ("Netgate")
3c9cd6e4dc59202f2b150a5456541629b633af3b Kristof Provost 2026-04-16 13:53:15
in_mcast: Avoid calling sysctl_wire_old_buffer() in an epoch section
Wiring a virtual address range may require the thread to sleep, and this
is not permitted in an epoch section.

MFC after:      1 week
c1b514c88c76a4de906775d47b06388e62ab6845 Mark Johnston 2026-04-17 12:42:54
iflib: ignore reclaim coalescing when low on tx descriptors
If we are low on TX descriptors, bypass iflib_txq_can_reclaim()
and force a reclaim. This is intended to reduce the number of
output drops under heavy load when using simple transmit.

Differential Revision: https://reviews.freebsd.org/D56339
Sponsored by: Netflix
52e7958702be469a61a5e3173c20a08fc0721b4d Andrew Gallatin 2026-04-17 15:52:36
Commit group #47: iflib: accurately count bytes/segments for TSO
iflib: accurately count bytes/segments for TSO

When using software based ifnet counters, iflib has not factored
TSO into account when reporting the segments and bytes sent.
So it will underreport NIC bandwidth by a small percent,
and will undercount sent segments by a large factor.
Fix this by calculating the number of added segments the NIC
will send, and add header size multiplied by that number
to arrive at a correct accounting of segments and bytes sent.
This makes these software counters directly comparable to
hardware counters.

Doing this requires moving the calculation into iflib_encap() where
we have already parsed the packet and know the header size, MSS, etc.

Differential Revision: https://reviews.freebsd.org/D56338
Sponsored by: Netflix
3fade68cfdf95ee0b517b5d69b270bd8da633404 Andrew Gallatin 2026-04-17 15:45:22

iflib: fix book keeping

iflib_txq_drain() returns the number of consumed entries. In the case
of TSO, a single entry can contain multiple TCP packets.

Reported by:            Ricardo Branco, David Wolfskill
Reviewed by:            gallatin
Fixes:                  https://cgit.freebsd.org/src/commit/?id=3fade68cfdf9 ("iflib: accurately count bytes/segments for TSO")
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D56509
cca22c36c306dfabe13b1d1de10e8d27ef3c3bce Michael Tuexen 2026-04-18 19:57:40
carp: define CARP_AUTHLEN for carp_authlen field
Replace the bare 7 with a named constant.
d9e7dd4a19b81a78a801973f8f5231f46a6d20b8 Christos Longros 2026-04-17 18:32:01
Commit group #48: nd6
nd6: Break nd6_prefix_update out of prelist_update

if PI exists, call prefix_update, instead of doing it inside
the prelist_update.
no functional change intended.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56130
d96e8cb4e72847ac545423460af122fa14b2b1f1 Pouria Mousavizadeh Tehrani 2026-04-16 22:18:02

nd6: Break pfxrtr_add out of nd6_prelist_add

Updating defrouter only required by `prelist_update()`.
since `nd6_prelist_add()` is a public function, exclude unsed
dr logic from it.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56131
ced1de238fbe620e2b110c34561d63656bd2043c Pouria Mousavizadeh Tehrani 2026-04-16 22:19:18

nd6: Change prelist_update return type to void

The return value of `prelist_update()` is unused.

Reviewed by: markj, zlei
Differential Revision: https://reviews.freebsd.org/D56132
d022dd82059b6173505377d47e3d0048906f8311 Pouria Mousavizadeh Tehrani 2026-04-16 22:20:47

nd6: Ignore entire PI if violates RFC 4862 section 5.5.3

Ignore prefix information update earlier in `prelist_update()`.
If PI is invalid or autonomous bit is unset, we better to let our
SLAAC address expire and if we don't have any previous matching
prefix, better not to create new one.
Because either our router don't want us to have one anymore, or
the very RA is malicious.

Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D56133
05f2acd34483e9a2aa3d3b3d53e398cadab199ad Pouria Mousavizadeh Tehrani 2026-04-16 22:27:33

nd6: Remove anycast check in prelist_update

RFC 2462 is obsoleted by RFC 4862 and it made statements more
clear than before.
Considering SLAAC can't create anycast addresses by itself, remove
its check.
While here, update comments based on RFC 4862.

Reviewed by: markj, zlei
Differential Revision: https://reviews.freebsd.org/D56134
e8081190617741e348fc85f17ff90b066407fc0f Pouria Mousavizadeh Tehrani 2026-04-16 22:31:52

nd6: Break nd6_prefix_lifetime_update out of prelist_update

Logic of updating prefix lifetime is big enough that deserves
its own function.
While here, fix style.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56135
5f27592e149fbbb6318ef6c4b72482e1a7a41ef4 Pouria Mousavizadeh Tehrani 2026-04-17 14:16:51

nd6: Remove goto and unused condition in prelist_update

While here, style it.

Reviewed by: markj, zlei
Differential Revision: https://reviews.freebsd.org/D56136
72043945c3c6e924ac57ace76ec0a4447d05d905 Pouria Mousavizadeh Tehrani 2026-04-17 16:57:47
net80211: radiotap: add more VHT flags, and struct
Add the struct for VHT information and flags for the known and flag
field as documented on radiotap.org.  iwlwifi has started filling in
these details.

While here, add Copyright information for all the additions in the
last years.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
125b09de09ec5ca1939de0207090513453b5908e Bjoern A. Zeeb 2026-04-14 15:21:27
routing: Initialize V_rt_numfibs earlier during boot
V_rt_numfibs can be set at compile time (with the ROUTETABLES kernel
config option) or boot time (with the net.fibs tunable).
vnet_rtables_init(), running during SI_PROTO_DOMAIN, was checking the
tunable and updating V_rt_numfibs accordingly, but that means that
earlier SYSINITs, such as vnet_mroute_init(), see the compile-time value
for V_rt_numfibs before it gets corrected in vnet_rtables_init().

Fix this by initializing V_rt_numfibs earlier, so that SYSINITs are less
likely to use the wrong value.

Add a comment describing the weird, preexisting semantic of resetting
rt_numfibs to 1 in VNET jails.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294510
Reviewed by:    glebius, zlei, pouria
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56473
2b264cb802b9b45306b1f3dfd3e9d4edfb23b2f6 Mark Johnston 2026-04-18 12:20:00
routing: Use a better error number in sysctl_fibs()
ENOTCAPABLE is for capsicum and its use here is inappropriate.  In
particular, note that syscallret() treats this value specially.

Reviewed by:    glebius, pouria, zlei
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56481
8de0fc10a1c2d65bdb39eff862266ab1f87902c8 Mark Johnston 2026-04-18 12:21:22
tcp: Allocate t_tcpreq_info on demand
When TCP_REQUEST_TRK is enabled, the tcb grows by 600 bytes
to accommodate the t_tcpreq_info[MAX_TCP_TRK_REQ] array.
Even when the option is enabled, not every connection is using
this feature.  So let's allocate it on-demand, and save 600
bytes in the common case.

Sponsored by: Netflix
Reviewed by: rrs, tuexen
Differential Revision: https://reviews.freebsd.org/D56484
29336f1c9d25c32896620a00a6218c332b37c4b7 Andrew Gallatin 2026-04-17 20:01:36
sctp: initialize inp to avoid uninitialized use
If we take an early goto out_unlocked inp is uninitialized and then
may be used in SCTP_LTRACE_ERR_RET().  Initialize inp to NULL
to avoid warnings.

Found with:     gcc15 tinderbox build
MFC after:      3 days
Reviewed by:    tuexen, pouria
Differential Revision: https://reviews.freebsd.org/D56503
4cdbcc2b6a2e551529f7133665ef406869b48bf7 Bjoern A. Zeeb 2026-04-18 13:25:18
pf: be more robust against interface name conflicts
pf assumes that interface names are unique (and share a namespace with
interface group names).
Unfortunately the FreeBSD network stack has a few edge cases where this
assumption can be violated. Try to be more robust against this: rather
than changing the association between a kif and ifp just ignore the next
interface with the same name.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
ff76ec3e9b287df9378f09ce29eca668162903f4 Kristof Provost 2026-04-20 09:22:13
pf: Use MTX_DUPOK to initialize hash chain mutexes
pf_udp_mapping_insert() may lock more than one row at a time.

Fixes:          https://cgit.freebsd.org/src/commit/?id=cd5ff4e841fb ("pf: use hashalloc(9) for key, id, src-node and udp-endpoint hashes")
Reviewed by:    kp
Differential Revision:  https://reviews.freebsd.org/D56501
ffad36e1d7002a7da751856b28eb50c36b137abb Mark Johnston 2026-04-20 16:48:40
iflib: Add a missing CURVNET_RESTORE() in the error path
Signed-off-by:        Peter Ganzhorn <peter.ganzhorn@gmail.com>
Reviewed by:    zlei
Fixes:          https://cgit.freebsd.org/src/commit/?id=6d49b41ee84b iflib: Add pfil hooks
MFC after:      3 days
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2150
f49f61f19463c21125bb1215cf8e0530f52953e3 Peter Ganzhorn 2026-04-20 16:59:59
ctld: Return from the inner "main" loop on EINTR
This ensures that child processes are reaped in the outer loop in
main().

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294035
Reviewed by:    asomers
Fixes:          https://cgit.freebsd.org/src/commit/?id=66b107e82b2f ("ctld: Use kevent(2) for socket events rather than select(2)")
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56525
e56687bb2d32ee4b1774300f3960427ca56b34bb Nikolay Denev 2026-04-20 17:18:50
ctld: Support multiple physical ports in a target
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293076
Reported by:    Ken J. Thomson <thomsonk@yandex.com>
Reviewed by:    asomers
Fixes:          https://cgit.freebsd.org/src/commit/?id=969876fcee57 ("ctld: parse config file independently of getting kernel info")
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D55767
7bb2b3801554a58039ed9d1fd05b65ce24c6c661 John Baldwin 2026-04-20 17:19:25
ctld: Update nchildren directly in wait_for_children
This results in slightly less duplicated code.

Reviewed by:    asomers
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56526
4b79ee8eb139696c1fe845d25a56439d02ab4131 John Baldwin 2026-04-20 17:19:49
pf: do not allow flags to be changed with securelevel set
With securelevel set (for pf that means >= 3) we're expected to reject
rule changes. However, we allowed interface flags to be changed, which
would allow 'set skip on X' to be changed.

Remove DIOCSETIFFLAG and DIOCCLRIFFLAG from the securelevel whitelist.

MFC after:      1 week
Reported by:    cyberkittens
Sponsored by:   Rubicon Communications, LLC ("Netgate")
d5ca00f2d8743f0885c17f50c8c011cae285fbdb Kristof Provost 2026-04-13 13:48:39
Commit group #49: pf: only allow a subset of netlink calls when securelevel is set
pf: only allow a subset of netlink calls when securelevel is set

Extend the genl_cmd struct to allow calls to also carry a securelevel.
If that's set compare the current securelevel to only allow the call if
the level is lower than that.

If no value is specified continue to allow calls in any securelevel,
as before.

This allows us to easily implement the same securelevel restrictions for
pf as we have for the corresponding ioctls.

Reviewed by:    glebius
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D56390
9933bdcb12641839b7396ccd0c6b8a2d55d12744 Kristof Provost 2026-04-20 06:36:17

netlink: fix LINT-NOVIMAGE build

Include the required header for securelevel_ge()

Fixes:          https://cgit.freebsd.org/src/commit/?id=9933bdcb1264 ("pf: only allow a subset of netlink calls when securelevel is set")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
3103d39cd99f0a49414f907459d8fd3c11dc36b8 Kristof Provost 2026-04-22 21:33:30
loopback: fix use-after-free
Once we hand an mbuf over to netisr_queue() we may no longer access it.
Save the length before the call so we can use it to increment counters
afterwards.

Fixes:          https://cgit.freebsd.org/src/commit/?id=956acdce0505 ("loopback: Account for packet drops")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
07a3501e6c85baa4236061f8af4c2772307835f4 Kristof Provost 2026-04-21 09:19:26
inpcb: remove always true condition in in_pcblookup_local()
We are searching through the hash that has only wildcard bindings.
This was missed by fdb987bebddf05e15a5af840379c7715a94aec1c.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D56488
14a47a8bed8758abd7ea6ced14e8a8d9bd2c97bc Gleb Smirnoff 2026-04-21 16:10:49
tests/sys/netinet/tcp_hpts: Make a socket available in mock inpcbs
After commit 9b76228006d8, tcp_hptsi() dereferences inp_socket in order
to get the inpcb's VNET.  This means that mock inpcbs created by the
HPTS test fixture must set inp_socket.  Also set the current VNET there;
previously, it was NULL, and this was not noticed since VNET_DEBUG is
disabled even in debug kernels.

Fixes:  https://cgit.freebsd.org/src/commit/?id=9b76228006d8 ("inpcb: retire inp_vnet")
69e8d8b49d4bd889a42ba354f290f05d88bcd4b1 Mark Johnston 2026-04-21 14:31:18
pf: fix duplicate rule detection for automatic tables
We should look at the table name for automatic tables as well. These
are different tables, so the rules using them are (or can be) different
as well.

MFC after:      3 days
Reported by:    Michael Sinatra <michael@burnttofu.net>
Sponsored by:   Rubicon Communications, LLC ("Netgate")
fb838352751767e756bd45cd2040fa464ed4de20 Kristof Provost 2026-04-09 16:11:41
ctld: Don't add an iscsi port for targets with only kernel ports
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293076
Reviewed by:    asomers
Fixes:          https://cgit.freebsd.org/src/commit/?id=969876fcee57 ("ctld: parse config file independently of getting kernel info")
Differential Revision:  https://reviews.freebsd.org/D56523
614ef718496eb6fd815ddcfde203bee8da1178b1 Ken J. Thomson 2026-04-23 19:15:48
ctld: Ports without a portal group are not dummy ports
The default implementation of is_dummy should return false.  Only
portal group ports should possibly return true.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293076
Reported by:    Ken J. Thomson <thomsonk@yandex.com>
Fixes:          https://cgit.freebsd.org/src/commit/?id=6acc7afa34aa ("ctld: Convert struct port to a hierarchy of C++ classes")
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56524
3df5cc33d894edd6b0ae87e51f0e35c3501fb907 John Baldwin 2026-04-23 19:16:08
ctld: Move the pidfile handle out to a global variable
This ensures it will be destroyed (removing the associated pidfile)
anytime the process exits, including from exit(3) calls.  This fixes
a few places that would "leak" the pidfile on certain errors.

This also removes the need for some convoluted logic where
configuration objects would hand-off ownership of the pidfile handle
from the old configuration to the new configuration.

Reviewed by:    asomers
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56527
aad4fec5d7e260a789456a8cc82b293064fab5f3 John Baldwin 2026-04-23 19:17:05
pf: Document broadcast/multicast forwarding through route-to
pf_route() and pf_route6() forward broadcast and multicast traffic
when a route-to rule matches, without any check against the output
interface's broadcast domain. This is a deliberate property of the
route option code path, but it is not documented and the workaround
is non-obvious.

Document the behavior in pf.conf(5) with example block-out rules on
the target interface, scoped with the received-on qualifier so that
only forwarded traffic is dropped while the router's own broadcast
and multicast traffic continues to pass.

Add regression tests covering the full broadcast/multicast and
forwarded/local matrix on both IPv4 and IPv6.

Reviewed by:    glebius, kp
Approved by:    kp (mentor)
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D56559
4578c15ab914b6d71e93147f1b2e9b8048f394c8 R. Christian McDonald 2026-04-23 18:52:32
ctld: normalize iSCSI TargetName on login
Case-insensitive TargetName matching on logins was accidentally removed,
let's fix that by normalizing TargetName again according to RFC 3722.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294522
Fixes:                  https://cgit.freebsd.org/src/commit/?id=4b1aac931465f39c5c26bfa1d5539a428d340f20
Sponsored by:           ConnectWise
MFC after:              1 week
Reviewed by:            asomers, jhb
Approved by:            asomers (mentor)
Differential Revision:  https://reviews.freebsd.org/D56469
eb837cb8b2073c09bafaf3318f5bb103827b2bca Johan Söllvander 2026-04-24 07:44:43
ip_mroute: Avoid leaking uninitialized bytes to the routing daemon
Reported by:  KMSAN
MFC after:      1 week
e0751ae801b3e29c6dd52905ef1d63d5cd643b0a Mark Johnston 2026-04-24 13:22:51
pfsync: rename unused variable
Make it more obvious that this field is not used.
No functional change.

Event:  Wiesbaden Hackathon 202604
4001613878fe3cb059833c8a4b6199975f8d82f3 Kristof Provost 2026-04-25 11:27:03
ifnet: if_detach(): Fix races with vmove operations
The rationality is that the driver private data holds a strong reference
to the interface, and the detach operation shall never fail. Given the
vmove operation, if_vmove_loan(), if_vmove_reclaim() or vnet_if_return()
is not atomic and spans multiple steps, acquire ifnet_detach_sxlock only
for if_detach_internal() and if_vmove() is not sufficient. It is possible
that the thread running if_detach() sees stale vnet, or the vmoving is
in progress, then if_unlink_ifnet() will fail.

Fix that by extending coverage of ifnet_detach_sxlock a bit to also
cover if_unlink_ifnet(), so that the entire detach and vmove operation
is serialized.

Given it is an error when the if_unlink_ifnet() fails, and if_detach()
is a public KPI, prefer panic() over assertion on failure, to indicate
explicitly that bad thing happens. That shall also prevent potential
corrupted status of the interface, which is a bit hard to diagnose.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292993
Reviewed by:    glebius
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D56374
ba7f47d47dc1a177e4d8f115f791ec25f3da0eab Zhenlei Huang 2026-04-25 19:56:07
tuntap: add SIOCGIFCAP and SIOCSIFCAP ioctls
Add SIOCGIFCAP ioctl-command for tun/tap character device to be used
by bhyve for offloading in the future.
Add SIOCSIFCAP for symmetry.

Reviewed by:            markj, pouria, tuexen
MFC after:              1 week
Event:                  Wiesbaden Hackathon 2026
Differential Revision:  https://reviews.freebsd.org/D51289
28932dc425e19267313d221c26d10d3638e1cc4b Timo Völker 2026-04-26 09:48:36
tests/tcp_hpts_test: Fix resource leaks
When a KTEST_EQUAL assertion fails, the test function returns, but this
can cause it to leak locks, which can trigger a panic under witness.
Add a variant which causes control flow to jump to a label in case of
failure, and use that to prevent this problem.

Reviewed by:    Nick Banks <nickbanks@netflix.com>, tuexen
MFC after:      1 weeks
Differential Revision:  https://reviews.freebsd.org/D56647
f7bf9fd6199c99284dbc899928d8ad62861da414 Mark Johnston 2026-04-27 01:17:36
pf: improve ASCONF chunk validation
When processing an ASCONF chunk we failed to verify that the chunk
length was at least 8 bytes. As a result we might end up passing a
negative length to pf_multihome_scan(). Fortunately this merely meant
the function did nothing, but we should discard such invalid packets, so
explicitly check for this.

MFC after:      1 week
Reported by:    Mark Johnston
Sponsored by:   Orange Business Services
bea1c2fcd7839fd90a8ce96d6dc6a033779bc3c2 Kristof Provost 2026-04-28 08:54:24
ctld: kernel-sourced portal groups are not dummies
The current and historical versions of ctld would flag our initial set
of kernel ports as dummies, because their portal groups were empty since
portals come from the configuration on-disk.

As a result, we would never try to remove a kernel port at startup that
didn't exist in the configuration (possibly a feature if you wanted
concurrent ctld(8)), and we would always try to port->kernel_add() on
ports in the configuration (even if they actually did have an existing
kernel port).

Flag these portal groups as kernel groups so that we avoid trying to add
ports that already exist.  It may be the case that the kernel_remove()
loop in conf::apply() needs to do something other than the current
`oldport->is_dummy()` to avoid removing ports that it isn't supposed to
be managing, but that wuld also seem to apply to LUNs that would be
removed today.

Reviewed by:    jhb
Differential Revision:  https://reviews.freebsd.org/D51782
d9c0594191f5c45d7f3c737350321ee59bfce9bf Kyle Evans 2026-04-28 20:51:50
pf: improve SCTP validation
As per RFC5061 "4.2.  New Parameter Types" the add/delete IP address
parameters (0xc001, 0xc002) may not be present in an INIT or INIT-ACK
chunk. They are only allowed to be present in an ASCONF chunk.

This also prevents unbounded recursion while parsing an SCTP packet.

Approved by:    so
Security:       FreeBSD-SA-26:14.pf
Security:       CVE-2026-7164
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294799
Reported by:    Igor Gabriel Sousa e Souza
Sponsored by:   Orange Business Services
6f9ddb329b07099e392c78b6e4fef1c6252de0dc Kristof Provost 2026-04-26 09:34:55
inpcb: improve some internal function names
The 'hash' subword doesn't bring any additional information.  All inpcb
lookup functions operate on hashes.

For lookup functions that work on either exact hash or wild hash just
perform s/hash_//.  Rename in_pcblookup_hash() into
in_pcblookup_with_lock(), emphasizing its difference to
in_pcblookup_smr().  Rename in_pcblookup_hash_locked() to
in_pcblookup_internal(), as it doesn't return a locked inpcb and is used
only for internal purposes.  Note that the IPv6 sibling of this function
already lives by name in6_pcblookup_internal().  Some future changes will
make such naming more justified.

No functional change.

Reviewed by:            pouria, markj
Differential Revision:  https://reviews.freebsd.org/D56482
9b8eb70ca974c2c700f228adaceb9a6b9e918d00 Gleb Smirnoff 2026-04-29 16:19:03
inpcb: allow to specify different sizes for port and load balance hashes
Understand zero size as instruction to not allocate the hash.  Do not
allocate both hashes for rawip(4).  There are no functional changes to TCP
or UDP.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D56705
6883b120c53735ff1681ef96d257f376731f56b3 Gleb Smirnoff 2026-04-29 16:19:14
if_gre(4): Fix gre_clone_dump_nl address dump
Fix stack overflow by passing in_aliasreq instead of ifr
during netlink dump.

Fixes:  https://cgit.freebsd.org/src/commit/?id=e1e18cc12e68 ("if_gre: Add netlink support with tests")
c5a92616c41f9132d585c533e66dee88e98c73f2 Pouria Mousavizadeh Tehrani 2026-04-29 17:42:27
routing: Implement merge of nhgrp in new multipath route
Routing subsystem allows creating new multipath routes by
nexthop groups (e.g RTA_MULTIPATH in netlink), in case of
a second nexthop group on the same route, don't panic and
merge the existing nhgrp with new one.

Reviewed by: melifaro (except one comment)
Differential Revision: https://reviews.freebsd.org/D56187
dd945c6ba4ff8d444c4cb90a911d96c66b6fc4aa Pouria Mousavizadeh Tehrani 2026-03-31 19:13:48
netlink: Fix RTA_MULTIPATH on RTM_GETROUTE
Before this patch, netlink never returned RTA_MULTIPATH.
Also, add RTA_MULTIPATH attribute in way that don't confuse
non-mpath support consumers.

Differential Revision: https://reviews.freebsd.org/D56188
84bb3648d2151576ebd707b592942a1fd77aa2c4 Pouria Mousavizadeh Tehrani 2026-04-08 19:16:35
routing: Expire nhops inside the nhgrp
Fix route expiration of nhops that exists inside a nhgrp.

Differential Revision: https://reviews.freebsd.org/D56189
8a64738f5a93ea878425ee3f51e1b9efbd3f5d6e Pouria Mousavizadeh Tehrani 2026-04-19 10:58:25
Commit group #50: krb5: import MIT 1.22.2
krb5: import MIT 1.22.2

Merge commit '90c687295e2d62f9411fc5b571f5af4e8ee187a7'
736e411a737b9f57c1303e6d15c5afd4f63af0d3 Cy Schubert 2026-04-30 19:24:20

krb5: Adjust version to 1.22.2

Fixes:          https://cgit.freebsd.org/src/commit/?id=736e411a737b
8f46ba065143d9d89968a20b23844287d54c04a2 Cy Schubert 2026-05-01 00:57:39

krb5: Adjust additional version strings

Fixes:          https://cgit.freebsd.org/src/commit/?id=736e411a737b
c64ee36e5d09ecee4ce4951047014c8461734fb5 Cy Schubert 2026-05-01 14:40:19
krb5: Fix two NegoEx parsing vulnerabilities
Bring in upstream commit 2e75f0d93 fixing two CVEs. Upstream commit
log is:

 In parse_nego_message(), check the result of the second call to
 vector_base() before dereferencing it.  In parse_message(), check for
 a short header_len to prevent an integer underflow when calculating
 the remaining message length.

 Reported by Cem Onat Karagun.

 CVE-2026-40355:

 In MIT krb5 release 1.18 and later, if an application calls
 gss_accept_sec_context() on a system with a NegoEx mechanism
 registered in /etc/gss/mech, an unauthenticated remote attacker can
 trigger a null pointer dereference, causing the process to terminate.

 CVE-2026-40356:

 In MIT krb5 release 1.18 and later, if an application calls
 gss_accept_sec_context() on a system with a NegoEx mechanism
 registered in /etc/gss/mech, an unauthenticated remote attacker can
 trigger a read overrun of up to 52 bytes, possibly causing the process
 to terminate.  Exfiltration of the bytes read does not appear
 possible.
c9dd7bffa58c50b2f7ed9e66ace39197c468d8e6 Cy Schubert 2026-04-30 19:27:31
pfsync: reject invalid SCTP states
SCTP states should always have a src scrub object associated with them.
Crafted pfsync packets might not have this, leading to us derferencing a
NULL pointer on cleanup.

Validate the pfsync state insertion packet to make sure this is correct.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294989
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
bf6d00afdb6171ba04a1c5a7fde904cde87d212d Kristof Provost 2026-05-04 16:08:35
pf: do not reject rules with colliding hashes
We insert rules in pf_krule_global solely for the benefit of the
'keepcounters' feature. Failing to insert (beause the rule hash
collides, or an identical rule already exists) would be worse than
restoring counts to the wrong rule (or failing to restore them at all).

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282863, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294860, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294859, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294858
MFC after:      3 days
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D56745
a0e4c65f1814a7a677364dc29bb703f84323d175 Kristof Provost 2026-04-29 15:04:44
pfctl: handle errors from PFNL_CMD_GETSTATES
Sponsored by: Rubicon Communications, LLC ("Netgate")
c24b1d9359b899c7532d5b296f37cf3d74a36942 Kristof Provost 2026-05-05 16:57:25
if_vlan: Use the exclusive lock everywhere
Running sys/net tests in parallel reveals some panics which look like
the one below:

```
shared lock of (sx) vlan_sx @ /home/markj/sb/main/src/sys/net/if_vlan.c:2395
while exclusively locked from /home/markj/sb/main/src/sys/net/if_vlan.c:1850
panic: excl->share
cpuid = 9
time = 1776467219
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00d84e0780
vpanic() at vpanic+0x136/frame 0xfffffe00d84e08b0
panic() at panic+0x43/frame 0xfffffe00d84e0910
witness_checkorder() at witness_checkorder+0xdb1/frame 0xfffffe00d84e0ad0
_sx_slock_int() at _sx_slock_int+0x64/frame 0xfffffe00d84e0b10
vlan_ioctl() at vlan_ioctl+0x25c/frame 0xfffffe00d84e0b70
if_setflag() at if_setflag+0xdc/frame 0xfffffe00d84e0be0
ifpromisc() at ifpromisc+0x27/frame 0xfffffe00d84e0c00
vlan_setflags() at vlan_setflags+0x64/frame 0xfffffe00d84e0c30
vlan_unconfig_locked() at vlan_unconfig_locked+0xb7/frame 0xfffffe00d84e0c70
vlan_clone_destroy() at vlan_clone_destroy+0x5d/frame 0xfffffe00d84e0cb0
if_clone_destroyif_flags() at if_clone_destroyif_flags+0x8c/frame 0xfffffe00d84e0cf0
if_clone_detach() at if_clone_detach+0x106/frame 0xfffffe00d84e0d20
vnet_destroy() at vnet_destroy+0x154/frame 0xfffffe00d84e0d50
prison_deref() at prison_deref+0xaf5/frame 0xfffffe00d84e0dc0
sys_jail_remove() at sys_jail_remove+0x1a7/frame 0xfffffe00d84e0e00
amd64_syscall() at amd64_syscall+0x169/frame 0xfffffe00d84e0f30
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe00d84e0f30
--- syscall (508, FreeBSD ELF64, jail_remove), rip = 0x25bd44705ca, rsp = 0x25bcfe72ab8, rbp = 0x25bcfe72b40 ---
```

All vlan interfaces are locked by a single recursive global lock.  There
are cases, like in the panic above where vlans are stacked on top of
each other, where the driver tries to acquire an exclusive lock while
holding a shared lock, and vice versa.

With longer-term goals of making the networking regression test suites
stable when run in parallel, and simplifying network control plane
locking, which I find is quite complex and buggy, let's change if_vlan
to use the exclusive lock everywhere.

Reviewed by:    pouria, zlei, kp, glebius
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56778
486c2dfaa7b9ed1ed79662584c9b0f4fd0c23d67 Mark Johnston 2026-05-06 11:48:24
pfctl: optionally print the rule in the state overview
When dumping states optionally (at '-vv') also show the rule which
created the state. This can be helpful if the ruleset changed and we
want to know what rule created the state.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
726ff260ecfa38878aec982456c44ddb0f9c791b Kristof Provost 2026-05-05 12:42:16
if_geneve: Fix uninitialized variable use in geneve_udp_input()
Set the ifp variable as soon as soft_c becomes available
so that interface statistics can be incremented.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295129
Reported by:    Robert Morris <rtm@lcs.mit.edu>
Fixes:          https://cgit.freebsd.org/src/commit/?id=e44d2e941e8e ("if_geneve: Add Support for Geneve ...")
70ef02b5d3fdbc4f51ea81404c4cbca310083ce6 Pouria Mousavizadeh Tehrani 2026-05-10 19:25:53
if_media: Claim 10BASE-T1S and 10BASE-T1L constants
These are two single-pair Ethernet (SPE) variants that run at 10 Mbps.
10BASE-T1S has automotive origins and supports multiple nodes on up to
25m of cable.  10BASE-T1L is intended for building and industrial
automation and supports long-distance point to point links of over 1km.

Reviewed by:    kbowling
Differential Revision: https://reviews.freebsd.org/D56952
a3036edd0292291a71fb74ba2bce355159ac6913 Ed Maste 2026-05-04 23:48:25
ipfw: fix IPv6 flow label matching
* do not require just only ip6 proto for flow-id opcode in ipfw(8).
  ipv6-icmp, tcp, udp should be fine too.
* fix off-by-one bug leading to out-of-bounds read.
* apply IPV6_FLOWLABEL_MASK before comparison in flow6id_match(),
  so flow-id opcode will match a specified flow label. No need to
  take protocol version and traffic class into account.
* add the test to verify that opcode is working correctly.

Reviewed by:    pouria
Obtained from:  Yandex LLC
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56869
3d39eadcdeb301e95abdc94b1ad5d1255fa0f446 Boris Lytochkin 2026-05-12 07:44:10
lacp: fix link state with multiple aggregators
When we have multiple aggregators, the link state should reflect the
state of the active aggregator.

This change was prompted by a script pruning 10GbE interfaces from an
lacp bundle with 100GbE interfaces. Mixing speeds like this creates multiple
aggregators.  When the last 10GbE interface was removed, lagg0 would loose
link because the current aggregator's port count would drop to 0, even
though the 100GbE aggregator had active ports. This left the system in a
hard to diagnose state where lagg0 reported "active", but all outgoing
IP traffic was dropped, due to the RT_LINK_IS_UP() check noticing lagg0's
if_link_state was marked as down.

Reviewed by: zlei
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D56579
9f69446d45484c16d2b9b9bf71bbb2fca86cb6e5 Andrew Gallatin 2026-05-12 12:52:24
tests/tcp_hpts_test: Fix more resource leaks
Address leaks that I missed in commit f7bf9fd6199c
("tests/tcp_hpts_test: Fix resource leaks").

Reviewed by:    Nick Banks <nickbanks@netflix.com>, tuexen
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56943
26bffe5695d7cab2e797ce4ad153f324c0262f48 Mark Johnston 2026-05-12 17:44:31
if_vxlan: Update *m0 after a pullup
vxlan_input()'s caller is supposed to free *m0 if it is non-NULL after
the function returns.  vxlan_input() failed to update *m0 after the
pullup however, so if it hits an error case after the pullup, we'll free
the mbuf twice.  Currently this can happen only if the interface is
brought down or due to a packet loop.

Reported by:    Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai
Reviewed by:    pouria, zlei
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56944
a6c4fe2d1a38885914b1c3e85508b965ccdb7874 Mark Johnston 2026-05-12 17:50:15
rtnetlink: Check for allocation failure in nlattr_get_multipath()
Check for alloction failure on `npt_alloc()` for RTA_MULTIPATH
attributes in `nlattr_get_multipath()`.
Also, add tests for maximum number of rtnexthop in rtnetlink.

Reported by:    Joshua Rogers of AISLE Research Team
Reviewed by:    markj
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D56954
188631e43a1a5d2985156141c2e244a925670683 Pouria Mousavizadeh Tehrani 2026-05-11 19:53:21
rtnetlink: Align RTA_MULTIPATH length validation in nlattr_get
Fix length validation of RTA_MULTIPATH attributes in
nlattr_get_multipath() by making sure the user request is align.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295102
Reported by:    Robert Morris <rtm@lcs.mit.edu>
Reviewed by:    markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=7e5bf68495cc ("netlink: add netlink support")
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D56963
4329663a861ef74796b79b6b0872cfe10d31c591 Pouria Mousavizadeh Tehrani 2026-05-12 11:34:28
openssh: Add reference for another local patch
A bug fix was committed locally and submitted upstream.  Document it in
our upgrade instructions, as these sometimes take a long time before
getting merged.

Sponsored by:   The FreeBSD Foundation
6531070132b0210aaaeb08c0dc93cb272bed348e Ed Maste 2026-05-15 16:16:45
openssh: Fix SIZEOF_TIME_T in freebsd-configure.sh
Sponsored by: The FreeBSD Foundation
Reviewed by:    jlduran
Differential Revision: https://reviews.freebsd.org/D57053
0b0e5daf4333a0faf93133f7d2c7b3743eead9d8 Ed Maste 2026-05-17 17:05:26
openssh: Regen config.h to fix i386 SIZEOF_TIME_T
Fixes: https://cgit.freebsd.org/src/commit/?id=2574974648c6 ("OpenSSH: Update to 10.3p1")
Sponsored by:   The FreeBSD Foundation
f5993872faf5dbd5c142857e9633b11e330f8c38 Ed Maste 2026-05-18 02:52:12
Commit group #51: tcp: Make RFC 6191 support configurable
tcp: Make RFC 6191 support configurable

Add a default-on per-VIMAGE sysctl for RFC 6191 connection recycling.
This makes it possible to merge the change to older branches where it
can be switched off by default to minimize risk.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   Modirum MDPay
Reviewed by:    pouria, marius.h_lden.org, tuexen
Differential Revision:  https://reviews.freebsd.org/D57045
2af70d7a384934cee497fb6d75678e04f1416287 Dag-Erling Smørgrav 2026-05-18 14:50:14

tcp: Fix typo in RFC 6191 sysctl

Fixes:          https://cgit.freebsd.org/src/commit/?id=2af70d7a3849 ("tcp: Make RFC 6191 support configurable")
MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   Modirum MDPay
78074011acee4c3e859ffd37009abb56cc6c8c56 Dag-Erling Smørgrav 2026-05-18 14:59:25
Commit group #52: ctld
ctld: Remove redundant call to conf::isns_schedule_update

This is already called at the end of conf::apply.

Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56530
4f90de0933218fd257300c6341abf157387f7641 John Baldwin 2026-05-18 19:47:41

ctld: Mark a few more isns_* methods in the conf class private

These are only invoked from other methods in the conf class.

Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56531
63d7b7fad2dd2343854c60f0da4ac46ef5b0d8b1 John Baldwin 2026-05-18 19:47:57

ctld: Add a dedicated conf method for shutting down

Currently the main loop creates an empty config and applies it to
force a shutdown of all of the existing configuration.  While this is
functional and does avoid duplicating some code, it is also a bit
clunky and requires a special hack in the pidfile path handling
in the conf::apply method.

Instead, use a dedicated conf::shutdown method which tears down the
CTL ports and LUNs and closes the sockets.

Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56532
f1c5de5fab9d5cada11935418db11e19ebff7e34 John Baldwin 2026-05-18 19:48:09

ctld: Simplify pidfile rename handling in conf::apply

Explicitly copy the pidfile path from the initial configuration file
to the kernel-derived configuration to avoid having to check if the
old path is empty as a special case in conf::apply().

Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56533
9306d0449ba6fffadf08d5ab61aea596369e03f4 John Baldwin 2026-05-18 19:49:57

ctld: Don't ignore pp/vp values of kernel ports with pp == 0 but vp != 0

Fixes:          https://cgit.freebsd.org/src/commit/?id=c6f1e9b8a412 ("ctld: Simplify XML parsing memory management")
Sponsored by:   Chelsio Communications
7a436d378951bedbdaa71d45bf236fb001323549 John Baldwin 2026-05-27 20:56:39

ctld: Refactor ioctl port handling

- Normalize ioctl port names when the port name is first added to
  the configuration.  This can catch potential duplicate port names
  sooner and helps with other parts of this change.

- When recognizing existing ioctl ports, always expand the name to
  include the physical and virtual port numbers.  This permits binding
  ioctl/0/0 or ioctl/1/0 to a target, for example.

- When adding physical ports to a target, first check for an existing
  kernel port to reuse.  This handles both ioctl and non-ioctl ports
  and removes the need for the conf::add_port method for ioctl ports
  to check in kports.

- If an existing kport isn't found when adding physical ports, check
  to see if the port name is an ioctl port.  If so, call conf::add_port
  to add an ioctl port.  This add_port method overload is now simpler
  as it always creates a new port.

NB: The kernel_port class handles CTL ports that already existed
before ctld started including existing ioctl ports, whereas the
ioctl_port class handles ioctl ports that are created and completely
managed by ctld.  This was true before this change but is perhaps more
obvious after this change.

Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D57092
caef3c50ac067ca751ba4950f310821a521ebf57 John Baldwin 2026-05-27 20:57:23

ctld: Only check physical port linking in a single configuration context

Commit 969876fcee57 moved struct pport from being per-configuration to
being a "global" object shared across multiple configurations.  As a
result, the check for duplicate ports actually spanned across
configurations, such that reloading a configuration would now think
that existing physical ports were already linked.

The linking field in pport added in the C++-ification (commit
6acc7afa34aa) faithfully replicated this bug (albeit simpler as I had
noticed that the TAILQ links weren't used after the earlier commit).

To restore the desired behavior, remove the linking field from struct
pport entirely and use a local unordered_map in conf::add_pports which
tracks if a given pport is claimed by more than one target.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293076
Reported by:    Ken J. Thomson <thomsonk@yandex.com>
Fixes:          https://cgit.freebsd.org/src/commit/?id=969876fcee57 ("ctld: parse config file independently of getting kernel info")
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D57093
d1a8fa2e0f415f941e628f959fa0e70f23058fdb John Baldwin 2026-05-27 20:57:38
net80211: migrate wk_rxmic / wk_rxmic in TKIP code to accessors
These are the last two uses of the wk_rxmic / wk_txmic macros.
Everything should be using the accessor methods at ths point.

Reviewed by:    bz
Differential Revision:  https://reviews.freebsd.org/D54790
8d36ec1c9c5b7c545e1a7584e66e1ff9b9798ee7 Adrian Chadd 2026-05-19 05:28:49
netlink: factor out compatibility code from inlined function
This is a refactor of 228c632ab3f62.  First, move compatibility one level
up, where we yet work with the full header.  Second, move this rarely
executed code outside of the inline function.  Should be no functional
change.

Reviewed by:            pouria, melifaro
Differential Revision:  https://reviews.freebsd.org/D56915
e145afc9eb9187be7e7cfdd42043cefc07b6e8d6 Gleb Smirnoff 2026-05-20 14:27:39
netlink: fix unsigned overflow on a truncated message
PR:                   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295106
Submitted by:           Robert Morris <rtm@lcs.mit.edu>
Reviewed by:            pouria, melifaro
Differential Revision:  https://reviews.freebsd.org/D56916
e924a2c80b9e1ace68d8ca0ffdacec65feec90a3 Gleb Smirnoff 2026-05-20 14:27:52
ipfilter: Validate length before checksum
Validate the length of the packet listed in the mbuf is the same as
the calculated packet length. If not reject the packet and bump the
bad packet stat.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295198
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57095
8dfb0805fc31cd78940429ab0560dae7e8ab6536 Cy Schubert 2026-05-11 15:44:52
Commit group #53: ipfilter
ipfilter: Add NULL check for fin_dp in ICMP packet handlers

Add NULL checks for fin->fin_dp in ipf_pr_icmp6() and ipf_pr_icmp()
before dereferencing. When processing packets with IPv6 extension
headers, ipf_pr_pullup() can succeed but fin->fin_dp may still be NULL
due to extension header processing leaving insufficient data for the
protocol header.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288333
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2214
Signed-off-by:  Teddy Engel <engel.teddy@gmail.com>
68ed81631afa20c07883f7f60343f6da8397ee41 Teddy Engel 2026-05-19 21:36:15

ipfilter: Add NULL check for fin_m in ipf_pr_icmp6()

Add NULL check for fin->fin_m before calling M_LEN() in the ICMPv6
error handling code path. When ipf_checkicmp6matchingstate() calls
ipf_makefrip() with a synthesized fr_info_t that has fin_m set to
NULL, the subsequent call to ipf_pr_ipv6hdr() can reach ipf_pr_icmp6()
which would crash when trying to access the mbuf via M_LEN().

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288333
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2214
Signed-off-by:  Teddy Engel <engel.teddy@gmail.com>
cdc40489a7a617b742e295cf9005b3569b45e823 Teddy Engel 2026-05-19 21:36:23

ipfilter: Fix NULL dereferences in ipf_checkicmp6matchingstate()

Add NULL checks for ic6 (the ICMPv6 header pointer from fin->fin_dp)
and oic (the inner ICMPv6 header from ofin.fin_dp after ipf_makefrip).
These pointers can be NULL when processing malformed ICMPv6 error
packets with extension headers.

Also fix the length validation: the original check (fin->fin_plen <
sizeof(ip6_t)) could never trigger because an earlier check already
ensures fin->fin_plen >= ICMP6ERR_MINPKTLEN (48). Replace with a proper
check that fin->fin_dlen contains at least ICMPERR_ICMPHLEN +
sizeof(ip6_t) bytes to ensure sufficient data exists for both the
ICMPv6 error header and the embedded IPv6 header.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288333
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2214
Signed-off-by:  Teddy Engel <engel.teddy@gmail.com>
c028080749c09e68c555155df0e9f681ba63c6ae Teddy Engel 2026-05-19 21:36:33
routing: Add support for metric
In our routing stack implementation, metric is an attribute
of the nexthop, not the route itself.
Store metric in nhop_priv which is control-plane data of
nexthop, filter the nexthops by metric and populate the mpath
slots in nexthop group with only the lowest metric nexthops
for use in the forwarding path.

`cmp_priv()` compares nhops based on priv hash.
Add metric compare logic to it and only return nexthops
with different metrics if the input nexthop's metric is
zero (wildcard).
Also, add support for metric via rtsock by introducing rmx_metric.

Finally, remove the upper 8-bit reservation of weight for
administrative distance.

Reviewed by:    adrian
Discussed with: markj
Relnotes:       yes
Differential Revision: https://reviews.freebsd.org/D56322
c0256b31efcccb6964822b5aadb183e8a6d45507 Pouria Mousavizadeh Tehrani 2026-05-02 20:04:26
netlink: Add RTA_PRIORITY support (metric)
* Use our new 32-bit metric for RTA_PRIORITY support.
* Update snl library for new RTA_PRIORITY support.
* return RTA_PRIORITY for both MPATH and non-MPATH routes.

Reviewed by:    glebius (previous version)
Discussed with: markj
Differential Revision: https://reviews.freebsd.org/D56323
73acfc5863489f0d7ed671d5529eea4c05ec40e6 Pouria Mousavizadeh Tehrani 2026-05-02 20:58:40
netstat(1): Show metric value for routes
Add metric support and show its value in wide flag and
libxo output.
Also, add metric to the description of wide flag (`-w`) in
routing display (`-r`) section of manual page.

Reviewed by:    markj (manpage)
Discussed with: markj
Differential Revision: https://reviews.freebsd.org/D57011
1f03c62e43a02ec705b9998f37edde0258c442e9 Pouria Mousavizadeh Tehrani 2026-05-15 10:08:16
ipfw: fix checksum after NAT
When checksum offloading is used, IPFW needs to fix the checksum
after libalias has done NAT. The ipfw_nat() function does so, but
only for mbufs without a receiving interface. However, if, for example,
the packet was sent inside a jail that used checksum offloading over
an epair, ipfw still needs to fix the checksum even though the mbuf
has set a receiving interface (epair).
This patch just removes the check whether a receiving interface is set.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295057
Reviewed by:            tuexen
MFC after:              immediately
Differential Revision:  https://reviews.freebsd.org/D57091
81b47a7c604f1d563283759572fa7a1f9d4dc56f Timo Völker 2026-05-21 10:54:44
pf: fix incorrect table decoding in netlink
We used nla_p_table for pfr_table structures, but this netlink decoder
was intended for pfioc_table and decoded an extra field, outside
of pfr_table. This allowed userspace to write (slightly) outside of
pfr_table.

Use a separate nlattr_parser for pfr_table.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295218
Reported by:    Robert Morris <rtm@lcs.mit.edu>
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
64327f769cee0c26e1b81e6195a5092498b10403 Kristof Provost 2026-05-21 08:13:24
pf: switch to getmicro(up)time()
It is reported that micro(up)time() performs poorly in certain
virtualisation scenarios. Absolute accuracy isn't required here, so
switch to the slightly less accurate (as per the man page) get-variants.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295043
MFC after:      3 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
e4130ac13d2fe9c17b8f8e86d39a7b5223fe7b79 Kristof Provost 2026-05-21 11:31:11
netlink: Fix lock leak in nl_find_nhop
Reviewed by: bz, pouria
Fixes: https://cgit.freebsd.org/src/commit/?id=7e5bf68495cc ("netlink: add netlink support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57156
d66fec481bfd65cbabb6c12a410d76843e76083e Ed Maste 2026-05-21 21:14:41
netlink: Avoid undefined behaviour
Even though it is not dereferenced, it is UB to take the address of an
out of bounds array element.

Reviewed by: pouria, bz, des, adrian
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57158
1a4ad649cb135501f0bee56a4214e8c904ca402e Ed Maste 2026-05-22 00:50:00
tcp: Remove a no-op eventhandler
It has done nothing since commit bc7d18ae7224.  No functional change
intended.

Reviewed by:    tuexen
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57101
bc041630fae2ea89bf041bf5d13df220aae4b2bf Mark Johnston 2026-05-22 14:51:15
netlink: Fix interface type match
Reviewed by: bz, glebius, pouria
Fixes: https://cgit.freebsd.org/src/commit/?id=7e5bf68495cc ("netlink: add netlink support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57167
eff5f220c379d4173fdc0e5ec00380888bf7649a Ed Maste 2026-05-22 13:35:52
netlink: Check for NULL return from npt_alloc()
Reviewed by: glebius, pouria
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57171
1dbc104148845434575d1931d47876ae0ca1542f Ed Maste 2026-05-22 14:41:16
netlink: Avoid potential undefined behaviour
Taking the address of an OOB array element is UB, even if not
dereferenced.

Reviewed by: des, bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57172
4d125ed6e7d445d574c11dc35c40ec3013559806 Ed Maste 2026-05-22 14:55:49
Commit group #54: net80211
net80211: add some example doxygen inline documents

This isn't supposed to be comprehensive, I want to have examples
for the common doxygen comments:

* describing a struct
* inside a struct - single line before the item
* inside a struct - same line after an item
* inside a struct - multi-line before an item

These build fine with the doxygen build in tools/kerneldoc/subsys/ .

Differential Revision: https://reviews.freebsd.org/D57056
0c37c9928c68ca50b3d5a1282d0c756e71c2ef35 Adrian Chadd 2026-05-17 18:41:11

net80211: update/add some VHT doxygen documentation

Add and update some documentation to be picked up by doxygen.

Differential Revision: https://reviews.freebsd.org/D57079
1ccaef9867461c42251922e3fc4d4f85cec682b5 Adrian Chadd 2026-05-19 05:08:50

net80211: add initial README.md and PROTOCOL.md

* Add top level README.md, linking to in progress and todo items
* Add an 802.11 protocol overview, with todo items - this is designed
  to provide a basic introduction to 802.11 for people wishing to work
  on net80211 and drivers.
* DEBUG.md - cover the debug API
* DATAPATH_TRANSMIT.md - transmit datapath
* DATAPATH_RECEIVE.md - receive datapath
* PROTOCOL.md - a high level (for values of "high") overview of
  the 802.11 protocol and where it intersects with net80211

Differential Revision: https://reviews.freebsd.org/D56760
490c53e9353feb129fe0acb8d9ba8fa52db24e2c Adrian Chadd 2026-04-26 23:32:35
netlink: Fix RTM_GETROUTE loop for RT_TABLE_UNSPEC
Reviewed by: bz, pouria
Fixes: https://cgit.freebsd.org/src/commit/?id=7e5bf68495cc ("netlink: add netlink support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57234
33acf0f26b490ea4887d820a3f45c56e3913a17d Ed Maste 2026-05-22 14:27:53
Commit group #55: divert: Define semantics for SO_REUSEPORT_LB on divert sockets
divert: Define semantics for SO_REUSEPORT_LB on divert sockets

Allow SO_REUSEPORT_LB to be set on divert sockets.  If set, then bind()
will add the socket to a "load-balancing group".  When a divert-to rule
matches a port with an associated group, the corresponding state ID is
used to select a specific socket from the group.  Packets without an
associated state are simply forwarded to the first socket in the group.
For now I only pass a state ID from pf, as I couldn't see a useful
identifier on the ipfw side.

This implementation is simple but has a caveat, that being that if
sockets are added to the group while flows are being processed, the size
of the group will change and this changes the mapping of state IDs to
sockets.  So, to get a consistent mapping, the divert socket application
must bind all of its sockets before any traffic is diverted by the
firewall.

Reviewed by:    glebius
MFC after:      1 month
Sponsored by:   OPNsense
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D56563
895a0ae67fe2c0c45b68991f1bba0c62f4d00ad5 Mark Johnston 2026-05-26 12:43:51

divert: Avoid using atomic_(load|store)_(acq|rel)_16

It's not implemented on some arches.  Use a plain int to count the
number of sockets in a divert lbgroup.

Reported by:    Jenkins
Fixes:          https://cgit.freebsd.org/src/commit/?id=895a0ae67fe2 ("divert: Define semantics for SO_REUSEPORT_LB on divert sockets")
c564074c9aaa8a3f9273de3cb802edcb3e2e2a40 Mark Johnston 2026-05-26 18:21:27
tcp: fix TCP_ACCOUNTING build
The uninitialized timeval was discovered by the new clang.
2750d957870aa45661e94cb6f7c5f1bfea52bf41 Gleb Smirnoff 2026-05-26 17:23:32
inpcb: a pcb may travel only from the wild hash to exact, not vice versa
The only possible way to exercise in_pcbrehash() is to bind(2) and then
connect(2).  The second branch was a dead code since fdb987bebddf.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D57241
ca91300c074923cecfe197de16a3318b06876134 Gleb Smirnoff 2026-05-28 04:46:27
inpcb: update inpcb multipath routing information only on success
This is very similar to IPv4 change 24e5c2ee2a18.  Don't modify inpcb
until we are sure connect(2) will be successful.

Fixes:  https://cgit.freebsd.org/src/commit/?id=0c325f53f16731f608919a4489f96fbbe28d2344
d62e8c5c6fdc9e3b006bf126e1fb863e8bdd6c51 Gleb Smirnoff 2026-05-26 16:02:06
ctld: More consistent error messages
The error messages ctld emits when it finds a port or LUN it did not
create were inconsistent with each other as well as with ctld's other
error messages.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    jhb
Differential Revision:  https://reviews.freebsd.org/D57270
95fc64cc29fb4cddc7cad093cfa32587a623f560 Dag-Erling Smørgrav 2026-05-28 17:22:43
rtnetlink: Fix weight overflow in RTA_MULTIPATH
If the weight value is larger than 8 bits, set it to the maximum.
Also, only send RTA_WEIGHT if its value is not the default.
This reduces message size and matches the behavior of
non-multipath routes.

Reviewed by:    emaste, markj
Differential Revision: https://reviews.freebsd.org/D57266
97f7b21dd52542421bc883e336e35af078af47fe Pouria Mousavizadeh Tehrani 2026-05-27 09:58:34
netlink: Use early exit pattern in _nl_modify_ifp_generic
No functional change.

Reviewed by:    pouria, melifaro
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57349
9ddb6064f815ebdd0cfea4b2e0d3b6f0c98ea072 Ed Maste 2026-05-29 21:08:51
netlink: Check permissions for interface flag changes
Reviewed by:  pouria, melifaro
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57332
96dbc9a8de105065b6b1e55702aa648319176587 Ed Maste 2026-05-29 15:52:03
netlink/route: extend pre-2.6.19 Linux compat shim to del/getroute
Commit f34aca55adef ("netlink/route: provide pre-2.6.19 Linux compat shim",
2024-06) fixed the partial fix for net/bird2 on the netlink path by mapping the
legacy 8-bit struct rtmsg::rtm_table field onto the modern 32-bit RTA_TABLE
attribute when the latter is absent.

That fix, however, was only applied to rtnl_handle_newroute. The two sibling
handlers: rtnl_handle_delroute and rtnl_handle_getroute were left looking at
attrs.rta_table directly. They are reachable from exactly the same client
(bird, in its netlink scan path), so any FIB number that fits in 8 bits
silently maps to RT_TABLE_UNSPEC in those handlers.

Reviewed by:    melifaro (previous version)
Approved by:    emaste
MFC after:      1 week
Sponsored by:   Netflix
e492ad08fc347ebf40979d3a6baa9d7b8917c76b Olivier Cochard 2026-05-29 23:17:28
lagg: Handle a port count of zero
The sc_count check in lagg_transmit_ethernet() and
lagg_transmit_infiniband() is racy, as the lagg protocol handlers are
only synchronized by net_epoch.  Handle a count of 0 in each protocol
handler where it's needed, namely in the RR and LB handlers.

Reported by:    Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai
Reviewed by:    pouria, zlei
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56942
49d90d9ddfc1ecda9ad9b6cb5565e5fbdcc14964 Mark Johnston 2026-06-01 16:40:43
net: Fix handling of unmapped user pages in if_getgroup()
We cannot call copyout() while in a net epoch section, unless the user
memory is wired.  Use the global ifnet lock to synchronize the accesses
instead.

Reported by:    emaste
Reviewed by:    zlei
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57154
68004e56fdc22c11b4ec680e83309b4ea2bfe13a Mark Johnston 2026-06-01 16:44:15
nat64lsn: Fix type confusion panic when using wrong NAT64 instance type
When an ipfw rule references a NAT64 instance by name using
'nat64lsn', the kernel looks up the instance in the shared
srvstate[] array without verifying the instance type.
If the named instance is actually a nat64clat or nat64stl
instance (created with 'nat64clat' or 'nat64stl'), the code
incorrectly casts the instance to nat64lsn_instance and
dereferences the ->cfg pointer, which causes a kernel panic.

The root cause is that all NAT64 instance types share the same
srvstate[] array but have different struct layouts.
For nat64lsn_instance, the field after 'no' is a pointer to nat64lsn_cfg.
For nat64clat_cfg, the same offset contains an embedded nat64_config struct.

Fix by adding a type check after NAT64_LOOKUP() to verify that the
instance's etlv matches IPFW_TLV_NAT64LSN_NAME before proceeding.
If the type doesn't match, return IP_FW_DENY to reject the packet
safely rather than crashing.

Signed-off-by:  Teddy Engel <engel.teddy@gmail.com>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292023
Reported by:    pouria
Reviewed by:    ae
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2249
ea4888e63f6ac89c38982ffee693f89a5927e9c9 Teddy Engel 2026-06-01 16:42:56
lacp: Simplify lacp_compose_key()
lacp uses interface speed to separate lacp members into different
aggregation groups.  It wants to use the lower 4 bits of the key
to represent the speed.   This change fixes a few bugs around that:

1) Actually use the baud rate reported by the interface as the speed
  (and fall back to use the baudrate associated with the media if
   the interface somehow doesn't support if_baudrate)

2) Compressess the baud rates down to the 4 bits reserved for them.
   Using things like FM_400G_FR8 does not fit in 4 bits (its value
   is 0x1811) . In fact, interfaces faster than 1Gb/s don't fit in
   4 bits using the old scheme

3) Emits a warning on the console once per boot if it encounters a
   NIC with an unsupported speed to make it slightly more obvious
   why LACP might not behave as expected.

This was prompted by a 400g nic with a broken media detection
reporting "unknown" as its speed, and being unable to be in the
same aggregation group with a different 400g nic that was properly
reporting its speed.

Sponsored by: Netflix
Differential Revision:  https://reviews.freebsd.org/D57026
Reviewed by: slavash
e98ed8d99fd41873dc52cf78e70e9f12e3e93042 Andrew Gallatin 2026-06-02 16:18:03
netpfil: add PF netlink command decoding support
Convert PFNL_CMD values in pf_nl.h from an enum to #define constants,
add a pfnl_cmd table definition for mktable, and implement the
corresponding command decoding helpers in libsysdecode.

This allows mktable to generate PF netlink command lookup tables and
enables symbolic decoding of PF netlink commands.

Reviewed by:    kp
Signed-off-by:  Ishan Agrawal <iagrawal9990@gmail.com>
Sponsored by:   Google LLC (GSoC 2026)
017690e509134422dbfa80316eab56d8d3f87065 Ishan Agrawal 2026-06-01 12:24:05
udp: Fix resource leaks in an error path in udp6_send()
Reported by:  Andrew Griffiths <andrew@calif.io>
Fixes:          https://cgit.freebsd.org/src/commit/?id=069a67374ed9 ("ip6: Remove support for RFC2675 (Jumbo Payload Option)")
Reviewed by:    pouria, tuexen, glebius
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57341
520e0f576f710eb60fb901b87b4eb0e1530362ae Mark Johnston 2026-06-05 21:48:35
if_stf: Free entire mbuf chain on failure
Reported by:   Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by:    markj, bz, kp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57476
5a7f41e94b6d47e60e5d76dfb3a61ee2746700ca Ed Maste 2026-06-05 20:56:51
ipsec: Free entire mbuf chain on failure
Reviewed by:  kib
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57475
85195c0c7f8a2926f0ba131178d9231bc33c81b5 Ed Maste 2026-06-05 20:51:48
pfsync: remove invalid panic
When we undefer a packet (when the peer acks the state) it's possible
that we don't find a corresponding pfsync_deferral. We panic here, but
that's actually something that can happen in normal operation:
 - if we have too many deferred packets already (in pfsync_defer())
 - if the deferral timed out (in pfsync_defer_tmo())

Remove this panic and document the scenarios where it might occur.

MFC after:      2 weeks
Sponsored by:   Orange Business Services
035e87247f845500b4672e10efb8f47fd2c0f2a2 Kristof Provost 2026-06-06 13:44:17
ipfilter: Fix ip_pptp_pxy (PPTP proxy) length underflow
A PPTP client sending a specially crafted PPTP message with a length
smaller than the already processed fixed header can panic the system.
This resultes in a negative remaining length (a large unsigned 16-bit
number).

Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li,
                and Ke Xu from Tsinghua University using GLM-5.1 from
                Z.ai
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57383
37e9d3641ba0e0da0d2bbaa26a59ee56a8cf3ee6 Cy Schubert 2026-05-29 06:17:39
krb5: Fix null dereference in SPNEGO token processing
krb5 1.22.1 erroneously removed a check from get_negTokenResp() for
successful decoding of the mechListMIC field.  Restore the check to
prevent a null pointer dereference.

Commit message details obtained from upstream commit.
Obtained from:  Upstream commit 4ae75cded
MFC after:      3 days
efb5c07f91c5c11fb9bd32227ac74c2d08adf3cf Cy Schubert 2026-06-02 17:57:17
krb5: Fix reachable assert when importing krb5 names
If a name token contains trailing garbage, error out from
krb5_gss_import_name() instead of crashing the process with an
assertion failure.

Commit message details obtained from upstream commit.
Obtained from:  upstream commit 07818f1fd
Reported by:    Aisle Research (Ze Sheng, Dmitrijs Trizna,
                Luigino Camastra, Guido Vranken) to krb5-bugs
MFC after:      3 days
fce16f60de9718be6b789f00e86141a84cd920d3 Cy Schubert 2026-06-02 18:09:43
netgraph: remove remnants of IPPROTO_DIVERT
256fa87c9fc31d67c3da27dd1aac0c42db3dcf41 Gleb Smirnoff 2026-06-08 16:35:07
netlink: Use unsigned type in nl_process_nbuf
nlmsghdr::nlmsg_len and nl_buf::offset are u_int.  Make msglen match.

Reviewed by:    pouria, glebius
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57474
888d9236e2249cb1bda686aca8729fdcc69a10ac Ed Maste 2026-06-05 19:16:53
ipfw nat: Add assertion that mbuf is not a chain
Discarding m_free's return value will result in an mbuf leak if the mbuf
was in a chain.

In general we should use m_freem if the mbuf may be in a chain, or
assert that the return was NULL.  There will not be a chain here due to
m_megapullup, so add an assert.

Reviewed by:    ae
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57479
b16c731b0191d6c47de46a3c6057b0c5ec0dd420 Ed Maste 2026-06-05 21:00:07
ip6: Drop dead code in ip6_input_hbh()
After commit 069a67374ed9, ip6_input() quickly rejects packets with
plen == 0, before ip6_input_hbh() is called.  So, there is no need to
check this condition again in the helper function.

Reviewed by:    pouria, zlei, tuexen
Differential Revision:  https://reviews.freebsd.org/D57342
acf0be6e5192c8b1ae2c9a71d86828daf12317b2 Mark Johnston 2026-06-08 22:45:44
libalias: Serialize updates to the global instance list
libalias maintains a global list of all libalias handles.  The list was
updated without any locking, but nothing prevents updates from running
concurrently.

MFC after:      1 week
2ff705f32a2033201a8f83f1ade5ddbc0460387d Mark Johnston 2026-06-08 22:46:32
net80211: add DEFERRED_WORK.md
Describe the ieee80211_task API, why its used and some of
its shortcomings.

Differential Revision:  https://reviews.freebsd.org/D57261
c3d8aca1d43ee8c569a351b7e1bf2aeb53508b98 Adrian Chadd 2026-06-09 01:00:36
net80211: delete the deprecated ieee80211_wepkey struct
This hasn't been used in a long time, and since I am shuffling around
the net80211 crypto API a bunch, let's just delete it instead of
leaving it here and trying to figure out how to support it if it's
used by userland somehow.

Reviewed by:    guest-seuros
Differential Revision:  https://reviews.freebsd.org/D57312
62c1865c9aaef436498c444b460e6ec2fbcaf44d Adrian Chadd 2026-06-09 04:27:12
in6_mcast: Fix a race in in6p_set_source_filter()
We drop the inpcb lock in order to copy in the source list, but this
leaves a window where the multicast filter structure might be freed.
This can be exploited to obtain root privileges.

In the v4 code this race is mitigated by holding the global multicast
lock across the gap.

Restructure the code to copy in filters before doing anything else, so
that there's no need to drop the inpcb lock and reason about the
correctness of doing so.  Do the same in the v4 code for consistency.

Approved by:    so
Security:       FreeBSD-SA-26:29.ip6_multicast
Security:       CVE-2026-49412
Reported by:    Andrew Griffiths <andrew@calif.io>
Reported by:    Maik Münch <maik@secfault-security.com>
Reviewed by:    glebius
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57347
1bac7df1baebd233d31d086a973a48df18f99e73 Mark Johnston 2026-05-29 20:12:24
pf: free match rules after exiting critical section
This fixes a panic reported on armv7:

sys/netpfil/pf/counters:match_block  ->  panic: free: called with spinlock or critical section held
[...]
vpanic() at vpanic
         pc = 0xc0321b5c  lr = 0xc02f7b5c (free+0x140)
         sp = 0xc8c858bc  fp = 0xc8c858e0
         r4 = 0xe2fad648  r5 = 0xe402ce78
         r6 = 0xc8c859e8  r7 = 0x0000001c
         r8 = 0xc8c858b4  r9 = 0xc0321b5c
        r10 = 0xc8c858bc
free() at free+0x140
         pc = 0xc02f7b5c  lr = 0xe2f4f920 ($a+0x5f8)
         sp = 0xc8c858e8  fp = 0xc8c85930
         r4 = 0xe402ce68  r5 = 0xc8c8599c
         r6 = 0xffffffff r10 = 0x0000001c
[...]
KDB: enter: panic

Consequently, this fixes armv7 CI:
https://ci.freebsd.org/job/FreeBSD-main-armv7-test/2287/consoleText

Fixes:  https://cgit.freebsd.org/src/commit/?id=6353f5d9a5c6f194bb014b8785a57f5314e8c652
Reviewed by:    kp
MFC after:      3 days
432ac5c07c6b1fb960f2e7d8e8cfb1306ce351ff Siva Mahadevan 2026-06-07 01:26:55
routing: Enable hash_outbound during nhgrp allocation
Multipath routes can be added via both RTM_F_CREATE and RTM_F_APPEND.
Therefore, it's possible to have mpath routes without calling
add_route_flags_mpath.

Instead of checking V_fib_hash_outbound for every route append,
check it during nhgrp_ctl initialization, which is only called for
the first multipath request per rib_head.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293136
Reviewed by:    glebius
Tested by:      Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Differential Revision:  https://reviews.freebsd.org/D57469
de639dcde2e273a6e6f2e877054c0606f9a8da25 Pouria Mousavizadeh Tehrani 2026-06-05 12:12:18
netlink: Indicate that ifinfomsg uses IFT_* types
On Linux struct ifinfomsg uses ARPHRD_* values, while we used IFT_*
types (which derive from SNMP ifType definitions in RFC 1573).
Update the header to reflect this.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272144
Reviewed by:    pouria
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57334
21a75a85f0e0cc328b6e9b437d783ef0c25dc52e Ed Maste 2026-05-29 16:23:17
udp: Wrap a long line in udp_send()
No functional change intended.

MFC after:      1 week
3b69c7201fd06b368090f2ee3840d384a949cba8 Mark Johnston 2026-06-15 15:57:01
sockstat: don't use getprotoent(3)
This removes requirement for existence of obsolete IPPROTO_DIVERT in
<netinet/in.h> and the 'divert' entry in /etc/protocols.

Also, this avoids running through the nsdispatch(3) machinery on startup,
cutting down about 20 syscalls, three of which are open(2).  The code of
sockstat(1) itself is also reduced.

The only UI change for a normal execution is that now the divert(4)
sockets are reported as "divert4" instead of "div4".  The prefix "4"
itself is also incorrect, as divert(4) is not a part of IPv4.  This will
be addressed in a separate change.

There is small UI change for incorrect runs.  Previously protocols listed
in /etc/protocols, but not supported, would err out like this:

  # sockstat -P ggp
  sockstat: protocol 3 not supported

And non-existent protocols would err out like this:

  # sockstat -P foo
  sockstat: cap_getprotobyname: No error: 0 USER COMMAND
  PID FD PROTO LOCAL ADDRESS         FOREIGN ADDRESS

Now both cases will consistently err:

  sockstat: protocol foo not supported

Reviewed by:            pouria, tuexen
Differential Revision:  https://reviews.freebsd.org/D57507
3a58a50dd4fa05d4a09054cf66701dc2409b0032 Gleb Smirnoff 2026-06-16 16:58:13
sockstat: consolidate unix(4) protocols in the array of protocols
This makes it possible to list unix(4) protocols in -P, which was not
possible before.  Update the manual page and provide an example.

In 'struct sock' make member proto a pointer into the protocols table
instead of a number.  This removes namespace collision that mixed
IPPROTO_TCP and etc with SOCK_STREAM and etc.  There were no known bugs
due to this collision, though.

Preserve all current UI bugs for possible combinations of protocol
selection options.  Should be no UI changes outside the improved -P.

Reviewed by:            pouria, tuexen
Differential Revision:  https://reviews.freebsd.org/D57508
8b2b62b49d886816213fb6b39258afb1373ef43b Gleb Smirnoff 2026-06-16 16:59:01
pfctl: pfctl_get_astats() doesn't set errno
After commit 08f54dfca197 pfctl_get_astats() doesn't set errno anymore,
except in one place.  Fix up that one place and adjust callers
appropriately.

Reviewed by:    kp
Fixes:          https://cgit.freebsd.org/src/commit/?id=08f54dfca197 ("pf: convert DIOCRGETASTATS to netlink")
Differential Revision:  https://reviews.freebsd.org/D57608
34e155336f0dd10efa8261b971fd540d92817339 Mark Johnston 2026-06-16 19:37:35
tcp: cleanup resource handling in SYN handling
Handle cred, ipopts, and maclabel using the same pattern:
allocate at the beginning and set to NULL when the object is
transferred to a struct syncache. When exiting the function, free
these objects if not transferred or when transferred to the on-stack
struct syncache. This makes use of a new function syncache_release().

This fixes a use after free problem: ipopts should only be freed,
if the on-stack struct syncache is used and the pointer in this
structure still points to the allocated ipopts. If the ipopts
are moved from the struct syncache to the struct inpcb in
syncache_socket(), which is called by syncache_tfo_expand(),
the pointer in the struct syncache is set to NULL.

In a FreeBSD default setup this problem is mitigated by
1. TCP fast open support on the server side not being enabled
   (the sysctl-variable net.inet.tcp.fastopen.server_enable is 0).
2. Incoming IP packet with source routing options are not being
    processed by the host stack
    (the sysctl-variable net.inet.ip.accept_sourceroute is 0).

Only if these two sysctl-variables are changed, a FreeBSD system
is affected, if a server actually using TCP fast open is running.

Reported by:            Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai
Reviewed by:            markj, rscheff
MFC after:              3 days
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D57374
1ed2bf1e0052df8dd6b429fc4ddd1908005f39ef Michael Tuexen 2026-06-17 13:46:56
tcp.fastopen.client_enable: Fix documented default
The default value has been 1 since June 2018, but the docs were not
updated to reflect the change.

MFC after:      3 days
Reviewed by:    ziaee
Fixes:          https://cgit.freebsd.org/src/commit/?id=af4da5865557 (Enable TCP_FASTOPEN by default)
Signed-off-by:  Matteo Riondato <matteo@FreeBSD.org>
Closes:         https://github.com/freebsd/freebsd-src/pull/2285
0bc852cc62afcd79fc776f784623c3f2b7691d27 Matteo Riondato 2026-06-17 14:59:01
net/if_media.h: Add 800GBase-X and 200Gbit/s per lane support
Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
MFC after:      1 week
Sponsored by:   Nvidia networking
Differential revision: https://reviews.freebsd.org/D57083
51f313dbc7a28a7bd2013c205261f29f115eb0a7 Slava Shwartsman 2026-05-13 10:10:50
iflib: Fix mbufs leaked by 0 len packets emitted from the if driver
Some interface drivers, notably bnxt, can insert 0 length packets onto
their receive queues when certain conditions are met, such as discarding
packets in the case of bnxt.

When this packet gets processed by assemble_segments(), The solitary
mbuf on the queue that composes it consist of a single zero length
fragment. The loop in assemble_segments() doesn't seem to expect
that a 0 length fragment can exist in the iri_frags list without a
non-zero length header preceding it. In this situation, without filter
intervention rxd_frag_to_sd() returns a pointer to the corresponding
mbuf in the rxq, where it is matched as a zero-length fragment and
immediately discarded without freeing as mh has not yet been assigned.

This change corrects this behavior by falling through the mh == NULL
case and freeing m on the condition that it is not NULL before
continuing the loop.

Reviewed by:    gallatin
Sponsored by:   Spectra Logic
Differential Revision:  https://reviews.freebsd.org/D57537
e2903636a069d5ef364c8f56452bff5818d15f99 Reid Linnemann 2026-06-17 18:22:44
if_ovpn: Fix a lock leak in an error path
Reviewed by:  kp
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=04a7134c1e92 ("if_ovpn: fix use-after-free of mbuf")
Differential Revision:  https://reviews.freebsd.org/D57696
f7b71f832c990da0bf203095f02405df665529d0 Mark Johnston 2026-06-20 14:12:19
if_fwsubr: remove ARP target hardware address trimming
Per RFC 2734 section 5, the 1394 ARP packet is a fixed 32-octet structure
with no target hardware address field.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57617
3ffd2baa268d298201d54c733dc0e635cc1dca9f Abdelkader Boudih 2026-06-22 00:31:29
ipfw/nat64: Fix type confusion panic when using wrong NAT64 instance type
Add etlv type validation to ipfw_nat64clat() and ipfw_nat64stl() to
verify that the retrieved instance is actually a nat64clat instance
before use.

All NAT64 instance types share the same srvstate[] array but have
different struct layouts.
Without type validation, using the wrong instance type with
a handler causes type confusion and kernel panic.

Signed-off-by:  Teddy Engel <engel.teddy@gmail.com>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292023
Reviewed by:    pouria
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2259
2e6b22abf44d99b84abf17fe25ca2e8f89716c04 Teddy Engel 2026-06-02 16:24:57
iflib: handle transient errors from isc_txd_encap()
Until we introduced support for nic ktls offload, all error returns
from isc_txd_encap() indicated a permanent failure. Iflib remapped all
those failures to ENOMEM, which was treated by the tcp stack as a
permanent error and passed back to the caller. This was done to avoid
creating "infinite loops" where a packet couldn't be mapped for
transmit, and kept being sent over and over.

Now that we have support for nic ktls offload, some ktls offload
drivers may return ENOBUFS from their encap function to indicate that,
for example, the ktls context may not yet be fully initialized.  This
needs to be treated as a transient error so that the TCP stack may
re-try at a later time. To achieve this, pass the raw error back to
the caller when the encap routine returns an error aside from EFBIG.

Note that I audited all in-tree iflib drivers. Only ice and ixl ran
return anything other than 0 from their encap, which is EFBIG. both of
which are still treated as they were before.

Testing with an out-of-tree ktls offload nic using iflib showed ENOMEM
errors from sendmsg() before this change, and no more errors passed
back to userspace after this change.

Reviewed by: kp, sumit.saxena_broadcom.com
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D57550
074ff8746388b3ed8581a84a7eea7b4b3e1bfe23 Andrew Gallatin 2026-06-15 14:20:41
ctld: Simplify handling of non-iSCSI and non-NVMe kernel ports
Just add these directly to the kports object rather than treating them
as iSCSI ports.

Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D57283
03ac6fe4f6d2bce06a672024152eb894a423dfcb John Baldwin 2026-06-24 15:28:51
pflog: remove unused argument from pflogattach()
efcc183f9b0dad94b7e954556e6e2515ec0f85be Kristof Provost 2026-06-21 16:19:22
netinet6: refactor in6_pcbconnect()
If the inpcb is already bound to a local address, there is no reason to
call in6_pcbladdr().  If the inpcb is already bound to a local port, there
is no reason to call in_pcb_lport_dest().  In the opposite case, if the
inpcb is not bound, and we are about to choose a non-conflicting local
addr:port, then there is no reason to call in6_pcblookup_internal().

This change makes in6_pcbconnect() to look much more alike the IPv4
in_pcbconnect().  I tracked this strange logic all the way down to initial
KAME import and failed to find any reasoning for it.

Reviewed by:            pouria
Differential Revision:  https://reviews.freebsd.org/D57534
90ea8e89d9b751e8b5ae90ef3397883b035788e5 Gleb Smirnoff 2026-06-25 21:34:38
ng_socket: simplify protosw(9) methods
- so_pcb can't be non-NULL in pr_attach.
- so_pcb can't be NULL in all other methods.
- Short circuit data socket attach down to the common attach.
- Short circuit both detach methods down to common one.
- Inline control socket attach.
- Inline control pr_bind.
- Inline data pr_connect.
- Rely on pr_connect_notsupp() for control connect(2).
- Don't use cast on so_pcb, it is void *.

Should be no functional change.
41bc52c89320807c1162f5547b07c29fcb718e19 Gleb Smirnoff 2026-06-26 19:01:30
ng_socket: plug node reference leak
There is no need to reference node in its constructor, the framework
already granted us a reference.  This extraneous reference was later given
back on socket detach.  However, if node is destroyed before the socket,
the node was leaked.  This leak was harmless until VIMAGE, where
vnet_netgraph_uninit() would cycle through all nodes and shut them down
expecting them to not exist after the shutdown.

Fixes: https://cgit.freebsd.org/src/commit/?id=19284374970533e1aa04020d4f840e8877ed6266
4d3cbeb7b407e127a5364f86039745068fbfc61f Gleb Smirnoff 2026-06-26 23:03:14
ctld: Normalize physical port names
Don't require ioctl port names to be fully expanded as this
contradicts the syntax documented in the ctl.conf(5).  However, don't
require users to exactly guess when pp or vp can be omitted.  Instead,
normalize all physical port names by parsing any port name with a pp
or vp value and reformatting them to a standardized format.  This
format is also used when generating names for kernel-enumerated ports.

Reported by:    Seth Hoffert <seth.hoffert@gmail.com>
Fixes:          https://cgit.freebsd.org/src/commit/?id=caef3c50ac06 ("ctld: Refactor ioctl port handling")
Sponsored by:   Chelsio Communications
4907d1c5c7f97ca985611441df5871705b90030c John Baldwin 2026-06-25 16:21:25
ctld: Cleanup redundant handling of duplicate kernel ports
Sponsored by: Chelsio Communications
21e94133eb51ef4eaea5bc37891741dd52d5933b John Baldwin 2026-06-26 19:42:33
loopback: improve checksum offloading
* Allow disabling IFCAP_RXCSUM_IPV6 or IFCAP_TXCSUM_IPV6.
* Do not pretend the checksum is correct by setting the LO_CSUM_SET
  flags if IFCAP_RXCSUM_IPV6 or IFCAP_RXCSUM is enabled. Instead,
  remove the LO_CSUM_SET flags (in case they have been set somehow)
  if IFCAP_RXCSUM_IPV6 or IFCAP_RXCSUM is disabled.
* Do not unset the transmit checksum offload flags LO_CSUM_FEATURES or
  LO_CSUM_FEATURES6 since they now have a meaning for the receive path.

Reviewed by:            glebius, pouria, tuexen
Okayed by:              bz
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D57518
d6c4cea7740d5c5c673a06ba37e4f1bdcddb2ece Timo Völker 2026-06-28 10:50:15
rack_bbr_common: don't use stale pointer after m_pullup()
Reviewed by:          tuexen
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D57816
be23edc1e4028e32a46e8fe7118de787fd5d79a2 Jana Smith 2026-06-28 11:04:05
pflog: create bpf tapping points without ifnet(9)
Just as was done for ipfw's log device stop creating entire struct
ifnet's for pflog devices. Create only a bpf_t.

This does mean we lose the create/destroy infrastructure provided by the
clone interface. Rather than implement this ourselves we allow users to
configure the number of pflog interfaces using the net.pflog.if_count
sysctl. We default to 8 devices, but allow up to 256.

The /etc/rc.d/pflog script will create extra devices as required.

While it was possible to rename pflog devices pfctl expected the pflogX
name, so it's safe to assume users never did this.

Requested by:   glebius
Reviewed by:    glebius
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D57851
e4f3ab161a9e149fd2f657f6d8af2ba3c618255f Kristof Provost 2026-06-24 10:21:20
loopback: use new names for checksum offloading flags
No functional change intended.

Reviewed by:            tuexen
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D57945
bcf4e3c001f5ec9cc206b0d81f0954559d1424d8 Timo Völker 2026-06-29 20:03:46
protocols: remove IPPROTO_DIVERT
f9a0147ee56e002fe31f155dcb2a7042f5b20a7e Gleb Smirnoff 2026-06-29 20:14:00
netinet6: cleanse safeguards against IFT_PFLOG
This "interface" type is no more.  Leave the constant in if_types.h, we
probably need an exp-run before removing it.
bdd0c4d0a7fe6db4c2c8f66fa260abe9d3049118 Gleb Smirnoff 2026-06-29 20:18:31
pflog: run VNET_SYSUNINIT in SI_SUB_PROTO_FIREWALL
Suggested by: pouria, glebius
Sponsored by:   Rubicon Communications, LLC ("Netgate")
b8c6f5811b2a948a265a4bd90d33a18efb2a6f1e Kristof Provost 2026-06-29 14:05:52
libalias: Fix buffer overflow in RTSP aliasing
In alias_rtsp_out(), we construct a new packet in a fixed-length buffer
before copying it back into the original buffer.  We never checked if
the data we were writing to this temporary buffer fit in it, nor if the
result fit in the original buffer.

* Use a dynamically sized allocated buffer instead of a fixed-length
  stack buffer.

* Check for overflow before appending to our temporary buffer.

* Check for overflow before copying the data back to the packet buffer.

* While here, use size_t for sizes and bool for booleans.

Approved by:    so
Security:       FreeBSD-SA-26:41.libalias
Security:       CVE-2026-49420
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57753
271b8f0f090836393d835219c37ae7e41ac39357 Dag-Erling Smørgrav 2026-06-28 22:10:40
rack: Reload the TCP stack PCB after reacquiring the inpcb lock
Malicious userspace might switch TCP stacks twice while the inpcb lock
is dropped.  If it does so, the validation of tp->t_fb might succeed,
but the saved pointer to the stack PCB might be invalid.  Reload it to
avoid this problem, as BBR already does.

Approved by:    so
Security:       FreeBSD-SA-26:43.tcp
Security:       CVE-2026-49422
Reported by:    Maik Münch
Reviewed by:    tuexen
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57791
eec9084656bcd7dd52f8f564c96dc6aced5be554 Mark Johnston 2026-06-23 21:46:17

System administration

Stuff in man section 8 (other than networking).

rtadvd: Fix validation of the MTU parameter when parsing config
MFC after:    1 week
607f6be6ec19f49ff595226afe1c8aa6515c59a0 Mark Johnston 2026-04-01 12:14:24
route(8): Show weight of nexthop in multipath routes
Reviewed by: zlei, markj
Differential Revision: https://reviews.freebsd.org/D56202
759d8a13a3b4510b7fab4d6c32e5a8de5ab056e7 Pouria Mousavizadeh Tehrani 2026-03-31 19:50:51
bhyve/virtio: Fix comparison of integer expressions of different signedness
It's a bit silly to have iov_to_buf() and buf_to_iov() return a ssize_t
to begin with, just to be able to return -1 for error. Change this to
size_t and use 0 as an error indicator, which won't require any changes
to the code using these functions.

While here, switch iov_to_buf() to use reallocf() instead of realloc().

Reviewed by: jhb
Fixes: https://cgit.freebsd.org/src/commit/?id=2a514d377b37 ("bhyve/virtio-scsi: Preallocate all I/O requests")
Differential Revision: https://reviews.freebsd.org/D55800
970e0db1c38b8b5f873e7c9797bb9abcad76a1d7 Hans Rosenfeld 2026-03-09 18:10:54
rtld: allow dlopen("#<number>/<path>")
When a specially formatted path is passed to dlopen(), of the form
  #number/path
and the number is the valid dirfd file descriptor listed in the
LD_LIBRARY_FDS, interpret it as a relative path name against dirfd
number.

This complements the result returned from dladdr() for such objects
in dli_fname.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56152
ffbf3fecdeffa17c0745e7ed342989acb620d68e Konstantin Belousov 2026-03-29 22:45:49
rtld: add test for dlopen("#dirfd/path")
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:   https://reviews.freebsd.org/D56152
72252591ac01037fa53501adb88f00d5d3cc09ed Konstantin Belousov 2026-03-30 00:42:00
Commit group #56: tunefs: Don't lower WARNS
tunefs: Don't lower WARNS

Use casts to silence the alignment warnings instead of potentially
suppressing other legitimate warnings.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56033
c5e79c7e93dda07c383be9b99a1a91894652f546 Dag-Erling Smørgrav 2026-04-02 11:21:59

tunefs: Fix alignment warning on arm64

MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=c5e79c7e93dd ("tunefs: Don't lower WARNS")
Reviewed by:    bakul
Differential Revision:  https://reviews.freebsd.org/D56229
616f47f176c308a29b1f4a6bba1b1a4dc01c3091 Dag-Erling Smørgrav 2026-04-02 21:23:47
tunefs: Add tests
MFC after:    1 week
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D56034
6630c3a73688ae3c33df892f6802bea5b8460e17 Dag-Erling Smørgrav 2026-04-02 11:22:05
New version of jng (2.0)
Changes for jng 1.0 -> 2.0 include:

+ Add experimental MSS clamping
+ Add support for ng_bridge(4) NGM_BRIDGE_GET_STATS (getstats)
+ Add JSON formatted ng_bridge(4) statistics (see above) via "jng stats -j <name>"
+ Add error messages
+ Minor refactoring for code readability (read: quietly() function)
+ Rename eiface variables to jiface to clarify as-for jail interface (not ng_eiface(4))
+ Fix missing description for alternate form of "jng show" usage
+ Update "jng show <name>" to accept multiple names (now "jng show <name> …" is allowed)
+ Update "jng shutdown <name>" to accept multiple names (now "jng shutdown <name> …" is allowed)
+ Add "-a" option to "jng stats" (as-in "jng stats -a") to show all ng_bridge(4) stats
+ Update "jng stats <name>" to accept any kind of name (make it easier to use)
+ Add version ident
+ Remove extraneous line in LICENSE section
+ Add -h to usage statements
+ Bump copyright

Reviewed by:    jlduran
Differential Revision:  https://reviews.freebsd.org/D43516
8e68f940c1d19aaf441c56b46583cbd9ab7448de Devin Teske 2026-04-04 19:39:22
Commit group #57: tunefs: Better fix for arm64 alignment issues
tunefs: Better fix for arm64 alignment issues

Rather than trust that the compiler will lay out the stack frame the
way we expect it to, use a union to force the correct alignment.

MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=616f47f176c3 ("tunefs: Fix alignment warning on arm64")
Reviewed by:    kevans, mckusick
Differential Revision:  https://reviews.freebsd.org/D56245
8244dd326265867293b2286efc3d571f06ef0dab Dag-Erling Smørgrav 2026-04-07 13:54:28

tunefs: Fix pointer arithmetic

While here, remove a bogus const which has been there for years.

MFC after:      1 week
Reported by:    ivy@
Fixes:          https://cgit.freebsd.org/src/commit/?id=1b83e8a3f840 ("Constify string pointers.")
Fixes:          https://cgit.freebsd.org/src/commit/?id=8244dd326265 ("tunefs: Better fix for arm64 alignment issues")
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D56343
9d95d806691e4ef1411c6c3b892d8b774754d724 Dag-Erling Smørgrav 2026-04-11 19:23:08
lualoader: allow the local module to filter out the BE list
This allows something like the following local.lua to install a filter
to implement its own notion of hidden BEs using a naming convention of
a leading dot to hide them:

-- file: /boot/lua/local.lua
local core = require("core")

local function be_hide(be)
    if core.isSingleUserBoot() then
        -- All BEs are accepted for single-user
        return true
    end

    local name = be:match("/([^/]+)$")
    if not name then
        -- Accept malformed BEs, for whatever reason
        return true
    end

    return name:match("^%.") == nil
end

if core.bootenvFilter then
    -- Just in case we need to be compatible with older versions of
    -- core.lua without the filtering functionality.
    core.bootenvFilter(be_hide)
end
-- EOF

Requested by:   Marek Zarychta
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55359
bf0881060ecd75ce79683b82ebcd4809eadf7cf5 Kyle Evans 2026-04-08 12:49:18
Commit group #58: arm64: Add arm64 SVE tests
arm64: Add arm64 SVE tests

Add the tests/sys/arch directory for architecture-specific tests and
use it to add arm64 SVE tests. These test the kernel is managing the
SVE state in a way we expect.

These tests require SVE hardware support to run so will skip when they
can't detect it.

Reviewed by:    markj
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D43311
0ddaa4c86d68e8dacee8a78877e5742d53c122b3 Andrew Turner 2026-04-08 14:17:55

test/sys/arch: Fix arch without test/sys/arch/${MACHINE_ARCH}

Fixes:          https://cgit.freebsd.org/src/commit/?id=0ddaa4c86d68 ("arm64: Add arm64 SVE tests")
Sponsored by:   The FreeBSD Foundation
8672683ec80a6767b1aa12dedeed94d20ec57911 Li-Wen Hsu 2026-04-09 15:49:56
installer: Add download.freebsd.org to mirror list
download.freebsd.org is backed by project mirrors and a CDN, which
should benefit most users.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    delphij (releng)
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D54849
45079cdf8b517adf803db7dc7aa85e5728cfeb2f Li-Wen Hsu 2026-04-09 04:06:19
gptzfsboot: boot prompt should emit new line on input
In case the user did input, we should put newline
on screen to avoid possible error messages to get
mixed with user input.
c1c97f18b5b9110b3222816ed9129a882b6b5931 Toomas Soome 2026-04-09 10:48:15
loader.efi: panic() should show stack trace
Because panic() does provide mechanism to have architecture specific
panic call, we can instruct it to print out stack trace too
(in hope we actually can print). While there, also implement simple
check to detect loop in trace.

illumos issue: https://www.illumos.org/issues/17887
aacf448007f7adbcdb528556cabcd120c9e8cb75 Toomas Soome 2026-04-09 11:36:12
Allow passing xtras to safe_set
This allows safe_set to be leveraged in other contexts
where additional chars like '*' or '!' or even '\[\]' need to
be preserved in the result.
de9fe28ab8476ca25a63066503f5fb40dcdd5719 Simon J. Gerraty 2026-04-10 16:08:02
Pass severity to vectx_open() rather than vectx_close()
file_loadraw() can have a need to load unverified files
like "dtrace_dof".  Allow severity_guess() to look at the filename
but if it returns less than VE_MUST check that the type is not
one we insist on verifying.

In vectx_open if severity < VE_MUST we can allow it to be unverified.
If passed VE_GUESS we call severity_guess().
Regardless, we record severity in ctx so it is available to vectx_close().

Sponsored by: Hewlett Packard Enterprise Development LP

Reviewed by:    khng
Differential Revision:  https://reviews.freebsd.org/D56297
35bbdfad28626255c63360d98c45e41f2c692ef0 Simon J. Gerraty 2026-04-10 17:43:15
hccontrol: Support generic Bluetooth LE AdvData
hccontrol LE_Set_Advertising_Data does not currently allow construction
of manufacturer-specific type 0xFF AdvData.  Fixed by a new data-entry
option -b "b1,b2,b3,...,bn" where b's are 8-bit byte strings (octets).

Signed-off-by: F. Duncanh <fduncanh@gmail.com>
Reviewed by: takawata, pouria
Pull Request: https://github.com/freebsd/freebsd-src/pull/2082
2c6feab253297c21d00601ceef818fcbe4da70d8 F. Duncanh 2026-03-18 05:14:26
loader.efi.8/efibootmgr.8: Don't use contradicting term 'EFI BIOS'
Both (U)EFI and BIOS are completely different things, be precise and don't use
them together.

Reviewed by:    imp
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56329
4f684e929de1275b1099b17b2a2cff0d3f4af223 Michael Osipov 2026-04-09 11:39:41
mfiutil(4)/mrsasutil(4): "show drives" truncates information
Improve mfi_pd_inq_string() by
* Reusing buffer sizes from cam/cam.h according to SCSI specification + NULL byte
* Don't truncate vendor-specific information by escaping into a too small buffer
* Use cam_strvis() from libcam instead of old, outdated local copy
* Recaculate size of inq_string based on the reused buffer sizes and
  format statements

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294354
Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56328
850eb149e7ab0733fcf9469a607dca223ff467ad Michael Osipov 2026-04-09 09:19:36
daemon(8): Add "--output-file -o" to list of options enabling supervision mode
This is the small internal doc fix from https://reviews.freebsd.org/D46313

Reviewed by:    michaelo
Approved by:    (blanket; comment fix)
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55325
e9a69948a8837601d71e556550a272ca85c03e48 Andre Albsmeier 2026-04-12 16:10:59
iwmbtfw(8): Identify device type based on HCI quieries result
rather than on VID/PID. Later is not reliable for some types.
VID/PID identification can be restored by specifying of -p option.

Tested by:      arrowd, wulf
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290639
MFC after:      1 week
84488787f42bc62b428da37793ac45d1411f2b74 Vladimir Kondratyev 2026-04-12 18:09:22
diskinfo: Align and alphabetize options
MFC after:    3 days
afe57c12e97d5c8773d829c2914f35462a7cdd0c Alexander Ziaee 2026-04-13 01:59:33
rc.d/NETWORKING: remove the NETWORK alias
NETWORKING is the documented placeholder, while
/etc/rc.d/NETWORKING still provides the legacy alias
NETWORK.

The NETWORKING script was originally introduced to avoid
conflicts with NetBSD's lowercase network script on
case-insensitive file systems.  The NETWORK alias was
retained for compatibility with older scripts.

Following the discussion in PR 293652, remove the legacy
NETWORK alias from 16-CURRENT.  Keeping both names adds
more confusion than value now that NETWORKING is the
documented placeholder and current base system and ports
tree uses are already clean.

Add an UPDATING entry to note that local RC scripts using
REQUIRE: NETWORK should be migrated to REQUIRE: NETWORKING.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293652
Reviewed by:    michaelo, jlduran
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D56300
47a9af4b39bf174efed7f6d43644d4b0bc0c9886 Aotian Cao 2026-04-08 07:58:00
periodic/daily: show verbose zpool status when errors are detected
When zpool status -x reports errors, the output only shows basic error
counts without identifying which files are affected. Replace the
unconditional echo of the brief status with verbose output (zpool
status -v) in the error path so administrators can see exactly which
files have been damaged.

The healthy/no-pools path still shows the brief status.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223243
Signed-off-by: Po Han Chen <hypery11@gmail.com>
Reviewed by: imp, jlduran, asomers
Pull Request: https://github.com/freebsd/freebsd-src/pull/2089
92378e0405a8caf77372cd1028970b1f7c7cf364 Po Han Chen 2026-03-23 05:00:29
pmcstat: print raw TSC in decoded log output
Extend pmcstat -R output to include the raw TSC for each decoded record
and print tsc_freq from the initialize record so TSC deltas can be
converted to elapsed time.

Update the pmcstat documentation to describe the decoded output and the
architecture-specific TSC behavior.

Sponsored by: AMD
Signed-off-by: Andre Silva <andasilv@amd.com>
Reviewed by: imp, mhorne, Ali Mashtizadeh
Pull Request: https://github.com/freebsd/freebsd-src/pull/2085
ee12645ec737eb940554769af2c275524ea20d37 Andre Silva 2026-03-31 20:28:39
virtual_oss: Introduce virtual_oss_default_control_device rc variable
The -t option gives the user the ability to create a control device for
a given virtual_oss(8) instance, so that the instance's configuration
can be manipulated during runtime with virtual_oss_cmd(8). As is
expected, the control device's name is not known, since it is specified
by the user.

This patch introduces a virtual_oss_default_control_device rc variable,
which defaults to "vdsp.ctl". The goal of this is that third-party
programs and scripts can access the control device of the default
virtual_oss(8) configuration without guessing. This is especially useful
for sbin/devd/snd.conf which deals with hot-swapping sound devices using
virtual_oss(8).

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55670
70e27ecba51892cbe4cc94bbf785c6dd261dfd57 Christos Margiolis 2026-04-16 14:51:02
stand/libofw: make OF_hasprop() part of the library
Currently it is only needed by powerpc ofwfdt.c, and defined statically
there. Make it available as part of libofw, mirroring what we have in
the kernel.

Two small tweaks are made to the implementation:
  1. Return type is changed to bool
  2. Return 'true' when OF_getproplen() == 0. This matches the expected
     semantics of the kernel version, described in OF_hasprop(9).

Reviewed by:    manu, imp, adrian
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56429
48a05f833c7d0c089d37522cc234039ec823edf4 Mitchell Horne 2026-04-16 17:48:46
rtadvd(8): Set route info lifetime to 0 during shutdown
RFC 4191 section 3.1: if the received route's lifetime
is zero, the route is removed from the Routing Table if present.
Also, do not tell route information option is unknown.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263982
Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D55448
4dc6522d57c748cdaddd8327909574360a3de517 Pouria Mousavizadeh Tehrani 2026-04-01 13:29:15
pfctl: fix how source and state limiters are wired into rbtrees
i messed up when we added support for names on these things. the
id and names are each supposed to be unique, which is checked by
putting the one limiter into an rb tree based on their id and another
based on their name. unfortunately i used the same RBT_ENTRY fields
for both trees, which meant using both trees on the same limiter
corrupted the topology, which goes badly when you want to use
multiple limiters.

found by, tested, and ok dgl@ (who is not me, this is not a typo)
ok jmatthew@

Obtained from:  OpenBSD, dlg <dlg@openbsd.org>, f951d642cc
Sponsored by:   Rubicon Communications, LLC ("Netgate")
6f8ea66cbcf2e2e5bc82e8f0c2e0038a3c7d6a9e Kristof Provost 2026-04-16 09:16:29
loader.efi: Defer efi_translate(e_entry) until after bi_load
bi_load itself loads various things into the staging area which can
cause it to grow, which may result in the staging area moving, including
the kernel. Therefore the address we get for the kernel entry point
prior to bi_load may not be correct afterwards when we actually call it,
and so we must defer the translation.

On arm and riscv (but not arm64, which predates both of them in
loader.efi and did not gain a copy of arm's added printf when arm
support was added) we also printf this entry point to the console, which
we can no longer do since bi_load calls ExitBootServices, so remove this
printf that, in practice, seems to not be so useful, given nobody ever
felt the need to add it to arm64. If anyone really feels this is an
important printf to have then bi_load will need to be split so we can
call printf after all the loading and potential reallocation of the
staging area, but before ExitBootServices is called.

We may also want to make this code more uniform and shared between the
three architectures here, since there isn't much architecture-specific
about this (and something like the RISC-V boot hart protocol could
easily be made an MD hook).

Reviewed by:    imp
Fixes:          https://cgit.freebsd.org/src/commit/?id=0cafabf97fae ("Add support for arm64 to loader.efi and boot1.efi")
Fixes:          https://cgit.freebsd.org/src/commit/?id=ea7796a9ae6b ("EFI: don't call printf after ExitBootServices, since it uses Boot Services")
Fixes:          https://cgit.freebsd.org/src/commit/?id=2192efc03bc4 ("RISC-V boot1.efi and loader.efi support")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56431
ab1d659e78e454995b7c2b4566e035269b215e48 Jessica Clarke 2026-04-17 14:20:12
boot1.chrp: Improve comment for the SLOF hack
Since this original comment was written, the actual issue in SLOF
was diagnosed and documented in commit 424089a0fc, which fixed it
for loader(8).  Update the comment in boot1 to be more informative
to future readers.

MFC after:      3 days
Reviewed by:    jhibbits, adrian
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56470
eb0279550d52962241b4178101cd7f7d732eb682 Lexi Winter 2026-04-17 16:56:33
ping6: treat setsockopt failures as fatal
ping6 needs IPV6_RECVPKTINFO and IPV6_RECVHOPLIMIT to process
incoming replies. When these options fail, replies are silently
dropped and ping6 appears to hang. Use err(3) instead of warn(3)
so the user gets a clear error and immediate exit.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Reviewed by:    pouria, jlduran, glebius
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56237
9a4a9f623bbaf991b3ba580593d47f2ee9f7b03b Christos Longros 2026-04-17 18:19:24
stand/common/load_elf: Do kernel module relocations for PPC
reloc_ptr() skips relocations for the kernel module, because on most
platforms the kernel is ET_EXEC and this is not required.  On PPC,
the kernel is ET_DYN and we need to relocate here, otherwise the
module metadata will not be loaded properly and the kernel module
will have an incorrect version, preventing module dependencies from
resolving.

This fixes loading kernel modules from loader.conf on powerpc.

Diagnosed by:   jrtc27
Reviewed by:    jrtc27, adrian
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56457
ba94d75749721fae999f756cb227638f9d4398a8 Lexi Winter 2026-04-18 12:07:10
service(8): Replace indentation in usage()
The -d option was indented with spaces instead of tabs, and this broke
formatting.

Before:

-d                Enable debugging of rc.d scripts
-j              Perform actions within the named jail

After:

-d              Enable debugging of rc.d scripts
-j              Perform actions within the named jail

MFC after:      1 week
554f5aa526266057672740e22af0a75cc32bddd5 Christos Margiolis 2026-04-19 10:40:31
pfctl: fix man page and error message for -S option
The `pfctl -S` flag was added to disable DNS resolution in
<https://reviews.freebsd.org/D50724> but documentation and error
messages refer to a `pfctl -N` flag for the same purpose. The `pfctl -N`
flag performs an unrelated function, so the docs and error messages need
to be changed. Caught this when revising documentation for the `-N`
flag.

Reviewed by:    kp
Signed-off-by:  Ross Williams <ross@ross-williams.net>
18de44e7b44209d94999523a93d83031e26a5719 Ross Williams 2026-04-17 15:20:18
rtld: fix processing of preloaded z_initfirst objects
After we found some preloaded z_initfirst object, we must process till
the end of the preload list still, not stopping on the first found
object.

Reported by:    des
Reviewed by:    des, markj, siderop1@netapp.com
Fixes:  https://cgit.freebsd.org/src/commit/?id=78aaab9f1cf359f3b7325e4369653f6b50593393
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56466
9b844b495e8e63439ffe523757ac7444a16317af Konstantin Belousov 2026-04-16 23:07:43
ifconfig: Fix segfault in geneve_status_nl
Initialize nla_geneve_link structure to zero to prevent
segfault when a TLV is not received by the netlink parser.

Reported by:    Seth Hoffert <seth.hoffert@gmail.com>
Fixes:          https://cgit.freebsd.org/src/commit/?id=688e289ee904 ("ifconfig: Add support for geneve (netlink)")
d95a73b4c7e314084f838c7b68ae9da8e4ba2982 Pouria Mousavizadeh Tehrani 2026-04-21 12:17:00
safe_set ignore leading white-space
Also treate ':' at the start of a line as for '#'
ie. a comment.
69cc351c4c911cfeda1851f3c18a4b61281708cb Simon J. Gerraty 2026-04-22 16:15:13
safe_set treat ':' and '#' differently
Treat '#' as a comment anywhere,
but ':' only at start of line.
566cc005812b72a4ba236764651dd8e82c94a166 Simon J. Gerraty 2026-04-22 16:37:35
rtlbtfw(8): Load firmware from filesystem with mmap()
rather than with read() to alleviate concerns about partial reads.
87ed6840a0a6320295f6abb43a987d20ae126cf7 Vladimir Kondratyev 2026-04-24 15:15:22
bsdinstall: fix root password prompt with backslashes
Use "read -r" to set the root password in "bsdinstall rootpass" to
prevent issues with passwords containing one or more backslash
characters.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294781
Discussed with: tuexen, crest
Approved by:    khorben
MFC after:      3 days
Event:          Wiesbaden Hackathon 202604
1566386b90d34dea7f30a0e6b511e178bd0d50b8 Lars Engels 2026-04-25 14:41:24
caroot: Clean up
* Get certdata.txt directly from the NSS Mercurial repository, rather
  than from the Mozilla Firefox repository which imports it from NSS at
  irregular intervals.

* Instead of always fetching the latest certdata.txt, fetch a specific
  version.  For this commit, we set this to the version that was last
  imported in May 2025.

* Add a refrence to the MPL to the generated files.

* Regenerate with latest OpenSSL.  This is purely cosmetic; mostly, the
  certificate names now contain less unnecessary whitespace and some
  elements are quoted.

MFC after:      1 week
Reviewed by:    michaelo, kevans
Differential Revision:  https://reviews.freebsd.org/D56620
ce33d6396aadb0613f1e74661bdbec571f836a60 Dag-Erling Smørgrav 2026-04-27 09:32:19
caroot: Regenerate
Regenerate using certificate data from NSS 3.123.1.

MFC after:      1 week
Reviewed by:    kevans
07b52233e8b74c5ac884b9c9a894f57fad8dbd00 Dag-Erling Smørgrav 2026-04-27 09:32:51
Commit group #59: mixer(8): Deprecate some unintuitive control values
mixer(8): Deprecate some unintuitive control values

This is a follow-up to cc7479d7dc9b ("mixer(8): Improve mute and recsrc
controls"). These deprecated values will be completely removed on
2026-06-15.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    0mp
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/21
a28bb575c89c8de62684419ece1ff5e070e4ce24 Christos Margiolis 2026-04-23 12:06:15

mixer(8) tests: Remove tests for deprecated control values

Fixes:          https://cgit.freebsd.org/src/commit/?id=a28bb575c89c ("mixer(8): Deprecate some unintuitive control values")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
54922e4ec8909829a7ca8d2158c2a514a06df094 Christos Margiolis 2026-04-27 22:59:38
bsdinstall: Add SPDX-License-Identifier tags
Reviewed by:  emaste
Sponsored by:   The FreeBSD Foundation
80c73c89dc6a156a119350d7c28c6db1f3b741df Tuukka Pasanen 2026-02-16 09:10:57
bsdinstall: Improve auto-partition message
Manually tuning ZFS for systems with <8GB ram hasn't been necessary at
least since the switch to OpenZFS. We have users reporting using 1GB RAM
with no manual tuning/issues. Further, the page this links to is a stale
wiki page, which is causing complaints. Remove this misleading note and
replace it with a similar message for UFS. While here, reword that note
to be a bit clearer.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287719
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D50971
5ed26c21e4ff1d478d4611abbf3dc14cc1b77244 Alexander Ziaee 2026-04-28 16:59:19
efibootmgr: Show attributes, category and optional data when verbose
Also rework a bit the way device path are displayed for consistency.

Signed-off-by:  stephane.rochoy@stormshield.eu
Reviewed by:    imp
Sponsored by:   Stormshield
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2167
76de40889eed130442b67e14249f96e2e8f88f48 Stéphane Rochoy 2026-04-24 07:03:31
cron: log when a crontab path is too long
Log via syslog when snprintf truncates the crontab path, instead of
silently skipping the entry.

Signed-off-by:  Christos Longros <chris.longros@gmail.com>
Reviewed by:    bcr, kevans
Differential Revision:  https://reviews.freebsd.org/D56235
91bfba010bcda665cc24a76af631cc85fcb0c688 Chris Longros 2026-04-29 04:06:29
Commit group #60: dhclient: Check for unexpected characters in some DHCP server options
dhclient: Check for unexpected characters in some DHCP server options

Some options are written directly to the lease file, which may be parsed
by subsequent dhclient invocations.  We must make sure that a malicious
server can't control the "medium" field of a lease definition, otherwise
they can achieve RCE by injecting one into the lease file, whereupon it
will be passed to dhclient-script, which passes it through eval.

Approved by:    so
Security:       FreeBSD-SA-26:12.dhclient
Security:       CVE-2026-42511
Reported by:    Joshua Rogers of AISLE Research Team (https://aisle.com/)
8008e4b88daf37015d16c4ac709b91804b586575 Mark Johnston 2026-04-27 20:03:09

dhclient: Improve server and filename validation

* Don't iterate over each string three times; once is enough.

* Reject control characters (anything below space) in addition to the
  double quote and backslash.

* If an unsafe character is encountered, discard the string instead of
  rejecting the entire lease.

* If backslashes are encountered in the file name option, convert them
  to forward slashes instead of rejecting the option.

* Tweak the warning messages a bit.  Looking through the rest of the
  code, it seems to me that notes generally end with a period while
  warnings generally don't.

Fixes:          https://cgit.freebsd.org/src/commit/?id=8008e4b88daf ("dhclient: Check for unexpected characters in some DHCP server options")
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294886
MFC after:      1 week
Reviewed by:    brooks, markj
Differential Revision:  https://reviews.freebsd.org/D56740
873a195ba63575e46686cfd6ea9670a0ca340fa0 Dag-Erling Smørgrav 2026-04-30 16:45:35
dhclient: Fix reallocation of dhclient script environments
When the number of DHCP options exceeds a threshold, script_set_env()
will reallocate the environment, stored as an array of pointers.  The
calculation of the array size failed to multiply by the pointer size,
resulting in a smaller than expected buffer which admits out-of-bounds
writes.

Approved by:    so
Security:       FreeBSD-SA-26:15.dhclient
Security:       CVE-2026-42511
Reported by:    Joshua Rogers of AISLE Research Team (https://aisle.com/)
5d8e32aad2a8316b0aab8a93a677a63e4c3df422 Mark Johnston 2026-04-27 20:56:21
md5: Encode non-printable filenames
Encode filenames in the VIS_CSTYLE | VIS_OCTAL style regardless of
output mode.  When reading filenames from a checksum file, attempt to
decode them, and use the decoded name unless the decoded name does not
exist but the undecoded one does.

This breaks compatibility with GNU coreutils, which unfortunately uses
a non-reversible encoding when outputting filenames containing
non-printable characters.

While here, drop a sentence about preimage attacks against MD5 and SHA1
from the manual page, as I no longer trust it to be true.

MFC after:      1 week
Reviewed by:    bcr, markj
Differential Revision:  https://reviews.freebsd.org/D56615
70fde0ed6bbbb1f84c440190ba1e5435f8c90e13 Dag-Erling Smørgrav 2026-04-29 18:41:05
bhyve: allow read/write to full CRB buffer
For some reason, we've incorrectly calculated the size of the CRB data buffer
register. There's no need to divide the CRB data buffer size by 4. We should
allow access to the whole buffer instead.

Reviewed by:            markj
MFC after:              1 week
Sponsored by:           Beckhoff Automation GmbH & Co. KG
Pull Request:           https://github.com/freebsd/freebsd-src/pull/2169
75909086a45da3c5aeaff8152728111cf798c6bc Corvin Köhne 2026-04-02 06:36:40
etcupdate: fix arguments order of diff command
Due to misplacement of the second -L argument of diff command, it is
treated by getopt_long as an error.

Also add -l option for a diff command that alters the way it shows
differences. Instead of printing full diff, it reports changed file
the same way as added/removed files are reported.

Reviewed by:    imp
Obtained from:  Yandex LLC
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56708
6d65c91b9a4743bbffc3508bf754e68b65bbd494 Boris Lytochkin 2026-04-30 11:31:34
dmesg(8): Add -t and -f options for converting timestamps
Kernel timestamps are relative to kern.boottime.
With -t, kern.boottime is added and converted to either
a default format or the one specified using the -f option.

Signed-off-by:  Andre Albsmeier <mail@ghub.e4m.org>
Reviewed by:    kib, pouria
Discussed with: imp
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/1985
a7233085558db6d2ee0251891a85a7e74dddcb7e Andre Albsmeier 2026-01-23 11:10:18
devfs: add bpf example
Add an example for allowing members of the network group to read from
bpf devices. In particular, this allows members of the network group
to monitor traffic without running with root privileges.

Reviewed by:            markj, glebius
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D56742
cf678e30ca015c93edc8a43aeff58cce3249c3af Michael Tuexen 2026-04-30 20:35:07
route(8): Add route get for multipath routes with -o flag
Get the next hops of the specified route.
route.8 manual will be updated when other actions for
this option are implemented.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D56191
39b19ce77bc0f1b9a6a685fff22f52932dcb7cf3 Pouria Mousavizadeh Tehrani 2026-04-19 11:07:22
Commit group #61: ping: use CLOCK_REALTIME for ICMP Originate Timestamp
ping: use CLOCK_REALTIME for ICMP Originate Timestamp

RFC 792 defines the ICMP Originate Timestamp field as milliseconds
since midnight UTC.  However, ping(8) currently derives this value
from CLOCK_MONOTONIC, which represents time since an unspecified
starting point and is not related to UTC.

The issue was introduced by commit 1ad76f1b6047, which replaced
gettimeofday(2) with clock_gettime(CLOCK_MONOTONIC) for timekeeping
in ping(8).

Fix this by using CLOCK_REALTIME when generating the ICMP originate
timestamp.

Before:

$ ping -Mt -c1 127.0.0.1
ICMP_TSTAMP
PING 127.0.0.1 (127.0.0.1): 56 data bytes
<...> time=0.061 ms tso=16:50:31 tsr=17:38:28 tst=17:38:28

(note the tso is off)

After:

$ ping -Mt -c1 127.0.0.1
ICMP_TSTAMP
PING 127.0.0.1 (127.0.0.1): 56 data bytes
<...> time=0.038 ms tso=17:42:09 tsr=17:42:09 tst=17:42:09

Reviewed by:            asomers, glebius
Fixes:                  https://cgit.freebsd.org/src/commit/?id=1ad76f1b6047
MFC after:              1 month
Differential Revision:  https://reviews.freebsd.org/D56759
069681afd58a711eb7407be4a9c9a05f787d250f Maxim Konovalov 2026-05-01 17:45:27

tests/ping: Fix date(1) invocations

Fixes:  https://cgit.freebsd.org/src/commit/?id=069681afd58a ("ping: use CLOCK_REALTIME for ICMP Originate Timestamp")
667dd9eafa4d5352efdfcdc1a9e228c23fbc60f5 Mark Johnston 2026-05-03 19:05:55
bsdinstall: Always use pkg.FreeBSD.org
The FreeBSD-base bits are accessible via pkg.FreeBSD.org, even for
releases, so there is no need to point at pkgbase.FreeBSD.org.

MFC after:      3 days
89b97931d6d415d7a2504d8ea2c99beafd77cf24 Colin Percival 2026-05-05 02:43:59
init: allow to specify a custom path for rc(8)
This is useful for testing alternative service managers
without modifying /etc/rc

MFC After:      1 weeks
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D56828
9f2ad7c09709e01ff6b856df0315e91ddc20df32 Baptiste Daroussin 2026-05-05 12:00:41
certctl: Unstickify (un)trusted certificates
Ever since certctl was rewritten in C, the rehash command has reingested
TRUSTDESTDIR / UNTRUSTDESTDIR in addition to TRUSTPATH / UNTRUSTPATH.
This seemed like a good idea at the time but was, in retrospect, a
mistake, as it means a (un)trusted certificate remains (un)trusted
forever (or at least until it expires) even if it is removed from
(UN)TRUSTPATH.  Among other issues, it causes ports QA to fail for any
port that either installs certificates or depends on a port that does.

Although this behavior was undocumented, the change may surprise users
who have added certificates manually, so update the manual page to point
it out and add prominent warnings to the trust and untrust commands.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290078
MFC after:      1 week
Reviewed by:    kevans, bcr
Differential Revision:  https://reviews.freebsd.org/D56617
2fef18ff594328a771b6aa659e8ffa5a7e076540 Dag-Erling Smørgrav 2026-05-05 22:30:52
devmatch: read linker.hints from all module paths
Previously, devmatch would stop at the first linker.hints file
found in kern.module_path. This meant modules installed in
/boot/modules/ were invisible to devmatch if /boot/kernel/
contained a linker.hints file (which it always does).

Merge hints from all directories in kern.module_path.
This allows third-party or out-of-tree kernel modules in
/boot/modules/ to be auto-loaded by devmatch just like
built-in modules.

Reviewed by:            imp
Differential Revivion:  https://reviews.freebsd.org/D56847
748402ebf2d7a08b13d0b21694afdaad55cfa9cd Baptiste Daroussin 2026-05-06 13:11:16
bhyve/virtio-scsi: Don't invoke iov_to_buf() in an assert() expression
If anyone would build bhyve with -DNDEBUG, any code in the expression
in assert() won't be executed.  Instead put the return value in a
temporary variable to assert that it has the expected value.

Reviewed by: emaste, markj (earlier version)
Fixes: https://cgit.freebsd.org/src/commit/?id=2a514d377b37 ("bhyve/virtio-scsi: Preallocate all I/O requests")
Differential Revision: https://reviews.freebsd.org/D55803
bc9f667eb11d9b47541f834faefbc6aac077cee2 Hans Rosenfeld 2026-03-10 19:14:10
rtadvd(8): Honor pltime/vltime in interface declarations
Currently rtadvd ignores interface pltime/vltime specifications
unless the (static) address range is also included in the config file.
This extends the validity of a pltime and/or vltime stanza in
the config file for an interface to delegated addresses from
an upstream provider.

Signed-off-by:  tickerguy <karl@denninger.net>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288426
Reviewed by:    pouria
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1863
103f9883d1ed7431c432caa6ab9c61cd4d0831d0 tickerguy 2025-09-29 16:05:29
nuageinit: only parse user_data as yaml when necessary
This fixes a regression introduced in cae280931c9e which prevents
user_data as a shell script to be used

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295062
Reported by:    Ross McKelvie <ross@exitzero.uk>
MFC After:      1 day
c316ec259011e9e22e40eaa72d834f3bfac95c28 Baptiste Daroussin 2026-05-06 20:14:17
nuageninit: modify the test to show the issue fixed inc316ec259011
Ensure the script used is invalid when parsed by libyaml which
highlight the issue revealed in PR295062

while at here validate the mode of the file is properly changed

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295062
MFC After:      1 day
2a86992ab5019b4997ccadf7427011ba44e33c97 Baptiste Daroussin 2026-05-06 20:45:50
jail: avoid leaking jail config fds to exec.* hooks
The jail(8) command must not leave parsed configuration files open
since the file descriptors will be leaked to child processes
including the untrusted exec.start or exec.stop hooks.

While fopen() doesn't provide direct access to O_CLOEXEC, it does
provide access to FD_CLOEXEC via "e" in the mode string which
provides the desired defense in depth against leaking file descriptors
into exec.* hooks since those always execve() into a shell.

Jail configuration is potentially sensitive and some hooks execute from
within the jail context, leaving some opening for the jail to exfiltrate
information about the host environment.

(Commit message wordsmithed by kevans)

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295052
Reviewed by:    kevans
MFC after:      3 days
276d9b88a9e6fd6fd90e57c36444756ad297d2ab Jan Bramkamp 2026-05-06 23:28:53
jail: open the fstab files with fopen("re")
This protects against accidentally leaking them past fork()+exec()
in future refactorings.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295052
Reviewed by:    kevans
58811b0ae096c134af372bcf475aea1d8d0e3c08 Jan Bramkamp 2026-05-06 23:28:53
devd: Use PF_LOCAL instead of PF_INET
Avoid dependency on INET (IPv4) by using PF_LOCAL,
allowing media check to work on systems without INET support.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295045
Reviewed by:    kevans
MFC after:      1 week
b2e4da0b53ad082768b8f6f83766e030fd00d02a Marek Zarychta 2026-05-07 01:28:08
pfctl: relax interface name requirement
The FreeBSD network stack, for better or worse, does not impose any
requirements on interface names. As such it's valid for an interface
name to start with a number (or indeed, be something like '⭐').

Allow this in pfctl, and add a test case for the specific case of
interface names starting with a number.

Note that we don't support UTF-8 names fully, so those may still fail.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295064
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
4e7c1ff95a5187faee524055f22c4cf4134d1147 Kristof Provost 2026-05-07 09:58:17
fsck_msdosfs: fix FAT header correction not persisting in cache mode
When fsck_msdosfs runs with FAT32 cache mode (used for large
filesystems that cannot be mmap'd), a detected FAT header correction
was written into the in-memory buffer but the corresponding cache
entry (fat32_cache_allentries[0]) was never marked dirty.  As a
result, fat_flush_fat32_cache_entry() skipped it, the corrected
bytes were never written to disk, and copyfat() propagated the
uncorrected on-disk data to all backup FAT copies.  Every subsequent
fsck run would repeat the same "FAT starts with odd byte sequence /
FIXED" cycle indefinitely.

Fix by marking fat32_cache_allentries[0].dirty = true after applying
the in-memory correction, ensuring the chunk is flushed before
copyfat() runs.

Obtained from:  https://android-review.googlesource.com/c/platform/external/fsck_msdos/+/4047981
MFC after:      3 days
10e342c1ec78af5a0b97739c806b16a632118fa5 Lianwei Wang 2026-05-09 04:56:12
BSD.root.dist: Correct tag for /etc/sysctl.kld.d
This is only used by rc.subr and belongs in rc, not runtime.

Fixes:          https://cgit.freebsd.org/src/commit/?id=fa6d67cd16b5 ("BSD.root.dist: Add package tag for all directories")
MFC after:      3 days
Reviewed by:    ivy
Differential Revision:  https://reviews.freebsd.org/D56900
44338ccd12685621c4b1c57e692a4f27f5a655d3 Dag-Erling Smørgrav 2026-05-09 09:04:08
stand/i386: quiet executable stack warning
Reviewed by:  imp, kib
Differential Revision:  https://reviews.freebsd.org/D56908
0f6c880fcecdbb9cc84ed03ee85a518dd3c66f12 Ryan Libby 2026-05-10 04:25:43
Commit group #62: nuageinit
nuageinit: add decode_base64 tests
68fd0feacb8ce5da9c47deea5505b3241b2ba6ec Baptiste Daroussin 2026-05-07 17:17:56

nuageinit: add addsudo tests
a49b3b10aae2db1f4a4ecf310fdedc80eb6bb7e2 Baptiste Daroussin 2026-05-10 15:54:47

nuageinit: add adddoas tests
0f92bee2b3e08ffa34720a2eeffbce01af3f19f9 Baptiste Daroussin 2026-05-10 15:54:48

nuageinit: add update_sshd_config tests
8b03193289e87fd243acc50c5128c80459792667 Baptiste Daroussin 2026-05-10 15:54:48

nuageinit: fix dirname('/') returning nil instead of '/'
b813e46e153327b66db4791ec0003b7e7cc51214 Baptiste Daroussin 2026-06-04 16:44:31

nuageinit: add dirname edge case tests
5f58d9207469dcd2d3fa24db7f5276a681df91e5 Baptiste Daroussin 2026-06-04 17:24:45

nuageinit: add config2_network DNS services test
9459465308ff17a11cad1c3d1987951055f114d6 Baptiste Daroussin 2026-06-04 17:48:32

nuageinit: add nil/empty guard to decode_base64()

Return an empty string when input is nil or zero-length instead
of processing it through the decoding loop.
57807f389a9e42774d944e256b499f5fd82ff855 Baptiste Daroussin 2026-06-04 18:09:06

nuageinit: add hostname validation (RFC 952/1123) to sethostname()

Validate hostnames before writing them:
- Reject empty hostnames
- Reject hostnames longer than 253 characters
- Reject hostnames with invalid characters
- Reject hostnames starting or ending with dot/hyphen
- Reject labels longer than 63 characters
- Reject labels starting or ending with hyphen

Expand the sethostname test to cover all rejection cases.
Update nuage.sh sethostname_body to ignore stderr (warnings).
46d1758aa7a2af37a356a93812b492a406c6ffd4 Baptiste Daroussin 2026-06-04 18:26:49

nuageinit: remove dead checkgroup(), inline check in purge_group()

Call getgroups() once instead of N times per call. Inline the
membership check directly, removing the now-unused checkgroup()
helper function.
852504a5fa5eb6b4dea98bd7abdb89f1c7bab2b0 Baptiste Daroussin 2026-06-04 18:32:48

nuageinit: fix non-standard f:close(cmd) and remove dead precmd

- f:close(cmd) -> f:close() in adduser() and exec_change_password():
  the 'cmd' argument is not standard Lua and is silently ignored.
- Remove dead 'precmd' variable in adduser().
fdff89256fd921e40f2fa532895315b1dab6f5e6 Baptiste Daroussin 2026-06-04 18:59:30

nuageinit: fix TOCTOU in addsshkey, adddoas, addsudo

Replace check-then-create patterns with direct creation:

- addsshkey: check what exists before creation, use mkdir_p() for
  .ssh directory, handle errors with warnmsg() instead of assert().
  Apply chmod/chown only on newly created files/directories.

- adddoas: same pattern for doas.conf and the etc directory.

- addsudo: same pattern for the sudoers file and sudoers.d directory.

All three functions now use warnmsg() for error handling instead of
returning nil,err or using assert().
cf5722ed60cf271e516927684c90464debb37496 Baptiste Daroussin 2026-06-04 19:06:35

nuageinit: fix update_sshd_config crash when file does not exist

Previously update_sshd_config() would assert-fail if sshd_config did
not exist. Now it creates a new file with the given key/value.

Also replace the fragile simultaneous r+ + temp file approach with
a cleaner read-then-write pattern: read all lines into memory, modify
as needed, then write to a temp file and rename. All assert() calls
replaced with proper error handling via warnmsg().

Add test case for missing file creation.
0ba9b7b7f815b57f1c121b0f78eaee02d2cdd414 Baptiste Daroussin 2026-06-04 19:10:37

nuageinit: refactor goto abuse in chpasswd()

Replace goto next/list pattern with proper elseif/else control
structure. The goto-based flow was fragile and hard to follow;
the elseif chain makes the validation logic explicit and linear.
ea0932d71aa7a2d25b178f1593bfad194d8c7929 Baptiste Daroussin 2026-06-04 20:02:58

nuageinit: complete SSH support with ssh_deletekeys and disable_root

Add missing SSH cloud-config options from cloud-init spec:

- ssh_deletekeys: remove existing SSH host keys on first boot so
  new ones are generated automatically by sshd(8).
  Implemented as delete_ssh_host_keys() in nuage.lua using lfs.dir()
  with a directory existence guard via lfs.attributes().

- disable_root: set PermitRootLogin to 'no' (or a custom value via
  disable_root_opts) in /etc/ssh/sshd_config.

- disable_root_opts: optional string or array to override the
  PermitRootLogin value used when disable_root is true. Only the
  first array element is used.
22c1f5d0ec215e36dd4448b9128b856b5441d21c Baptiste Daroussin 2026-06-04 20:17:03

nuageinit: use single-quote shell escaping for hostname in rc.conf.d

The hostname value was written inside double quotes in
/etc/rc.conf.d/hostname. POSIX shell performs command substitution
inside double quotes, so a hostname containing $() or backticks would
be executed when the file is sourced (e.g., by rc(8)).

Switch to using the existing shell_escape() helper, which wraps values
in single quotes. In POSIX shell, single-quoted strings are completely
literal — no expansion or substitution of any kind is performed.

While the hostname is already validated to contain only
[a-zA-Z0-9.-], this change provides defense-in-depth so the output
format is safe regardless of future validation changes.

Reported by:    Yazdan Soltani <yazdan.soltani@gmail.com>
da3890fdccfa7d540ea746182248299b81f95345 Baptiste Daroussin 2026-06-09 14:04:18

nuageinit: fix shell command injection in multiple rc.conf.d writes
0211c8722ff2ac9367565e526e62837745bb2cce Baptiste Daroussin 2026-06-09 14:16:44

nuageinit: fix shell injection in power_state_change delay and add test
09d068e52722dee0ed65eb88c5ea5bff4bb2ba06 Baptiste Daroussin 2026-06-09 14:19:56

nuageinit: validate set-name to prevent shell injection in variable names

Shell variable names cannot be safely quoted with shell_escape() —
only alphanumeric characters are valid. Add validation that set-name
only matches [a-zA-Z0-9]+; invalid values are rejected with a
warning and the rename is skipped entirely.
13fb6dbc738f4ba30e78a8fb21efa1382c520d33 Baptiste Daroussin 2026-06-09 14:24:56
nuageinit: fix command injection and related issues
- Add shell_escape() helper to safely escape shell arguments
- Apply shell_escape to all user-controlled values in shell commands:
  adduser (usershow, useradd, lock, primary_group, groups)
  addgroup (groupshow, groupadd, members)
  exec_change_password (usermod)
  settimezone (tzsetup root and timezone)
  install_package (pkg package names)
- Escape double quotes in hostname when writing rc.conf.d/hostname
- Add missing 'local' declaration for resolvconf_command in nameservers()
- Escape interface name in resolvconf -a command
- Change open_resolvconf_conf() from 'w' to 'a' mode to prevent
  data loss when nameservers() is called multiple times
- Clean up stale resolvconf.conf at the start of each boot
  (skip on postnet to preserve config written by first call)

MFC After: 1 day
8b70a203be10411c560ed303ab25713d70b316e9 Baptiste Daroussin 2026-05-07 18:22:14
bsdinstall: do pkgbase installations with the "script" command
"bsdinstall script" will now do a pkgbase installation by default.  The
system components to install can be specified in the COMPONENTS
variable, and have the same names as those used in the interactive
installer.  bsdinstall will still do a legacy distset installation if
DISTRIBUTIONS is defined in the installerconfig file.

MFC:            1 week
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290375
Sponsored by:   ConnectWise
Reviewed by:    ziaee, ivy, jduran
Differential Revision: https://reviews.freebsd.org/D56717
dc14ae4217a0babb1240f813b642edc2d7b955a6 Alan Somers 2026-04-28 17:27:17
hastd: Include param.h instead of relying on pollution in hooks.c
This is needed at least for MAX() and PATH_MAX.

MFC after:      1 week
fae5815a1d7ef6ef07a15231ca695cba0f848e18 Mark Johnston 2026-05-12 17:46:34
edquota: Include param.h
Required for MAXPATHLEN and MAXLOGNAME.

MFC after:      1 week
ee2d1a1a5a1877f8ce7b9eee94479ec702880bd7 Mark Johnston 2026-05-12 17:46:40
reboot: Include limits.h for PATH_MAX
MFC after:    1 week
9461071d5cd901c968dcd7f4a114905995f90d66 Mark Johnston 2026-05-12 17:46:45
fsck_ffs: Avoid relying on param.h pollution from libufs.h
- gjournal.c needs param.h to get a definition of isclr().
- fsck.h needs signal.h for sig_atomic_t.

Sort includes while here.

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56858
3cd3900b690d8296094921cec844da3f72d30cbb Mark Johnston 2026-05-12 17:47:11
ipfw: treat ipv6 address with zero mask as 'any'
Make the behaviour similar for both IPv4 and IPv6. Also add
the corresponding tests.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294733
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56618
2872268c7f6d473aae9b02ebb5d2c24fc2cff9b1 Andrey V. Elsukov 2026-05-17 10:12:20
limits: Further RLIMIT_VMM cleanup
Teach limits(1), sh(1), and setclassresources(3) about RLIMIT_VMM.

Fixes:          https://cgit.freebsd.org/src/commit/?id=1092ec8b3375 ("kern: Introduce RLIMIT_VMM")
Reviewed by:    bnovkov
Differential Revision:  https://reviews.freebsd.org/D57031
363ea40c765424b3cbd9b96790235af030fcc8ff Dag-Erling Smørgrav 2026-05-17 16:23:50
fwget: update realtek and intel pci entries
For Realtek we only add new entries.

For Intel the old way of extracting IDs from the driver no longer
works.  The new list is shortened as we drop more specific entries
which were already covered by wildcard entries.  The new lists are
also sorted within the groups.
There are 4 entries the new driver no longer carries but are still
present in older versions, so we keep them manually.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
ca67cfa5237f7ac537ca8611054b5af2098e2d86 Bjoern A. Zeeb 2026-05-17 23:10:15
freebsd-update: Skip /etc/ssl/cert.pem
We already run `certctl rehash` at the end, there is no point in asking
users upgrading from 15.0 to 15.1 to manually merge the trust store.

MFC after:      3 days
Reviewed by:    cperciva
Differential Revision:  https://reviews.freebsd.org/D57028
2509ddee9bdb2240ba2f622e3a55a98ebc2aa4ae Dag-Erling Smørgrav 2026-05-18 16:22:04
Add test cases for safe_eval.sh
safe_set is the routine that does all the work.

In safe_set; if we replace one=`cmd arg` or two=$(cmd arg) add quotes
around the result eg. one="_cmd arg_"
Also lines containing `` or $() are too likely to result in syntax
errors, so just delete them.

Differential Revision:  https://reviews.freebsd.org/D56795
701d7be6e4a9a145700fdee5c038470b355a0e05 Simon J. Gerraty 2026-05-18 17:51:18
bsdinstall: Avoid invoking eval on the wlan SSID list
The wlanconfig utility is not careful about handling untrusted network
names, which can contain shell metacharacters.  Factor network selection
into a subroutine and use the `set -- "$@"` trick to build up a list of
positional parameters for bsddialog without evaluating them.

Approved by:    so
Security:       FreeBSD-SA-26:23.bsdinstall
Security:       CVE-2026-45255
Reported by:    Austin Ralls
Reviewed by:    dteske, des, asiciliano
Differential Revision:  https://reviews.freebsd.org/D56973
0f15f5359041ac50090606082a9c46d913ce7d0f Mark Johnston 2026-05-12 14:13:56
bsdconfig: Make sure that SSID names are properly escaped
The f_menu_wpa_scan_results() function returns a list of networks
discovered by a scan.  The untrusted network names are evaluated in
f_dialog_menu_wireless_edit.  The quoting applied in
f_menu_wpa_scan_results() protects against evaluation of something like
"$(whoami)" but one can add single quotes to defeat that.

Pass the SSID names through f_shell_escape to work around this.  Escape
single quotes in f_dialog_wireless_edit() and f_menu_wireless_configs()
too for consistency.

I note that this module doesn't seem to actually work, see e.g.,
bugzilla PR 229883.

Approved by:    so
Security:       FreeBSD-SA-26:23.bsdinstall
Security:       CVE-2026-45255
Reported by:    Austin Ralls
Reviewed by:    dteske, des
Differential Revision:  https://reviews.freebsd.org/D56974
2afb4c979f2d1befc3e259a0a7359a8e31a48e55 Mark Johnston 2026-05-12 14:16:46
Commit group #63: route(8)
route(8): Show metric value in get route

Reviewed by:    glebius
Differential Revision: https://reviews.freebsd.org/D56325
6dd429aeabecd63ece3c567b73472e2c75991afc Pouria Mousavizadeh Tehrani 2026-05-03 11:55:25

route(8): Show metric value in monitor route

Reviewed by:    glebius
Differential Revision: https://reviews.freebsd.org/D56326
f15b8a8f1de1c1d879afe9296eb3d998c64469c6 Pouria Mousavizadeh Tehrani 2026-05-04 17:59:15

route(8): Add metric argument

Add support for metric in route command.

Differential Revision: https://reviews.freebsd.org/D56335
2e2d402d061dc0d091308c477ab800b3eda007ad Pouria Mousavizadeh Tehrani 2026-05-02 21:22:17
ping6: convert receive loop from pselect(2) to ppoll(2)
pselect(2) might overflow if the desciptor number is above
FD_SETSIZE and silently corrupt the stack. Switch to ppoll(2) so
the receive socket fd is no longer constrained by FD_SETSIZE.

Reported by:    Joshua Rogers of AISLE Research Team
Reviewed by:    markj
MFC after:      7 days
Differential Revision:  https://reviews.freebsd.org/D56721
1d0410fb349fded5a79db3c6e6d993eb9efcc10c Mariusz Zaborski 2026-05-21 06:08:46
ipfw: fix parsing error in nat config port_range
Also fix the corresponding tests.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263240
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57010
6eba055fcf5b0bbfbebcac59f5982d13815001b0 Vyacheslav Terehov 2026-05-21 07:15:22
virtual_oss(8): Create loopback devices with GID_AUDIO
Make sure the user is part of the audio group to avoid unintended
snooping of loopback audio by unprivileged users.

While here, retire voss_dsp_perm, since we don't use the same value
everywhere now.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    emaste
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/26
5f904cb1b05c94453727abb606d6109fe504b10b Christos Margiolis 2026-05-06 16:19:27
rc: virtual_oss: Create a loopback device in the default configuration
The loopback device allows us to record desktop sound by reading from
it, or even use it as an input device, for example during a call.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    emaste
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/16
8532b4a436364d04d5c1feb7af5ecd4b5df71a9f Christos Margiolis 2026-04-17 10:03:30
sbin/devd/snd.conf: Add missing -n options to sysrc calls
Reviewed by:  christos
Fixes:          https://cgit.freebsd.org/src/commit/?id=70e27ecba518 (virtual_oss: Introduce virtual_oss_default_control_device rc variable)
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/36
bc2055b94576078453b372f537ef40bc4e3c18e4 Joseph Mingrone 2026-05-21 19:43:05
tftpd: Add missing bounds checks
In send_[rw]rq(), we were using strlcpy() to avoid overflowing our
packet buffer, then failing to check the result and blithely advancing
our pointer by the full length.

Luckily, this code is only ever used by tftp(1), not tftpd(8).

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57075
933893771344e1647eeda152016b938fdc30ccdc Dag-Erling Smørgrav 2026-05-22 17:57:31
tftpd: Simplify packet drop macro
The first argument is always the function name, for which we can simply
use __func__.  This leaves only the optional return value, so we can use
a single variadic macro instead of two nearly-identical copies.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57076
76c3387024b40c2e28ed2d1bb64b3a14371c3c0b Dag-Erling Smørgrav 2026-05-22 17:57:35
syslogd: fix memory leak in casper_ttymsg()
nvlist_take_string_array(9) takes ownership of the array and its
strings. casper_ttymsg() freed neither, leaking memory on every
F_CONSOLE and F_TTY message. On long-running systems with high
error-rate syslog traffic routed to /dev/console, syslogd.casper grew
to hundreds of MB.

Use nvlist_get_string_array(9) to borrow the array instead. Update
casper_wallmsg() similarly.

Approved by:    src (des)
Closes:         https://github.com/freebsd/freebsd-src/pull/2222
Fixes:          https://cgit.freebsd.org/src/commit/?id=61a29eca550b ("syslogd: Log messages using libcasper")
MFC after:      3 days
MFC to:         stable/15
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295488
Reported by:    Pat Maddox <pat@patmaddox.com>
Reviewed by:    markj
Tested by:      dch
c783d7181d6a71cb2453f06e40c08c892510c2f2 Pat Maddox 2026-05-22 21:45:30
pxeboot: warn and abort on TCP-only NFS server, which doesn't work for pxeboot
When pxeboot gets a 0 as a port number from portmapper (indicating an
error), it currently happily sends NFS packets to the server's port 0
in an endless loop. Change this to instead bail out with a useful
message.

This happens, for example, with recent Linux NFS servers as many
distributions switched to TCP only NFS serving by default. FreeBSD's
pxeboot must have UDP. In this situation pxeboot asks the server's
portmapper for the UDP NFS port and since there is none gets 0.

Also add a hint to the manpage explaining this and how to fix it.

Reviewed by: ziaee, kevans, imp
d2c21935e8666f5e9a38e27701445f5acc82465d Martin Cracauer 2026-05-24 15:43:00
ttymsg: Overhaul
* Instead of an error string, return the usual 0 or -1 and let the caller
  figure out what, if anything, to tell the user.

* Avoid string manipulations by opening /dev first and using openat()
  with O_RESOLVE_BENEATH.

* Add a boolean argument which, if false, causes ttymsg() to return
  without sending the message if the tty's group-writable bit is not
  set.  This saves programs that respect this setting (like syslogd(8))
  from having to check before calling ttymsg().

* Update all callers.

The observable effect of this change is minimal except for slightly
different error messages when ttymsg() fails.  However, syslogd(8) will
no longer print spurious error messages on the console after trying and
failing to write a log message to an X11 session.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295171
MFC after:      1 week
Reviewed by:    jfree, markj
Differential Revision:  https://reviews.freebsd.org/D57018
05e8f2bf0906875e666469e0338f922d1113d034 Dag-Erling Smørgrav 2026-05-25 16:51:23
lpd: Restore ability to specify a port number
This has been broken since IPv6 support was added in 2000.  We would
validate the port number (which had to be a port number, but can now
also be a service name) and then ignore it.

MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=08829865f659 ("IPv6 support for lpr.")
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57181
c0cae7d8da50daa87af4cd6d7c9a2043343b506f Dag-Erling Smørgrav 2026-05-25 16:51:31
Commit group #64: lpd
lpd: Drop deprecated -p option

This alias for the -s option has been deprecated since 2002.  Time to
drop it from the documentation.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57183
6047f6a21085ae3877228f8df19a0d4bce45905f Dag-Erling Smørgrav 2026-05-25 16:51:44

lpd: Avoid buffer overflow when sending a job

When forwarding a print job to a remote server, we could overflow the
command buffer if a control or data file had a very long name.

MFC after:      1 week
Reported by:    Joshua Rogers <joshua@joshua.hu>
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57184
f2c7c5f94803b67a9a6af625d4fc8882d2afda6c Dag-Erling Smørgrav 2026-05-25 16:51:48

lpd: Fix issues reported by clang-analyzer

Also, unlink our temporary file if we fail to chmod it.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57185
0f3e14870906da22a7ca821fb2153d375157cac2 Dag-Erling Smørgrav 2026-05-25 16:51:53
Commit group #65: bhyve/virtio-scsi
bhyve/virtio-scsi: Support for multiple targets

Currently, virtio-scsi supports only one target with 16383 LUNs, which
fits nicely with what CTL provides. It would be useful to support more
than that, multiple targets each with 16383 LUNs.

While this can be useful with CTL by attaching each target to another
CTL target port, this will be necessary to support SCSI passthrough.

The new syntax for configuring targets will look like this:

-s X,virtio-scsi,target=/dev/foo,target=/dev/bar,target=4:/dev/baz

This will create the following configuration nodes:

pci.0.X.0.device=virtio-scsi
pci.0.X.0.target.0=/dev/foo
pci.0.X.0.target.1=/dev/bar
pci.0.X.0.target.4=/dev/baz

The existing configuration syntax is still understood for compatibility:

(1) -s X,virtio-scsi
(2) -s X,virtio-scsi,/dev/foo
(3) -s X,virtio-scsi,dev=/dev/foo

This will create the following configuration nodes:

pci.0.X.0.device=virtio-scsi (1, 2, 3)
pci.0.X.0.target.0=/dev/cam/ctl (1)
pci.0.X.0.target.0=/dev/foo (2, 3)

Reviewed by:    markj
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D53221
4151296fdcbad2706936ffa7d428d8621ad11823 Hans Rosenfeld 2025-10-29 11:12:09

bhyve/virtio-scsi: Implement task management functions

Currently, all I/O requests are queued internally, and a number of
threads will pick I/O requests of the queue and send them to CTL with
a synchronous CTL_IO ioctl. On the other hand, TMF requests are sent
to CTL immediately using the same synchronous ioctl.

Besides being unworkable for non-CTL backends such as for SCSI
passthrough, this simple approach may easily run into situations
where a TMF request operating on a particular I/O request is sent
to CTL while it is still on our queue and thus unknown to CTL.
In addition, for target and/or LUN resets we should really clear
our queue and return all outstanding I/O requests with a proper
status.

Reviewed by:    markj
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D53222
19728f98cb5c59f153de8df8b458c42e3e5168f6 Hans Rosenfeld 2025-10-29 11:04:20

bhyve/virtio-scsi: Support multiple backends

In order to support multiple backends for virtio-scsi, we should isolate
the core of virtio-scsi from the backend-specific code. The existing
interface to CTL will become the new "CTL" backend for virtio-scsi.

Care has been taken to keep compatibility with previous configurations:
The first backend linked (CTL) will be the default backend if none is
specified, and it does provide a default configuration if no further
options such as targets are explicitly configured.

Reviewed by:    markj
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D53223
9542ddb21dc15986843708d3f845eb23e7090107 Hans Rosenfeld 2025-09-16 15:34:12

bhyve/virtio-scsi: Make all I/O processing parameters configurable

This includes:
- seg_max, the number of segments allowed in a single command
- {ctl,evt,req}_ringsz, the number of descriptors in a queue
- thr_per_q, the number of processing threads per request queue
- num_queues, the number of request queues

Reviewed by:    markj
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D54073
ccb14be785f79583a6a0622a89489c8d681f2bf8 Hans Rosenfeld 2025-11-10 17:08:31
Commit group #66: nanobsd
nanobsd: Use NANO_IMG1NAME

Do not hard-code _.disk.image, use NANO_IMG1NAME instead.

Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57040
689f7466c1aee7810e6a965e82338c765105a1cf Jose Luis Duran 2026-05-27 00:12:48

nanobsd: Get the code size by its partition index

Previously the code was assumed to be on the on the first line of the
_.partitioning file.  Instead, explicitly look up the size by its
partition index to make the parsing order-independent.

The _.partitioning file:

1. First column: starting sector.
2. Second column: size in 512-byte sectors.
3. Third column: partition index.

Get the code size by explicitly selecting when the partition index is 1.

Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57216
9d133c76402e769fd63ed838ad641572439cd126 Jose Luis Duran 2026-05-27 00:13:15

nanobsd: Remove spurious exit call

Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57217
d2a9ad033c3cb42b3b2a888baf63374b613df03e Jose Luis Duran 2026-05-27 00:13:47

nanobsd: Use rounded sizes for cfg and data slices

Use the calculated (rounded up) cfg and data sizes from the
_.partitioning file, instead of consuming them directly from the global
variables.  We obtain the size of the cfg and data slices by explicitly
searching for index 3 and 4 respectively in the _.partitioning file.

This ensures that the final image has the rounded-up sizes, and not the
raw sizes.

Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57219
beddf2c591739a43e36c339b393e0beb3878d01a Jose Luis Duran 2026-05-27 00:14:09

nanobsd: Account for metadata overhead in code slice

The code slice size (CODE_SIZE) includes 16 sectors reserved for disk
metadata (see bsdlabel(8) offset).  Subtract these 16 sectors from the
total size passed to nano_makefs.

This prevents the generated filesystem from consuming the entire slice
allocation, ensuring there is enough space for the metadata without
overflowing the partition boundary.

Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57220
dadbbccd804980895a098b01f553b5f7193daa81 Jose Luis Duran 2026-05-27 00:14:56

nanobsd: Offset code partition to a track boundary

Ensure the primary and secondary code partitions start at a proper track
boundary by applying a NANO_SECTS offset in bytes.

While track-boundary alignment is largely obsolete on modern storage,
this change maintains compatibility with current images (legacy).  A
future commit will transition to 1 MiB alignment boundaries.

Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57221
f1de49f508714b024ac6f3a60845108f81c7aee7 Jose Luis Duran 2026-05-27 00:15:39

nanobsd: Explicitly set image size and secsz in mkimg

When building an unprivileged NanoBSD image, explicitly set the desired
image size, by passing --capacity to mkimg in bytes, and the logical
sector size (-S) to 512 bytes.

Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57222
318a85d4b201b1cb77f25c8a98d2b0687e8259e5 Jose Luis Duran 2026-05-27 00:21:57

nanobsd: Refactor secondary code partition logic

Rearrange the conditional logic for building the secondary code slice
(altroot).

Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57223
87150a2ed140d5a3c1272ce9cfe815f19282840b Jose Luis Duran 2026-05-27 00:22:39

nanobsd: Fix code image size formatting

mkimg(8) parses sizes using expand_number(3).  It is an error to use "b"
as a suffix.  This is the result of a confusion with makefs(8), which
uses NetBSD's strsuftoll(3).

Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57224
ca2d4026c3f2bb8eeab888cf50f2c2e3914ab3e5 Jose Luis Duran 2026-05-27 00:23:05

nanobsd: Use makefs -R flag to honor rounded sizes

Switch from the min/max size flag (-s) to the round-up flag (-R) when
invoking makefs(8).

Because the partition sizes passed to nano_makefs have already been
rounded up by calculate_partitioning(), using -s can cause makefs to try
to perform sizing adjustments that usually result in failures.

Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57225
c579927ac591ffcf36f4cd06444d167ba467ec8d Jose Luis Duran 2026-05-27 00:23:46

nanobsd: Adjust the order of the flags in makefs

The order of the flags matter in makefs(8). The -t (type) flag must come
before the -o (options) flag; otherwise, the options are reset.

Move the -t flag before the -o flag and remove the shim function
_xxx_adjust_code_size() that was created to align to the default makefs
FFS values.

It effectively prevented us from generating NanoBSD images using
unprivileged builds with the partitions internally aligned as intended.

Reviewed by:    senguptaangshuman17_gmail.com, imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57226
54359982309e63254424eea1f981215c84d2b9c6 Jose Luis Duran 2026-05-27 00:24:26

nanobsd: Register the boot.config file in the metalog

Ensure that the boot.config file gets an entry in the metalog by
tgt_touch()ing it.  If a file is not present in the metalog, it gets
excluded from the final image when using "-U" (unprivileged builds).

MFC after:      2 weeks
f1de8e3511d043e707cf4a63ea76a15a42f81ab0 Jose Luis Duran 2026-05-27 00:25:10
sndctl(8): Implement EQ controls
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
8b8dbc6bbe391fd95a19bd1d9f0aac47bac085f8 Christos Margiolis 2026-04-17 16:10:48
bsdinstall: Use libarchive secure flags for extract
This doesn't really matter, as we trust that the installer tarballs are
not malicious, but it doesn't hurt to set these flags.

Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57274
f9f46294d6af2a937afa74938bd4bb6826cbb921 Ed Maste 2026-05-27 13:29:21
Commit group #67: rc
rc: virtual_oss: Define some variables in rc.conf

They will now be part of /etc/defaults/rc.conf and be accessible by
sysrc(8).

Fixes:          https://cgit.freebsd.org/src/commit/?id=70e27ecba518 ("virtual_oss: Introduce virtual_oss_default_control_device rc variable")
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295560
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    0mp, jrm
Pull-Reqeust:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/33
a576e5140ef352af6cf227528d1bfc6b964516c8 Christos Margiolis 2026-05-21 11:38:22

rc: virtual_oss: Wait for process to exit

Sometimes virtual_oss processes do not exit immediatelly. If we do not
wait for the processes to fully exit before returning from
virtual_oss_stop(), then the service restart operation might call
virtual_oss_start() too early and fail, because it will think the
service wasn't stopped and is still running.

Reported by:    jrm
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    0mp, jrm
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/33
803f686938ec2472d54a26bff668e48cc4999558 Christos Margiolis 2026-05-21 16:26:46

rc: virtual_oss: Handle absent pidfile properly

Instead of throwing errors from the programs that use it, print a
warning if the file does not exist.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    0mp, jrm
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/33
b2677d002edbe9308b1f8cecd1a5fc515d2a5deb Christos Margiolis 2026-05-21 16:53:27

rc: Fix improper use of load_kld

Fix scripts that needlessly used -e when the simpler -m would work, or
that used -m when the module and file name are the same, or, in one
particularly egregious case, used -m with the wrong name when using
nothing at all would have worked just fine.

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D57705
cfe1962a19259fea8f51673f4da6c96656776486 Dag-Erling Smørgrav 2026-06-23 15:23:25

rc: Improve load_kld

* Centralize the usage message.

* Document and enforce that -e and -m are mutually exclusive; previously,
  speficying both would result in only -e being applied.

* If -e was not specified, and -m was not specified or did not match,
  fall back to `kldstat -n file` which will always work for modules that
  aren't built into the kernel.

This means the kld and ntpd scripts can now rely on load_kld to dtrt.

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D57706
a95d324dd3107afcbc16767d183acca7a57ebca9 Dag-Erling Smørgrav 2026-06-23 15:23:30

rc: Make devmatch use load_kld

The default behavior of load_kld is now robust enough for devmatch.
Switching means settings from /etc/sysctl.kld.d are now properly applied
when the corresponding modules are loaded by devmatch.

While here, reduce the amount of output produced by devmatch from one
line per module to a single line.

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D57707
b9f616d031566e94e6967a2c533b8aa7f36123b9 Dag-Erling Smørgrav 2026-06-23 15:23:34
virtual_oss(8): Fix buffer overflow in voss_compressor() call
This particular calls swaps the samples and maxchan arguments, which can
cause a buffer overflow in p_ch_chain if maxchan exceeds its bounds
(VMAX_CHAN).

Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste
453de99b386d40754a038cc4b804f4c7a3b04624 Christos Margiolis 2026-05-28 13:51:26
crashinfo: Create core.txt.last symlink
When saving a coredump, savecore(8) maintains .last symlinks for the
info and vmcore artifacts, but not for the crashinfo text report.

Make crashinfo(8) create the link, pointing at the current
core.txt.<bounds> file.

This makes /var/crash/core.txt.last track the same core dump as
info.last and vmcore.last.

[mhorne: I tweaked the submission, such that the link will be created as
soon as the core.txt.X file is generated; not only after a successful
report has been written.]

Signed-off-by:  Ricardo Branco <rbranco@suse.de>
Reviewed by:    mhorne
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2199
4dfc78e0e3bb096514455e9bb6cf63e46e84db13 Ricardo Branco 2026-05-15 14:58:41
bsdinstall: script: Fix scripted DISTRIBUTIONS
Restore exporting DISTRIBUTIONS to make it available to other scripts.

Reviewed by:    imp, asomers
Fixes:          https://cgit.freebsd.org/src/commit/?id=dc14ae4217a0 ("bsdinstall: do pkgbase installations with the "script" command")
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57319
283959bbe0863917c4fc3200a92d1055a4c89bdc Jose Luis Duran 2026-05-29 02:09:49
spi: switch to switch
use recommended switch with default case to catch invalid values

Reviewed by:    kevans, adrian
Differential Revision:  https://reviews.freebsd.org/D54759
ee41a882054c0761853971f8742607b3eae06784 Sulev-Madis Silber 2026-05-29 16:58:50
route: Fix `flush` w/o specified address family
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291867
Reported by:    gavin
Reviewed by:    pouria, melifaro
Sponsored by:   The FreeBSD Foundation
Fixes: https://cgit.freebsd.org/src/commit/?id=c597432e2297 ("route(8): convert to netlink")
Differential Revision: https://reviews.freebsd.org/D57336
32a7ba251acbfb442665eed40fb4f48c8f2bd710 Ed Maste 2026-05-29 16:44:09
Commit group #68: stand: compile ia32 EFI loader with -malign-double
stand: compile ia32 EFI loader with -malign-double

The UEFI spec says:
> Structures are aligned on boundaries equal to the largest internal
> datum of the structure and internal data are implicitly padded to
> achieve natural alignment.

Unlike the old Intel EFI toolkit, the EDK2 headers expect ia32 builds to
use -malign-double to achive this.

Make EFI versions of libsa32, liblua32, and ficl32. With the difference
being that they are compiled with -malign-double.

Differential Revision:  https://reviews.freebsd.org/D55385
d15cc7625dde9bcb6a63ee59cccf14f3b93b15bf Ahmad Khalifa 2026-05-30 02:40:39

stand/efi/Makefile: fix build order

Move liblua32efi and ficl32efi before .WAIT, otherwise there's a race
between the interpreter and the loader being built.

Reported by:    kbowling
Discussed with: kevans
Fixes:          https://cgit.freebsd.org/src/commit/?id=d15cc7625dde9bcb6a63ee59cccf14f3b93b15bf
23996d940a63359465021277d4b2f5b569054379 Ahmad Khalifa 2026-05-31 00:02:06
mdmfs: Use standard bool definition
Include `<stdbool.h>` instead of defining a local bool enum.
This avoids duplicating a standard type name and keeps the
source compatible with headers that provide bool as a macro,
or in case of C23 that compilers provide it as keyword.

Signed-off-by:  Faraz Vahedi <kfv@kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
64502126e126476456ca2aa60b4f798ed2d0b879 Faraz Vahedi 2026-05-26 06:06:52
stand: Revert the EFI loader back to strict mode
The change to relaxed mode has had too many unintended breakages. Revert
back to strict mode until that works for all the cases that are
currently broken.

Fixes: https://cgit.freebsd.org/src/commit/?id=784150fd2535, https://cgit.freebsd.org/src/commit/?id=d69fc3a9dc71
PR:  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295289
Sponsored by: Netflix
a1d78374b5c426d43a287b9523660bce36cb55c8 Warner Losh 2026-06-01 03:34:59
bsdinstall: Add virtual_oss service option
Since virtual_oss is now part of base, there is no reason not to provide
an installer option to enable it, and make it more visible to new users,
who might also benefit from the devd rules in /etc/devd/snd.conf, which
use virtual_oss, as well as 8532b4a43636 ("rc: virtual_oss: Create a
loopback device in the default configuration").

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    ivy
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/31
eb5aa5c337c8d52fc1a7e867f526ca770bbe6612 Christos Margiolis 2026-05-20 15:51:39
virtual_oss_cmd(8): Improve error messages
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
4f7092eeb22d3882f54d67a35149533fef8376ca Christos Margiolis 2026-06-02 12:57:45
pfdenied: fix checking root anchor
pfctl doesn't like empty anchors (-a ''), but we can specify the root
anchor as '/' too, so do that instead.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295324
Tested by:      Paweł Krawczyk
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
3d9cd10b2857ee7a9ec1b04457d9ec44f614d32c Kristof Provost 2026-06-03 08:49:31
defaultroute: Fix dual-stack and IPv6-only handling
Since IPv6-only setups are becoming more common, and IPv6
connectivity is often sufficient for tasks such as DNS
resolution and NTP time synchronization, update defaultroute
rc.d script to support IPv6-only environments.

Reviewed by:    pouria, ae
Differential Revision: https://reviews.freebsd.org/D56797
d52de9a3448f0233a11e0b4de557e403ace71748 Marek Zarychta 2026-06-04 07:58:07
lualoader: add be-list and be-switch commands
This is useful for driving BE changes from the loader command prompt,
rather than having to use the menu.  Note that the active carousel in
the boot environment carousel doesn't currently reflect a switch in
boot environments done this way- I'm considering this only a minor bug,
as you probably can't or won't go back to the menu if you're using these
commands.

Reviewed by:    imp (previous version)
c7ff706b31c22f10c2403869c46b443448da3e08 Kyle Evans 2026-06-04 13:57:16
etcupdate: Make diff -l actually work
While here, remove unnecessary blank lines.

MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=6d65c91b9a47 ("etcupdate: fix arguments order of diff command")
Reviewed by:    Boris Lytochkin <lytboris@gmail.com>
Differential Revision:  https://reviews.freebsd.org/D57330
a85e39030f8c7faa3d5a33373389440de6f0fff7 Dag-Erling Smørgrav 2026-06-04 22:41:27
Commit group #69: pw
pw: remove duplicate pw_user_add declarations
1cc5684b3216dd0198c4fe83cdbcaed8d874c99c Baptiste Daroussin 2026-06-04 22:12:19

pw: fix uninitialized name pointer in pw_group_del

The 'name' variable could be left uninitialized if neither the
positional argument nor -n is supplied, leading to undefined
behavior when passed to getgroup().
13f4a37b536b60d559c766b3ec4f2d5d25279ea3 Baptiste Daroussin 2026-06-04 22:12:24

pw: fix inverted condition in shell_path error handling
4fd8a69ec6623da5ef33818be134efffebe37f75 Baptiste Daroussin 2026-06-04 22:12:35

pw: fix const qualification in unquote()

The unquote() function took a const char * parameter but modified the
string in-place (removing quote characters). Change the parameter to
char * and update callers that passed const char * to cast explicitly.
5f9c8f142d1702f5810618e02534054d28d22fa5 Baptiste Daroussin 2026-06-04 22:13:23

pw: fix setmode(NULL) crash when homemode is a boolean value
fe1e912d5a394565e9adfbc443555ae0b3f087e5 Baptiste Daroussin 2026-06-04 22:13:52

pw: fix incorrect metalog path in mkdir_home_parents
ab478de1f9b3f73036ee05004fb2d503a0f339bc Baptiste Daroussin 2026-06-04 22:19:54
Commit group #70: nuageinit
nuageinit: implement bootcmd support

Add support for the 'bootcmd' cloud-config directive, which allows
running commands very early in the boot process, before the hostname
is set and before the network is configured.

- nuageinit: bootcmd() function follows the same pattern as runcmd(),
  writing commands to /var/cache/nuageinit/bootcmds instead of runcmds.
  It is the first entry in the pre_network_calls table.

- rc.d/nuageinit: execute /var/cache/nuageinit/bootcmds immediately
  after /usr/libexec/nuageinit completes, before unmounting the config
  drive. This ensures bootcmd runs before NETWORKING per cloud-init spec.
b9be7608cd13888a32815bfb2263e20855706969 Baptiste Daroussin 2026-06-05 05:00:00

nuageinit: implement manage_etc_hosts support

Add support for adding the instance hostname to /etc/hosts on the
127.0.0.1 and ::1 localhost lines, matching cloud-init's default
behaviour (manage_etc_hosts: true).

create a revolve_hostname helper to avoid code duplucation.
ba58e8ad726318ed59b6cc5934435dbddbe23dac Baptiste Daroussin 2026-06-05 05:49:16

nuageinit: add tests for bootcmd, ssh_deletekeys, disable_root, manage_etc_hosts
6e54d00867dd2b979d2dc097c710613e6b9bd33b Baptiste Daroussin 2026-06-05 06:38:33

nuageinit: implement mounts support

Add support for the 'mounts' cloud-config key which configures
mount points by appending entries to /etc/fstab and creating
the corresponding directories.
797dad91ff468a9bd6cd5d4f720eb4bbac1f454a Baptiste Daroussin 2026-06-05 10:05:08

nuageinit: implement resolv_conf support

Add support for the 'resolv_conf' cloud-config key which writes
directly to /etc/resolv.conf.
4662263c246fd9c31cf0f03089845140114445bc Baptiste Daroussin 2026-06-05 10:06:02

nuageinit: implement keyboard support
58184a301a1f0ef0858689f8dcc608cb468d4644 Baptiste Daroussin 2026-06-05 10:09:51

nuageinit: implement ssh_authkey_fingerprints support

Add support for the 'ssh_authkey_fingerprints' cloud-config key
which logs SSH host key fingerprints to the console via ssh-keygen.
d7984912385cc5a191547dc6c2d73acba25e2239 Baptiste Daroussin 2026-06-05 10:38:06
etcupdate: Make nobuild the default
The common case for etcupdate is to run it after building and installing
the world, in which case we already have an object directory to draw on.
Add a -b option to turn nobuild off (opposite of -B), and turn nobuild
on by default.

MFC after:      1 week
Reviewed by:    jhb, emaste
Differential Revision:  https://reviews.freebsd.org/D57306
ddf6fad0295aa92af5eed2a4b2fa0bd02f47d94d Dag-Erling Smørgrav 2026-06-05 15:53:25
rc: Bail if /dev/null is not a device
On startup, check that /dev/null exists and is a character device.
Otherwise, one of two things will happen: either /dev is a writable
directory and we will immediately create /dev/null as a regular file
and dump garbage into it, or it does not and we will spit out a stream
of error messages about failing to create /dev/null.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295782
MFC after:      1 week
Reviewed by:    jhb, emaste
Differential Revision:  https://reviews.freebsd.org/D57447
b5a96894f67a92f78f0641763eff1e0a46f2e036 Dag-Erling Smørgrav 2026-06-05 15:53:29
bhyve(8): allow cpu pinning using N-M:X-Y ranges
bhyve's -p allows to pin guest's virtual CPU vcpu to hostcpu, however
this becomes very tedious work when you have to pin more than a single
CPU.

This allows to pass a range to -p, e.g. -p 0-3:4-7 which will pin the
cpus 0:4, 1:5, 2:6, 3:7. The ranges must be equal and the CPU numbers
must be ascending.

Sponsored by: Armenian Bioinformatics Institute
Reviewed by:    corvink, markj
Tested by:      bnovkov
MFC after:      3 weeks
Differential Revision:  https://reviews.freebsd.org/D54937
8f6c577c9f706aea6f138fa1bec27029d4ab587d Antranig Vartanian 2026-06-05 15:34:18
loader.efi: Fix when staging moves late
Prior to this commit, we'd compute the page tables and have the last
entries point to the staging area. We'd then add some more metadata to
the image and boot. This assumed the staging area didn't need to move
for this last bit of data.

However, if we go over the staging limit, when we copyin new data, we
grow the staging area, usually be moving it to a lower address.  This
overage usually happens when we're loading modules and so things work
out nicely. Sometimes we're close to the limit, and we need to do this
growing inside bi_load, after we've computed the page table, making the
page table wrong, and the code we jump to random rather than the btext
routine we normally start at.

To fix this, move computation of the table (but not its allocation) to
after bi_load, but before we call the trampoline.

This problem was most observed when loading microcode for many peole,
but Gleb reproduced the error with a set of modules that didn't include
ucode.

This bug hunt was greatly assisted by Claude who looked at the crash
from the EFI boot loader and surmised that we weren't jumping to the
code we thought we were jumping to. After inspecting the code, I asked
claude how corruption could happen (I thought overwriting the page
table), but claude notice the possibility that staging might change
after we computed the page table, and this fix is the result. Claude
didn't suggest a diff, but did provide many helpful clues that lead me
to this fix.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294630
Reviewed by: kib (prior version)
Sponsored by: Netflix
MFC After: insta per re@ request
Differential Revision: https://reviews.freebsd.org/D57462
3915ffb1c3e04b26d1506bf35d3f665b2e25a915 Warner Losh 2026-06-05 05:18:40
Commit group #71: nuageinit
nuageinit: implement ntp support

Add support for the 'ntp' cloud-config key which configures NTP
by writing /etc/ntp.conf with server and pool entries.
6d27d52ccd35d1980e99bc2fc4dae602334d28af Baptiste Daroussin 2026-06-05 20:25:29

nuageinit: implement ca_certs support

Add support for the 'ca_certs' cloud-config key which manages
CA certificates by writing them to /etc/ssl/certs/ and running
certctl rehash.
b56f029add4825b21b2957f19ccfbb219a3f96cb Baptiste Daroussin 2026-06-05 20:27:07

nuageinit: implement MIME multipart user-data support

Add support for MIME multipart/mixed user-data, allowing a single
user-data blob to contain multiple parts with different content types.
be711ade6f66506fb2cae9fd33b142ce910f0346 Baptiste Daroussin 2026-06-05 20:45:54

nuageinit: implement power_state_change and locale support
328a76d17f85ff6aa6228035c4c4b989eb7534f8 Baptiste Daroussin 2026-06-05 20:48:18
nuage.lua: add encode_base64 helper
71e8122b3f6efdaac23ac219312dfe270731b495 Baptiste Daroussin 2026-05-07 21:53:04
Commit group #72: nuageinit
nuageinit: implement final_message support
e01f202ecf9344bd6658869a869f36c5b3790384 Baptiste Daroussin 2026-06-05 21:03:45

nuageinit: implement phone_home support

Posts instance data (hostname, instance_id, public keys) to a URL
using fetch(1). Supports:
- url: target URL
- post: list of data items to send, or 'all'
- tries: number of retry attempts (default 1)
58653bf4d0fb8ccd5de146d671ec101a1df0ede0 Baptiste Daroussin 2026-06-05 21:28:25

nuageinit: expose decode_base64 to fix tests
68e60bb8b6c968fe615f81ccc8afd2a30ff78003 Baptiste Daroussin 2026-06-06 06:05:50
nuageinit: install certs in /usr/share/certs/trusted
Suggested by: kevans
e5ef12ccd01f8ec6c519bf2a56cac2808f78c51a Baptiste Daroussin 2026-06-06 19:30:53
fwget: amdgpu: Add needed package for Granite Ridge
Sponsored by: Beckhoff Automation GmbH & Co. KG
5f84c6db7aa16447632c4e6e8959bf28d1bbd8aa Emmanuel Vadot 2026-06-08 07:28:00
nuageinit: Create parent directories in write_files
Currently, 'write_files' does not create parent directories, and
'runcmd' cannot be used here, since those scripts run after the files
have been written. The only workaround is to create the files in an
existing directory, such as '/root' or '/tmp', and then move those
files using 'runcmd', but this is cumbersome when there are many files,
even if they are small.

With this change, nuageinit now creates the parent directories for each
file using the path field, which mimics the same behavior as in
cloud-init.

Permissions and ownership can also be configured using 'runcmd'.

Reviewed by:            bapt@
Approved by:            bapt@
Differential Revision:  https://reviews.freebsd.org/D57395
ea3426bc80aad58e689c144ec6ddee0cda7861cb Jesús Daniel Colmenares Oviedo 2026-06-08 21:05:09
devd/snd.conf: Handle absent control device properly
If virtual_oss is not enabled when these rules run on startup, dmesg
will show the following messages:

Starting devd.
virtual_oss_cmd: Could not open control device: /dev/vdsp.ctl: No such file or directory
virtual_oss_cmd: Could not open control device: /dev/vdsp.ctl: No such file or directory

Reported by:    olce, Mark Millard <marklmi@yahoo.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
439b219fed3eea8ad3e1204393a8605826b8bbca Christos Margiolis 2026-06-09 15:10:58
loader.efi: Search boot device before foreign ZFS pools
When `boot_policy` is `RELAXED`, `find_currdev()` tried ZFS pools on every
disk before searching the boot ESP and sibling partitions. Booting install
media from USB could therefore select an installed ZFS root on internal
storage instead of the intended memstick UFS image.

Extract the boot-device partition walk into `try_boot_device_partitions()`
and run it before relaxed foreign-pool probing. The ZFS search order is
preserved; pools on the boot device are tried first, followed by pools on
other devices when `boot_policy` is `RELAXED` and the boot device yields
no bootable root.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2239
1c85c5eea09a4c9649b7634225220337e6005cd4 Faraz Vahedi 2026-05-26 14:35:42
bsdinstall(8): Fix GPT label conflicts with disks not managed by us
Signed-off-by: Phil Krylov <phil@krylov.eu>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1735
a62eaf71ddb7463cf51d2be8be6506befbcfff8d Phil Krylov 2025-06-22 02:39:30
Warn if hostname is empty
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1700
9a6a2e4b7d203fe9c5ea4f335564f4797bb29a01 ykla 2025-05-18 00:19:06
Commit group #73: ppp
ppp: Don't fetch a non-existent variadic argument

Only fetch the optional mode argument to ID0open to pass to open(2) if
O_CREAT is present in the flags argument.  It is UB to fetch an
argument that doesn't exist.  On CHERI this UB results in a fault.

Reviewed by:    brooks
Obtained from:  CheriBSD
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D57137
b5a8b933d4994835e10226562ff8126298c96693 John Baldwin 2026-06-10 13:44:10

ppp: Permit CHAP challenges up to 255 bytes

RFC 1994 does not place any limit on the length of the value field in
challenge messages except that the length is a single octet which
bounds the maximum length to 255.

NB: I'm not sure why the local[] and peer[] arrays contain room for an
authentication name (AUTHLEN) in addition to a challenge value/response,
but I've just left that in place.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271955
Reported by:    Robert Morris <rtm@lcs.mit.edu>
Reviewed by:    des
Differential Revision:  https://reviews.freebsd.org/D57138
7e971892dfc5aac20bd62be7817941dbaed55f42 John Baldwin 2026-06-10 13:44:10

ppp: Reject FSM messages whose length is smaller than the message header

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271843
Reported by:    Robert Morris <rtm@lcs.mit.edu>
Reviewed by:    des, emaste
Differential Revision:  https://reviews.freebsd.org/D57139
4d8fde8cff0796f32e659036543aa17d16a15b1b John Baldwin 2026-06-10 13:44:10
inetd: Add missing argument to the -p flag description
While here, use the more specific "pidfile" consistently instead of
ambiguous "filename".

Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57531
75a94ae7d143a067a7a9eef2a1d2072fbd5044cf Mateusz Piotrowski 2026-06-10 15:50:12
virtual_oss(8): Properly cleanup cuse(3)
virtual_oss(8) does not currently keep track of the cuse(3) it creates,
nor does it destroy any of them on exit, except for the control device.
This is harmless if virtual_oss(8) is killed after all audio streams
have been shut down, but if it's killed during I/O, the process hangs
and/or goes into uninterruptible sleep state.

To fix this, have pointers to all cuse(3) devices, and explicitly
destroy them on exit. Also make sure we don't leak memory in
dup_profile().

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    jrm
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/41
0bd5ef6b43633a3cf77495a087a9376b2b3b11c9 Christos Margiolis 2026-05-29 11:32:42
virtual_oss(8): Make sndstat FD global
There is no reason to have per-profile copies, plus this way we open
/dev/sndstat multiple times if more than 1 profile is created.

Also close the FD on exit to avoid leaking.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    jrm
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/41
93a234a694f37d373acf303a247d129dda28044e Christos Margiolis 2026-06-09 13:36:48
rc.d/routing: Silence errors for loopback routes
_loopback entry in `static_routes` ensures a loopback route
exists in all routing tables.
However, loopback routes may already be added by the kernel.
Therefore, re-adding them triggers an `EEXIST` error on every boot.
This change suppresses those harmless errors.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259553
MFC after:      1 week
Reviewed by:    glebius, jlduran, markj
Differential Revision:  https://reviews.freebsd.org/D57470
9f80c8b90bdaa8ffac887a8c478a16c84d74a87b Pouria Mousavizadeh Tehrani 2026-06-10 11:26:07
mixer(8): Retire deprecated control values
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
de2a1366022d71c1d650832d378964c4cbe65ba7 Christos Margiolis 2026-06-13 16:29:40
rtld parse_integer(): support binary, octal, and hex C notations
Reviewed by:  des, dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57549
4249a9bc098dd9e32105a2965e76abd702de4d4a Konstantin Belousov 2026-06-12 13:55:27
rtld-elf: add some tests for parse_integer()
Reviewed by:  des, dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57549
3eafe0188410dcccb21c28a4c2e8f19c68861c76 Konstantin Belousov 2026-06-13 00:51:53
ping6: fix outpack overflow in pattern fill loop
The fill loop was bounded by packlen, which is sized for the receive
buffer (datalen + IP6LEN + ICMP6ECHOLEN + EXTRA), not for outpack.
With large datalen the loop wrote past outpack[MAXPACKETLEN].

Bound it to the actual data area in outpack instead.

Reported by:    Oculytic
Reviewed by:    des, markj
Differential Revision:  https://reviews.freebsd.org/D57441
e15be258bbf2978dfc62b5483d86c76884eb8576 Mariusz Zaborski 2026-06-16 17:02:02
Commit group #74: Update bsdconfig dot USAGE
Update bsdconfig dot USAGE

Replace mention of graphics/ImageMagick with graphics/GraphicsMagick
ef0654f2c65066b8e69c3e543099f7034def4fb1 Devin Teske 2026-06-17 14:22:33

Update bsdconfig dot USAGE

graphics/gimmage is no longer in ports, remove mention
234bb65d0bf34580bc93e44a802c0c60e7f31009 Devin Teske 2026-06-17 14:30:39

Update bsdconfig dot USAGE

graphics/gqview is no longer in ports, remove mention
12ec78284337c6aef0acdf942c210cf08e367da6 Devin Teske 2026-06-17 14:32:12
Update bsdconfig dot USAGE copyright following previous commits
08da4322ff6225aacb315e475537229c11a6badf Devin Teske 2026-06-17 15:13:19
Update bsdconfig dot USAGE
print/gsview is no longer in ports, remove mention
4519d987c4db2c500c34b324b315c5dfd6efb3bc Devin Teske 2026-06-17 15:17:02
Update bsdconfig dot USAGE
Add gm prefix to convert command.

`convert` of ImageMagick is now available under `gm convert` where
`gm` is the main entry point for GraphicsMagick commands.
4acaa22829f77d287a4c99a7709fea80040998c8 Devin Teske 2026-06-17 15:24:48
bsdconfig: Update dot USAGE
graphics/gx is no longer in ports, remove reference
00c8e7691001f5659f2bd2dbadb31fe48d9f61c7 Devin Teske 2026-06-17 16:34:46
autofs: remove dead code
log_set_peer_name() and log_set_peer_addr() were never used

Differential Revision:  https://reviews.freebsd.org/D57164
943bfad1097f3459f70ece6ecfd86e5d6d615a6e Robert Wing 2026-06-18 20:12:46
stand: Bulk operations on each gfxfb_blt if shadow buffer enabled
Previously, gfxfb_blt flushed the framebuffer on every call. Since a
single drawing operation may invoke gfxfb_blt multiple times, this can
result in unnecessary flushes.

Instead, write updates to the shadow buffer (when present) and mark the
affected area as dirty. Flushing is deferred so multiple gfxfb_blt calls
can be coalesced into a single update. As before, only the dirty region
is flushed.

This fixes the slow bootloader problem in some platforms.

Reviewed by:    imp, adrian, obiwac
Tested by:      obiwac, jrm
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57373
32da2f23ae4d18888d34682b0ddb49ec80c0bb26 ShengYi Hung 2026-05-31 15:07:51
bsnmpd/snmp_hostres: fix hrFSTable remoteMountPoint leak
Free the previous value before re-strdup'ing, and initialise
remoteMountPoint to NULL in fs_entry_create() so the free() is safe on
the newly-created path

Observed via a dtrace leak snapshot on 15.0-RELEASE-p4:
  data leaked = 1983, count = 1683
    libc.so.7`malloc+0xa8
    snmp_hostres.so.6`fs_tbl_process_statfs_entry+0x276
    snmp_hostres.so.6`refresh_storage_tbl+0x502
    snmp_hostres.so.6`op_hrStorageTable+0x1a
    libbsnmp.so.7`0x2a2b1892ba3d
    libbsnmp.so.7`snmp_getbulk+0x37f

Reviewed by:    sjg, ngie
Differential Revision:  https://reviews.freebsd.org/D57604
28ddd11d91f860df9b9be485c5b0526c10b4aec1 Mariusz Zaborski 2026-06-19 11:58:17
tests: Add pjdfstest integration
Use ATF to wrap the new reimplementation of pjdfstest that came out of
GSOC 2022, now available in the ports tree as filesystems/pjdfstest.

So far I added tests for UFS (with several different option
combinations), tmpfs and ZFS, plus ZFS+nullfs.  All of these create a
memory disk, initialize the filesystem, and point the pjdfstest
executable at it.

In the future it would be good to add tests for at least NFS and p9fs.

Reviewed by:    asomers
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56605
8fd4d1c0fff8441b42dbab767810db7aeaf796c3 Mark Johnston 2026-06-19 13:27:04
ifmcstat: Fixup getopt args to match reality.
Reviewed by:  emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=ad0e698e642e ("ifmcstat: remove libkvm(3) code")
Event:          BSDCan 2026
22d66952555c86a5b7d1d499b48906c3a5f4c13d Gordon Tetlow 2026-06-20 01:39:50
efitable: Fixup getopt args to reflect guid use.
Correct the manpage to reflect the preference for GUID vs UUID.
Take the long version of --guid for the -g option.
Sort the argument list while we are touching it.

Reviewed by:    imp
MFC after:      1 week
MFC to:         stable/15
Event:          BSDCan 2026
Differential Revision:  https://reviews.freebsd.org/D57695
3a4e049c38143980e472b2926abde3c7549530c4 Gordon Tetlow 2026-06-20 02:59:49
periodic/security: Introduce $security_status_loginfail_ignore for 800.loginfail
Introduce a new variable "security_status_loginfail_ignore" to filter unwanted
login failure messages from the daily security checks.

Co-authored-by: Michael Osipov <michaelo@FreeBSD.org>
Co-authored-by: Joseph Mingrone <jrm@FreeBSD.org>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295191
Reviewed by:    jrm
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57671
6a7c8c92245562cfd9b900dedacab99a13d5ca86 Andre Albsmeier 2026-06-19 13:50:00
rtld: Check for -1 as an-end-of-section marker
rtld calls functions in the .init_array section one at a time, until
it finds a distinguished sentinel value. The C runtime does the same
thing (in crtend.c). However, that checks for the sentinel -1 and not
1. If one is using a linker that unifies .ctors and .init_array, then
rtld will miss the sentinel value. I believe the author of this code
intended to write -1 instead of 1. Indeed, changing the code to also
check for -1 prevents rtld from attempting to call a non-existent
function. The same is true of .dtors and .fini_array.

Signed-off-by:  Daniel Levin <daniellevin2607@gmail.com>
Reviewed by:    kib
MFC after:      3 days
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2270
45a0cb52d3d62f8caae420b93e4b8c76ae3bc766 Daniel Levin 2026-06-08 14:42:03
etcupdate: Warn if the tree hasn't been built
Warn the user before trying `make installetc` if etcupdate was invoked
without -b (or with -B) and it appears that `make buildetc` hasn't
already been run (which usually happens as part of `make buildworld`).

MFC after:      1 week
Reviewed by:    jhb
Differential Revision:  https://reviews.freebsd.org/D57504
53a3d4760eb90c89bf04636c957511882d7f347d Dag-Erling Smørgrav 2026-06-22 18:59:18
makefs/zfs: Explicitly include sys/param.h for nitems()
MFC after:    1 week
Sponsored by:   The FreeBSD Foundation
88deb1cff92cb3620c248f32fa6e7bdbc5301213 Mark Johnston 2026-06-22 20:19:32
loader.efi: Fix a comment
Move a comment further up in the file. After the sethead() we need to
use efi_exit(), not after the performance measuring stuff.

Sponsored by:           Netflix
e8a3352e8b5784fe3417a367a488159f0ab30ae8 Warner Losh 2026-06-22 22:17:12
adduser.sh: Add info which separator to use in the question itself
During the non-root user setup (adduser.sh), people are often confused
what the separator is when they are asked which groups to join the new
user into. For example, wheel and operator: users often assume that the
two groups are separated by a comma (and maybe even a space after it),
but the script will check for that and refuses such entries.

Help the users by mentioning that the groups need to be space separated
in the question itself. That way, it does not take up extra space and
avoids confusion about what the separator is.

Reviewed by:            jrm
Event:                  Halifax Hackathon 202626
Differential Revision:  https://reviews.freebsd.org/D57768
15a1ba4a1c467a686573158fd5e49abafa42d587 Benedict Reuschling 2026-06-23 13:13:44
zfskeys - only prompt if zfskeys and zfskeys_prompt are enabled
By default don't block booting with a prompt if a zpool needs a keyboard
password to unlock it.  To enable prompting for keyboard password during
boot require:
    zfskeys_enable="YES"
    zfskeys_prompt_enable="YES"

to both be enabled.  This returns to POLA of prior behaviour.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296130
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57750
276a3dacdb60b65d65301aced5d8443cc5d27ea2 Doug Ambrisko 2026-06-22 18:45:42
ping: Flush stdout after printing initial status
MFC after:    1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57765
141bb8579882f9d1f7e95351573e30f10689f4bf Dag-Erling Smørgrav 2026-06-23 15:20:22
pciconf: Minor cleanups in the config register methods
This is mostly to provide cleaner code for future changes to copy
from.

- Use NULL instead of casting 0 to pointer types.

- Inline readone() in the sole caller now that it is just a single line.

- Use a helper variable for the count of items on each line of output
  in readit().

- Fix the double space in the middle of byte output to only trigger
  for width 1.  For other widths it would output spurious spaces at
  the end of the line which doesn't really hurt, but is buggy
  nonetheless.

- Avoid using implicit booleans by explicitly comparing integer
  expressions against zero.

- Don't compare the endptr returned from strtol() against NULL.

Differential Revision:  https://reviews.freebsd.org/D57535
c6eb9f16cf0e19b54b382aa44f0c9a7bcec5fc40 John Baldwin 2026-06-23 15:51:43
Commit group #75: makefs cd9660: Populate creation time stamps in RockRidge extensions
makefs cd9660: Populate creation time stamps in RockRidge extensions

Differential Revision:  https://reviews.freebsd.org/D57527
0a301f33306c07e629a2423827238aaef85f5d68 John Baldwin 2026-06-23 15:51:43

makefs: Fix build on systems without st_birthtime such as Linux

Reviewed by:    emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=0a301f33306c ("makefs https://cgit.freebsd.org/src/commit/?id=cd9660: Populate creation time stamps in RockRidge extensions")
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2297
4e57c2aa307d34ca6e44f01c6fd671734ed5e486 John Baldwin 2026-06-25 15:37:55
ifconfig: Fix handling of unsupported -j option with MK_JAIL=no
The ifconfig(8) utility built with MK_JAIL=no does not support the
-j option.  When the option is specified, Perror() is called without
setting errno, which can result in errno being reported as zero and
a misleading error message being displayed.

Also remove "[-j jail]" from the usage message when built with
MK_JAIL=no.

Event:  Halifax Hackathon 202606
7e093e5780bbf5af416526c1ab6339fe6e94b37b Hiroki Sato 2026-06-23 21:02:47
loader/efi: pre-allocate memory map buffer before ExitBootServices
Move the memory map allocation before the ExitBootServices retry
loop to ensure no boot service calls occur between GetMemoryMap
and ExitBootServices.  This simplifies the control flow by removing
the inner sizing loop and matches the strategy used by the Linux
EFI stub.

Identified while investigating an ExitBootServices hang on
AMD AGESA 1.3.0.0a firmware (Gigabyte B650 GAMING X AX V2).

Signed-off-by:          Christos Longros <chris.longros@gmail.com>
Reviewed by:            imp
Differential Revision:  https://reviews.freebsd.org/D56249
9417b115a283f4c09da35c5ccff9787e2ac95505 Christos Longros 2026-06-24 04:42:12
pciconf: Add option to write into a BAR region
Add option -W that allows to write into a BAR region.

Also, add an option -R that allows to read from a BAR region that
works similar to -r that reads from the PCI config space.

Reviewed by:    bcr (manpages), jhb
Differential Revision:  https://reviews.freebsd.org/D55915
e63fbcc69402d4a1e8681a95710f0ec01a6837b4 Timo Völker 2026-06-24 19:57:34
adduser: Normalize supplemental groups
Rather than insist on a space-separated list, normalize the input so
that any number of spaces, commas, colons, or semicolons are accepted.

Reviewed by:    bcr
Differential Revision:  https://reviews.freebsd.org/D57774
65fba082f44cb9451d2b12bcd99c3287d0a47acc Dag-Erling Smørgrav 2026-06-25 03:05:36
rc.firewall: Use checkyesno for boolean variables
Use the checkyesno function from rc.subr instead of hardcoded checks for
boolean variables.  Also drop an incorrect comment about the default
logamount value; the actual default is zero (unlimited).

MFC after:      1 week
Reviewed by:    kevans, allanjude
Differential Revision:  https://reviews.freebsd.org/D57678
a3c077c1ccbe57ffad6317879bc1e49291892414 Dag-Erling Smørgrav 2026-06-26 14:38:44
rc.firewall: Support on-disk lists
For firewall_allowservices and firewall_trusted, if an element of the
list looks like an absolute path, read the file, skipping comments and
blank lines, and treat the first word on each line as an address or
subnet to be added to the list.

We should probably be using tables instead, but this is still an
improvement over the status quo ante.

MFC after:      1 week
Relnotes:       yes
Reviewed by:    allanjude
Differential Revision:  https://reviews.freebsd.org/D57679
a71abf38e2b46c02965f3224c62bb6ef1971996e Dag-Erling Smørgrav 2026-06-26 14:38:53
rc.d/ddb: Really silently exit
The comment says “silently exit if ddb is not enabled”, but we'd exit
with an error message.

Note that I switched the sysctl variable used to test for the presence
of ddb from debug.ddb.scripting.scripts to d.d.s.script, which has a
smaller value if set.

While here, drop a pointless fork-exec, and use ${SYSCTL_N} for
consistency.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=177217
MFC after:      1 week
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57686
b0d3a2889a1b8e4b73ad1f396884224e1442b214 Dag-Erling Smørgrav 2026-06-26 14:38:58
rc.d/tmp: Fix dupe mount check
Before mounting a new mfs on /tmp, we check if there already is one.
However, the dupe check only takes /dev/md[0-9]* into account, while the
default mfs type these days is tmpfs.  Rewrite it to look for tmpfs as
well.

Note that the dupe check is redundant in the tmpmfs=auto case, but we
leave moving it for later.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=182035
MFC after:      1 week
Reviewed by:    kevans, allanjude
Differential Revision:  https://reviews.freebsd.org/D57682
45efa4e61623e3eeee7fd0a3f4436616e24c8e98 Dag-Erling Smørgrav 2026-06-26 14:39:03
local-unbound-setup: Support IPv6-only systems
* In the server configuration, disable protocols not supported by the
  kernel.

* In resolv.conf, instead of only using 127.0.0.1, use either 127.0.0.1,
  ::1, or both depending on which protocols the kernel supports.

MFC after:      1 week
Reviewed by:    jlduran
Differential Revision:  https://reviews.freebsd.org/D57840
f0a861efbafeb81428d5e8c23dac9da73fe14007 Dag-Erling Smørgrav 2026-06-26 14:43:26
ping: Don't mix stdio and direct writes
POSIX does not allow mixing direct writes to STDOUT_FILENO with stdio
operations on stdout like we do here.  More importantly, it causes
tests to fail randomly (or not-so-randomly after I added an fflush in
a previous commit).

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57884
8bda488114f330d758e6741ff44882bb12b76c0d Dag-Erling Smørgrav 2026-06-26 14:46:09
loader.efi: Add comments describing the boot protocol
Add some comments about the boot protocol. Need to do a deeper dive into
the networking code since it's the last set of code used here.

Signed-off-by: Warner Losh <imp@FreeBSD.org>
Differential Revision:  https://reviews.freebsd.org/D57800
1e49aa7a984e0d4381538aa6cf16d37b20b000b9 Warner Losh 2026-06-26 14:45:31
loader: Add defines for ZLIB_CFLAGS, BZIP2_CFLAGS and ZSTD_CFLAGS
These are scattered in several places, so centralize the setting of
these flags.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D57861
53811ed6237972f92a80627ea2c17ece212315a7 Warner Losh 2026-06-26 14:45:42
Commit group #76: loader.efi
loader.efi: Add verbose flag to try_as_currdev

Since we print almost everywhere before we call this, centralize the
devpath to text dance here.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D57801
7140742c8c684c96644c094ed489ff5167c77c5a Warner Losh 2026-06-26 14:45:46

loader.efi: Refactor try_boot_device_partitions

Break out the probing into try_disk_and_partitions and adjust the trying
message slightly to be a little clearer what we're doing.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D57802
ce9bfd781679ba67123345352a754c2e2dd1ef0b Warner Losh 2026-06-26 14:45:51

loader.efi: Expand uefi_rootdev to probe disks

uefi_rootdev had to be the exact device to work. This is often difficult
to arrange and awkward. Instead, have it search the specified device: As
a partition if it specifies the partition, and as the whole disk if the
specified partition didn't work or it specifies a disk. This brings it
into lone what we do with other devices. This overrides the boot manager
search we do before we do this for the boot device, but this knob has
always been meant to overload the boot manager search.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D57803
82eb1970759de3fb7eacbbfc1e53bf64bf48dfe4 Warner Losh 2026-06-26 14:45:55

loader.efi: Improve the trying MD messsages

Expand the tring MD message a little to make it clearer.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D57804
7f5475594aabf1d6aa3db4c9237a2bd4f4aef6c4 Warner Losh 2026-06-26 14:46:01

loader.efi: Trim ZFS searching for other booting options

When we're searching the system for all the disks in relaxed mode, we
need to do a final pass over all the non-boot disks. We no longer need
to have two loops since ZFS on boot device is selected properly in
try_boot_device_partitions. This also simplifies the code a bit.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D57805
3e3fd1fde8e168910edc538966111c0b5f03cd5f Warner Losh 2026-06-26 14:47:25

loader.efi: efiblk_memdisk_preload passes the VirtualDisks to FreeBSD

Set hint.md.%d.physaddr and hint.md.%d.len for each of the VirtualDisks.
The memory for these remains after we exit boot services so FreeBSD can
use them. This leverages the BIOS work we did for memdisks. In
hindsight, I should have passed this in via metadata, but it's been in a
release.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D57806
59219fc76a4bde45039695373a662ad59432d451 Warner Losh 2026-06-26 14:47:31

loader.efi: Recognize new memdisk=<url> and memcd=<url> options

Support ipxe downloading of a memory disk (either presented to the OS as
a harddisk or a cd). This requires an ipxe server since it uses the ipxe
download protocol to grab the disk. If there is a disk, we add it to the
environment as a disk, and then the rest of the bootloader just sees it
and boots from it.

I've cribbed code from https://github.com/russor/memdisk_uefi and
adapted it to work in the context of the FreeBSD bootloader.

The ipxe_download.h file was created from the documentation of the
interface.

So a .ipxe file with the line
chain http://10.2.0.1/loader.efi memdisk=${cwduri}FreeBSD-15.1-RELEASE-amd64-bootonly.iso
would use the FreeBSD boot loader to boot the FreeBSD 15.1 release.

md(9) has a bug at the moment that prevents it from probing the
partitions on it.

Also, we'll automatically decompress gzip, bzip2 and zstd files
automatically.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D57677
afee781523e45198c7be0a19281bcae2c4ab66db Warner Losh 2026-06-26 14:47:36

loader.efi: Fix build with gcc due to pointer / int issues on 32-bit build

Use (uintptr_t) casts to cast the EFI_PHYSICAL_ADDDRESS to a pointer.

Fixes: https://cgit.freebsd.org/src/commit/?id=afee781523e4 ("loader.efi: Recognize new memdisk=<url> and memcd=<url> options")
Sponsored by:           Netflix
Reviewed by:    rlibby
Differential Revision:  https://reviews.freebsd.org/D57893
9cb1459633a1f96ed2fd5bd37530be3c4f6ae9e6 Warner Losh 2026-06-26 23:12:48

830d7396cd3aaa0bb9980e6d778f8f9c1d17b1a2 Dave Cottlehuber 2026-06-26 23:27:29
gstat: Refactor and polish. Added option for {kB/MB/GB} per second.
c263dd413ca0b43b4513e6e6dd8ed64c0eb9c3aa Poul-Henning Kamp 2026-06-27 11:26:18
rc.d: fix lockd and statd flags processing after scvj
The documented flags are named differently than the script name, this
requires special handling of the flags.

The Service Jails feature requires the handling of the variable to be
differently than it was initially. The change back then did not work,
which resulted in the flags to be ignored.

This commit fixes the issue in head. This affects 15.0 and 15.1 too.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296233
Reported by:    Robert Blayzor <rblayzor@inoc.net>
Tested by:      Robert Blayzor <rblayzor@inoc.net>
Fixes:          https://cgit.freebsd.org/src/commit/?id=f99f0ee14e3af81c2 - rc.d: add a service jails config to all base system services
MFC after:      1 month
MFC to: 15-stable
d05d60e958bca778ea193932facb026c48d7ca0b Alexander Leidinger 2026-06-27 13:44:33
gstat: Sanitize code which gcc did not like.
27e292627589172e70ea01a736f639d7aedbab9d Poul-Henning Kamp 2026-06-27 15:10:25
Commit group #77: rtld
rtld: add spinlock around the crt malloc calls

Right now, the rtld malloc is called under the write-locked rtld bind
lock. A future change adds places where only read-locked rtld bind lock
is held, and then the spinlock protects the malloc structures from the
parallel updates.

Reviewed by:    kevans
Tested by:      Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57908
559f45638dfa50195c591bb0f7f3d3d8f3bb8dc0 Konstantin Belousov 2026-06-27 18:50:29

rtld: stop using unbound alloca()

For DoneList allocations, its size depends on the number of loaded DSOs.
Small images could be served by alloca(), but large donelists need to
go into heap.

For map_object(), alloca size is the number of segments in the object.

In both cases, over-grown situations would cause a stack overflow.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295991
Noted and reviewed by:  kevans
Tested by:      Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57908
1e370f038778e16c4b31f8992dda339d429e5cb8 Konstantin Belousov 2026-06-27 15:11:37

rtld: unify the return path for map_object()

Reviewed by:    kevans
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57908
70fb92cd56bfe88a12d2a253542320bad7198321 Konstantin Belousov 2026-06-29 20:08:31
stand: Fix shadow buffer offset handling
The shadow buffer is addressed relative to `tg_origin`, which includes
the padding offset, whereas `gfxfb_blt` operates on coordinates without
that offset. To make `gfx_fb_copy_area` emulate the behavior of
`gfxfb_blt`, the source coordinates must include the padding offset,
while the destination coordinates must not. The original implementation
omitted the offset from the source coordinates; this change corrects
that.

Additionally, `gfx_fb_cons_display` already applies the padding offset,
so the redundant adjustment is removed.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296246
Reported by:    2khramtsov@gmail.com
Reviewed by:    imp
Tested by:      2khramtsov@gmail.com, junchoon@dec.sakura.ne.jp,
naito.yuichiro_@gmail.com
Fixes:          https://cgit.freebsd.org/src/commit/?id=32da2f23ae4d
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57821
76aa776b5f47ecd0d45336e22795fef98af57d2f ShengYi Hung 2026-06-24 14:31:03
syslogd: Handle connection errors when setting up forwarding sockets
Since syslogd was converted to run in a Capsicum sandbox, it needs to
explicitly connect() its forwarding sockets rather than using sendmsg().
At the time syslogd starts during boot, some of its forwarding
destinations may not be routable, in which case connect() fails.

Fix this by making connect() failures non-fatal, and use cap_net to
lazily connect sockets once something actually tries logging to the
destination.

Add a regression test.

Reported by:    ae
Reviewed by:    ae
Discussed with: jfree
Fixes:          https://cgit.freebsd.org/src/commit/?id=4ecbee2760f7 ("syslogd: Open forwarding socket descriptors")
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57394
8a62a5f77b10ddfa593c4a3d7751cf9bac3bb1b3 Mark Johnston 2026-06-30 19:19:50
bhyve: Add CPU pinning diagnostic message
When pinning a vcpu to a hostcpu fails, print out a diagnostic message
to stderr indicating the failing CPU pair.

MFC after:      1 month
Reviewed by:    bnovkov
Differential Revision:  https://reviews.freebsd.org/D57619
9ea13242985dc145b2471cc8f651be87c6a74bfe John De Boskey 2026-06-30 21:29:50

Libraries

posix_spawn: actions chdir and fchdir are now required by POSIX
Drop the _np suffix.

Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56222
7caa71145c5eea5925c295e0cdd95b517005acf9 Konstantin Belousov 2026-04-02 07:57:58
lib/msun: Added fmaximum and fminimum family. Tests and man page
Starting from the existing fmax{,f,l} functions I've added the fmaximum
family, which handles NaN according to the newest standard (propagating
it).

This commit is a PoC for GSoC 2026.

Reviewed by:    fuz, kargl
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D55834
e55db843ef45a8788f69e110d97210fb3968b92f Jesús Blázquez 2026-03-31 16:31:15
Add boot_setenv
Move is_restricted_var() to libsa/environment.c so it can be leveraged
by boot_setenv called from subr_boot with not truted input.

Also, allow for local tuning via ENV_IS_RESTRICTED_ALLOWED_LIST and
ENV_IS_RESTRICTED_LIST

Sponsored by:   Hewlett Packard Enterprise Development LP.

Reviewed by:    kevans, imp
Differential Revision:  https://reviews.freebsd.org/D56287
a371b008d13f84cf4448bf6d700641ecc15c206b Simon J. Gerraty 2026-04-07 16:29:07
lib/msun/aarch64: provide export file for arch-specific fenv methods
Reported and tested by:       fluffy
Reviewed by:    emaste
Fixes:  https://cgit.freebsd.org/src/commit/?id=3a01e1e1a50cb9a9594aac2148dc920a6b295428
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56283
96a685c229f2ce440591f98d33d36776e56dd55c Konstantin Belousov 2026-04-06 16:41:23
libgcc_s: export __extendhftf2
We've compiled it since the LLVM 13 import in 2021, but for some reason
never exported it.  A user of CheriBSD recently caused Morello LLVM to
emit a reference to it so finish the job and export it.

Reviewed by:    dim, emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=6e75b2fbf9a0 ("Merge llvm-project release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a")
MFC after:      1 week
Sponsored by:   DARPA, AFRL
See also:       https://github.com/CTSRD-CHERI/cheribsd/issues/2614
Differential Revision:  https://reviews.freebsd.org/D56310
a7e07d0d57f1a2f2c94c6be1e3f33c03635235d1 Brooks Davis 2026-04-08 15:31:03
libc: fix memfd_create's HUGETLB handling
The 'simplification' commit referenced below actually broke one aspect
of MFD_HUGETLB: the caller isn't supposed to be required to specify a
size.  MFD_HUGETLB by itself without a shift mask just requests a large
page, so we revert that part of memfd_create() back.

While we're here, fix up the related parts of the manpages a little bit,
since MFD_HUGETLB is actually supported.  The manpage claims that we
would return ENOSYS if forced mappings weren't supported, but this was
actually not true.  However, that seems like a very important
distinction to make between ENOSYS and EOPNOTSUPP, so fix the
implementation to match the docs.

Fixes:  https://cgit.freebsd.org/src/commit/?id=8b8cf4ece660f ("memfd_create: simplify HUGETLB support [...]")
Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D56114
9a8d333368baef356f0a611b47ec592568dd14f9 Kyle Evans 2026-04-09 02:37:00
cap_dns: plug a memory leak
9f1be4bfebd08b249877267a1634c249c9f6d221 Mariusz Zaborski 2026-04-10 10:19:05
lib/msun: Added fmaximum_mag and fmaximum_num families
Added support for the f{maximum,minimum}_{mag,num} families, the new
C23 standard functions for maximum magnitude and number-preferring
maximum.  This includes modifying fmax.3, on top of D56230, to
recommend the use of fmaximum_num and fminimum_num.

Reviewed by:    fuz, kargl
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D56236
4e30c12973c73539bef01be3870a90b6346141e8 Jesús Blázquez 2026-04-11 08:11:44
unistd.h: _Fork(2) is required by POSIX 2024
Reviewed by:  imp
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56362
f286933c950f6308117c8400f36f3160f6227491 Konstantin Belousov 2026-04-12 08:57:51
libarchive: merge from vendor branch
libarchive 3.8.7

Important bugfixes:
 #2871 libarchive: fix handling of option failures
 #2897 iso9660: fix undefined behavior
 #2898 RAR: fix LZSS window size mismatch after PPMd block
 #2900 CAB: fix NULL pointer dereference during skip
 #2911 libarchive: do not continue with truncated numbers
 #2919 CAB: Fix Heap OOB Write in CAB LZX decoder
 #2934 iso9660: fix posibble heap buffer overflow on 32-bit systems
 #2939 cpio: Fix -R memory leak
 #2947 libarchive: lzop and grzip filter support

Important bugfixes between 3.8.5 and 3.8.6:
 #2860 bsdunzip: fix ISO week year and Gregorian year confusion
 #2864 7zip: ix SEGV in check_7zip_header_in_sfx via ELF offset validation
 #2875 7zip: fix out-of-bounds access on ELF 64-bit header
 #2877 RAR5 reader: fix infinite loop in rar5 decompression
 #2878 mtree reader: Fix file descriptor leak in mtree parser cleanup
       (CWE-775)
 #2892 RAR5 reader: fix potential memory leak
 #2893 RAR5: fix SIGSEGV when archive_read_support_format_rar5 is called
       twice
 #2895 CAB reader: fix memory leak on repeated calls to
       archive_read_support_format_cab

Obtained from:  libarchive
Vendor commit:  ded82291ab41d5e355831b96b0e1ff49e24d8939
MFC after:      1 week
eb5165bb491138f60d9004bc4c781490016d9288 Martin Matuska 2026-04-13 13:47:17
lib/libifconfig: Fix pointer-sign warnings
Fix all pointer-sign warnings generated when compiling libifconfig.

One of these warnings comes from the misuse of snl_add_msg_attr_string
for a byte array.  Though userland treats carpr_key as a string, it is
actually an array of bytes.  Handle it as such in libifconfig.

While here, fix a small consistency nit in ifconfig_sfp_get_sfp_dump.

Signed-off-by: Ryan Moeller <rmoeller.dev@gmail.com>
Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/1850
20cd1b475a1ef9dfca30726999aa1b9a02d5bc39 Ryan Moeller 2025-09-18 15:04:35
libpfctl: fix add state/source limiter
When processing the return data from these calls pass the limiter
pointer, not the limiter pointer pointer.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
13b4a14c719ab7c65ccaab86ddc79f0edc312aa3 Kristof Provost 2026-04-16 12:30:35
libarchive: Update configuration
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294577
MFC after:      1 week
Reviewed by:    mm
Differential Revision:  https://reviews.freebsd.org/D56468
05bbe5e3883492dd2afa52039da1fac45c5059a0 Dag-Erling Smørgrav 2026-04-18 08:25:31
mixer(3): Rename _mixer_readvol() to mixer_readvol()
No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
c39237a4fd2b1472e452052103156c915942d070 Christos Margiolis 2026-04-18 11:50:04
libvmmapi: Check for allocation failure in vm_vcpu_open()
vm_vcpu_open() really should check the value returned from malloc() and
return NULL on failure. Also, all users of vm_vcpu_open() need to check
the returned value for NULL, too.

Reviewed by:    corvink, markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56346
91f03cde6604fdb940f30d81e4860118ee07f4b3 Hans Rosenfeld 2026-04-20 15:14:16
geom_part: Restore the human readable format of size
Prior to the change 4f809ffec69c, the sizes are formated by
humanize_number(3) with the flag HN_DECIMAL, which displays the result
using one decimal place when it is less than 10. That is more accurate
and useful. Add equivalent field modifier hn-decimal to xo_emit() to
restore the previous behavior.

Reported by:    Mark Millard
Reviewed by:    js
Fixes:          https://cgit.freebsd.org/src/commit/?id=4f809ffec69c gpart: add libxo support for "show" subcommand + man page updates
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56514
0d16792c6e983005581ed0176ed81e7302582196 Zhenlei Huang 2026-04-20 16:59:59
include/stdbit.h: declare size_t, (u)int*_t, and (u)int_least*_t
These are required by ISO/IEC 9899:2024 § 7.18.1 ¶ 1 but were forgotten
in my initial work.

The current approach leaks intptr_t, uintptr_t, intmax_t, and uintmax_t
through <sys/_stdint.h>.  This could be avoided using a more complicated
approach if desired.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294131
Fixes:          https://cgit.freebsd.org/src/commit/?id=6296500a85c8474e3ff3fe2f8e4a9d56dd0acd64
Reported by:    Collin Funk <collin.funk1@gmail.com>
Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56515
c8c9324c94dfd4eeecbcfe4a1d3daa047420d3e5 Robert Clausecker 2026-04-19 12:36:34
lib/msun: Replace manual checks with isnan() calls
The maximum and minimum functions, as well as nextafter and nexttoward,
were using manual NaN checks instead of the isnan() macro.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294692
Reviewed by:    fuz, kargl
MFC after:      1 month
f6e1f27e9f005447e88a9b37df8a75751b1e0c3a Jesús Blázquez 2026-04-21 15:23:20
libc/fls*.c: use *_WIDTH macros over CHAR_BIT * sizeof(type)
Makes the code easier to understand.

MFC after:      1 week
bc537e970d7e52d278952915b0b1842dfbb03afc Robert Clausecker 2026-04-22 22:47:23
Partially revert libc++ commit aa7f377c965c, restoring stdint.h
This partially reverts upstream libc++ commit aa7f377c965c:

  [libc++] Remove libc++'s own stdint.h and locale.h (#107436)

  These headers are not doing anything beyond the system or compiler
  provided equivalent headers, so there's no real reason to keep them
  around. Reducing the number of C headers we provide in libc++ simplifies
  our header layering and reduces the potential for confusion when headers
  are layered incorrectly.

The problem is that libc++'s own `stdint.h` _does_ do something: it
defines `__STDC_LIMIT_MACROS` and `__STDC_CONSTANT_MACROS` before
including the system `stdint.h`, causing the latter to expose macros
like `SIZE_MAX`, `UINT64_C`, and others.

If the `__STDC_LIMIT_MACROS` and `__STDC_CONSTANT_MACROS` macros are not
exposed, C++ programs compiled for standards before C++11 can fail with
errors due to those macros not being available.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
00bee6fcd77f7812e967f85d1cacbc349ff312b3 Dimitry Andric 2025-12-30 19:49:35
Fix up builds on Linux hosts after llvm 21.1.8 merge
This is because contrib/llvm-project/llvm/lib/Support/Unix/Threading.inc
attempts to use pthread_get_name_np(3) and pthread_set_name_np(3), which
are not defined on Linux.

Reported by:    ivy
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
b6d823e39072daae9df4b47a15ea7142b7a55f1a Dimitry Andric 2026-04-25 15:20:27
libgcc_s: Add a linker script to link to libgcc
When using outline atomics on arm64 the compiler will create a call to
a function that performs the atomic operation. This allows us to use
the fastest operation depending on the hardware.

As these functions are implemented in libgcc create a linker script
so libraries that link against libgcc_s will include libgcc to pull
them in.

Reviewed by:    imp, jhb
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D45268
e63eee84cad59f63338a539e73bed07917932088 Andrew Turner 2026-04-27 10:54:18
hwpmc_ibs: Add external error handling
Add EXTERR_CAT_HWPMC_IBS to the external error categories and replace generic
EINVAL returns in ibs_allocate_pmc() with EXTERROR() calls that provide
detailed error messages.

This will be augmented with additional cases in the near future.

Reviewed by:    mhorne
Sponsored by:   AMD
Signed-off-by:  Andre Silva <andasilv@amd.com>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2134
a9a562a08e77ac024066a6ca7ab77e7e25e007dc Andre Silva 2026-04-06 20:55:43
libiscsiutil: preserve errno across warning logs
Various calls in the implementation can clobber errno; preserve it for
the caller since none of these will bubble up pass/fail to simplify
some future error handling in ctld.

Reviewed by:    jhb
Differential Revision:  https://reviews.freebsd.org/D56539
fe9d81d7c6602e9b18cde2aaf8cbd5f65b87c091 Kyle Evans 2026-04-28 20:51:50
efivar: Move dump functions into libefivar
To allow their use by efibootmgr.

Signed-off-by:  stephane.rochoy@stormshield.eu
Reviewed by:    imp
Sponsored by:   Stormshield
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2167
48363f39f1417df3e39da53f219596f8501c9452 Stéphane Rochoy 2026-04-24 12:10:19
libifconfig: Skip bridge VLAN config for span members
bridge(4) doesn't support BRDGGIFVLANSET for span members, which
means if a span interface is configured, libifconfig will fail to
fetch bridge members.  Skip this for IFBIF_SPAN members.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292634
MFC after:      3 days
Reported by:    Emrion <kmachine@free.fr>
Reviewed by:    pouria, zlei
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56694
454322c08b8aa181939c8d920472f03cfd591032 Lexi Winter 2026-04-29 03:11:20
libnv: switch fd_wait() from select(2) to poll(2)
The previous implementation used FD_SET() on a stack-allocated fd_set,
which is an out-of-bounds write whenever the socket fd is >= FD_SETSIZE
(1024).

Approved by:    so
Security:       FreeBSD-SA-26:16.libnv
Security:       CVE-2026-39457
Reported by:    Joshua Rogers of AISLE Research Team (https://aisle.com/)
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56689
f5ea3dce2cbe1ee2068c5e5c11bb066f5789685b Mariusz Zaborski 2026-04-28 14:35:10
ssp: fix our gets_s implementation under _FORTIFY_SOURCE
Annex K specifies an interface for handling constraint violations from
gets_s, but we previously broke this for some classes of get_s misuse.

Provide a more nuanced version that tries to dodge errors that would
trigger a constraint handler while still providing value.  Notably, we
don't want to trigger a failure unless the passed-in length reasonably
fits within an RSIZE_MAX, because gets_s will immediately call larger
lengths bogus and fail.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294881
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56734
d98f4f0698ef0c5178882c544b4c38542d4780f0 Kyle Evans 2026-05-01 02:57:51
tests: fix remaining test failures under _FORTIFY_SOURCE
The getgroups test is a NetBSD tests, so just apply our larger hammer
and disable the feature entirely.  The audit test can take a more
surgical approach and use __ssp_real() appropriately, since it's a local
one.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294881
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56735
910f78a5143af32dfcb237a463397aa0c31c07df Kyle Evans 2026-05-01 02:57:51
lib/clang: Fix bootstrapping on macOS after LLVM 21 merge
Fixes:                https://cgit.freebsd.org/src/commit/?id=770cf0a5f02d ("Fixups after llvm-project main llvmorg-21-init-19288-gface93e724f4 merge")
MFC after:      1 month
50bd6ee0cce9d3959828b0267b06ea0403781f41 Jessica Clarke 2026-05-01 16:55:28
lib/msun: fmaximum_mag_num family. Tests and man page
Added the fmaximum_mag_num{,f,l} and fminimum_mag_num{,f,l} functions.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294719
Reviewed by:    fuz, kargl
MFC after:      1 month
f62d826a6f5b9022b0cedfe22a698998ad9cb7f4 Jesús Blázquez 2026-04-21 17:17:00
lib/msun: Replaced pattern to force exception in _num families
Replaced the old pattern of using a ternary to force addition
(raising exceptions for sNaN's) with a new one using a volatile
variable. The _mag_num family was already implemented with this pattern

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294719
Reviewed by:    fuz, kargl
MFC after:      1 month
7c20e15592a07ea457cacb0d6706948815c8420e Jesús Blázquez 2026-04-27 16:43:41
libc: add freadlink(3)
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56365
ae6a13deb8e33a52188643e09171207e1d7171e8 Konstantin Belousov 2026-04-12 08:56:26
Add O_SYMLINK emulation
for MacOSX partial compatibility, defined as O_PATH | O_SYNC | O_DIRECT.

libc openat() wrapper is modified to fstat() the descriptor and re-open
in the normal mode if the type is not symlink.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56365
f9458655e78f6532e962a13d28d6a6086b4156de Konstantin Belousov 2026-04-12 08:48:32
libusb: Add libusb_endpoint_transfer_type enum
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
261002908ffd9f13d19d1c6be6f82edac26b6938 ShengYi Hung 2026-05-05 14:39:29
libusb: fix incorrect status type when completion on cancel the events
Reviewed by:    lwhsu, markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51736
06271366982eb6fe59502fcdf95a1a22e0671d5f ShengYi Hung 2025-08-05 09:41:17
libc: correct posix_spawn_file_actions_init ENOMEM error
The return value of posix_spawn_file_actions_init() is an error number.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D56911
3ca8ec19b6ecc8ae4413d0505ce2d0efdd3e52c8 Jilles Tjoelker 2026-05-09 22:01:50
libc: add freadlink(3)
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56365
a2e0822543e93a8d815acd2d1c3d51ef73d6e262 Konstantin Belousov 2026-04-12 08:56:26
[libm] implementation of rsqrt, rsqrtf, and rsqrtl
From the PR:
The attached diff implements the inverse square root function, i.e,
rsqrt(x) = 1 / sqrt(x).  Exhaustive testing of the float version
suggests that it is correctly rounded in round-to-nearest for all
test values in the range [0x1p-127,0x1p126].
Exhaustive testing of rsqrt and rsqrtl cannot be done, but 1100M
values of x for rsqrt and 400M values for rsqrtl were tested.  All
tested values were correctly rounded.

I do not have access to LD128 (i.e., IEEE 128-bit floating point)
hardware, so the implementation of rsqrtl() is untested.

The following is a summary of changes to source code.

* lib/msun/Makefile:
  . Add s_rsqrt.c and s_rsqrtf.c to COMMON_SRCS.
  . For non-53-bit long double targets, add s_rsqrtl.c to COMMON_SRCS.
  . Add MLINKS for rsqrt.3, rsqrtf.3, and rsqrtl.3 to sqrt.3.

* lib/msun/Symbol.map:
  . Add rsqrt, rsqrtf, and rsqrtl to the Symbol map for shared libm.so.

* lib/msun/man/sqrt.3:
  . Update the sqrt.3 manual page to include information for rsqrt[fl].
  . Note, these function come from ISO C23 (and IEEE-754 2008).

* lib/msun/src/math.h:
  . Add prototypes for new functions.

* lib/msun/src/math_private.h:
  . Add _SPLIT, _FAST2SUM, _SLOW2SUM, _XADD, _MUL, and _XMUL
    macros to perform type-type arthimetic (i.e., float-float).

* src/s_rsqrt.c:
  . New file with the implementation of 'double rsqrt(double)'.
  . For 53-bit long double targets, add a weak reference for rsqrtl.

* src/s_rsqrtf.c:
  . New file with the implementation of 'float rsqrt(float)'.

* src/s_rsqrtl.c
  . New file with the implementation of 'long double rsqrt(long double)'.
    Note, the LD80 version uses bit twiddling and LD128 version is a
    straight C language implementation.  The LD128 is untested due to
    lack of hardware.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295089
MFC after:      1 week
3085fc9d97bd83785ba3ba43e0378d7d67987d1f Steve Kargl 2026-05-08 14:06:08
libutil: Include param.h in quotafile.c
Required for MAXPATHLEN.

MFC after:      1 week
237900f17f091d059a3ead6a5320285654f4bfa0 Mark Johnston 2026-05-12 17:47:04
libufs: Avoid using param.h constants in libufs.h
MAXBSIZE is defined in param.h, which defines many other things.  To
avoid forcing all consumers of libufs.h to include param.h, let's
instead redefine it and verify the definition in inode.c.

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56859
271d25a066b59df1e2bb774990948c985382126a Mark Johnston 2026-05-12 17:47:17
cap_net: fix error propagation for ENOTCAPABLE in cap_getaddrinfo
Fixes:                https://cgit.freebsd.org/src/commit/?id=b60053fde172 ("libcasper: Fix inconsistent error codes of cap_get{addr,name}info()")
ee04ee95ab386147c57d3b4efcc5774e8d64330b Mariusz Zaborski 2026-05-12 09:48:56
cap_net: do not allow new limits to drop keys from the old ones
If the old limit had family/hosts/sockaddr set, the new limit must
have them too. Before, a missing key in the new limit was treated as
"allow any", which let a caller silently extend their limits.

Reported by:    Joshua Rogers of AISLE Research Team
Reviewed by:    markj
MFC after:      1 day
Differential Revision:  https://reviews.freebsd.org/D56991
d705a519525f2acae3c1efba11436ec6ee8aea0a Mariusz Zaborski 2026-05-12 08:33:41
Commit group #78: nlist: Handle multiple symbol tables
nlist: Handle multiple symbol tables

* Instead of looking for and stopping at the first SHT_SYMTAB section,
  iterate over all SHT_DYNSYM and SHT_SYMTAB sections until we've either
  found all our symbols or run out.

* Perform bounds checks on section and string table offsets and sizes
  before attempting to mmap() the string table.

* Perform bounds checks on individual symbol table entries before
  attempting to access the corresponding strings.

* Stop treating _Foo and Foo as the same symbol.

This unbreaks OpenSSH which uses nlist(3) to verify PKCS#11 providers.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295336
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=77909f597881 ("Initial elf nlist support [...]")
Fixes:          https://cgit.freebsd.org/src/commit/?id=644b4646c7ac ("OpenSSH: Update to 10.1p1")
Reviewed by:    kib, emaste
Differential Revision:  https://reviews.freebsd.org/D57034
4617a6cb82a673b02257257c1f5f8a3c8d2bb943 Dag-Erling Smørgrav 2026-05-19 06:52:53

nlist: Decrement nent on match

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295336
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=4617a6cb82a6 ("nlist: Handle multiple symbol tables")
e9cbbf04d6fe24b3a207cf085122def72145742e Dag-Erling Smørgrav 2026-05-21 09:26:47
libcasper: switch from select(2) to poll(2)
The previous implementation used FD_SET() on a stack-allocated fd_set,
which is an out-of-bounds write whenever the socket fd is >= FD_SETSIZE
(1024).

poll(2) takes an array indexed by slot rather than by fd value, so it
has no FD_SETSIZE limit.

Approved by:    so
Security:       FreeBSD-SA-26:22.libcasper
Security:       CVE-2026-39461
Reported by:    Joshua Rogers
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56695
a10bc81d333e04664c1a1d6024c580794b079eca Mariusz Zaborski 2026-05-18 15:32:49
acl_id_to_name.c: Fix printing of uids and gids
uid_t and gid_t are uint32_t (unsigned 32bit integers).
They are printed as signed integers when calling getfacl
(and other tools using the acl_to_text() libc function).
This causes uid/gids larger than 2G (214783648) to print
as negative numbers
- which causes problem with setfacl since the acl_from_text()
  libc function fails on negative numbers.

Reviewed by:    rmacklem
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57179
6e7c10c79deac3c6bb6ad3bd12c8e0ad68bb59f0 Peter Eriksson 2026-05-25 19:44:41
upstream: fix hard-to-reach NULL deref during pubkey auth
To hit this, the user must be using a PEM style private key with no
corresponding .pub key adjacent to it.

OpenBSD-Commit-ID: b7150acc5322fa33f21491834d9471fbe3d30f20
(cherry picked from commit cf6c0b3b94cdc223f1b8be1ef2d93e993af5d976)

Reviewed by:    emaste
77fd9e0ceabcfa99894b3e70f60013c157115ca0 djm@openbsd.org 2026-05-13 05:11:02
fts: Check link count before using it
* Check the range of the link count before trying to use it.

* Rewrite the comment explaining what the link count is used for.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57324
b2b95249ae0e24a6e24ad4286da56f1aff7a6db0 Dag-Erling Smørgrav 2026-05-29 17:45:06
login_class: Fix kqueues, pipebuf resource types
* kqueues is a count but is listed as a size

* pipebuf is a size but is listed as a count

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295623
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=a4c04958f526 ("libutil: support RLIMIT_PIPEBUF")
Fixes:          https://cgit.freebsd.org/src/commit/?id=85a0ddfd0b26 ("Add a resource limit for the total...")
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57333
b5dce0ae4f78251f56ffcb6c6a58b9e6c20380e0 Dag-Erling Smørgrav 2026-05-29 22:06:44
rpcsvc: Remove obsolete bool definition from yp_prot.h
`yp_prot.h` has carried a SunRPC-era typedef of `bool` guarded by
`BOOL_DEFINED`, but the header itself does not use it. The YP/RPC
interfaces use `bool_t` for protocol booleans.

Defining `bool` in a public header collides with modern C headers
that provide `bool` as a macro or keyword, such as `<stdbool.h>`
and C23-aware assert handling. Drop the compatibility typedef and
leave `bool` definition to the consumer's language mode.

Signed-off-by:  Faraz Vahedi <kfv@kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
60c11e7c54d0128fafcea9c804c7736e2fb53e37 Faraz Vahedi 2026-05-25 19:14:58
libc: Restrict the static_assert macro to pre-C23 modes
Signed-off-by:        Faraz Vahedi <kfv@kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
c5c7d18d011830088a2134e1be32f610f1f3e797 Faraz Vahedi 2026-05-17 20:47:49
libc: Add variadic assert in accordance with C23
Signed-off-by:        Faraz Vahedi <kfv@kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
867b51452ea78ece0b312a387e63fdbc2a11056a Faraz Vahedi 2026-05-28 07:31:29
libc: Add <assert.h> C23 feature test macro
Signed-off-by:        Faraz Vahedi <kfv@kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
0fe73dcf7c3260260afd95c3d1cfe846feb1df7c Faraz Vahedi 2026-05-17 20:39:18
ntsync: install headers for userspace consumption
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57038
0ac9aac81c40159d561e43fc6976a866f852832b Konstantin Belousov 2026-05-17 07:43:01
protocols: Update with IANA list
- Update /etc/protocols with IANA list updated 2026-03-09.
- Document that 240 (pfsync) is not assigned by IANA.
- Document deprecated protocols.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295739
Reviewed by:    des
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57445
e3fa020202d8e040242016bda275dde83c058549 Yoshihiro Takahashi 2026-06-05 13:14:06
libc: Guard mergesort() allocation size arithmetic
Signed-off-by:        Faraz Vahedi <kfv@kfv.io>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2243
Reviewed by:    fuz
MFC after:      1 week
3501eec9dd39b527a46e82de53480968d283b90e Faraz Vahedi 2026-05-28 13:50:45
msun: Fix up for recent rsqrt[fl] functions
Paul Zimmermann (of Core-Math and MPFR fame) graciously tested
the recently committed rsqrt[fl]() functions.  He identified 127
incorrectly rounded values for rsqrtf() in round-to-nearest mode.
This patch fixes the rounding in RN.  Exhaustive testing now shows
that rsqrtf() is corrected rounded for RN.  He also tested rsqrt()
and rsqrtl() in the interval [1,4).  Both appear to be correctly
rounded.  Finally, the patch includes small changes to comments.

A concise list of changes is

* lib/msun/src/s_rsqrt.c:
  . Fix comments.

* lib/msun/src/s_rsqrtf.c
  . Fix comments.
  . Exhaustive testing by Paul Zimmermann found 127 incorrectly
    rounded values in round-to-nearests.  These gave have the
    form 0x1.13e07pN with N an odd integer.  With this patch, all
    values are now correctly rounded in round-to-nearest.

* lib/msun/src/s_rsqrtl.c
   . Fix comments.
   . Move all variable declarations to top of function and sort.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295706
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=3085fc9d97bd83785ba3ba43e0378d7d67987d1f
c3f6dcea199289329c1d3b91b69e5a4821fc3dff Steve Kargl 2026-06-07 19:12:16
libc: Add free_sized() and free_aligned_sized() as per C23
Add C23 sized deallocation entry points as thin wrappers around free(3).
Implementations may ignore size and alignment hints, so behaviour stays
correct for existing allocations without validating caller metadata yet.

When jemalloc is updated to 5.3.1, rewire these to je_free_sized() and
je_free_aligned_sized() so deallocation can use the allocator's sized
deallocation (free_sized for fast paths and free_aligned_sized for
correct aligned hints.)

Please note this change satisfies the standard interface only. Both
functions should be delegated to jemalloc after the upgrade so callers
get the intended allocator behaviour; until then, hints are unused and
neither sized nor aligned-sized deallocation optimizations apply.

Signed-off-by:  Faraz Vahedi <kfv@kfv.io>
Reviewed by:    fuz
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2201
MFC after:      1 month
5f732742ad5b3133a860a8969cf2bd13dc9ac358 Faraz Vahedi 2026-05-16 18:36:17
libc: Use slow path in fenv in C++
C++ exposes cfenv functions via using ::func. Our name-mangling
mechanism rewrites all function calls causing symbols such as
std::feclearexcept to be transformed into std::__feclearexcept_int.
Since no such function exists, compilation fails.

The using ::feclearexpect declarations themselves are unaffected because
they are not function calls, which further exposes the mismatch

As a result, enable the fast path only for C and fall back to the slow
path in C++.

Reviewed by:    kib
Fixes:          https://cgit.freebsd.org/src/commit/?id=5bc64b7d417d
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57450
9c0489508695fde3bdd742edfd1b4b681aab4d19 ShengYi Hung 2026-06-04 08:58:28
cap_net: add tests for limits drop
Reviewed by:  markj
Differential Revision:  https://reviews.freebsd.org/D56992
97edd37e6279d76efee89d466550587246161dc9 Mariusz Zaborski 2026-06-09 11:34:13
libc: Fix assert() sanitiser for C++ contextual bool conversion
Replace the `(bool(*)(bool))` probe in `__assert_sanitize()` with an unevaluated
conditional expression, so types with `explicit operator bool()` that require a
contextually converted constant expression of type `bool` are handled correctly.

Ergo, arity check is now performed separately via `__assert_sanitize_arity()`, a
unary template whose parameter pack must bind to exactly on argument after
`__VA_ARGS__` is substituted into the call.

Also align NDEBUG with C23 requirements.

Reported by:    dim, aokblast
Signed-off-by:  Faraz Vahedi <kfv@kfv.io>
Reviewed by:    aokblast, fuz
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=867b51452ea78ece0b312a387e63fdbc2a11056a
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2265
48d20fd1cf90179e778c6155900cbed2be140273 Faraz Vahedi 2026-06-06 11:38:47
libc: Suppress <stdalign.h> content for C23 and later
C23 deprecates <stdalign.h> and specifies that the header shall
provide no content (§7.15.1).

Signed-off-by:  Faraz Vahedi <kfv@kfv.io>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2223
MFC after:      1 month
Reviewed by:    imp, fuz
694baf88c2ae5957fdb24ed163993109987e1ef9 Faraz Vahedi 2026-05-20 10:06:16
libc: fix strtold NaN representation on riscv
Regenerate gd_qnan.h on riscv using the qnan.c
config tool found in contrib/gdtoa.

This fixes the following tests in CI:
lib/libc/stdio/scanfloat_test:infinities_and_nans
lib/libc/stdlib/strtod_test:strtold_nan

Reviewed by:    jrtc27
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57405
1e25cda7f06923d05e28dac8eb1c1c428a5c92dc Siva Mahadevan 2026-06-10 22:29:02
libpfctl: retrieve family id only once
Look up the pfctl family id when we open the handle, rather than for
every function call.
This saves us a lot of netlink calls, at the expense of storing one
extra int in the handle.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
2a478dfc7f9cd60037939e121026bf26a01e8c41 Kristof Provost 2026-06-11 12:53:31
libpfctl: fix memory leak
When we snl_init_writer() we allocate memory in the struct snl_state in the struct pfctl_handle.
This memory was never released again, leading to a memory leak. We still
had a reference to the memory and would release it on pfctl_close()
(so valgrind did not detect it as a leak), but long-lived users (e.g.
bsnmpd) would eventually run out of memory.

Explicitly reset the snl_state when we're done to prevent this.

MFC after:      2 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
fcb31b57112425a4eb64241651a0206108105298 Kristof Provost 2026-06-11 14:58:20
acl_to_text_nfs4.c: Fix a snprintf() for large uid
Commit 6e7c10c79dea fixed a couple of snprintf()s for large
uid/gid numbers above 2Gig.  This patch fixes another one.

Reviewed by:    rmacklem
Differential Revision:  https://reviews.freebsd.org/D57561
69e20977a468c9e570ee896ed7cf04969e86756d Nick Price 2026-06-13 21:15:17
tests/sigtramp_test: xfail on non-amd64
This test fail until at least https://reviews.llvm.org/D155066 is
rebased and picked up for aarch64 and more work is done for the other
archs.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289096
Reviewed by:    jlduran
Fixes:          https://cgit.freebsd.org/src/commit/?id=fef84fd8ae845e19cec0f6b9aac0e6451cca3d7a
MFC after:      3 days
0010c4b8a020dbeb81e61b71117d1caae9b044cc Siva Mahadevan 2026-06-15 22:09:05
msun/logarithm_test: expect_fail log1p_accuracy_tests in the correct spot
While here, remove the conditional on the "ci" config var to ensure that
this is reproducible locally as well.

This fixes a case where we are expecting a fail before the failing ATF_CHECK_*
assertion happens. Found in a CI failure here:
https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/16608/testReport/lib.msun/logarithm_test/log1p_accuracy_tests/

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253984
Fixes:          https://cgit.freebsd.org/src/commit/?id=405188aeac540f7666dfde37c2f32d222119f56e
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57351
19af9c77acc912e4bf90a667924f5f4ff78a7759 Siva Mahadevan 2026-06-17 17:04:54
libmlx5: sync PCI device allowlist with mlx5_core_pci_table
Userspace mlx5_driver_init() only attached when vendor/device matched
hca_table, while the kernel already probed additional Mellanox PCI IDs
That mismatch prevented libibverbs from loading the mlx5 provider on
those HCAs.

Extend hca_table to mirror mlx5_core_pci_table and add cross-references
so future kernel ID additions are paired with a userspace update.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 week
0e2175cef5027728c0ca1ff98366cf6ecfbe2db3 Slava Shwartsman 2026-05-04 11:19:36
libusb: Sync libusb_class_code with upstream
This reflects the difference from the upstream libusb code.
See: https://github.com/libusb/libusb/blob/master/libusb/libusb.h

Reviewed by:    adrian
Event:          BSDCan 2026
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57620
61e2ffd8168cc0f558ba7effe445573ffe2ad8c3 ShengYi Hung 2026-06-17 19:50:54
Commit group #79: ctermid(3): Fix return values section
ctermid(3): Fix return values section

ctermid() doesn't, and has never, set errno.

While here, add ctermid_r to the name section and align the parameter
name in the source file.

Reviewed by:    bnovkov
Approved by:    bnovkov
MFC after:      3 days
Obtained from:  https://github.com/apple-oss-distributions/libc
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D57396
dc24f31b67f5b0bac35cb93470f6f2d065d99f6f Aymeric Wibo 2026-06-19 14:21:12

ctermid(3): Fix return

Reported by:    bnovkov
Fixes:  https://cgit.freebsd.org/src/commit/?id=dc24f31b67f5 ("ctermid(3): Fix return values section")
Sponsored by:   Klara, Inc.
d7c110658e0b11fbe7a1f5d9f2b340d1985b9742 Aymeric Wibo 2026-06-19 14:53:42
libc/dbm: Differentiate between uninitialized and end-of-db cursors
Commit `3a686b851f8f` fixed a `dbm_nextkey` edge case when using
the function after reaching the end of the database, but it inadvertently
broke the following `R_NEXT` behaviour:
"If the cursor is not yet set, this is the same as the R_FIRST flag."

Fix this by adding a new cursor constant that allows us to differentiate
between an unset cursor and a cursor that overflowed.

Reported by:    ae
Fixes:  https://cgit.freebsd.org/src/commit/?id=3a686b851f8f
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D57670
Reviewed by:    markj
f879eb3febb6c294d684e8e7fecd5cc396ec5a28 Bojan Novković 2026-06-19 15:24:05
lib/msun/tests: re-enable nan_test on riscv
Commit 1e25cda7f06923d05e28dac8eb1c1c428a5c92dc fixed it.

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
52ad4f883489f73e7a876f5cf296bb5a7dc696a2 Siva Mahadevan 2026-06-15 22:27:52
iconv: Update availability of bool
While here, drop duplicate include.

MFC after:      1 week
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57733
8f750231d4b58ac71cbd3ac3548e1d7eb849f04b Dag-Erling Smørgrav 2026-06-22 13:23:23
Commit group #80: libusb
libusb: implement IAD parser

libusb provide functions to parse interface association descriptor. This
descriptor indicates that a function is composed by multiple interface
and which interfaces is associate to the target function. This
descriptor is not a separate USB require, instead, it comes with the
config descriptor.

Reviewed by:    adrian
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50958
ae489991d1c0b550ead309abc1eade3b185e7499 ShengYi Hung 2025-06-11 17:24:04

libusb: implement libusb_set_option

Implement libusb_set_option for API compatibility of libusb upstream
The implementation status of each option is as following:

LIBUSB_OPTION_LOG_LEVEL: just like libusb_set_debug
LIBUSB_OPTION_LOG_CB: add callback support for DPRINTF
LIBUSB_OPTION_NO_DEVICE_DISCOVERY: disable initialization of devd and
netlink when register. Also, create no thread when registration of
callback happens.
LIBUSB_OPTION_USE_USBDK: no needed as USBDK is for Windows

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50818
2879c818e5535e9c9dc592714c7d4ef0c1c9e8c1 ShengYi Hung 2025-06-11 19:07:39

libusb: refactor the process of setting option when init the context.

From
https://github.com/libusb/libusb/commit/6622f386f52807dac76c8a260c98aa02c311bc93#diff-c1f9bc250077d41456a3e580fca0ddf5d8c25b741bff6d9b9505990a8b70b254R2358.
We are able to set all of the option from the init_context. To address
this, we modify the process of setting option in init_context to make it be more clear and then
adapat libusb_set_option inside to all other option.

Reviewed by:    adrian
Sponsored By:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51224
be95871347a85f6feac59d036f62182fce847f23 ShengYi Hung 2025-07-09 09:36:07

libusb: implement libusb_get_max_alt_packet_size

The libusb has a function to calculate the size from given interface,
alt_setting, endpoint. Implementing it by refactoring the calculating
function for libusb_get_max_iso_packet_size.

Reviewed by:    adrian
Sponsored By:   FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51225
964823a18e116e86c05e1d6a6fd80b1bb3274e57 ShengYi Hung 2025-07-09 10:49:24

libusb: implement zlp flag in libusb transfer

The USB protocol defines a Zero-Length Packet (ZLP) to signal the end of
a transfer when the data size is an exact multiple of the Maximum Packet
Size (MPS). Without a ZLP in such cases, the device may not be able to
determine that the transfer has completed.

This flag is added to libusb to allow the user send a ZLP in the end
of libusb_xfer.

Reviewed by:    adrian
Sponsored by:   The FreeBSD Foundataion
Differential Revision: https://reviews.freebsd.org/D51759
d84b639a684e7e0640e7c24a1a6dbc09da4bc3d4 ShengYi Hung 2025-08-06 12:48:05

libusb: Add missing default in handling option switch

This makes GCC happy

Fixes:  https://cgit.freebsd.org/src/commit/?id=2879c818e553 ("implement libusb_set_option")
Event:  Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
08dca5971b08b65f227883502d9bb9f59eebd578 ShengYi Hung 2026-06-23 14:29:57
libusb: Implement libusb20_tr_get_flags
Reviewed by:    adrian, bapt
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57543
1a8701e2e9a97cabb18ed58d236382796d7f7aa7 ShengYi Hung 2026-06-11 15:39:44
librpcsec_gss: Fix an off-by-one in rpc_gss_get_principal_name()
Include an extra byte for the nul-terminator, otherwise we may end up
with an out-of-bounds write.

The corresponding bug in the kernel implementation was fixed by commit
e3081f7e3e2d ("kgssapi(4): Fix string overrun in Kerberos principal construction").

Reviewed by:    markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57738
635ad6f2ec97e9c6b1f15620cd5ee84eb632082f Jane Smith 2026-06-22 21:40:53
libusb: Implement libusb_set_log_cb
Reviewed by:    adrian
Event:  Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57770
25c2251064752b0ced310b1ed3795c8a68849b1c ShengYi Hung 2026-06-23 14:03:09
netlink: decode netlink message flags symbolically
Generate an nlm_flag table definition for mktable from
netlink/netlink.h, add a sysdecode_nlm_flag() helper to
libsysdecode, and use it when decoding netlink message headers.

This enables mktable to generate netlink message flag lookup tables and
replaces raw hexadecimal output for recognized NLM_F_* flag values
with their symbolic names.

Reviewed by:    kp
Signed-off-by:  Ishan Agrawal <iagrawal9990@gmail.com>
Sponsored by:   Google LLC (GSoC 2026)
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2294
4c932a4d45fb3130ffa80176f5ff9dcacabd49f1 Ishan Agrawal 2026-06-24 04:08:07
libnetbsd: Avoid bringing in all of sys/param.h in sys/types.h
It's okay to hard-code NBBY, as the value is somewhat unlikely to
change.

The pollution from sys/param.h makes it harder to import test code from
NetBSD since it can introduce conflicting definitions, e.g.,
MIN()/MAX().

Reviewed by:    ngie
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57754
0976744085bcd7ebda9779b02d78a85254b3e352 Mark Johnston 2026-06-24 13:16:45
libusb: don't treat EINVAL from USB_FS_COMPLETE as device detach
ugen20_process() treats any non-EBUSY errno returned by USB_FS_COMPLETE
as device detach and returns LIBUSB20_ERROR_OTHER. This causes libusb10
to set device_is_gone and fail all subsequent transfer with
LIBUSB_ERROR_NO_DEVICE.

However, USB_FS_COMPLETE can also return EINVAL when a completion
references an endpoint that no longer exists, for example after
SET_INTERFACE or SET_CONFIG removes and recreates endpoints. This is a
transient condition and does not indicate device detach.

Treat EINVAL the same as EBUSY and stop draining completions. This
prevents a guest selecting an isochronous streaming altsetting from
permanently breaking the passed-through device.

Reviewed by:    bapt
Event:          Halifax Hackathon 202606
Location:       Peggy's Cove Rock
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57542
240330a85e5f7f5d448123902ebee4136ef221fd ShengYi Hung 2026-06-25 22:38:17
locale: make install Unicode 17.0.0/CLDR 48.2
Data changes:

48.1:
- Update RSD (Serbian Dinar) to use 2-digits for non-cash and 0-digits
  for cash.
- Fix issue with tippi and bindi in Punjabi exemplars.
- Fix parsing issue in numeric date+time patterns for zh_Hant and yue.
- Fix issues with hour cycle display names for several languages.

https://cldr.unicode.org/downloads/cldr-48#481-changes

48.2:
- Group separator for number formatting was updated to ' in fr-CH
  consistent with other Swiss locales.
- Some fixes to date formats including: Hv available formats were
  updated to match behavior in CLDR 47 due to web compatibility issues
  related to current JS capabilities.
- Emoji annotations fixes including collisions between emoji short
  names.
- Updated AM/PM for ko & ps to be consistent with how the wide forms are
  localized.

https://cldr.unicode.org/downloads/cldr-48#482-changes

MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57627
cfd5bdcb4ee56c658ebc7cf7ea941261d1cd7f73 Jose Luis Duran 2026-06-28 23:07:38
do_posix_spawn(): use bool
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
b516c234d0e4ccd69ca1f3d3a8bb80eed3f0a87c Konstantin Belousov 2026-06-26 17:15:12
posix_spawn(3): create a guard page below the stack for rfork_thread on x86
Reviewed by:  kevans
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57955
2767a1f3686e5b1657ff4c3d57737c7f21598125 Konstantin Belousov 2026-06-29 22:06:53
iconv(3): Fix problems in various encodings
Fix null pointer dereference with HZ8 encoding.

Fix output buffer overrun in UTF-7, VIQR, ZW encodings.

Approved by:    so
Security:       FreeBSD-SA-26:49.iconv
Security:       CVE-2026-58081
Reviewed by:    markj, kevans
Differential Revision:  https://reviews.freebsd.org/D57947
a9d3259c4e50da8aac100da23aa37c43055f8be2 Taylor R Campbell 2026-06-22 21:15:25
iconv: Fix a buffer overflow in the HZ encoding
wcrtomb may store up to 2 2-byte escape sequences to the state buffer in
addition to the character itself.  In the worst case, a 3-byte heap
overflow is possible.

Approved by:    so
Security:       FreeBSD-SA-26:49.iconv
Security:       CVE-2026-58081
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57949
8bc3abb7d71eebe6819af1e61640067733e596dc Mark Johnston 2026-06-23 16:05:31

Filesystems

cd9660: Add length checks to Rock Ridge parser
* cd9660_rrip_slink() did not check that the lengths of individual
  entries do not exceed the length of the overall record.

* cd9660_rrip_altname() did not check that the length of the record
  was at least 5 before subtracting 5 from it.

Note that in both cases, a better solution would be to check the length
of the data before calling the handler, or immediately upon entry of
the handler, but this would require significant refactoring.

MFC after:      1 week
Reported by:    Calif.io in collaboration with Claude and Anthropic Research
Reported by:    Adam Crosser, Praetorian
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56215
d0afead876076f605c363f03d92304d1bd75be1c Dag-Erling Smørgrav 2026-04-01 17:14:16
nfsid.h: Put the nfsd_idargs structure in a new .h
This patch moves the definition of the nfsd_idargs
structure out of nfs.h and into a new file called
nfsid.h.

This is being done so that it can be included in
nfs_diskless.c in a future commit.

There should be no semantics change from this
commit.

MFC after:      1 week
Fixes:  https://cgit.freebsd.org/src/commit/?id=8b9775912cbc ("nfs_diskless: Add support for an NFSv4 root fs")
e6db4dd9d7216067388ae91ac73c3917a93f9420 Rick Macklem 2026-04-06 14:09:01
nfs: make no-IP kernels compile
Compiling a LINT-NOIP kernel (assumingly also a NOINET) port and ip
are set but not used in nfsrv_getclientipaddr().

Hide the variables behind #ifdef checks and do likewise for the parsing
results.  Admittingly the code probably wants to be rewritten one day.

Found with:     gcc15 tinderbox build
MFC after:      3 days
Reviewed by:    rmacklem
Differential Revision: https://reviews.freebsd.org/D56502
395c8f0855e0039205d9cb97adec39d9b9307c8b Bjoern A. Zeeb 2026-04-18 13:27:39
fusefs: better handling for low-memory conditions
Under conditions of low memory, getblk can fail.  fusefs was not
handling those failures very systematically.  It was always using
PCATCH, which appears to have been originally copy/pasted from the NFS
client code, but isn't always appropriate:

* During fuse_vnode_setsize_immediate, which can be called from many
  different VOPs and from the vn_delayed_setsize mechanism, remove
  PCATCH.  Some of these callers cannot tolerate allocate failure.

* In fuse_inval_buf_range, don't assume that getblk will always succeed.

* When calling fuse_inval_buf_range from VOP_ALLOCATE,
  VOP_COPY_FILE_RANGE, or VOP_WRITE (with IO_DIRECT), return EINTR if
  the allocation fails.

* When calling fuse_inval_buf_range from VOP_DEALLOCATE, remove PCATCH.
  This VOP must not fail with EINTR.

No new tests, because I can't force any particular getblk call to fail.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293957
Sponsored by:   ConnectWise
Reported by:    zjk7@wp.pl
MFC after:      1 week
374548e930bd9452351059c14e697036d903b1c4 Alan Somers 2026-03-30 14:22:07
nfscl: Disable use of callbacks for NFSv4.0
The only use for callbacks for NFSv4.0 is delegations
and delegations rarely work well for NFSv4.0 anyhow.

Therefore, this patch disables callbacks for the
NFSv4.0 client.  This is the same behavior as
occurred when the nfscbd(8) daemon was not running.

This change allowed a function called nfscl_getmyip()
to be removed from the kernel, which is nice since
maintaining this function was bothersome, due to its
use of routing, etc.

MFC after:      2 weeks
71ac1ec5c9d990e7881e75f04140eb0bfe473a21 Rick Macklem 2026-04-30 21:37:36
nfsd: Get rid of NFSD_VNET macros
When the nfsd was vnet'd, the VNET macros were hidden
behind macros that had the NFSD_ prefix on them.
This was done because, at the time, it was thought
that something other than vnet might be used for this.
That has not happened and probably will not happen,
so this patch replaces these obscuring macros with
the regular vnet ones.

There should be no semantics change caused by
this commit.

Discussed with: bz, glebius
MFC after:      1 month
821976facf746ef241e1524b44bb1de0af98fdc0 Rick Macklem 2026-05-02 21:36:43
fdescfs: do not change vnode type on VOP_GETATTR()
There is no point to do it.  The VNON type is good enough for fdescfs
operations, and changing the type on stat(2) is arbitrary and does not
serve much purpose, because we recalculate the returned file type on
each stat(2) anyway.

But setting the type to VLNK has undesired consequence of namei()
trying VOP_READLINK() there, which might fail since it defer the
calculation of path to vn_fullpath().

Submitted by:   Mike <mmpestorich@gmail.com>
PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294768
MFC after:      2 weeks
fbecfc4aa028964f972a0457809aa041d415f61b Konstantin Belousov 2026-05-03 19:09:15
nfsd: Disable use of callbacks for NFSv4.0
Commit 71ac1ec5c9d9 disabled callbacks for the NFS
client for NFSv4.0.  This patch does the same for
the NFSv4.0 server.

The only use for callbacks for NFSv4.0 is delegations
and delegations rarely work well for NFSv4.0 anyhow.

Therefore, this patch disables callbacks for the
NFSv4.0 server.  This is the same behavior as
occurs when vfs.nfsd.issue_delegations is 0.

This change allowed the functions called
nfsrv_getclientipaddr() and nfsrv_getipnumber() to be
removed from the kernel.

MFC after:      2 weeks
457c621add0a531273ee27798c924c6aaeacc4c1 Rick Macklem 2026-05-03 23:25:45
nfs_nfsdserv.c: Clip number of callback slots
The client tells the server how many callback slots
it can handle in the callback session.  However, the
NFSv4.1/4.2 server can only handle a maximum of
NFSV4_SLOTS slots.  This patch clips the client's
value to that, to avoid using too high a slot#
for a callback.

Fortunately, I do not know of an extant client that
specifies a value greater than NFSV4_SLOTS, so this
patch is not really needed, as yet.  Also, the client
rarely uses a slot# above 0 when doing callbacks.

MFC after:      2 weeks
03e9e83f358678bab5e4c1ddf9c9d8faa7183cbb Rick Macklem 2026-05-05 00:04:00
nfs_clsubs.c: Fix ncl_getcookie() when "pos" is negative
In ncl_getcookie(), a very large value for "off" for
a directory can result in "pos" being set to a bogus
value (including a negative one), due to truncation.
When "pos" is negative, is can skip past the
while (pos >= NFSNUMCOOKIES) loop and return a
bogus pointer instead of NULL.

This patch changes the type to u_int and also adds
a sanity check for a very large "off" to ensure that
a NULL pointer is returned for this case.

This bug has been in the code for decades and I am
not aware of any report of it causing a problem for
users.

Reviewed by:    markj
Reported by:    Joshua Rogers of AISLE Research Team
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56779
448b4c3f7f7dd4c7e1707d7b833a26294c297182 Rick Macklem 2026-05-06 14:54:55
p9fs: implement basic pathconf support
This is needed for various pjdfstest tests which fail with syntax errors
if pathconf _PC_NAME_MAX/_PC_PATH_MAX return -1. For NAME_MAX we can use
the 9P2000.L Tstatfs call to get namelen from the host. While this could
theoretically be different for nested filesystems in the shared mount it
is a much better guess than just returning 255.
There does not seem to be a way to get the host PATH_MAX, so we just
return the conservative kernel default.

Found while fixing https://github.com/CTSRD-CHERI/cheribsd/issues/2617.

Reviewed by:    markj, kib
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D56493
96b2f4a9124158f27c4c27c32f6fa1a6018250fb Alex Richardson 2026-05-07 04:22:23
p9fs: Fix creating files with restrictive permissions
When a file is created via p9fs with restrictive permissions (like 000),
the 9P TCREATE request successfully creates and natively opens the file,
returning an open, writable file descriptor. Previously, p9fs would
attempt a subsequent TOPEN. That TOPEN would fail with EACCES due to the
restrictive mode, leaving a 0-byte file and causing operations like 'mv'
to abort.

We now preserve the writable descriptor returned by TCREATE so that the
subsequent VOP_OPEN can use it directly, avoiding the failing TOPEN.
Additionally, p9fs_compatible_mode now appropriately isolates the base
access intent when matching fids, preventing extended flags from
breaking the match.

A test case for this behavior has been submitted to pjdfstest:
https://github.com/pjd/pjdfstest/pull/87

Resolves: https://github.com/CTSRD-CHERI/cheribsd/issues/2617

Reviewed by:    markj
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D56494
40d59ee35dc106cda88d66e37527975a32596cd7 Alex Richardson 2026-05-07 04:23:27
Commit group #81: ufs: support unmapped bufs for indirect blocks in bmap
ufs: support unmapped bufs for indirect blocks in bmap

Use unmapped bufs for indirect block buffers in bmap, and use sf_bufs
for transient mapping them when we need to read the specific pointer.

[kib note: I changed the original patch to use sf_buf instead of
explicit DMAP utilization, making the change MI].

Tested by:      pho
Reviewed by:    kib
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D53424
bab04ddf1fd4b7a77d1cfae4a67ededf1f35ee0d Chuck Silvers 2026-05-07 12:43:53

ufs: ufs_bmap_seekdata() needs mapped buffer for scan

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295348
Reported and tested by:  Alastair Hogge <agh@riseup.net>
Reviewed by:    mckusick
Fixes:  https://cgit.freebsd.org/src/commit/?id=bab04ddf1fd4 ("ufs: support unmapped bufs for indirect blocks in bmap")
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57036
8ad8643a66735d28dac53a772856c94ca65b2bf3 Konstantin Belousov 2026-05-17 00:09:21
nullfs: do not allow to mount a vnode over itself
This causes recursion in VFS that is not worth handling.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275570
Reported by:    Alex S <iwtcex@gmail.com>
Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57043
7bdf2b5d5fbabfc8749c4ff6e618c3e843b14de0 Konstantin Belousov 2026-05-16 22:16:45
tmpfs: Overhaul option handling on remount
On remount, we must accept all the same options as on initial mount.
For parameters which we're unable to modify on the fly, fail only if
the new value is different from the existing one.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295096
MFC after:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57044
1cfc208a07b64a64377a4f8fe51c28f588a929cf Dag-Erling Smørgrav 2026-05-19 06:54:28
fusefs: Handle buggy servers' LISTXATTR response
The fuse protocol requires server to respond to LISTXATTR with a
NUL-terminated string.  If they don't, report an error rather than
attempt to scan through uninitialized memory for a NUL.

Approved by:    so
Security:       FreeBSD-SA-26:20.fusefs
Security:       CVE-2026-45252
admbugs:        1039
Reported by:    Joshua Rogers
Sponsored by:   ConnectWise
d91c459a93e5f70c1d3ad3d504bcf64babed8600 Alan Somers 2026-05-04 19:35:11
p9fs: Implement msize mount option and bump default to 128 KiB
QEMU warns when msize is <= 8192 due to degraded performance.
This change bumps our default msize to 128 KiB, matching the
Linux Kernel v5.15 and newer default. Linux supports even larger values,
but 128 KiB is a sensible default.

We also add a new 'msize' mount option to allow users to override
this value, and we validate it against our maximum supported MTU
(currently fixed by the UMA zone size).

Reviewed by:    markj
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D56496
882181b1ae4c78b4f191fdb7cf6fe1b6ff83c9ff Alex Richardson 2026-05-26 19:38:18
smbfs: plug smbfs_node_alloc() leak of name buffers when insmntque() fails
f0e702a7a289f0f350bdaeb943805d6d17f9e403 Haoxiang Li 2026-05-26 13:21:39
fs/msdosfs: add support for file namws with surrogate pairs
Long file names are using UTF-16 symbols to represent international or
special characters. The implementation in FreeBSD did not support the
"Supplementary Private Use Area-B" (PUA-B), which requires a surrogate
pair to be represented in UTF-16 (Unicode code points beyond U+FFFF).

The PUA-B is used to represent emoji characters, which are supported
in file names on other common operating systems. The motivation for
this change was that removable media written on another system were
only partially readable on FreeBSD, since they contained emojis in
file names.

A test script that verifies correct operations on files names with
emojis has been added to the tools/test/stress2/misc directory under
the name msdos24.sh.

Reported by:    Fabian Keil <fk@fabiankeil.de>
Reviewed by:    ib
Approved by:    mkcusick
MFC after:      1 week
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D57313
f983cb362de77773efba8975eb0f4b247ce5e6f9 Stefan Eßer 2026-06-01 05:50:22
Avoid incorrect UFS1 timestamp corrections when system clock fails at boot.
Git 1111a44301da - main - Defer the January 19, 2038 date limit in
UFS1 file systems to February 7, 2106 - did so by changing the UFS1
32-bit signed timestamps to unsigned. With this change, time stamps
from before January 1, 1970 went from being negative numbers to
large positive numbers implying times in the future. When such a
time stamp is encountered when an inode is read into memory or when
it is encountered by fsck, its timestamp is replaced with the
kernel's current time.

Andre Albsmeier reported that he had a machine reboot after a power
failure and the battery that maintained its real-time clock had
died. The result was that the system booted with the time set to
five years earlier (absent a real-time clock value, the boot ROM
used the time that the boot ROM had last been updated). The net
result was that fsck reset the time stamps of all files newer than
five years old to the five year old time.

Andres's original request was for a flag in the file system superblock
to say that there are no timestamps from before 1970 in the file
system, so there shouldn't be anything to fix because of the signed
to unsigned switch. But this assumes that no one every does an rsync
or extracts a tar file or restores a dump that introduces an incorrect
time stamp on their system. So this approach was not taken.

This change compares the system's version of the current time to
the last modification time in the file system superblock. If the
current time is earlier than that time then use the last modification
time in the superblock as the value for the current time. There
should be no files in the file system with times newer than the
last modification time in the superblock.

The superblock time stamp is updated in the in-memory superblock
every time any change is made to anything in the file system. The
superblock is written to the disk every 30 seconds, so it may be
off by up to 30 seconds plus the time it sits in the disk cache
waiting to be written if the system has an unclean shutdown (such
as a power failure). Thus, the worst case scenario with this change
is that files written in the last 30 seconds plus disk cache delay
time before the crash may have their times adjusted back by up to
30 seconds plus the disk cache delay time.

Requested by: Andre Albsmeier
Approved by:  kib
Reviewed by:  kib, imp, Andre Albsmeier
MFC-after:    1 week
Differential Revision: https://reviews.freebsd.org/D57371
553ef188f7ecc23a384bd7ef1f3d5015fb8661da Kirk McKusick 2026-06-01 23:48:21
nfs_clrpcops.c: Change initial layout type to flex files
Since the File 4.1 layout is only supported by some
large configurations of Netapp Filers, switch the client
pNFS code to attempting to use Flexible File Format first.

File 4.1 Layout should still work for any servers that do
no support Flexible File Layout.
07d733963ecd1957999f5381b438b8c369686750 Rick Macklem 2026-06-03 19:04:59
nfsd: Add support for striped Flexible File layout
Without this patch, the NFSv4.1/4.2 pNFS server configuration
did not support striping.  This was mainly because the Linux
client driver did not support it either.  The Linux client
driver for Flexible File layout does now support striping.
(Linux kernel version 6.18 or newer)

As such, this patch adds striping support.  The configuration
is currently just two new sysctls called
vfs.nfsd.pnfsstripeunit - Size (in bytes) of a stripe
vfs.nfsd.pnfsstripecnt - # of DSs to stripe across
A setting of 0 for the first sysctl and 1 for the second
disables striping.  A patch that allows use of a different
striping configuration for each exported MDS file system
is planned for the future.

The pnfsdscopymr may be broken by this patch, but since
no one reported that they were actually using a pNFS server
configuration, I do not believe that will be a problem at
this time.

Until the FreeBSD NFSv4.1/4.2 client is patched to handle
striped flexible file layouts, mounts to a striped pNFS
configuration must be done without the "pnfs" mount option.
(Linux systems with a kernel version of 6.18 or newer
should be able to handle a striped pNFS configuration.)

Future patches that convert the pNFS server to a
"loosely coupled" configuration (which allows the use
of non-FreeBSD servers as DSs) are anticipated.
72e57bc264179818f55b49deb97bc40f56c2b936 Rick Macklem 2026-06-04 01:26:36
nfs_commonkrpc.c: Improve handling of NFSv4.1/4.2 recovery
Commit 4d80d4913e79 fixed a long standing bug in the recovery
code.  However. glebius@ reported seeing multiple
recovery cycles with this patch during an NFSv4.1/4.2
server reboot.

This commit should minimize the risk of multiple
recovery cycles.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294925
Reported by:    Jov <amutu@amutu.com>
MFC after:      2 weeks
Fixes:  https://cgit.freebsd.org/src/commit/?id=4d80d4913e79 ("nfs: Fix argument typo to avoid a crash")
ea4886f2829bf33866c8c0c60b14a9641fc54b40 Rick Macklem 2026-06-04 22:02:48
nfsd: Add per-MDS fs striping configuration
Commit 72e57bc26417 added support for striping to the pNFS
server when using the Flexible File layout.
It is configured globally via the following sysctls:
vfs.nfsd.pnfsstripeunit - Size (in bytes) of a stripe
vfs.nfsd.pnfsstripecnt - # of DSs to stripe across

This patch allows the above settings to be overridden
on a per-MDS exported file system basis.  With this
patch, a stripeunit can optionally be specified for
the MDS file system listed when one is listed after
a '#' in the "-p" nfsd argument.  This is done by
appending "@NNN", where NNN is the stripeunit, in bytes.

The current syntax implies that neither a '#' nor '@'
can be in the MDS mount point's directory path.

This patch does not affect current pNFS server
configurations (of which there appears to be very
few, anyhow).
3dfbbe8586bbd489ffc67941f09f94c2d8152946 Rick Macklem 2026-06-05 14:59:42
zfs: merge openzfs/zfs@a170134fe
Notable upstream pull request merges:
 #18372 eaaea55b6 Consistently encode DRR_BEGIN packed nvlist payloads with
                  NV_ENCODE_XDR
 #18410 891e379d0 Fix failfast default and usage
 #18470 a2d053329 zdb: Add some more file layout output, triggered by -v
 #18472 d50f5b6d0 dsl_dir: avoid dd_lock during snapshots_changed updates
 #18493 d65015938 Vdev allocation bias/class change
 #18497 8fdc86675 zfs: annotate nested dd_lock in reservation sync
                  accounting
 #18494 956deba27 zdb: detect BRT and DDT leaks during block traversal
 #18499 c7cfe0805 zarcstat: detect attached L2ARC device with no data
 #18503 439b802e7 sa: fix sa_add_projid lock ordering
 #18508 968f4db03 zpool-attach.8: add EXAMPLES section
 #18513 45dddc452 zfs.4: Fix documentation of zfs_arc_dnode_reduce_percent
 #18516 8ff64005a zap: split implementation out into more files
 #18520 181e1b522 Fix double free for blocks cloned after DDT prune
 #18535 -multiple zstream: fix crashes when refcount tracking enabled
 #18536 -multiple refcount tag fixups
 #18541 a65ed7afd zpool/zfs: accept --help and -? after a subcommand
 #18544 6fb72fda0 zio_ddt_write: compute have_dvas after taking dde_io_lock
 #18546 -multiple zap: internal locking uplift
 #18550 40a87651d zap_impl: use flex array field for mzap_phys_t.mz_chunks
 #18551 -multiple zap: make the _by_dnode() op variants be the primary
                  implementation
 #18570 112b0131b zpl_xattr: stop heap-allocating prefixed xattr names
 #18578 4bc8c39b6 zed: Prefer dRAID distributed spares to regular ones
 #18596 e30ab5fa4 FreeBSD: Make it possible to build openzfs.ko with
                  sanitizers
 #18597 472ddca11 zed: Prefer spares with matching rotational and size
 #18599 c90dc2808 enforce exact decompressed length for lz4, gzip, and zstd
 #18603 -multiple zap: add zap_cursor_init_by_dnode; cursor unit tests;
                  mock dnode refcounts
 #18604 59dc88602 nvpair: Check for un-terminated strings in packed nvlist
 #18606 ef6f26145 When reading a vdev label skip libzfs_core_init()
 #18613 0aa4088dc sharenfs: Check for invalid characters
 #18615 80fb85b80 Fix the integer type in zfs_ioc_userspace_many()
 #18616 e199f6d98 Fix uninitialized variable warning in vdev_prop_get()
 #18617 7de42602c Extend dataset zfs_ioc_set_prop() secpolicy
 #18622 5fea0c838 Parallelize metaslab_sync_done() calls
 #18623 cab50d5ad Add additional verification of size fields and strings
 #18630 -multiple zap: misc function removal / uplift / tests
 #18633 a8ef128da Fix uninitialized variable warning in zil_parse()

Obtained from:  OpenZFS
OpenZFS commit: a170134febea405c6b6f5ed51724cdcfb6d8e726
d9497217456002b0ddad3cd319570d0b098daa29 Martin Matuska 2026-06-06 20:48:32
cd9660: Don't parse RRIP records whose length overflows the sector boundary
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272896
Reported by:    Robert Morris <rtm@lcs.mit.edu>
Reviewed by:    des, emaste
Differential Revision:  https://reviews.freebsd.org/D57135
0492dbe9212ee0172e8003c487f256015478edd6 John Baldwin 2026-06-10 13:44:10
fusefs: only search for FREAD fufh in readdir
The extra search for an FEXEC fufh shall be removed, since readdir
is only supposed to be called on a directory opened with FREAD.  The
sole exception is NFS, which will call VOP_READDIR with directories that
aren't open at all.  fuse already has special code to handle that.

Also remove the fuse_filehandle_get_dir() function, since it's not
used anywhere else.

Signed-off-by:  CismonX <admin@cismon.net>
Reviewed by:    asomers
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1729
4179f1d9deed83977f159c8afea204293ef4c7d7 CismonX 2025-06-20 09:41:46
fusefs: fix error handling when reading a directory's sticky bit
When trying to delete or rename a file, fuse_vnop_lookup must check
whether its parent directory's sticky bit is set.  Realistically, the
parent directory's attributes will almost always be cached.  But it's
possible that they won't be, and in that case we must send a new
FUSE_GETATTR request to the server.  If that request fails for some
reason, then we must fail the lookup.  Prior to this change fusefs would
ignore failure of that request.

Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li,
                and Ke Xu of Tsinghua University
MFC after:      2 weeks
Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D57588
b4af6a4cccc3b4b0ea461463196c258eb92ad2e5 Alan Somers 2026-06-14 17:37:15
nfs_clvnops.c: Fix the case where va_flags are being cleared
Commits c5d72d2 and 3b6d4c6 broke the case where the
archive/hidden/system attributes are being set false
(UF_ARCHIVE, UF_HIDDEN or UF_SYSTEM bits being cleared.)
and the NFS server does not support those attributes.
These patches only checked for support if the
archive/hidden/system attributes were non-zero.

This patch fixes the problem.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296088
Tested by:      Joshua Kinard <freebsd@kumba.dev>
MFC after:      1 week
Fixes:  https://cgit.freebsd.org/src/commit/?id=c5d72d29fe0e ("nfsv4: Add support for the NFSv4 hidden and system attributes")
572680712c317b81d66475203ac1b9d6bbeca5d5 Rick Macklem 2026-06-18 00:30:29
nfs_nfsdserv.c: Fix setting of birthtime for some ZFS pools
Some ZFS pools do not support va_birthtime and will return
EINVAL when a VOP_SETATTR() of it is attempted.  The MacOS
NFSv4 client sets va_birthtime (TimeCreate) in the same
Setattr with ctime/mtime and other attributes after a new
file is created.  The EINVAL failure leaves these new files
messed up (mode == 0).

This patch pretends the setting of TimeCreate succeeded if
ctime/mtime were also set in the same Setattr RPC, which
resolves the problem for the MacOS client.

If this fix is not sufficient, a new pathconf name to detect
if a file system supports birthtime may be needed.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296066
Tested by:      Will <freebsd.geography231@slmails.com>
MFC after:      2 weeks
b1af05406b5117d76f567056fba0a023a6374465 Rick Macklem 2026-06-18 15:45:27
pfs_readdir(): block the target process from execing
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
4c0a0909f928baac982b7de4bfa5b5ca7de5291a Konstantin Belousov 2026-06-07 19:32:20
pseudofs: ensure that the target process vmspace is stable for VOP_READ/WRITE
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
a4993bac41350e85bc9affb862d2974a1a09bb5e Konstantin Belousov 2026-06-07 19:39:42
nfs_nfsdstate.c: Another unnecessary initialization for gcc
This code hasn't changed in a long time, so I don't know why
this showed up now?
c57fab60daeb2e7a97700699128897a496fdfd6a Rick Macklem 2026-06-21 14:42:19
cd9660: Add various length checks when parsing RRIP extensions
Pass the length of a RockRidge attribute to the handler functions and
validate that length in each handler.  If a parsing error is detected,
abort the entire parsing pass.

Reviewed by:    des
Differential Revision:  https://reviews.freebsd.org/D57136
9cd0d6231311bc5609403fb35377a7bb97a3cfaf John Baldwin 2026-06-22 16:41:04
nfscl: Add support for flexible file layout striping
Commit 72e57bc26417 added support for striping to the pNFS
server configuration.  This patch adds support for striping
to the NFS client.

For striped flexible file layouts, an extra structure
must be malloc()d for each stripe, since the number
of stripe servers can vary from one mirror to another.
This new structure is called nfsffs and a single one
of these structures is in the nfsffm structure so that
the non-striped layouts can avoid the additional malloc()'s.

This patch only affects NFSv4.1/4.2 mounts that use the
"pnfs" mount option against servers that support the
flexible file layout.
cf523f4beb8ff148828694485ab56f2c1f8f0159 Rick Macklem 2026-06-23 01:21:08
cd9660: Adjust parsing of timestamps in the extended atttributes record
The extended attribute record includes four different timestamps: file
creation, file modification, file expiration, and file effective date.
Only the first two are meaningful for stat(2).  The latter two (if
handled) would presumably affect if a file is visible for not.

Previously, the logic here was a bit contorted and made use of the
effective time.  It also seemed to treat the creation time as a change
time timestamp.

Instead, simplify the logic such that the modification time is set to
either the modification time (if present), or the creation time.  The
access and change times are then set to the modification time.

NB: This is not used if RockRidge extensions are present, and makefs
does not generate the extended attributes record.

Differential Revision:  https://reviews.freebsd.org/D57748
f6dd01b417dcf247904b4653063f5fb7f22a0878 John Baldwin 2026-06-23 15:51:43
cd9660: Add support for birth times
Both the Extended Attribute Record in the base ISO-9660 standard and
the RockRidge timestamp extension support a file creation timestamp.
Use this to populate the birthtime if present.

Reviewed by:    markj (earlier version)
Differential Revision:  https://reviews.freebsd.org/D57526
3d945604ef8e1aaa49e153d82821fb4c6c1e67f2 John Baldwin 2026-06-23 15:51:43
zfsd: Improve spare selection
Port OpenZFS PRs #18597 and #18578 from zed to zfsd.

When activating a spare, sort candidates before trying them:
 1. Distributed dRAID spare matching the failed vdev's group (fastest
    rebuild via sequential resilver)
 2. Regular spares
 3. Non-matching distributed spares (kernel will reject anyway)
 4. Within each tier: prefer rotational match, then smallest
    sufficient size

Also try all healthy spares in order rather than stopping at the
first one, and use sequential rebuild for distributed spares.
6aaaf7ba4bba5e01008924a61261b43a8356f591 Alexander Motin 2026-06-25 19:33:59
zfs: merge openzfs/zfs@37af89948
Notable upstream pull request merges:
 #18509 f16b3744d zstream: refactor common functions
 #18573 -multiple Persist z_seq across znode eviction
 s18611 eb0c674c2 zfs_ioctl: fix EBUSY race between quota queries and mount
 #18637 77e64d86e Fix self-deadlock when setting the "allocating"/"path"
                  vdev property
 #18645 e3082b923 freebsd: set mnt_time on the rootfs at mountroot time
 #18652 50d012b2a zbookmark_compare: handle "marker" bookmarks with negative
                  levels
 #18664 520eeeaa6 Improve performance of "zpool offline" for log devices
 #18668 6b8f79877 Avoid more abd_t allocations in RAIDZ/dRAID
 #18669 99ab859c3 Optimize metaslab_set_selected_txg()
 #18673 97b9ba7a9 delegate: add 'send:encrypted' permission
 #18687 2ea519c2a Avoid lookup overhead for nonexistent xattr directories
 #18688 87593ea2b Fix handling of _PC_HAS_HIDDENSYSTEM for FreeBSD
 #18693 0483a8e0c Clean up embedded slog metaslab across txgs
 #18695 41311c665 RAIDZ: Optimize single data column writes
 #18706 37af89948 ddt_log: Fix refcount tagging for begin/commit

Obtained from:  OpenZFS
OpenZFS commit: 37af899488652c55c456d3f160fb8b295db2ec70
d0b3ecdc274930e190ea233b6b69ff03782eaf8d Martin Matuska 2026-06-27 06:15:42
nfs_clstate.c: Fix CB_RECALL handling for NFSv4.1/4.2
Recent testing with a modified NFSv4.1/4.2 client that
sometimes ignored CB_RECALL callbacks, identified a few
problems when handling the unusual case of CB_RECALL not
be performed by the client.
- The csa_cachethis argument to CB_SEQUENCE was being ignored.
- The CB_SEQUENCE operation would reply NFSERR_DELAY
  after the first CB_RECALL attempt, making retries
  ineffective.
- The code could return NFSERR_RESOURCE, which is a
  NFSv4.0 specific error code.

This patch fixes the above three problems.

The patch only affects the NFSv4.1/4.2 client when
delegations are being issued and the client somehow
fails to handle a CB_RECALL callback of a delegation,
which is an unusual case.

MFC after:      2 weeks
9e1bbfb88e986b209709ea765189a3ebb6581bcd Rick Macklem 2026-06-27 23:35:20

Kernel

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

vmm: Restore the ability to create VMs as root in a jail
The new PRIV_VMM_CREATE and DESTROY permissions should be allowed by
jails, so need to be added to the list in prison_priv_check().  Then,
modify vmmdev_create() to verify that the jail was created with the
allow.vmm flag.  This is already verified when opening /dev/vmmctl, but
checking again doesn't hurt and ensures that one can't pass the
allow.vmm policy by passing a vmmctl fd along a unix domain socket from
outside the jail.

Rename vmm_priv_check() to vmm_jail_priv_check() to make the function's
purpose more clear.

Reported by:    novel
Reviewed by:    bnovkov
Fixes:          https://cgit.freebsd.org/src/commit/?id=d4c05edd410e ("vmm: Add privilege checks to vmmctl operations")
Differential Revision:  https://reviews.freebsd.org/D56119
f3c772361f3b6213ec7ae7de993b6953357c7b48 Mark Johnston 2026-04-01 09:25:27
linuxkpi: Handle bin attributes in sysfs attribute groups
For instance, this is used by DRM drivers to declare the EDID property
of an GPU output connector:

    sysctl -b sys.device.drmn1.card0.card0-DP-1.edid | edid-decode

    ...
    Block 0, Base EDID:
      EDID Structure Version & Revision: 1.4
      Vendor & Product Identification:
        Manufacturer: SAM
        Model: 29814
        Serial Number: 810635354 (0x3051505a)
        Made in: week 15 of 2025
    ...

Reviewed by:    bz, emaste, wulf
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55176
5bb0f63020669bd3675c651ba7745fc4356edc1a Jean-Sébastien Pédron 2026-02-08 10:11:39
compat/linux: map TCP_USER_TIMEOUT sockopt into TCP_MAXUNACKTIME
After reading both manual pages, our TCP_MAXUNACKTIME is fairly
similar to the TCP_USER_TIMEOUT, the only considerable difference
is ours is in seconds and linux's in milliseconds.

Round up linux's in setsockopt(2) to a next whole second and
clamp ours getter to UINT_MAX ms.

Reviewed by:    tuexen, glebius
Differential Revision: https://reviews.freebsd.org/D56168
MFC after:      2 weeks
Sponsored by:   Sippy Software, Inc.
5d4a39d8ed775d607e0702f317f687491ac0a23d Maxim Sobolev 2026-04-01 21:42:50
Commit group #82: kqueue
kqueue: compare against the size in kqueue_expand

This is a cosmetic change, rather than a functional one: comparing the
knlistsize against the fd requires a little bit of mental gymnastics to
confirm that this is fine and not doing unnecessary work in some cases.

Notably, one must consider that kq_knlistsize only grows in KQEXTENT
chunks, which means that concurrent threads trying to grow the kqueue
to consecutive fds will usually not result in the list being replaced
twice.  One can also more clearly rule out classes of arithmetic
problems in the final `else` branch.

Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D56209
0b4f0e0515d0c7ec855cd654ae5dc562f4931cae Kyle Evans 2026-04-01 22:30:48

kqueue: avoid a possible fork-deadlock

kqueue_fork_copy() is likely to have transitioned at least one knote
through a flux state, so we should check whether we need to wake
anything up on the way out to avoid a possible deadlock.

This was a part of D56210, but we'll close the review with the next
commit.

Fixes:  https://cgit.freebsd.org/src/commit/?id=b11289f87123f ("kqueuex(2): add KQUEUE_CPONFORK")
Reviewed by:    kib, markj
14d0baf2e89202cec3f9cb03a573372ccbc568b2 Kyle Evans 2026-04-01 22:30:48

kqueue: simplify knote_fdclose()

The influx logic in knote_fdclose() is a little misguided, the resulting
wakeup() call should always be redundant: knote_drop_detached() will
always issue a wakeup before it returns, so anything waiting on *that*
knote that had entered fluxwait should have been woken up then.  This is
the obvious divergence from the other influx/wakeup pattern in the
implementation, which will kn_influx-- and then issue the wakeup after
it has processed all of the knotes it can make progress on.

While we're here, the kq_knlist cannot shrink, so we can avoid that
condition in the loop and avoid potentially excessive wakeups from
fluxwait on kqueues that we didn't touch.

Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D56210
ff1050d2a366bd288a6ebbf63f98003272513f92 Kyle Evans 2026-04-01 22:30:48

kqueue: add some kn_knlist assertions around knlist_(add|remove)

We currently assert that kn_status is accurate, but there's more room
for error.  Neither of these are very likely, but currently we'd blow up
in SLIST*() macros instead of providing more obvious diagnostics.  It's
perhaps only worth testing these because knlist_remove() requires
getting logic across both f_attach() and f_detach() correct.

Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D56211
306c9049c642da6a59a5dc088589605a9aa38b87 Kyle Evans 2026-04-01 22:30:48

kqueue_fork_copy_knote(): zero kn_knlist for the copy before calling knlist_add()

Reported by:    pho, dhw
Fixes:  https://cgit.freebsd.org/src/commit/?id=306c9049c642da6a59a5dc088589605a9aa38b87
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
aab1ef4527f1b0935add3e8dba9e928e0623376f Konstantin Belousov 2026-04-02 11:02:14
kqueue: assert that kqueue knote lists own the knotes
Reviewed by:  kevans, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56212
51db69c14fb1a1c2dc807695e6f564d498d33d5a Konstantin Belousov 2026-03-31 09:13:35
subr_module: account for MODINFOMD_EFI_ARCH
b3d6829f4998ad8ac8c65d39ac9513ba85a9974b Ahmad Khalifa 2026-04-03 07:13:29
nfs_diskless: Add support for an NFSv4 root fs
Without this patch, diskless root NFS file systems
could only be mounted via NFSv3 (or NFSv2).
This patch adds the basic support needed to mount
a root fs via NFSv4.

At this time, the NFSv4 mount will only work if
the following is done on the NFS server configuration:
- The root directory specified in the "V4:" line in
  /etc/exports must be "/".  This is needed since the
  path to mount must be the same for NFSv3 and NFSv4.
- The NFS server must be configured to do both NFSv3
  and NFSv4, since the bootstrap code still uses NFSv3.
- The NFSv4 server must be configured with:
  vfs.nfs.enable_uidtostring=1
  vfs.nfsd.enable_stringtouid=1
  since the NFSv4 root fs cannot be running nfsuserd(8)
  when it is booting.  (This limitation may be removed
  in a future commit by hard-wiring enough id<-->name
  mapping entries to handle things until the nfsuserd(8)
  is running.)

To enable the root fs to be mounted via NFSv4, it needs:
- in the root file system's /boot/loader.conf
  boot.nfsroot.options="nfsv4"
  (Additional options like rsize=65536,wsize=65536 can
   also be specified.)
- in the root file system's /etc/sysctl.conf
  vfs.nfs.enable_uidtostring=1

Requested by:   Dan Shelton <dan.f.dhelton@gmail.com>
MFC after:      1 week
8b9775912cbc7bb3c05c1fdfc3597dc4b68a9b9e Rick Macklem 2026-04-05 16:00:24
net: Add SIOCGI2CPB ioctl & add page/bank fields to ifi2creq
This commit adds page & bank fields to ifi2creq in preparation
for adding CMIS support for 400g optics to ifconfig.
The new ioctl SIOCGI2CPB is added, so that drivers can distinguish
between callers asking for page/bank selection and legacy callers
that simply failed to zero out all ifi2creq fields.

The mlx5en(4) driver and iflib(4) driver frameork have been updated
to use this new SIOCGI2CPB ioctl and support page/bank operations.
A follow-on patchset will add support to ifconfig for reporting
data from CMIS optics.

This has been tested on Nvidia ConnectX-7 and Broadcom Thor2 (using
out of tree driver) based NICs.

Differential Revision: https://reviews.freebsd.org/D55912
Sponsored by: Netflix Inc.
Reviewed by: kib
cf1f21572897ffc85789fbb1792603967297f6fc Andrew Gallatin 2026-04-05 19:58:10
Commit group #83: linuxkpi
linuxkpi: Add `strtomem()` and `strtomem_pad()`

The DRM generic code started to use `strtomem_pad()` in Linux 6.11.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55729
362136ed4987230269740f54531f6a945f00d135 Jean-Sébastien Pédron 2026-03-02 23:04:09

linuxkpi: Move `_RET_IP_` to <linux/instruction_pointer.h>

This matches the declaration on Linux.

Reviewed by:    bz, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55730
8af854ea479a140a6e284d74e481d0b547408df2 Jean-Sébastien Pédron 2026-03-02 23:06:54

linuxkpi: Define `_THIS_IP_`

For now, the macro is not implemented and it returns 0.

The DRM generic code started to use it in Linux 6.11.

Reviewed by:    bz, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55731
56251304258a50fe31bac5cd7da74a4d25497606 Jean-Sébastien Pédron 2026-03-02 23:09:02

linuxkpi: Add mising functions in <linux/kmsg_dump.h>

The DRM generic code started to use `kmsg_dump_get_buffer()` and
`kmsg_dump_rewind()` in Linux 6.11.

Reviewed by:    bz, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55732
f2ad06a0801aaa987a40b8374b6baa8f510cb77a Jean-Sébastien Pédron 2026-03-02 23:50:55

linuxkpi: Define `CONFIG_PGTABLE_LEVELS`

This is a kernel configuration constant that is expected to be defined.

The DRM generic code started to use it in Linux 6.11.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55733
7bf93680807e518853262f3f961f88eb8ec03c83 Jean-Sébastien Pédron 2026-03-04 20:34:37

linuxkpi: Define `PMD_SHIFT`

For now, only define it for x86 architectures.

The DRM generic code started to use it in Linux 6.11.

Reviewed by:    bz, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55734
be92ad6b12a5046cecf25477e7a3e88f70e5daee Jean-Sébastien Pédron 2026-03-04 20:36:20

linuxkpi: Add <linux/linux_logo.h>

It only defines the `struct linux_logo` structure for now. It does not
define any actual logo.

Reviewed by:    bz, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55735
ca6ea6df1f9241346d043a2091484ac9ced6580e Jean-Sébastien Pédron 2026-03-04 20:49:50

linuxkpi: Add <linux/mfd/core.h>

To be exact, there was a dummy file with no content before. This commit
defines `struct mfd_cell` and adds two function stubs.

The function stubs are not implemented but still return success. They
log a message to indicate they need to be implemented.

Also, unlike Linux, <linux/mfd/core.h> includes <linux/ioport.h>. This
works around the fact that we can't include <linux/ioport.h> from
<linux/pci.h>, due to a conflict with the FreeBSD-native `struct
resource`.

The amdgpu DRM driver started to use it in Linux 6.11.

Reviewed by:    bz, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55736
356d6f47d3b54b34aaba9e60aa551f3d615d0e2f Jean-Sébastien Pédron 2026-03-08 09:40:38

linuxkpi: Add field `flags` to `struct resource`

This in the Linux version of `struct resource`, not the FreeBSD native
structure.

The amdgpu DRM driver started to use it in Linux 6.11.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55737
ddf89d899b8d2d0e26c1a22c92f3ac1eddeac9f6 Jean-Sébastien Pédron 2026-03-08 09:44:12

linuxkpi: Document why <linux/pci.h> can't include <linux/ioport.h>

Reviewed by:    bz, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55738
91e54839545f6cb91bb1a5f768ddd6c1e2420b48 Jean-Sébastien Pédron 2026-03-08 09:45:48

linuxkpi: Define `MIN_T()` and `MAX_T()`

There are the same as `MIN()` and `MAX()` except that they take a type
to cast both arguments to compare.

The DRM generic code started to use it in Linux 6.11.

Reviewed by:    bz, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55739
ece26db020db3a21b1a4c6b608f77a9ed5be5924 Jean-Sébastien Pédron 2026-03-08 11:18:22

linuxkpi: Define missing `SZ_*` below 1 kib

The amdgpu DRM driver started to use it in Linux 6.11.

Reviewed by:    bz, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55740
5ee604b2446fa0f3fb949b21a587884ad65b5737 Jean-Sébastien Pédron 2026-03-08 11:23:54

linuxkpi: Add <linux/ascii85.h>

This is used by the i915 DRM driver for some time to log more details
about a GPU error, but the code was commented out.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56282
0eaa57625d0fbe9960eabbaaedd522acdf673648 Jean-Sébastien Pédron 2026-03-09 19:04:12

linuxkpi: Define diagnostic macros like `might_resched()` or `cant_sleep()`

They are no-ops on FreeBSD.

While here, move the already defined `might_sleep*()` macros from
<linux/wait.h> to <linux/kernel.h> where they belong.

The DRM generic code started to use `might_fault()` in Linux 6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56434
ad528a6b174e7090cb06062867e9a146b017205d Jean-Sébastien Pédron 2026-04-11 09:37:05

linuxkpi: Define `dev_err_probe*()`

They differ from other `dev_*()` logging functions by returning the
passed error code. The error code is also used to determine if the
message should be logged in the first place and at which log level.

The DRM generic code started to use it in Linux 6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56435
2357de8ea14f9ee6193eb9e31a9c208e1541163a Jean-Sébastien Pédron 2026-04-11 09:40:39

linuxkpi: Define `__GFP_THISNODE`

It is used to force the NUMA node to allocate from. This flag is
unimplemented for now because we don't have an implementation of
`alloc_pages_node()` yet.

The DRM TTM code started to use this flag in Linux 6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56436
8f95998393f42f368fe22abd9a25c7fa4304e02a Jean-Sébastien Pédron 2026-04-11 10:23:27

linuxkpi: Define `sort_r()`

Like Linux `sort()` and FreeBSD `qsort()`, `sort_r()` is a wrapper
around FreeBSD `qsort_r()`.

The i915 DRM driver started to use it in Linux 6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56437
4dab15e96d40352e1a0b161a2a1cd763176108b6 Jean-Sébastien Pédron 2026-04-11 12:42:14

linuxkpi: Define `MINORBITS`

We can't really define a proper value for this constant because minor
and major are encoded in a complex way on FreeBSD which cannot be
represented with a simple shift.

The DRM generic code started to use it in Linux 6.12.

In this context, `MINORBITS` is used to define an upper limit passed to
`xa_alloc()`. Therefore it is not used to encode or decode minors. It is
used as an arbitrary value. Therefore, we define the constant to 20,
like on Linux.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56447
ae1f6954e2c82ad7f1d8b80155a921b908d51756 Jean-Sébastien Pédron 2026-04-13 21:47:22

linuxkpi: Add several `guid_*()` functions

The DRM generic code and the amdgpu DRM driver started to use several of
these functions in Linux 6.12. Likewise for `UUID_SIZE`.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56448
cefd0ae770bfad534ec666099489a869387e8836 Jean-Sébastien Pédron 2026-04-13 22:36:18

linuxkpi: Include <linux/uuid.h> from <linux/mod_devicetable.h>

The DRM generic code started to deppend on this indirect include of
<linux/uuid.h> in Linux 6.12.

Reviewed by:    bz, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56449
18c71d97b227e0c6c1d11aa1fd168d19523a3b2e Jean-Sébastien Pédron 2026-04-13 22:38:36

linuxkpi: Add `fop_flags` to `struct file_operations`

... along with the `FOP_*` flag constants.

Note that this `fop_flags` field is not used on FreeBSD. It is added to
make the DRM drivers compile out of the box.

The DRM generic code and drivers started this in Linux 6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56450
a5ae030d9f8f5557502c4e51d2a083a70c513379 Jean-Sébastien Pédron 2026-04-13 23:12:18

linuxkpi: Pass a `const void *` to `krealloc()`

This matches the API on Linux.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56451
bbd20c0795a7df35fc665165bf5f17d7f6533e54 Jean-Sébastien Pédron 2026-04-13 23:59:09

linuxkpi: Passing a size of zero to `krealloc()` frees the pointer

This matches the API on Linux.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56452
2434fcfd0dd07847a8518351b4525ec488f4d0bd Jean-Sébastien Pédron 2026-04-14 00:00:23

linuxkpi: Add `struct xa_limit` support to xarray

The `xa_alloc*()` functions family takes a `struct xa_limit` to describe
the range of IDs the caller wants to allocate. We were using a single
mask to qualify a maximum ID only.

This commit changes that to use the same `struct xa_limit`. The logic
did not change, except it now supports a minimum ID as well.

The definition of `XA_LIMIT()` macro is adapted, as well as the
definitions of `xa_limit_*` (only `xa_limit_32b` existed, the other two
are added with this commit).

The DRM generic code started to use this `struct xa_limit` in Linux
6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56445
783d018cf954f99032a0a4f655af8916024598a8 Jean-Sébastien Pédron 2026-04-13 21:39:22

linuxkpi: Define `DEFINE_XARRAY*()` macros

The `DEFINE_XARRAY*()` macros are used to declare a static xarray.

As the structure embeds a mutex(9), we also need to declare the static
mutex after the `struct xarray`. Thus the slightly awkward definition
of `DEFINE_XARRAY_FLAGS()`.

The DRM generic code started to use `DEFINE_XARRAY_ALLOC()` in Linux
6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56446
796fff59a5d32bc3be14feaeb228fc15ef43eb32 Jean-Sébastien Pédron 2026-04-13 21:44:16

linuxkpi: Add `copy_from_user_inatomic_nontemporal()` function

In Linux 7.1, `__copy_from_user_inatomic_nocache()` was renamed to
`copy_from_user_inatomic_nontemporal()`. This change was backported to
several LTS branches.

This includes Linux 6.12.x and the i915 DRM driver started to use it in
that version.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56719
713b4ce8ef46d7df4ffe50ab6733bb128dbe3cbd Jean-Sébastien Pédron 2026-04-29 22:14:59

linuxkpi: Define `__ATTR_RO_MODE()` and `__ATTR_RW_MODE()`

They are the same as their `__ATTR_RO()` and `_ATTR_RW()` equivalents
but they take the file mode as an extra argument.

We now use these new macros to redefine `__ATTR_RO()` and `__ATTR_RW()`
on top of them.

The amdgpu DRM driver started to use `__ATTR_RW_MODE()` in Linux 6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57574
294553b022b1e775111365094a70041934d98501 Jean-Sébastien Pédron 2026-06-12 10:44:36

linuxkpi: Define a bunch of constants in <acpi/video.h>

`ACPI_VIDEO_NOTIFY_PROBE` was already defined. Let's define the whole
set once and for all.

The amdgpu DRM driver started to use `ACPI_VIDEO_DISPLAY_LCD` in Linux
6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57575
53baadc2f6154d738f935a9dcc26648d2b3d89fd Jean-Sébastien Pédron 2026-06-12 13:58:06

linuxkpi: Add `pm_resume_via_firmware()`

This function is unimplemented, always return false.

While here, fix the return type of `pm_suspend_via_firmware()`: it
should be a boolean, not an integer.

The amdgpu DRM driver started to use `pm_resume_via_firmware()` in Linux
6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57580
2e10a6bd562768256f38078b84d95da30e1e2aa1 Jean-Sébastien Pédron 2026-06-12 17:00:31

linuxkpi: Add 'fd_empty()`

The DRM drivers generic code started to use it in Linux 6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57582
50aa145171bc88edde8cf3b7eb13dbbf88a3f8a7 Jean-Sébastien Pédron 2026-06-12 17:55:34

linuxkpi: Define `COUNT_ARGS()` and `CONCATENATE()`

`COUNT_ARGS()` counts the number of arguments it is passed. The
implementation is heavily inspired from the one of `CTR()`.

`CONCATENATE()` is an alias for `__CONCAT()`.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57584
af187b20cdb00b89a39dfea1a8eef41ce5c134aa Jean-Sébastien Pédron 2026-06-12 20:21:12

linuxkpi: Change `strscpy()` and `strscpy_pad()` to make their `len` argument optional

The previous implementation always took the `len` but now, it is
optional and defaults to the size of `dst`.

The DRM drivers started to use `strscpy()` without the `len` in Linux 6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57585
c27779e0a9546e8b2bfde74b5c9cbf08bbed000e Jean-Sébastien Pédron 2026-06-12 20:22:51

linuxkpi: Define `struct vfsmount` in <linux/mount.h>

In the context of the DRM drivers, this is used to show GEM objects in a
shmfs virtual filesystem. The new `shmem_file_setup_with_mnt()` - also
introduced in this commit as an alias to `shmem_file_setup()` - takes a
`struct vfsmount` as its first argument to indicate which shmfs mount
should be used.

For now, the structure is empty. As we don't present GEM objects in a
virtual filesystem right now, we can defer the actual implementation of
this structure once we have an actual use for it.

The DRM generic code started to use it in Linux 6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57572
272a12639440c2865fefba8b38771f8dd0ac5778 Jean-Sébastien Pédron 2026-05-08 10:09:59

linuxkpi: Add const qualifier to `bitmap_weight()` 1st arg

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57581
8aa685153bd6a05f6c0f89ae067d67a00a984c05 Jean-Sébastien Pédron 2026-06-12 17:21:59

linuxkpi: Define and fill `struct cpuinfo_x86->x86_stepping`

This will be used in a follow-up commit to implement `x86_match_cpu()`.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57698
a68dcfaf0236468703201e4f9a52139bd955bc45 Jean-Sébastien Pédron 2026-06-17 13:55:19

linuxkpi: Defined more Intel vendor/family/model constants

The i915 DRM driver started to use them in Linux 6.14.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57699
de51e9ae5f695b70c81a9dcb9f791af86765b097 Jean-Sébastien Pédron 2026-06-17 13:57:34

linuxkpi: Add <linux/cgroup_dmem.h>

In this header, we declare empty stubs for all functions, as if
`CONFIG_CGROUP_DMEM` was disabled is Linux.

The DRM TTM memory manager started to use this in Linux 6.14.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57702
b55cc81fcf9718887a51b22f1436f6cc369fa47b Jean-Sébastien Pédron 2026-06-17 17:22:12

linuxkpi: Define `ULL()`

It simply appends "ULL" to its argument.

The amdgpu DRM driver used it at some point in the development cycle of
Linux 6.14 but the use case was dropped later. Let's still add it to
linuxkpi because it will help if we need to do a git bisect in drm-kmod.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57703
72a6197df998bb6aa36cf33aa44f6d5b50247537 Jean-Sébastien Pédron 2026-06-17 18:43:01
Bump __FreeBSD_version to 1600015 after linuxkpi changes for DRM 6.11
As of this commit, all changes to linuxkpi required by the DRM drivers
from Linux 6.11 were committed.

Sponsored by:   The FreeBSD Foundation
36fe65cc7a31962e80a45d8b0fa6a401653a3deb Jean-Sébastien Pédron 2026-04-06 19:29:01
nfs_diskless: Fix handling of nfsuserd case for NFSv4
Commit 8b9775912cbc added support for an NFSv4 mounted
root file system, but only if the NFSv4 configuration
used id numbers in the strings.

This patch adds support for the case where the NFSv4
configuration uses name<-->id mappings via nfsuserd(8)
by priming the mapping cache with just enough entries
so that it works until the nfsuserd(8) is running.
They are listed in nfs_prime_userd[] in
sys/fs/nfs/nfs_commonsubs.c.

The entries in nfs_prime_userd[] are also wired into
the kernel's cache for name<-->id mappings when nfsuserd(8)
starts up.  This is necessary, since an upcall to the
nfsuserd(8) daemon for a mapping when looking up the
path to the passwd/group database files (/etc) will
hang the system, due to a vnode lock being held on
the entry in the path which blocks nfsuserd(8) from
accessing files.

To enable this case, the following must be put in the
NFS root file system's /boot/loader.conf:
boot.nfsroot.options="nfsv4"
boot.nfsroot.user_domain="<user.domain>"
where <user.domain> must be the same as nfsuserd
uses (usually set via the -domain flag).
If boot.nfsroot.user_domain does not exist or is
the empty string, ids is strings is configured.

MFC after:      1 week
Requested by:   Dan Shelton <dan.f.shelton@gmail.com>
Fixes:  https://cgit.freebsd.org/src/commit/?id=8b9775912cbc ("nfs_diskless: Add support for an NFSv4 root fs")
53b4ae3bf0f7e625d51fa263a5bd3859792d61e3 Rick Macklem 2026-04-07 15:50:21
imgact_elf: Unconditionally initialize a variable in a note handler
In the sb == NULL case, we are computing the size of the note using a
dummy sbuf drain handler which counts bytes and discards the contents of
the buffer, so the fact that "structsize" is uninitialized doesn't
matter.  But, the compiler may complain about this, so we might as well
just initialize it unconditionally to silence the warning, as other
handlers already do.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292811
MFC after:      1 week
8a68c2509c00ae0dbeab64064bb600cfac787a73 Mark Johnston 2026-04-08 04:19:56
vm_fault: Reset m_needs_zeroing properly
- When allocating a page, we should only consider the PG_ZERO flag when
  handling the top-level page.
- Unconditionally reset the flag when restarting the fault handler.
  Previously, vm_fault_busy_sleep() would fail to reset it.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294039
Reviewed by:    kib
Tested by:      Peter Much <pmc@citylink.dinoex.sub.org>
MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=cff67bc43df1 ("vm_fault: only rely on PG_ZERO when the page was newly allocated")
Differential Revision:  https://reviews.freebsd.org/D56234
04132e01004316ddd0e0cde6ef15b100b7b1844d Mark Johnston 2026-04-08 04:21:09
compat/linprocfs: Fix auxv sbuf leak
linprocfs_doauxv() allocates an automatic sbuf before validating
whether the requested read can be satisfied.

When the computed auxv read length exceeds IOSIZE_MAX, or when the
buffer length is too big, the function returns early without
releasing the sbuf.

Route these early exits through a shared cleanup path so the sbuf is
always deleted after sbuf_new_auto() succeeds.

Signed-off-by:  Shunchao Hu <ankohuu@gmail.com>
Reviewed by:    des, spmzt, zlei, aokblast
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2118
16aa49f6d1bbe70cd3e851139eb63d566de49b12 Shunchao Hu 2026-04-04 10:27:53
geom: Make g_waitidle() wait for orphaned providers
This is motivated by the following race in the ZFS zvol code.

When a zvol is created, we create a GEOM-backed zvol, which results in a
/dev/zvol/<zvol path> device file, created by GEOM::dev.  If volmode=dev
is specified, zvol_set_volmode_impl() will wither the GEOM, then create
a device file with the same name.  This sometimes fails because
g_wither_geom() is asynchronous, so we end up trying to create a device
file while the old one still exists.  I want to fix this by adding a
g_waitidle() call to zvol_os_remove_minor().

g_waitidle() is not sufficient: GEOM::dev does not destroy the device
until g_dev_orphan() is called.  (In fact the device destruction is
asynchronous too, but the delist_dev() call is sufficient to address
this race.)  So, I propose modifying g_waitidle() to block until
orphaned providers are processed.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258766
Reviewed by:    mav, imp, kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D55049
36d971464ac21f6531cb9eaa377f4e1dd915a2ad Mark Johnston 2026-04-09 01:08:45
kqueue: don't leak file refs on failure to knote_attach()
We'll subsequently just knote_free() since the knote is barely
constructed, but that bypasses any logic that might release references
on owned files/fops.  Defer clearing those until the knote actually owns
them and update the comment to draw the line more clearly.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D56318
0bf4d22c37083170961c31694b90551538901a1c Kyle Evans 2026-04-09 02:37:00
kqueue: slightly clarify the flow in knlist_cleardel()
This is purely a cosmetic change to make it a little easier on the eyes,
rather than jumping back to the else branch up top.  Re-flow it to use
another loop on the outside and just inline the re-lock before we repeat
after awaking from fluxwait.

The !killkn path should maybe issue a wakeup if there's a thread in
KQ_SLEEP so that userland can observe the EOF, but this isn't a
practical problem today: pretty much every case of knlist_clear is tied
to a file descriptor and called in the close(2) path.  As a consequence,
potentially affected knotes are almost always destroyed before we even
get to knlist_clear().

Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D56226
c6dd40f2d35d596ca60a5d87616c3e4a0fd4f676 Kyle Evans 2026-04-09 02:37:00
<sys/extattr.h>: use designated initializers for EXTATTR_NAMESPACE_NAMES
This is not a functional change, but it makes it more clear upon
inspection of the definition that the mapping property described is
preserved.  Maybe more importantly, if one ends up getting an index
wrong or punching a hole in the name array unexpectedly, then it'll
hopefully manifest more clearly as a (null) or nullptr deref rather than
potentially just emitting the wrong namespace name.

It's noted that this almost certainly invalidates its use in C++, but
there aren't really any known C++ consumers of it- let's just cross
that bridge if we get there.

Reviewed by:    kib, mckusick, rmacklem
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D55323
84ce651836e0d037f611cd33a5c65e1d57049432 Kyle Evans 2026-04-09 02:41:12
freebsd32: Fix freebsd11_nstat copyout condition
freebsd11_freebsd32_nstat() invoked copyout(2) when
freebsd11_cvtnstat32() failed and skipped copyout on success. This is
backwards.

Fix this to match freebsd11_freebsd32_nlstat() and freebsd11_nstat(),
and only copy the nstat32 result to userspace when conversion succeeds.

Signed-off-by:  Weixie Cui <cuiweixie@gmail.com>
Reviewed by:    mhorne
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2109
c6224994ac70b4f71ef9e11903bb2e50ed2b1bfe Weixie Cui 2026-03-31 10:12:32
sys/kobj.h: Make self-sufficient
kobj.h just needs sys/types.h (because it uses u_int, it can't use
sys/_types.h). kobj.h isn't a standard thing, so we don't need to be
careful about namespace pollution.

Sponsored by:           Netflix
428034ad0dbe3e39fc9cc96656688dd1f3d408a9 Warner Losh 2026-04-04 06:53:00
subr_early.c: cleanup includes
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
4da93b9a8a5411f7386e79053d9c46df29627594 Konstantin Belousov 2026-04-10 10:16:28
kevent: do not check knote lists being empty before removing a knote
If a knote belongs to the list, there is no reason to check for the list
emptiness.  On the other hand, if the knote does not belong to the list,
then checking for emptiness is not enough since there might be a
different knote there.

Reviewed bu:    kevans, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56341
31069fdbdae1027a6f1af7d56d418de4428ac6d9 Konstantin Belousov 2026-04-10 08:27:51
compat/linprocfs: Update /proc/partitions output
Linux /proc/partitions reports the major/minor pair, the device size in
1K blocks, and the device name.  linprocfs still printed obsolete
statistics columns and reported the size in bytes.

Update linprocfs_dopartitions() to emit the Linux-style header and
report provider sizes in 1K blocks.

Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
Reviewed by:    des
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2126
Closes:         https://github.com/freebsd/freebsd-src/pull/2126
5f5cc3c67ae8a4d9a27e750bef98a9ce1a6b2cf5 Shunchao Hu 2026-04-07 13:07:31
zstd: disable weak-symbol tracing hooks in the kernel
zstd's tracing API (zstd_trace.h) declares ZSTD_trace_compress_begin()
and friends as __attribute__((weak)) externals, gated on the
ZSTD_HAVE_WEAK_SYMBOLS compile-time probe.  That probe has covered
x86_64 and i386 since at least zstd 1.5.6, and was extended to aarch64
and riscv in 1.5.7.

In a static kernel image there is no dynamic linker to patch the PLT GOT
entries at runtime.  On amd64 the undefined weak symbols resolve directly
to NULL, so the "!= NULL" guard in the zstd source correctly suppresses
every call through the stubs.  On aarch64 and riscv the ABI requires
GOT-based indirection for external calls: the PLT stub address is
non-NULL, the guard passes, and the call lands in an uninitialized GOT
slot.  Because this happens before exception handlers are in place the
machine resets silently, making the kernel unbootable after the zstd
1.5.7 import.

The upstream-supported suppression is ZSTD_NO_TRACE (zstd_internal.h),
which skips inclusion of zstd_trace.h entirely and forces ZSTD_TRACE=0.
Add it to ZSTD_C alongside the existing ZSTD_* defines, and while here
group all three -DZSTD_* flags onto a single line in alphabetical order
with ${.IMPSRC} on its own line.

Reported by:    many
Tested by:      lwhsu
X-MFC-with:     c0d9a07101a1
de2ea5423cc63b62e7e42d11b667aa634109fc28 Bjoern A. Zeeb 2026-04-11 16:24:32
Commit group #84: hash(9): introduce hashalloc()/hashfree() KPI
hash(9): introduce hashalloc()/hashfree() KPI

This is a more extendable version than traditional hashinit(9).  It allows
different kinds of slot headers with optional locks.

Implement traditional hashinit()/hashdestroy() on top of it.

Reviewed by:            pouria, gallatin
Differential Revision:  https://reviews.freebsd.org/D55904
abf68d1cf02550c3c0341f5bb90be0d34f655a15 Gleb Smirnoff 2026-04-12 17:25:51

411c28b6caa4a55d89cc34d77b33141b78ced590 Gleb Smirnoff 2026-04-12 21:10:27
Commit group #85: inpcb: retire INP_DROPPED and in_pcbdrop()
inpcb: retire INP_DROPPED and in_pcbdrop()

The inpcb flag INP_DROPPED served two purposes.

It was used by TCP and subsystems running on top of TCP as a flag that
marks a connection that is now in TCPS_CLOSED, but was in some other state
before (not a new-born connection). Create a new TCP flag TF_DISCONNECTED
for this purpose.

The in_pcbdrop() was a TCP's version of in_pcbdisconnect() that also sets
INP_DROPPED.  Use in_pcbdisconnect() instead.

Second purpose of INP_DROPPED was a negative lookup mask in
inp_smr_lock(), as SMR-protected lookup may see inpcbs that had been
removed from the hash.  We already have had INP_INHASHLIST that marks
inpcb that is in hash.  Convert it into INP_UNCONNECTED with the opposite
meaning.  This allows to combine it with INP_FREED for the negative lookup
mask.

The Chelsio/ToE and kTLS changes are done with some style refactoring,
like moving inp/tp assignments up and using macros for that.  However, no
deep thinking was taken to check if those checks are really needed, it
could be that some are not.

Reviewed by:            rrs
Differential Revision:  https://reviews.freebsd.org/D56186
40dbb06fa73cac37d57563c07e55efd0cabbd488 Gleb Smirnoff 2026-04-12 18:33:07

151a1eab3b785129d279af601ed716eda74886a8 Gleb Smirnoff 2026-04-12 21:45:40
compat/linux: Add Linux i2c-dev ioctl compatibility support
Implement Linux I2C ioctl translation in the Linux compatibility layer
and wire iicbus cdevs up for in-kernel rdwr handling.
Support common i2c-dev requests including SLAVE, FUNCS, and RDWR,
while rejecting unsupported 10-bit and SMBus operations.

Signed-off-by:  YAO, Xin <mr.yaoxin@outlook.com>
Reviewed by:    imp, adrian, pouria
Differential Revision: https://reviews.freebsd.org/D56251
26740e8f80da17c78bee6fa322e6bb1f2669be5c YAO, Xin 2026-04-13 12:28:48
if_geneve: Add Support for Geneve (RFC8926)
geneve creates a generic network virtualization tunnel interface
for Tentant Systems over an L3 (IP/UDP) underlay network that provides
a Layer 2 (ethernet) or Layer 3 service using the geneve protocol.
This implementation is based on RFC8926.

Reviewed by:    glebius, adrian
Discussed with: zlei, kp
Relnotes:       yes
Differential Revision: https://reviews.freebsd.org/D54172
e44d2e941e8ebd74e6a1b1fdbed83fe86671cbc6 Pouria Mousavizadeh Tehrani 2026-04-11 14:12:01
linux: add sysfs filetype support for Linux statfs()
Added MAGIC number below and map to linsysfs in bsd_to_linux_ftype()

This maps:
  - `linsysfs` -> `LINUX_SYSFS_MAGIC` (`0x62656572`)

Signed-off-by: YAO, Xin <mr.yaoxin@outlook.com>

Reviewed by:    emaste
Pull request:   https://github.com/freebsd/freebsd-src/pull/2119
a3c457398f269c913aaa4d9dedcc72a70c02e845 YAO, Xin 2026-04-04 14:02:59
inpcb: retire inp_vnet
Now that a functional inpcb can not outlive its socket, just use socket's
vnet pointer.
9b76228006d8f0e45dea03d305eeac587d7a8500 Gleb Smirnoff 2026-04-14 16:02:00
qcom_gcc: Only build on arm64 for kernels with FDT
This fixes the build of the LINT-ACPI kernel.

Fixes:          https://cgit.freebsd.org/src/commit/?id=4e3fdced7f78 ("qcom_gcc: migrate the MSM8916 support to qcom_gcc")
c48381df77e15fda271555dcd5ef0cbbbd7cd9bf John Baldwin 2026-04-14 18:35:16
sys/time: appease gcc -Wtype-limits
In environments where time_t is 32 bits, including the 32-bit library
build on amd64, the overflow being tested for cannot happen, and gcc
complains with -Wtype-limits, causing the gcc build to fail.  Work
around this by ifdef'ing out the saturation code on i386.

Reviewed by:    imp, jfree
Discussed with: markj
Fixes:  https://cgit.freebsd.org/src/commit/?id=e3799530b3ba ("sys/time: Add saturating sbt conversions")
Differential Revision:  https://reviews.freebsd.org/D56369
00dccc3164c6dff38350a1baeeea7238acf2efc3 Ryan Libby 2026-04-15 08:08:37
linuxkpi: Fix an off-by-one error in the kfifo implementation
"total" is the number of slots in the array, so wraparound needs to be
done when "first" or "last" is greater than or equal to the number of
slots.

Note that no consumers of the code are currently connected to the kernel
build.

Reported by:    Stanislav Fort <stanislav.fort@aisle.com>
Reviewed by:    bz, emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56371
52d2fc702b85d56b35f8828fe7efca3cde0d25b7 Mark Johnston 2026-04-15 13:33:04
arm64: Define the .iplt section placement.
Ensure that the .plt and .ipld sections are in the executable memory segment.

MFC after:      1 week
Reviewed by:    andrew
Differential Revision: https://reviews.freebsd.org/D56403
1dddb580f950a27fb9859b2879755dde114c9d8b Michal Meloun 2026-04-15 09:32:54
vm_swapout: Remove a special case from vm_swapout_map_deactivate_pages()
John points out that this probably should have been removed in commit
472888018ce, which removed a special case where we'd set desired=0 if
the target process has P_INMEM clear.  It's not obvious to me that the
desired=0 case can't arise by setting an RSS limit to 0, but I'm not
sure why we'd try to go the extra mile in that case anyway.

Reported by:    jhb
Reviewed by:    kib
MFC after:      2 weeks
Fixes:          https://cgit.freebsd.org/src/commit/?id=472888018ce1 ("proc: Remove kernel stack swapping support, part 6")
Differential Revision:  https://reviews.freebsd.org/D56140
b6b0afefec4739923897d984448704ce34a21e6b Mark Johnston 2026-04-15 18:00:38
glabel(8): Fix debug message for already existing labels
Remove the duplicate (incorrect) name.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294542
Reviewed by:    markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56400
92c69c791c436eb966fab806393b70e53cde6874 Michael Osipov 2026-04-14 08:38:59
Commit group #86: kern_descrip.c: Clarify allocation and freeing of fd map in fdgrowtable()
kern_descrip.c: Clarify allocation and freeing of fd map in fdgrowtable()

When expanding a file table, the condition for allocating a new map
is NDSLOTS(nnfiles) > NDSLOTS(onfiles) whereas for freeing the old map
is NDSLOTS(onfiles) > NDSLOTS(NDFILE).

If a previously expanded file table were to be expanded slightly again
such that the map did not need to be increased, then fdgrowtable could
still free the current map.

This does not happen currently as nnfiles is rounded up to a multiple of
NDENTRIES at the beginning of fdgrowtable() so that every enlargement
after the first enlargement will always require a larger map.

Though the logic is currently correct, it is unclear and should the
earlier rounding up of nnfiles be relaxed or remove, the logic would
be incorrect. This patch therefore adds comments and invariants checking
the size of the table and map, and updates the map free condition so
that it is absolutely clear that the old map will only be deallocated
if a new map has been allocated.

Signed-off-by: Kristofer Peterson <kris@tranception.com>
Reviewed by: kib, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/2029
e75b324c93a14ab68d79d9247943ae10da184657 Kristofer Peterson 2026-02-18 13:56:53

file: Fix a format string assertion

Reported by:    Jenkins
Fixes:          https://cgit.freebsd.org/src/commit/?id=e75b324c93a1 ("kern_descrip.c: Clarify allocation and freeing of fd map in fdgrowtable()")
0dac997f2434a30785d71d7513b4ebfc3eecf0d7 Mark Johnston 2026-04-16 20:21:51
openat(2): check that userspace pass known and allowed flags
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56365
8a5601cff1ea32ab63df1377f61620e4f91999b3 Konstantin Belousov 2026-04-12 10:48:47
arm64: mte: handle synchronous tag check faults
The Memory Tagging Extension supports both Synchronous and Asynchronous
faults, called Tag Check Faults, which are configurable via
SCTLR_EL1.TCF0 for userspace and SCTLR_EL1.TCF for the kernel.

This commit adds support for handling synchronous tag check faults at
EL0 and EL1, although these are only enabled on a per-process basis in
userspace, kernel space does not enable tag check faults. A TCF in the
kernel will cause a kernel panic like any other virtual memory fault,
and a TCF in userspace will result in a SIGSEGV

Reviewed by:    kib
Sponsored by:   Arm Ltd
Signed-off-by:  Harry Moulton <harry.moulton@arm.com>
Differential Revision:  https://reviews.freebsd.org/D55947
6f9e9eba984f5c8d8a022c0ec99f844a911687fe Harry Moulton 2026-04-16 13:29:14
so_splice: Fix the KTLS check for the sink socket in so_splice()
Reviewed by:  gallatin
Reported by:    Claude Sonnet 4.6
Fixes:          https://cgit.freebsd.org/src/commit/?id=1000cc4a0d39 ("so_splice: Disallow splicing with KTLS-enabled sockets")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56385
d88a159da42a75dbd46ea4f6f9c8059975dab5e8 Mark Johnston 2026-04-16 19:57:36
i386: mark the stack as non-executable
Sponsored by:         Netflix
Reviewed by:            jhb
Differential Revision:  https://reviews.freebsd.org/D56411
62a19cd59b54a030c21a5529ed491ba2060140ca Warner Losh 2026-04-17 04:41:49
syscalls: Preserve the attributes of the args
Lightly parse and preserve the attributes of the args as attributes.

Sponsored by:           Netflix
Reviewed by:            brooks
Differential Revision:  https://reviews.freebsd.org/D56407
2a1745da389bd3bb9fd32c25cf221fa32866debd Warner Losh 2026-04-17 04:42:01
syscall: Create a script to export the data as json
Create a script to export the parsed data as json. Include the
annotations for the system call arguments, since they are helpful to
downstream uses.

Sponsored by:           Netflix
Reviewed by:            brooks
Differential Revision:  https://reviews.freebsd.org/D56408
b3b23f284a67317309af7c30bb70d5f461f3f02f Warner Losh 2026-04-17 04:42:10
Commit group #87: linux
linux: Support ICMP6_FILTER socket option translation

Handle Linux IPPROTO_ICMPV6 socket options in the Linuxulator and map
ICMP6_FILTER for both getsockopt(2) and setsockopt(2).

Linux and FreeBSD use inverted bit semantics for struct icmp6_filter, so
invert the filter contents before/after calling setsockopt/getsockopt.

Signed-off-by:  Ricardo Branco <rbranco@suse.de>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294434
Reviewed by:    pouria
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2138
64e2715f5d8f03ab7e763a49a0e102d755673810 Ricardo Branco 2026-04-12 11:01:47

linux: Support IPPROTO_RAW socket option translation

Handle Linux IPPROTO_RAW socket options in the Linuxulator for both
getsockopt(2) and setsockopt(2). Detect the socket family and remap
the level to IPPROTO_IPV6 for AF_INET6, reusing the existing option
translators.

This fixes IPV6_CHECKSUM for IPv6 raw sockets, which Linux programs
set at level IPPROTO_RAW rather than IPPROTO_IPV6.

Signed-off-by:  Ricardo Branco <rbranco@suse.de>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294434
Reviewed by:    pouria
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2138
caaa7a07fed4a16e753c0064482c0eaa0900607b Ricardo Branco 2026-04-12 14:08:38

linux: Translate IPv6 hoplimit ancillary data for recvmsg

Signed-off-by:  Ricardo Branco <rbranco@suse.de>
Reviewed by:    pouria
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2138
cd34d8dea4adb69b3d7189c7b98dbc9516da3e4a Ricardo Branco 2026-04-12 14:43:05
dtrace: Improve dmesg kernel message prefix
Provide intuitive log search keywords and increased system consistency.

MFC after:              2 weeks
Reported by:            mav
Reviewed by:            0mp, dteske
OpenZFS change:         d45c8d648 (Improve dmesg kernel message prefix)
Differential Revision:  https://reviews.freebsd.org/D55765
49e9b3061df036a73e8bc424c026158f3f57b183 Alexander Ziaee 2026-04-17 15:25:01
ixgbe: add MDIO bus support
This works enough to let me see the marvell switch on the MDIO bus.

It uses clause 22, which ixgbe's existing MDIO code doesn't currently
support, so it's implemented in a new source file.

Since mdio(4) is now required, add it where appropriate to GENERIC kernels.

Reviewed by:    kbowling
Differential Revision:  https://reviews.freebsd.org/D50128
cfec995c87f39e59c80554b85625b4aaa8ddf8db Adrian Chadd 2026-04-17 17:11:42
Commit group #88: LinuxKPI
LinuxKPI: 802.11: factor out chandef/chanctx initialization

Factor out chandef and chanctx initialization from lkpi_sta_scan_to_auth().
This makes the code a lot more readable and prepares for the next steps
that will re-use some of this.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
695f0f0d037a876fa27c0cdca9890e09fd75429e Bjoern A. Zeeb 2026-01-03 20:10:24

LinuxKPI: 802.11: save the default channel

Add a field to struct lkpi_hw to save the default channel for later
reuse.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
ced6909dd69b8476121dc291e01fa56ae14520e5 Bjoern A. Zeeb 2026-03-10 20:02:43

LinuxKPI: 802.11: keep chanctx on a reserved list

Keep the chanctx around as we may swap them.

In the future (11be) these lists likely need to be (a) limited to
maximum number of chanctx possible (see struct ieee80211_iface_limit),
and (b) with that also by radio.

For the moment keep this simple and start with a single chanctx
and build up from there when we get there.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
e62c92c0a5cfc000cf3c200e43738834ccc6472e Bjoern A. Zeeb 2026-03-23 00:47:57

LinuxKPI: 802.11: factor out getting and setting a chanctx

Further factor out acquiring the chanctx (either set or new),
as well as populating a chanctx with information.
This further simplifies lkpi_sta_scan_to_auth() and gives us
more reusable function blocks.

Sponsored by:   The FreeBSD Foundation
MFC after;      3 days
88cb1e17f471276e831c298c48acf9aca6ae29a6 Bjoern A. Zeeb 2026-03-23 03:55:14

LinuxKPI: 802.11: rework lkpi_ic_set_channel()

We are called by net80211 when channel changes are happening and
we have to map this to LinuxKPI 802.11.  There are multiple cases:
(1) it is a hardware scan and net80211 still changes the channel;
    we do not need to;
(2) it is a software scan (the magic fallback case) in which case
    we let net80211 drive the scan channel and we need to keep
    a copy of the scan_chandef (see follow-up commit);
(3) no scanning but a normal channel change triggerd by net80211;
    in that case we could (should?) setup the full flags right away
    but deferred LinuxKPI logic currently handle this for us as not
    in all cases the information was fully available from net80211
    in times we would have needed it.  We only do this in order
    to handle the emulate chanctx cases but do not change the
    channel otherwise; scan_to_auth will set the correct chanctx.
(3a) we have no (active) chanctx for that, create/set one,
(3b) we do have an (active) chanctx for this, use it but reset to
     defaults.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
491f5876bfb40a4f70f523b5d14bccf6b53d2b0c Bjoern A. Zeeb 2026-03-10 19:14:43

LinuxKPI: 802.11: improve emulate chanctx implementation

Now that all dependencies are implemented improve our chanctx emulation.
Some drivers still rely on chandef information for channel work.

In order to only do chanctx updates within mac80211 in Linux and
likewise in the LinuxKPI 802.11 compat layer, emulation functions
were introduced which claim to support chanctx driver operation but
in reality convert these to chandef field updates and (*config)
downcalls.

This is relevant to several mt76 chipsets (at least 7615, 7915),
and rtw88 and certain rtw89 chipsets (8851b, and the ones not supporting
SCAN_OFFLOAD or BEACON_FILTER) for us.

Migrate the logic out of the header and improve it.

Make use of the introduced dflt_chandef and scan_chandef fields,
add comparison of chandefs to see if we have to update, etc.

Also add strict checks for driver settings in linuxkpi_ieee80211_alloc_hw()
to make sure all preconditions are correctly met.  Store the result
if we are using the emulation functions in a field, so we can later
check on it and also leave a note to the users if emulation is used
in order to improve debugging on possible problem reports.

Use the new field that we use emulation in lkpi_ic_set_channel() instead
of a hand crafted check.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=ac1d519c01ca8 ("LinuxKPI: 802.11: adjustments for v6.11..")
166a7344df582f98a88f2b37b7aa3dc4558c9438 Bjoern A. Zeeb 2026-03-10 11:16:12

LinuxKPI: 802.11: add chandef tracing

Add chandef tracing so we can follow what is set and unset in the
chanctx emulation for drivers still needing this.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
72b9dda511b6944068fb18c2f2e059bca48d9edd Bjoern A. Zeeb 2026-04-03 19:59:02

LinuxKPI: 802.11: start filling vif->cfg.ap_addr

vif->cfg.ap_addr is used by various drivers now and is the BSSID for
non-MLO or the AP addr for MLO configurations.

If this is unset rtw89 gets cranky and certain packets are likely not
going out correctly (also for iwlwifi).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
dc886a4428712aa4fcdcf8cd9e850b048c923bbf Bjoern A. Zeeb 2026-04-16 23:42:03

LinuxKPI: 802.11: make sure dtim_period is set

When going from ASSOC to RUN LinuxKPI based wireless drivers have
certian expectations written in various ways.  I believe mac80211
waits to see a beacon before setting the vif to assoc (or the sta
to AUTHORIZED).  We have some comments in lkpi_update_dtim_tsf()
for that.
In practice we can filter out the beacons already and know when
they came in as we count them but it is hard to split up the
state machine and defer the work.

So we make sure that dtim_period is set to at least 1 before
calling the (*vif_cfg_change) after setting assoc to true;
0 is a reserved value according to the standards.

We will update it once we see a beacon and in case the value
differs from 1 shortly afterwards from the recv_mgmt callback.

While iwlwifi seems to have coped with our initial implementation,
rtw89 may hit a DIV 0 if dtim_period is 0 depending on how well
the rx path races with our unlocking in assoc_to_run.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
9f20a4ebf044eb0cab83397c83f13bb3958abf6a Bjoern A. Zeeb 2026-04-17 02:34:51

LinuxKPI: 802.11: add three more driver downcalls

Add (*link_sta_rc_update), (*set_bitrate_mask), and
(*sta_set_decap_offload) mac80211 driver downcalls in preparation
for further work.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
ba796102fefa24a1f97286bfeb0d762c16decdf4 Bjoern A. Zeeb 2026-04-26 17:08:03

LinuxKPI: 802.11: implement ieee80211_start_tx_ba_session()

Implement ieee80211_start_tx_ba_session() as a start for rtw8x (and
select mt76 chipsets) to support more throughput.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
fb97712a7f13b85ca707f52f206a2944ee66cf2c Bjoern A. Zeeb 2026-04-26 19:58:08

LinuxKPI: 802.11: add note about rate control support under boot -v

We currently do not support rate control in LinuxKPI.  As more drivers
and chipsets gain suppport for higher throughput add a note under
bootverbose if we hit one of these cases (currently only older iwlwifi
chipsets).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
a993d281111bef7c760340321e372a7cb6a759a0 Bjoern A. Zeeb 2026-04-26 20:04:46

LinuxKPI: 802.11: adjust tracing for action/ampdu/addba functions

Adjust the pure debug tracing to no longer be under HT and add more
to the other functions we are interested in, so we can follow the
calls more easily.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
22ac9be92d1da75989f67d6057a57c69b289b82d Bjoern A. Zeeb 2026-04-26 22:43:49

LinuxKPI: 802.11: make *addba* work better

Fill in more details for lkpi_ic_addba_request(), lkpi_ic_addba_response(),
and lkpi_ic_addba_response_timeout().

Migrate the ltxq flags seen_dequeue and stopped to a bitfield and add %b
support to log messages.   This seemed the better approach after needing
an additional stop field for BA while we have to hold packets from being
transmitted.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
259efa730c3d5c52d6ef0faa1d57d66eea5afa8e Bjoern A. Zeeb 2026-04-27 00:48:06

LinuxKPI: 802.11: set flag if frame should be part of an A-MPDU

In the output path where we are sending a frame to the driver mark it
if it should be part of an A-MPDU based on its tid, type, and whether
net80211 thinks that we are in the right state for this.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
cda79e505e2120fe3b4c4f16cb18d92bf2e01e4e Bjoern A. Zeeb 2026-04-27 00:55:27

LinuxKPI: 802.11: add print masks for tx status flags

Add print masks for tx status flags and use them in the TX tracing
in order to more easily debug TX problems.

As a result it was easier to determine that some dirver like the mt7921
(or mt76) do not always zero the status bits of the tx status information
(it is a union with the control bits passed on TX) and thus we get bogus
values back (rather than having flags in a different place than we thought).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
0cb3b9229876a2a83d217779cf5ecd09eb153fc3 Bjoern A. Zeeb 2026-06-10 11:50:03

LinuxKPI: 802.11: set undefined link in TX control info

We are not doing MLO yet so set the undefined link bit in the
TX info control message in case a driver checks if the TX would be
link specific.

Sposnored by:   The FreeBSD Foundation
MFC after:      3 days
f54e9d1b299d73081b33ad3f60471dbb1b243cb3 Bjoern A. Zeeb 2026-06-10 11:55:21

LinuxKPI: 802.11: improve hw_crypto key operations

mt7921 would happily receive traffic (MC/BC) and decrypt it correctly
when hw_crypto was used but TX would only have garbled data in frames.

The problem came from the fact with keys for which we do not have an
address the driver will pick the "sta" information from different places
(driver view of sta or vif).
In the downcall this is signalled by the sta argument being NULL as
the linux keyconf has no address field.

Us passing the sta for first the pairwise key and then also for the
group key likely overwrote the pairwise key on the sta and allowed
the MC/BC RX operations to succeed anyway (the observed behaviour).

Software crypto was fully fine for mt7921 and showed no problems.

Looking some other drivers:
- iwlwifi/mld picks the ap_sta if the sta argument is NULL; thus it
  always worked with our previous logic and this went unnoticed.
- rtw88 in rtw_sec_write_cam() decides whether to use the sta address
  or a broadcast address.
- rtw89 in rtw89_cam_attach_sec_cam() picks the rtwsta_link if sta is
  not NULL and has follow-up logic checking on that.

It is yet unclear if some of the MC problems observed on rtw8x
stem from the same problem.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
ff6c95d2c2dffbb024ad19ed306334a7993d964f Bjoern A. Zeeb 2026-06-13 11:14:11

LinuxKPI: 802.11: force update of net80211 crypto key flags

Several drivers (rtw8x, mt76) do not announce the supported ciphers suites
in the wiphy instance.  This means we never populate net80211 ic_cryptocaps
on device creation and thus not announcing any supported hw crypto
offload forcing a fallback to software crypto.

However when the mac80211 (*set_key) succeeds we know we can offload
crypto.  At that point the net80211 key flags have IEEE80211_KEY_SWCRYPT
set which we want to clear.  Historically the net80211 API does not
allow this though there should be no ill side effects (base on a
quick code inspection).  We thus have to DECONST the key argument
for now.  It is expected that with MFP support this will need to
become a common operation and the API will need to change as we
will only get the information of some details from the driver on a
per-cipher case when the (*set_key) downcall returns.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
31ded414b1282abdebcb24c18cc6dbebf84210f2 Bjoern A. Zeeb 2026-06-13 11:25:42

LinuxKPI: 802.11: leave a comment for sta->rates (mt7615, ?)

While we currently try to fill most rates places (e.g., basic_rates,
supp_rates, (*set_bitrate_mask)), sta->rates are not populated.

They are likely managed by the 802.11 rate control code (given no
ieee80211_hw_check HAS_RATE_CONTROL), which for use would be net80211,
which will require some extra code just to manage that.

At least Mediatek mt76 (mt7615) driver seems to fall into the category
of this need.  See about that once/if we get to it.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
557eed60d2a34d061350ac37acebe6686cd80d83 Bjoern A. Zeeb 2026-06-21 14:04:36

LinuxKPI: 802.11: add/improve/correct comments

Adjust/add comments to clarify certain situations.

No functional changes.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
08a78a296c840aa95ec13895c3c9bf1349becbae Bjoern A. Zeeb 2026-06-22 00:07:16

LinuxKPI: 802.11: add 11g check to lkpi_ic_getradiocaps()

Replace an early comment with code and add a (simplified) 11g check.
We make use of the annotated bitrate flags we added (see
lkpi_wiphy_band_annotate()) and check if on the 2GHz band there are
any bitrates which are 11g.  Upon the first one found we do set the
IEEE80211_MODE_11G to announce to net80211 that the 2.4Ghz channels
may operate on 11g as well.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
d4a529ad0d5638ad3e8d27815948b0a7c4628e3f Bjoern A. Zeeb 2026-06-22 00:10:22

LinuxKPI: 802.11: introduce TRACE_RATES()

Add a tracing bit for tracing rates related changes introduced in
followup commits.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
b58d8df5829233ced7024c30a0a979e2e0a722fd Bjoern A. Zeeb 2026-06-22 00:17:26

LinuxKPI: 802.11: initalize br_mask and basic_rates for each vap

During vap creating we inialize most [l]vif related variables.
Add a br_mask (bit rate mask) to the lvif and setup the legacy component
as it seems to be static.
Given we are looping over the bands, also initialize the bss_conf
basic_rates. At this point we only have all bitrates for the band
or the mandatory bitrates for the band available.  In order to not
hint usage of possibly unsupported bit rates set it up with the
manadatory bit rates only, which should get us through the mgmt
frames, etc. to get to assoc state.  By then we will do updates.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
7bf2eec68a293a22f332fc1592dffaa4ed9f0809 Bjoern A. Zeeb 2026-06-22 00:27:21

LinuxKPI: 802.11: make lkpi_sta_sync_from_ni() return bss_changes

This is a preparatory change with no functional changes.

Sponosred by:   The FreeBSD Foundation
MFC after:      3 days
038489e46ea3e77484ea85c4369610ba3ee8381b Bjoern A. Zeeb 2026-06-17 14:37:42

LinuxKPI: 802.11: add function to update some rate related fields

Add lkpi_sta_supp_rates() which serves multiple purposes:
(a) build (and update) the supp_rates field on a sta link (deflink only
    in our case still),
(b) build and update basic_rates on the vif->bss_conf and print a
    warning in case we end up without any basic rate (should not happen
    anymore, not even on initial startup sync),
(c) if HT or VHT are supported, then update the relevant br_mask fields
    for the current band.

Deal with the various flags which trigger different updates by returning
them so the caller can act upon.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
0d3cd54642f6695f9f82b82402f27e10bbee7cfc Bjoern A. Zeeb 2026-06-22 00:41:38

LinuxKPI: 802.11: add/change rate related tracing

Make use of the TRACE_RATES() macro and add various tracing events.
Also adjust some events formerly under TRACEOK to TRACE_RATES().

Ignoring the tracing, no other functional changes.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
42cf2798110e12df6ccc22a138ed89617ac7d407 Bjoern A. Zeeb 2026-06-22 01:01:15

LinuxKPI: 802.11: consider emulate_chanctx in lkpi_sync_chanctx_cw_from_rx_bw()

Only return early if the bandwidth has not changed and we are not
using emulate_chanctx or the chandef.width already matches the new
bandwidth.  Otherwise we have to continue to get all the values
updated.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
cff565a4c0335e12376ea43f99ef5328c45ce933 Bjoern A. Zeeb 2026-06-22 01:04:36

LinuxKPI: 802.11: track bandwidth/rx_nss change in lkpi_sta_sync_from_ni()

In lkpi_sta_sync_from_ni() track the bandwidth and rx_nss at the
beginning so at the end we can diff if they changed in order to generate
the appropriate RC*CHNAGED flags for the (*link_sta_rc_update) downcall.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
53d9c14af6a65dcc037527c6ff5308c94806fafe Bjoern A. Zeeb 2026-06-22 01:11:18

LinuxKPI: 802.11: adjust timing of sync_from_ni in lkpi_sta_assoc_to_run()

We used to call the (*sta_state) downcall into the driver to set the
sta state to ASSOC.  After that we did a lot of sync operations incl.
the lkpi_sta_sync_from_ni() which does a lot of rate and bandwith
adjustments.   This sync call needs to happen before we set the sta
to assoc as drivers rely on some of this information, e.g., ht_cap and
vht_cap (and equivalents for later standards) at that point.  Moving
this will make, e.g., mt7921 transmit at higher rates than just
basic_rates.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
75aadc902298005c47d2b931c483452027ceae69 Bjoern A. Zeeb 2026-06-22 01:16:45
Commit group #89: LinuxKPI
LinuxKPI: move hex2bin() from kernel.h to new hex.h

New Linux v7.0 drivers include hex.h.  Rather than adding a dummy
header, migrate the kernel.h hex2bin() into hex.h, where it belongs.
Care needs to be taken as the _h2b() helper function is still used by
other bits in kernel.h.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D56391
98297ff3cfbb42df86fa7af51a2740d5aa7236eb Bjoern A. Zeeb 2026-04-14 13:36:40

LinuxKPI: add default_gfp()

Various new allocation macros can take an optional gfp_t argument.
If the argument is not given we need to set the GFP_KERNEL default.
While this is only internally used and I initialy called it differently,
should this spread elsewhere having the same name as in Linux will be
good.

Sponsored by:   The FreeBSD Foundaton
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D56392
35b90c21f48056e85b70dbbe2209b6c3a4927315 Bjoern A. Zeeb 2026-04-14 13:40:24

LinuxKPI: conditionally add __flex_counter()

__flex_counter() is used by overflow.h and needed for "flex allocations".
It is either a void * typed 0 (NULL) (like this for _Generic checks),
or uses __builtin_counted_by_ref.

The latter was added to gcc and llvm fairly recently and while for gcc
the __has_builtin() check suffices, clang had parts broken until recently
so needs an extra check for the next major version.  The fixed hash is
currently not part of any tag to use, so we play it save (and hope 23
will have it).  It will be a while until we will see the builting to be
used but at least we will be prepared for it.  See inline comments for
the commit hashes and versions which added the feature.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D56393
524df650a92f648e19ba27d6727bdc79c8efdbbb Bjoern A. Zeeb 2026-04-14 15:06:56

LinuxKPI: sync overflow.h from Linux v7.0

overflow.h was imported directly from Linux in 3208d4ad2b8320a.
Update the file to the newer version as needed for v7.0 driver updates.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Obtained from:  git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
                028ef9c96e96197026887c0f092424679298aae8 (tag: v7.0)
Reviewed by:    emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D56394
d2c85255d4fca37ec9774f85f867f8fc89a51269 Bjoern A. Zeeb 2026-04-14 13:50:44

LinuxKPI: add kmalloc_obj[s], kzalloc_obj[s], and kzalloc_flex

Drivers in Linux v7.0 seem to have changed to the new allocation
macros using a sweep.  Add the ones I encountered with wireless
drivers so far.  They all take an optional argument for a gfp_t,
which default_gfp() deals with.

The plural version "objs" takes an extra nitems argument in addition
to the size.  We use size_mul() to possibly detect overflows.

The "flex" version uses an extra variable to track the variable sized
array allocations and if supported by the compiler will use
__builtin_counted_by_ref() to properly track bounds.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D56395
c72ac6af086962d236f4712761abacac0c62b48e Bjoern A. Zeeb 2026-04-14 15:13:18

LinuxKPI: implement devm_kmemdup_array()

Implement devm_kmemdup_array() using devm_kmemdup() in order to
prepare for Linux v7.0 based drivers.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D56396
f1834d03af617a93993056bb902082452673f89f Bjoern A. Zeeb 2026-04-14 13:35:36
pipe: retire the unused PIPE_LWANT macro
8c94a1ea155586a70369f263a5e01b26a1b37d58 Mateusz Guzik 2026-04-18 08:17:56
Commit group #90: LinuxKPI
LinuxKPI: 802.11: set IEEE80211_MIN_ACTION_SIZE according to struct

IEEE80211_MIN_ACTION_SIZE came up in the mt76 vendor subtree merge
as one of the non-mechanical changes which made me look.
Rather than (incorrectly) hand counting the offset from the beginning
of a frame, use the offset from the beginning of struct ieee80211_mgmt.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
f252ce00898d17f4892534934b8097cd7ccb9e26 Bjoern A. Zeeb 2026-04-15 07:50:35

LinuxKPI: 802.11: Add structures and functions for NAN support

In Linux v7.0 iwlwifi(4) started to add support for Wi-Fi Aware(tm)
also known as Neighbor Awareness Networking (NAN).

Add structures and fields for this as needed so far to keep the driver
compiling.  net80211 has no support for it as a new mode.

We may consider a dedicated header file for these parts in the future
depending on how much more is to come.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
a0112b013f93a47489051fed54ea48c077e59de4 Bjoern A. Zeeb 2026-04-18 11:26:59

LinuxKPI: 802.11: add struct/fields and functions for v7.0

Add 802.11 struct fields and functions support for Linux v7.0 based
wireless drivers (at least iwlwifi, rtw88, rtw89).

While here cleanup some other bits.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
25e776a5438005db59c6d474b5d47c42d2a341b9 Bjoern A. Zeeb 2026-04-14 15:23:31
gdb: Print a stack trace if a python command raises an error
MFC after:    1 week
9899c8da0c19e66bedf37dd914e13880089877e2 Mark Johnston 2026-04-18 12:23:18
membarrier(2): use atomic for lockless read of curproc->p_flag2
Reviewed by:  markj, Ricardo Branco <rbranco@suse.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56507
950fd59955e10429c1325c327f0141a7e97fcfe5 Konstantin Belousov 2026-04-18 18:42:56
membarrier(2): implement the MEMBARRIER_CMD_GET_REGISTRATIONS command
Reported by:  Ricardo Branco <rbranco@suse.com>
Reviewed by:    markj, Ricardo Branco <rbranco@suse.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56507
aaa10396a997bafc28ce6551e92563620caf3df4 Konstantin Belousov 2026-04-18 18:43:59
audit: Fix logging of IPv6 addresses
- kaudit_to_bsm: Log IPv6 as well as IPv4 and unix addrs
- au_to_sock_inet128: Treat ports the same way as au_to_sock_inet32() as
  just pushing a uint16 causes byte ordering problems on little endian.

Differential Revision: https://reviews.freebsd.org/D39633
Sponsored by: Netflix
Reviewed by: csjp
16de94eaf09b75a9a1e90254a6fe5812f55f4cab Andrew Gallatin 2026-04-20 21:35:46
tty: Avoid leaving dangling pointers in tty_drop_ctty()
The TIOCNOTTY handler detaches the calling process from its controlling
terminal.  It clears the link from the session to the tty, but not the
pointers from the tty to the session and process group.  This means that
sess_release() doesn't call tty_rel_sess(), and that pgdelete() doesn't
call tty_rel_pgrp(), so the pointers are left dangling.

Fix this by clearing pointers in tty_drop_ctty().  Add a standalone
regression test.

Approved by:    so
Security:       FreeBSD-SA-26:10.tty
Security:       CVE-2026-5398
Reported by:    Nicholas Carlini <npc@anthropic.com>
Reviewed by:    kib, kevans
Fixes:          https://cgit.freebsd.org/src/commit/?id=1b50b999f9b5 ("tty: implement TIOCNOTTY")
Differential Revision:  https://reviews.freebsd.org/D56046
093903a8d4c05d1adff79895a52a3e3009ff07a7 Mark Johnston 2026-03-23 15:22:48
Commit group #91: pkru: Fix handling of 1GB largepage mappings
pkru: Fix handling of 1GB largepage mappings

pmap_pkru_update_range() did not handle the case where a PDPE has PG_PS
set.  More generally, the SET_PKRU and CLEAR_PKRU sysarch
implementations did not check whether the request covers a "boundary" vm
map entry.  Fix this, add the missing PG_PS test, and add some tests.

Approved by:    so
Security:       FreeBSD-SA-26:11.amd64
Security:       CVE-2026-6386
Reported by:    Nicholas Carlini <npc@anthropic.com>
Reviewed by:    kib, alc
Differential Revision:  https://reviews.freebsd.org/D56184
ca87c0b8e396fff01d55f1985c2556934c35a950 Mark Johnston 2026-03-31 13:37:43

tests/posixshm: Check for hardware support in largepage_pkru

MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=ca87c0b8e396 ("pkru: Fix handling of 1GB largepage mappings")
75c66218401c00f4728d5312e2b933b8d3aefde1 Mark Johnston 2026-04-24 13:23:03
epoch: Don't idle CPUs when there's pending epoch work
The epoch(9) subsystem implements per-CPU queues of object destructors
which get invoked once it is safe to do so.  These queues are polled via
hardclock().

When a CPU is about to go idle, we reduce the hardclock frequency to 1Hz
by default, to avoid unneeded wakeups.  This means that if there is any
garbage in these destructor queues, it won't be cleared for at least 1s
(and possibly longer) even if it would otherwise be safe to do so.

epoch_drain_callbacks() is used in some places to provide a barrier,
ensuring that all garbage present in the destructor queues is cleaned up
before returning.  It's implemented by adding a fake destructor in the
queues and blocking until it gets run on all CPUs.  The above-described
phenomenon means that it can take a long time for these calls to return,
even (especially) when some CPUs are idle.  This causes long delays when
destroying VNET jails, for instance, as epoch_drain_callbacks() is
invoked each time a network interface is destroyed.

Work around this problem by not disabling the hardclock timer if there
is garbage present in the destructor queues.  The implementation of
epoch_drain_callbacks() has other problems, but this small change on its
own gives a good improvement, especially when running networking
regression tests.  Moreover, we should aim to invoke destructors in a
timely manner, so the change is generally beneficial.

Reviewed by:    glebius
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D56508
dce56594991464c276f340ce963d0f5461566c78 Mark Johnston 2026-04-21 14:28:31
kern/proc: expose reaper PID and subtree root in struct kinfo_proc
Expose process reaper metadata through struct kinfo_proc so userland
can reconstruct reaper hierarchies from kern.proc.all without adding
a new procctl(2) operation.

Two pid_t fields are added by carving 8 bytes from ki_sparestrings
(46 -> 38), restoring KI_NSPARE_INT to 2 and keeping sizeof(struct
kinfo_proc) unchanged:

  ki_reaper: PID of the owning reaper process
  ki_reapsubtree: PID of the direct child of the reaper that roots
                  the subtree the process belongs to

fill_kinfo_proc_pgrp() populates both fields under proctree_lock.
kvm_proclist() is updated for crash dump consumers. The freebsd32
compat struct and freebsd32_kinfo_proc_out() are updated accordingly.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293871
Reviewed by:    kib
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56538
0f89380a3d208d67698f2d35afd35257e5fdbe09 GenericRikka 2026-04-20 23:32:49
Commit group #92: linux: Support PR_GET_CHILD_SUBREAPER prctl(2)
linux: Support PR_GET_CHILD_SUBREAPER prctl(2)

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294651
Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: kib, pouria
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2151
50ff71e956b631b56a878bd723a9b32dfbdac60f Ricardo Branco 2026-04-19 21:06:52

linux: Fix a typo in a header comment

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294651
Reported by:    Dmitry Lukhtionov <dmitryluhtionov@gmail.com>
Fixes:          https://cgit.freebsd.org/src/commit/?id=50ff71e956b6 ("linux: Support PR_GET_CHILD_SUBREAPER prctl(2)")
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2151
45827f9ad2e32ec8e4cdde62cbf722a48fb1b396 Pouria Mousavizadeh Tehrani 2026-04-22 10:17:50
linux: Support LINUX_PR_GET_NO_NEW_PRIVS prctl(2)
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294651
Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: kib, pouria
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2151
98a868c61b931e37cf09adecd8542cbd874d333f Ricardo Branco 2026-04-19 21:16:48
kexec: Disallow kexec_load if securelevel > 0
kexec_load() + reboot is intended to be equivalent to a system reboot.
However kexec_load() can load arbitrary data as the target kernel,
leading to execution of arbitrary code, even though it's effectively in
a new context.  Rather than being equivalent to a system reboot, it's
also equivalent to kldload(), which loads arbitrary code into the
running kernel.  Since kldload() is blocked at securelevel 1, also block
kexec_load().

Reported by:    markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=e02c57ff3 ("kern: Introduce kexec system feature (MI)")
Sponsored by:   Hewlett Packard Enterprise
Differential Revision:  https://reviews.freebsd.org/D56580
e3e8ec2ab620f026b42b4988fce49eff7cec16eb Justin Hibbits 2026-04-22 15:51:06
Commit group #93: linuxkpi
linuxkpi: Add `struct kmsg_dump_detail`

This structure is used in a modified definition of `struct kmsg_dumper`
field `dump` in Linux 6.12. Therefore this field has two definitions put
behind the values of `LINUXKPI_VERSION`.

The DRM generic code started to use it in Linux 6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56433
e692f36a678d4fad6054161e554eb5ec544fffa8 Jean-Sébastien Pédron 2026-04-11 09:28:01

linuxkpi: Add more `struct folio`-related functions

The i915 DRM driver started to replace the use of `struct page` by
`struct folio` in its GEM shmem code in Linux 6.12.

linuxkpi were missing a few more functions: `kmap_local_folio()`,
`memcpy_to_folio()` and `offset_in_folio()`. They are equivalent of
their `struct page` counterparts.

One difference is that `kmap_local_folio()` takes an offset argument and
the returned address takes this offset into account.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56438
84fc57a369dfac882cb9e9333635aaa11978948f Jean-Sébastien Pédron 2026-04-11 14:19:39

linuxkpi: Define `fd_file()`

This macro simply returns the `file` field of the `struct fd`.

The DRM generic code and the amdgpu driver started to use it in
Linux 6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56440
373871696d3da5f9fe1dcd23c83be95dbaa1b41d Jean-Sébastien Pédron 2026-04-11 15:18:06

linuxkpi: Add `mem_is_zero()`

The DRM generic code and the i915 DRM driver started to replace the use
of `memchr_inv()` by a `mem_is_zero()` in Linux 6.12. We reuse the
previous use of `memchr_inv()` to implement `mem_is_zero()`.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56442
ab77c26d3643b88b29d3526d60b939d1cca402f9 Jean-Sébastien Pédron 2026-04-12 10:16:55

linuxkpi: Add `kmemdup_array()`

It is similar to `kmemdup()` but takes a number of elements to duplicate
and their size.

The i915 DRM driver started to use it in Linux 6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56444
7643dd70a4dfa5fd874300a7161c24b808d6b134 Jean-Sébastien Pédron 2026-04-12 22:23:06

linuxkpi: <asm/unaligned.h> is moved to <linux/unaligned.h> in Linux 6.12

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56454
849e5b0b6167d7c819f6998fa3e67122af81d794 Jean-Sébastien Pédron 2026-04-14 12:29:53

linuxkpi: Define a guard for the `mutex` type

The amdgpu DRM driver started to use `guard(mutex)` in Linux 6.12.x.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56571
7f59126493d44f21d9a2b1a0b5b81c30f9a438f0 Jean-Sébastien Pédron 2026-04-20 21:38:11

linuxkpi: Add `register_pm_notifier()` and `unregister_pm_notifier()`

They are empty stub returning success for now, like the previously
defined stubs in this header.

Several constant are also defined in the process.

The amdgpu DRM driver started to use them in Linux 6.12.x.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56572
06cfd1047da6f3cdba80da371592980a7143a7b6 Jean-Sébastien Pédron 2026-04-20 22:04:27

linuxkpi: Add `atomic_read_acquire()`

This function calls `raw_atomic_read_acquire()` which is also added.

They are located in <linux/atomic/*.h> headers, both included from
<linux/atomic.h>.

The amdgpu DRM driver started to use this in Linux 6.12.x.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56573
ade8a27ea4c28d12fabc2d5f8e44386a3add23d1 Jean-Sébastien Pédron 2026-04-20 23:34:39

linuxkpi: Define `system_state`

This is a global variable used to track the state of the system, like
booting, running, halting and so on.

This variable is based on the `enum system_states` enumeration.

For now, always set `system_state` to `SYSTEM_RUNNING`.

The amdgpu DRM driver started to use this in Linux 6.12.x.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56575
305ebed50b4e2e2346d211c5a65320fa45c7fbc4 Jean-Sébastien Pédron 2026-04-21 00:14:41

linuxkpi: Define `DIV_U64_ROUND_UP()`

It is the same as `DIV64_U64_ROUND_UP()` but takes a 32-bit integer as
the divisor.

The amdgpu DRM driver started to use this in Linux 6.12.x.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56576
002c08158f9e7eb61c467fe29ff8e24361fb8470 Jean-Sébastien Pédron 2026-04-21 00:32:18

linuxkpi: Add `rb_add()`

It is the same as `rb_add_cached()` but it works on `struct rb_root`, not
a `struc rb_root_cached`. It also does not return anything.

The DRM generic code started to use this in Linux 6.12.x.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56577
cff716c2854c167ef7ff3a4785f5faed9b0a4f98 Jean-Sébastien Pédron 2026-04-21 00:38:56
linux: Add support for membarrier(2)
FreeBSD has a native membarrier(2) syscall which is mostly compatible
with Linux. This is a thin wrapper around kern_membarrier() that
translates all available commands and flags.

Also update the syscalls.master prototypes to match the Linux 5.10+
three-argument form.  Pre-5.10 binaries using the two-argument form
continue to work: cpu_id is only consulted for RSEQ commands, which
FreeBSD does not support and which kern_membarrier() rejects with
EINVAL, matching Linux semantics.

Signed-off-by:  Ricardo Branco <rbranco@suse.de>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281691
Reviewed by:    kib, pouria
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2147
1594fe0b1029f246b3a14c8b21637091968362aa Ricardo Branco 2026-04-18 10:11:44
Commit group #94: linuxkpi
linuxkpi: Move {lower,upper}_32_bits macros to <linux/wordpart.h>

... from <linux/compiler.h>.

<linux/wordpart.h> is the header defining them on Linux 6.12 (I didn't
check older versions).

<linux/wordpart.h> is also included from <linux/kernel.h>.

The DRM generic code started to depend on <linux/wordpart.h> in Linux
6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56441
0a2f3b8ef16786a44fc88afd8862920df4527a3c Jean-Sébastien Pédron 2026-04-11 15:21:53

linuxkpi: Add Linux 6.12 variant of `kvrealloc()`

In Linux 6.12, the API changed to be closer to `krealloc()`:
* The function does not take the old size anymore
* The function becomes a wrapper around `krealloc()` with a fallback
  mechanism.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56453
d74fa49d0c0476353af137d22b5ef8711c67b854 Jean-Sébastien Pédron 2026-04-14 00:01:26

linuxkpi: Move `ARRAY_SIZE` to <linux/array_size.h>

The DRM generic code started to import this header directly in Linux
6.12.x. Let's move the definition of `ARRAY_SIZE()` (the only thing that
<linux/array_size.h> defines) to this header.

Also, include <linux/array_size.h> from the same headers as Linux. This
includes <linux/kernel.h>, so the change should not break anything.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56570
1c641d0436e377c57a767e37f56ce65253817d67 Jean-Sébastien Pédron 2026-04-20 21:34:08

linuxkpi: Add `memdup_array_user()`

The amdgpu DRM driver started this in Linux 6.12.x.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56574
5dfbc6593cdacd5b4e4939e09d595b3a9c8e47da Jean-Sébastien Pédron 2026-04-21 00:01:11

linuxkpi: Define `min_array()` and `max_array()`

They are macros that return the minimum or maximum values of an array of
integers. They assume that the array contains elements.

The i915 DRM driver started to use `min_array()` in Linux 6.12.x.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56583
9a2de1d2042d1c2730dd3049c26d481813b5f2bd Jean-Sébastien Pédron 2026-04-22 14:36:06

linuxkpi: Add `pci_dev_is_disconnected()`

For now, it is an empty stub that always return false. On Linux, it
looks at an internal error state of the device to determine if it is
disconnected.

The amdgpu DRM driver started this in Linux 6.12.x.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56582
43b47418e769df02f43f2b4636dd5c7516fa51f8 Jean-Sébastien Pédron 2026-04-22 14:34:00

linuxkpi: Move `GENMASK()` to <linux/bits.h>

... from <linux/bitops.h>.

This matches the location on Linux.

<linux/bits.h> is also included from <linux/bitops.h>. Therefore it will
not break anything.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56584
47e1ca7f3720c76fdc729e03034fa53c798b9318 Jean-Sébastien Pédron 2026-04-22 16:21:40
linuxkpi: Fix strlcpy size in linuxkpi_alloc_netdev()
`sizeof(*ndev->name)` is `sizeof(char)`, not IFNAMSIZ, so
the interface name was effectively limited to a single byte.
Use `sizeof(ndev->name)` for the `char name[IFNAMSIZ]` member.

Signed-off-by:  Weixie Cui <cuiweixie@gmail.com>
Reviewed by:    pouria
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2111
edb302bb49e00723030b84624f16217f18760564 Weixie Cui 2026-03-31 10:21:30
sys/README: update README.md
Add missing directories and fix alphabetical ordering

Signed-off-by:  Minsoo Choo <minsoo@minsoo.io>
Sponsored by:   FreeBSD Foundation
Reviewed by:    imp, mhorne, pouria
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2146
eb82fb188f0a190f774c3276612aa3b01f1e5f42 Minsoo Choo 2026-04-18 03:56:21
linuxkpi: Define `GFP_KERNEL_ACCOUNT` flag
This flag combines `GFP_KERNEL` and `__GFP_ACCOUNT`. The latter is also
defined in this commit. It is defined as a no-op flag as it is not
implemented.

The DRM generic code started to use it in Linux 6.12.x.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56587
af01ffbfb1c0a0104d3a4c7dd1342ed7c81c6c54 Jean-Sébastien Pédron 2026-04-22 16:28:52
linuxkpi: Implement __GFP_THISNODE in alloc_pages()
It indicates to `alloc_pages()` to allocate the pages from the current
NUMA domain. If it couldn't, it should not retry elsewhere and return
failure.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56590
06a51a510a60ca29193b2cdb8120b630ea9ef18c Jean-Sébastien Pédron 2026-04-22 16:27:32
LinuxKPI: Update seq_file to properly implement the iterator interface
The seq_file.rst documentation in the Linux kernel documents the
iterator interface for the seq_file structure.  In particular, the
ppos passed to seq_read is a logical offset into a seq_file managed by
the iterator interface, not an offset into the generated data.  For
example, if a seq_file outputs state for each node in a linked-list or
array, *ppos might be used as the index of the node to output, not a
byte offset.

Rewrite seq_read to honor this contract which fixes a few bugs:

- Treat *ppos as a logical iterator offset that is only updated by the
  next callback after outputting a single item via the show method.

- Use a loop to permit outputting descriptions of multiple items if
  the user buffer is large enough.

- Always invoke the stop method after terminating the loop to cleanup
  any state setup by start (e.g. if start allocated a buffer or
  obtained a lock, the stop method is called to cleanup).

While here, implement support for SEQ_SKIP as documented in the Linux
documentation even though it is not currently used in the tree.

Reviewed by:    bz
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D55899
f4418cf954c299fa0934f110d6f5e9d50f2d24c5 John Baldwin 2026-04-23 15:46:54
pmap_quick_(enter|remove)_page: Use void * instead of vm_offset_t
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
115065459cedf21a391f749fedb077b82b76ce67 John Baldwin 2026-04-23 17:05:53
busdma: Use char * instead of vm_offset_t for bounce page kernel pointers
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
fe9f0b18bf6a1f881fbe57da716ea429acd539c1 John Baldwin 2026-04-23 17:05:53
pmap_change_attr: Use void * instead of vm_offset_t
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
dfb804eb57f1e50f5c84060007e3b1e9c1edf253 John Baldwin 2026-04-23 17:05:53
pmap_change_prot: Use void * instead of vm_offset_t
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
d8863680744f2de6a97ca80d8eba3755f506203c John Baldwin 2026-04-23 17:05:54
sf_buf_kva: Return a pointer instead of a vm_offset_t
This removes the need for several casts to pointer in callers.

Effort:         CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
573e6313bc3b3d7d8da4531fbfaa2763dbe209a7 John Baldwin 2026-04-23 17:05:54
pmap_qenter/qremove: Use void * instead of vm_offset_t
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
e27501388fc0dc2a29f90cb24ba8d36e9bb6631f John Baldwin 2026-04-23 17:05:54
kva_alloc/free: Use void * instead of vm_offset_t
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
2d0634d2e74bb697573afaf888207a8ad1ba3242 John Baldwin 2026-04-23 17:05:54
vm_kstack: Use void * instead of vm_offset_t
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
8a0ff500d713ab314d2a728fdd1f34960ee055b7 John Baldwin 2026-04-23 17:05:54
sys: Switch td_kstack from vm_offset_t to char *
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
fe2957f591b55d9cbd70cf1325048012fc833fbb John Baldwin 2026-04-23 17:05:54
pmap_map: Use void * for the return value instead of vm_offset_t
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
ac7d52740249de51e805a7cd577b4374d6a6ae81 John Baldwin 2026-04-23 17:05:54
sys: Permit passing pointers to VIRT_IN_DMAP and DMAP_TO_PHYS
Add explicit uintptr_t casts to the arguments to these macros so that
the work both with virtual addresses (e.g. vm_offset_t) and pointers.

Drop no-longer-needed casts in various invocations of DMAP_TO_PHYS.

Effort:         CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
2c6d8f15bd45afddb87d9a435239f4280ebd26f7 John Baldwin 2026-04-23 17:05:54
PHYS_TO_DMAP: Return a void * instead of a vm_offset_t
Add a new PHYS_TO_DMAP_ADDR that still returns an address for use in
places that only need an address and not a pointer.

Effort:         CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
fe3e92e6868dce2ed94c98428b8df1f27ed3ef63 John Baldwin 2026-04-23 17:05:54
kmap_alloc_wait/kmap_free_wakeup: Use void * instead of vm_offset_t
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
30af462bd2641798a6ac29235b82e49ad386d363 John Baldwin 2026-04-23 17:05:55
DMAP_TO_VM_PAGE: Wrapper macro to map direct map address to a page
Effort:               CHERI upstreaming
Suggested by:   kib
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
120a5e3e195f1f780d89ce689e23654422285d62 John Baldwin 2026-04-23 17:05:55
VM_PAGE_TO_DMAP: Wrapper macro to return direct map address for a page
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
9a6e9d7799235d3e122bcc8065e865ae265a6ce2 John Baldwin 2026-04-23 17:05:55
Bump __FreeBSD_version for changing various kernel APIs to use pointers
Effort:               CHERI upstreaming
Sponsored by:   AFRL, DARPA
68d2339bc6afadba0107208430af03731a2e3f4a John Baldwin 2026-04-23 17:05:55
Commit group #95: kern
kern: vfs: add MAC checks for mount/unmount/update

The unmount check is straightforward and only really needs the
struct mount and flags used, in case a MAC policy wants to reject
force-unmounts or do special handling for FSID-based unmounts.

The mount check offers as much information as I think might be of
interest to a MAC policy: the vnode to be mounted on, vfsconf, and
applicable mount options.   XNU also has a later version that just takes
a struct mount for everything that VFS_MOUNT() has to offer, but my
draft policy doesn't need any of that.  It also doesn't really need the
unmount check, but it seems reasonable to add it while I'm here.

The update check similarly passes the flags/options for the operation,
along with the struct mount and label.

Reviewed by:    kib, olce
Differential Revision:  https://reviews.freebsd.org/D55601
0faa88f26c239b19ea543309f2c70384438eae73 Kyle Evans 2026-04-23 18:47:09

kern: mac: sprinkle a bit of const correctness

mpc_name and mpc_fullname are string literals in correct usage, so they
should really be const instead.

mpc_ops aren't typically const, but the framework shouldn't be doing
anything to clobber it; thus, good to constify it as a reminder.

Switch to using a slightly more semantically correct `void **` in the
fastpath bits while we're here, since we only do arithmetic on the outer
layer of pointer and compare the inner to a pointer-typed (NULL).

Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D55702
28b0084af332c34af3bdc60354bb7feea8ceeaa3 Kyle Evans 2026-04-23 18:47:09

kern: mac: bump the MAC_VERSION for 16.x

Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D55703
7982985bdf58d2ee90d10d5710b28f5c3cd48bb1 Kyle Evans 2026-04-23 18:47:09
mac_seeotheruids: allow specificgid to be a list of groups
The specificgid functionality has historically allowed only a single
group to be exempt, but in practice one might want a few services to
be exempt for reasons.  From a security perspective, we probably don't
want to encourage unrelated users to be grouped together solely for
this purpose, as that creates one point of shared access that could be
used for nefarious purposes.

Normalize the group list as we do cr_groups to allow for linear matching
rather than quadratic, we just need to account for the differences in
FreeBSD 15.0+ where cr_groups is entirely supplementary groups vs.
earlier versions, where cr_groups[0] is the egid and the rest is
sorted.

Reviewed by:    csjp, des (earlier version)
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D56592
b675ff8eedc9ac93cdf1cfe33185b7a1a027df37 Kyle Evans 2026-03-01 03:42:25
pass(4): Allowlist CCB func_codes to harden passthrough ioctls
The pass(4) driver's CAMIOCOMMAND and CAMIOQUEUE ioctls accept arbitrary
CCBs from userland.  This device requires root to open, and thus send
these commands. Previously, the only func_code filter was a blocklist
check against the XPT_FC_XPT_ONLY flag.  This missed several dangerous
func_codes that lack that flag:

 - XPT_ABORT: the abort_ccb field is a raw kernel pointer from the
   user CCB payload.  xpt_action_default() dereferences it without
   validation, leading to kernel crashes or worse.

 - XPT_SASYNC_CB: the callback and callback_arg fields come directly
   from the user CCB payload and get registered as a kernel async
   callback, allowing arbitrary kernel code execution.

 - Target mode CCBs (XPT_EN_LUN, XPT_TARGET_IO, etc.) fall through
   directly to the SIM with user-controlled payloads.

Replace the XPT_FC_XPT_ONLY blocklist with an explicit allowlist of CCB
function codes that are known to be safe for userland to submit: I/O
operations (SCSI, ATA, NVMe, SMP, MMC), device queries, transport
settings, and a handful of safe control operations (NOOP, REL_SIMQ,
RESET_DEV, DEBUG). Normally, the /dev/pass* permissions only allow root
to access them, so this is only a safety issue by default.

Also reject CAM_DATA_PADDR and CAM_DATA_SG_PADDR, since these pass
user-supplied physical addresses directly to DMA with no validation,
which on systems without an IOMMU allows arbitrary host memory access.
Add `options PASS_UNSAFE_PADDR` to allow the old behavior.

Verified that camdd, camcontrol, smartmontools, and cdrtools use only
func_codes on the allowlist (XPT_SCSI_IO, XPT_ATA_IO, XPT_NVME_IO,
XPT_NVME_ADMIN, XPT_PATH_INQ, XPT_GDEV_TYPE, XPT_GET_TRAN_SETTINGS,
XPT_SET_TRAN_SETTINGS, XPT_RESET_DEV, XPT_DEBUG) and none use
CAM_DATA_PADDR.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293888, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293890
Assisted-By:            Claude Opus 4.6 (1M context)
Sponsored by:           Netflix
Reviewed by:            jhb
Differential Revision:  https://reviews.freebsd.org/D56486
e1cff854997884ed9b7251d409d9c9c7a025606d Warner Losh 2026-04-24 18:29:53
cam: Set ccb_h.status on XPT_GDEVLIST early-return paths
XPT_GDEVLIST in xpt_action_default has two early-return paths (list
changed and index not found) that set cgdl->status but not ccb_h.status.
Since xpt_action sets ccb_h.status to CAM_REQ_INPROG before dispatching,
and XPT_GDEVLIST is an non-queued CCB, cam_periph_ccbwait skips the
sleep loop and immediately hits the KASSERT checking that status !=
CAM_REQ_INPROG, causing a panic.

Set ccb_h.status = CAM_REQ_CMP at the top of the code rather than the
bottom. Any future error paths will be right (since this command can't
fail at the command level, just in the status of the data level).

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293899
Assisted-By:            Claude Opus 4.6 (1M context)
Sponsored by:           Netflix
Reviewed by:            jhb
Differential Revision:  https://reviews.freebsd.org/D56487
3454d97aaec12f4a8c676c34182200471eecae24 Warner Losh 2026-04-24 18:31:13
cam: kern.cam.max_high_power tuneable / sysctl
Create a tunable for the maxinum number of 'high power' commands to
schedule, kern.cam.max_high_power.  Default remains at 4.

Differential Revision:  https://reviews.freebsd.org/D56462
cb78764d47db973a1c9d08565143a1b1b7f17513 Scott Long 2026-04-24 18:31:29
net: Fix collision between SIOCGI2CPB and IPSECGREQID
It turns out interface ioctls are defined not just in sockio.h, but are
spread among many files.  When I added SIOCGI2CPB at the bottom of the
file, the next number (160) collided with an ioctl (IPSECGREQID) that
I was unaware of in another file.  Fix this by moving to a number that
is unclaimed.

Fixes: https://cgit.freebsd.org/src/commit/?id=cf1f21572897 (net: Add SIOCGI2CPB ioctl & add page/bank fields to ifi2creq)
Reported by: dhw
Reviewed by: imp
5923b363ca616e7cd4fdec1f4f0bf0c98b272468 Andrew Gallatin 2026-04-24 20:01:44
Commit group #96: kgss
kgss: remove KGSS_VNET_* macros family

The original idea was that something else than VNET(9) might be used for
kgss in jails, but that is very unlikely to happen.

Mechanical change done with sed+grep.  No functional change.

Reviewed by:            rmacklem
Differential Revision:  https://reviews.freebsd.org/D56560
50c5715159f172103f68fa90e5423a45aea2a626 Gleb Smirnoff 2026-04-25 02:55:45

kgss: remove unnecessary CURVNET_SET() and kgss_gssd_handle checks

These RPC methods correctly acquire the kgss_gssd_handle later with call
to kgss_gssd_client().

Reviewed by:            rmacklem
Differential Revision:  https://reviews.freebsd.org/D56561
2bd2f267f344c51c66fc18d963df8cec78db34c1 Gleb Smirnoff 2026-04-25 02:55:50

kgss: de-virtualize kgss_gssd_handle

The RPC client is more of a class rather than an instance.  RPCs from
different VNETs are served by the same client.  This makes the kgss layer
fully transparent to VIMAGE and not even required to be aware of it.

It is responsibility of the rpcsec_gss module to have curvnet set on the
calling thread when doing RPC calls via kgssapi.

This change should enable proper operation of an NFS server with gssd(8)
in a VIMAGE jail.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294501
Reviewed by:            rmacklem
Differential Revision:  https://reviews.freebsd.org/D56562
4602d45eb3b1d33e0ea0d97c4d18033af95d7fca Gleb Smirnoff 2026-04-25 02:55:55
Bump __FreeBSD_version for llvm 21.1.8 merge
8f95b8b19088bd8d73f6d14dab7afe848dfc0c35 Dimitry Andric 2026-04-25 12:34:45
nullfs: Clear inotify flags during reclaim
The inotify flags are copied from the lower vnode into the nullfs vnode
so that the INOTIFY() macro will invoke VOP_INOTIFY on the nullfs vnode;
this is then bypassed to the lower vnode.  However, when a nullfs vnode
is reclaimed we should clear these flags, as the vnode is now doomed and
no longer forwards VOPs to the lower vnode.

Add regression tests.  Remove a test in vn_inotify_revoke() which is no
longer needed after this change.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292495
Reviewed by:    kib
Reported by:    Jed Laundry <jlaundry@jlaundry.com>
Fixes:          https://cgit.freebsd.org/src/commit/?id=f1f230439fa4 ("vfs: Initial revision of inotify")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56639
a02d794f5acd12ba3cf1de5c204a8dd56af47edd Mark Johnston 2026-04-26 01:35:37
conf/std.nodebug: disable DEBUG_LOCKS
MFC after:    1 week
Sponsored by:   The FreeBSD Foundation
85a04bea5a54d6879c8fbf49eea20aba7ca24692 Konstantin Belousov 2026-04-26 02:16:55
compat/linprocfs: Add some entries to /proc/sys/fs and /proc/sys/kernel
Add following sys/fs entries to linprocfs(4):
* proc/sys/fs/file-max
* proc/sys/fs/file-nr
* proc/sys/fs/nr_open
* proc/sys/fs/overflowuid
* proc/sys/fs/overflowgid
* proc/sys/fs/suid_dumpable
* proc/sys/fs/protected_hardlinks
Also, add /proc/sys/kernel/threads-max

Signed-off-by:  Ricardo Branco <rbranco@suse.de>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294713
Reviewed by:    markj, pouria
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2159
4f9f09d95103e1db6b7c75fce7cf3e8c448321e9 Ricardo Branco 2026-04-22 20:19:29
kern/init_main.c: path is for the binary, not process
Reviewed by:  imp, jilles
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56536
a268af3447ebaa9712174ba2d226ffdc66f68e98 Konstantin Belousov 2026-04-26 10:15:18
linux: Ignore sigaction(2) flags SA_UNSUPPORTED and SA_EXPOSE_TAGBITS
SA_UNSUPPORTED was introduced in Linux 5.11 to probe support
for other flags such as SA_EXPOSE_TAGBITS, introduced
at the same time. Ignore both.

Signed-off-by:  Ricardo Branco <rbranco@suse.de>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289285
Reviewed by:    pouria, kib
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2163
fdea83a5f63b881ade91c6cc9dfbf173137512c5 Ricardo Branco 2026-04-26 09:44:53
execve: Fix an operator precedence bug
The buggy version allowed userspace to overflow the copy into adjacent
execve KVA regions, which enables, among other things, injecting
environment variables into privileged processes.

Approved by:    so
Security:       FreeBSD-SA-26:13.exec
Security:       CVE-2026-7270
Reported by:    Ryan Austin of Calif.io
Reviewed by:    brooks, kib
Fixes:          https://cgit.freebsd.org/src/commit/?id=f373437a01a3 ("Add helper functions to copy strings into struct image_args.")
Differential Revision:  https://reviews.freebsd.org/D56665
8e8ddb05d07142e95cf84e32bf93b9ecb3f90283 Mark Johnston 2026-04-22 17:58:35
tcp: release nic ktls send tags when entering time wait
When under heavy load or churn, inline ktls offload NICs may run out
of hardware resources described by ktls send tags.  Rather than
waiting for connections to pass through the time_wait state, reclaim
the ktls send tags early, at entry to time_wait. By preventing
potentially tens or hundreds of thousands of sessions from holding
send tags in time_wait, this allows more ktls sessions to be offloaded
to hardware.

Reviewed by: glebius, kib, nickbanks_netflix.com, rrs, tuexen
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D56610
72e2ae505c4a081d4b4759f51e25bf6e17c99442 Andrew Gallatin 2026-04-29 23:26:05
dtrace: Add missing file for powerpc kernel build
787b5e136735e979398bca2057310d0fd594a3bc Justin Hibbits 2026-04-28 00:14:12
Commit group #97: preload: add "show preload" DDB command
preload: add "show preload" DDB command

This is the DDB equivalent of the debug.dump_modinfo sysctl which
outputs pretty-printed bootloader metadata.

Move sbuf_db_printf_drain to subr_prf.c and expose it for general use.

Reviewed By: jmg
Differential Revision: https://reviews.freebsd.org/D53763
b683fd0b3206b35214f7f87805246e5c74552942 Stephen J. Kiernan 2026-04-30 05:19:09

ddb.4: add 'show preload' entry

For the recently added command.

Fixes:  https://cgit.freebsd.org/src/commit/?id=b683fd0b3206 ("preload: add "show preload" DDB command")
16dd592982887fb3bc27460c50215cd54157ac5f Mitchell Horne 2026-04-30 13:22:21
linuxkpi: Define `VFM_*()` macros in <asm/cpu_device_id.h>
They use another set of constants and macros in <asm/intel-family.h>.

All these macros are defined regardless of the architecture, even though
they are specific to x86. Perhaps we should restrict them using #ifdefs.

The amdgpu DRM driver started to used `VFM_MODEL()` and the
`INTEL_*LAKE*` constants in Linux 6.12.x.

Reviewed by:    bz, olce
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56585
65dc0e9071a5ea206d6fbf070c974ebcfdea3680 Jean-Sébastien Pédron 2026-04-22 16:23:16
sx: Add `sx_has_waiters()` macro
This macro will return non-zero if there are threads waiting for this
lock; otherwise, it will return zero.

The function assumes (but does not assert) that the caller already holds
the lock and that it is interested in other threads waiting for it to
release the lock.

The motivation to add this is the implementation of
`rwsem_is_contended()` in linuxkpi.

This Linux function indicates the same thing to the caller: if other
threads are waiting for this semaphore.

The amdgpu DRM driver started to use `rwsem_is_contended()` in Linux
6.12.

Reviewed by:    bz, olce
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56443
eebb643bb3799ae90dd248f0b5047ec481b26f68 Jean-Sébastien Pédron 2026-04-12 17:20:25
Bump __FreeBSD_version to 1600018 after linuxkpi changes for DRM 6.12.84
As of this commit, all changes to linuxkpi required by the DRM drivers
from Linux 6.12.84 were committed.

Sponsored by:   The FreeBSD Foundation
1569e2334ab5b2ee1e2b7893cb05c17a27d3eca8 Jean-Sébastien Pédron 2026-04-30 17:54:30
uipc_shm.c: make large page allocation interruptible
in cases there is no page pressure or when the user lost patience
waiting for very large allocation.  Other case is already handled by
vm_wait_intr().

Reported by:    "Lizzie from Eden Emulator project"
Reviewed by:    adrian, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56725
839d3266d8c6f6471cb92a3c0ae32eb16d117427 Konstantin Belousov 2026-04-28 02:34:49
linux: Implement setfsuid(2) and setfsgid(2) as no-ops
These system calls exist to decouple the Linux filesystem credentials
from the effective credentials, avoiding signal exposure during
privilege transitions.
The signal permission model that motivated this was revised
in Linux 2.0, making these syscalls obsolete for new applications.

Implement both syscalls as no-ops that return the current effective
UID/GID as the previous filesystem UID/GID.
Linux returns the previous filesystem UID/GID for these syscalls
with no error indication.

Same for the equivalent setfsuid16() & setfsgid16() system calls.

Signed-off-by:  Ricardo Branco <rbranco@suse.de>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294879
Reviewed by:    kib, pouria
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2175
f4ae41b7ea5efb8381a5df234b3f5e1f7569f9b0 Ricardo Branco 2026-04-29 18:27:22
namei: Preserve ABI root for absolute symlinks before fallback
D40479 changed namei() so that an absolute symlink target
encountered during an ABI-root lookup restarts from the native root.
This helps the native fallback case, but it also makes successful
lookups inside an ABI root escape that root while following absolute
symlinks.

Only switch absolute symlink lookup to the native root after namei()
is already in the restarted/native fallback pass.
Do not mark the lookup as restarted merely because an absolute
symlink was encountered while still resolving inside the ABI root.

This preserves the intended native fallback behavior while keeping
absolute symlinks within a successfully resolved ABI-root path in
the ABI namespace.

Signed-off-by:  Ricardo Branco <rbranco@suse.de>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289739
Reviewed by:    kib
Fixes:          https://cgit.freebsd.org/src/commit/?id=cea7c564c70a ("namei: Reset the lookup to ...")
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2166
459ac3044b516af698d7342431bdbcf784fdf7a4 Ricardo Branco 2026-04-26 16:44:39
ctl_ioctl_frontend: Reject out-of-range initiator IDs
Various places in CTL assume that initiator IDs are not larger than
CTL_MAX_INIT_PER_PORT.  Other IDs such as lun IDs are validated in
places such as ctl_scsiio_precheck, but initiator IDs submitted by
userland were not previously validated.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291059
Reported by:    Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Reviewed by:    asomers
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56628
6f8312bdff236ad64d1c15c239051359d8245a68 John Baldwin 2026-05-02 16:43:29
nfscl: Fix handling of gssd upcalls for the NFS client
Without this patch, all upcalls to the gssd daemon are
done in vnet0 (outside of any vnet jail).  This does
not work well, because a user principal's credential
cache can be within the jail (/tmp/krb5cc_NNN in the
jail's namespace).

This patch modifies the client so that RPCs done
from within vnet jails does an upcall to a gssd
daemon running within the vnet jail.  It required
that the cache of uid->credential shorthands in
the rpcsec_gss be vnet'd.

The situation is still less than ideal and sec=krb5[ip]
mounts that are visible within vnet jails is still
not something I would recommend, but it can work ok
with this patch.

Vnet'ng the NFS client so that mounts can be done
within vnet jails is probably more useful, but that
will require additional work.

Discussed with: glebius
MFC after:      1 month
a6e527f893df2cbbd941839a93e50ae39ac0db55 Rick Macklem 2026-05-02 19:36:00
Add O_SYMLINK emulation
for MacOSX partial compatibility, defined as O_PATH | O_NOFOLLOW.
fstat(2) and freadlink(3) works on the resulting file descriptors,
but reads on the regular file do not.

More complete but more hackish version was developed but deemed too
hackish.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56365
2213820b6f4cd22bbfdc0f45741c3e7d17ae82c0 Konstantin Belousov 2026-04-20 20:02:13
bufspace_wait(): only try to help bufdaemon if there is a chance to help
Only call buf_flush() if there are some dirty buffers belonging to the
vnode we are allocating the buffer for.  Otherwise the bd dirty queue
scan cannot find anything and it makes no sense to spend CPU doing it.
067cfac2e7bd9dc857fb6cc504c01b0249bcd1b7 Konstantin Belousov 2026-04-22 05:09:34
sys/rangelock.h: explicitly enumerate padding at the end of the structure
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Differential revision:
a770638ecf16515d8922111c3fdd417aba6c045e Konstantin Belousov 2026-04-26 02:22:52
struct vnode: assign v_rl.resv1 as v_vrflag
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Differential revision:
d990e8f0e9478194569ba28c366b0c0c0f414e7b Konstantin Belousov 2026-04-26 02:31:50
vfs: convert vfs_op_thread_* macros to static inlines
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56611
a61a696e78a967b149a6e39b1f98ada26217a6bb Konstantin Belousov 2026-04-24 01:26:11
vnode: add VIRF_KNOTE flag
to indicate non-empty vnode knote list.  Use it instead of
VN_KNLIST_EMPTY() and guard note activations with it.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56611
7fe74a02764e5899b10cdc45ab34182b961d5d19 Konstantin Belousov 2026-04-24 01:31:27
vfs: convert VFS_OPs from macros to static inlines
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56611
48bf024f2ef5afeba3500bd92a04283370479edf Konstantin Belousov 2026-04-24 01:31:27
krpc: Get rid of KRPC_VNET macros
When the krpc was vnet'd, the VNET macros were hidden
behind macros that had the KRPC_ prefix on them.
This was done because, at the time, it was thought
that something other than vnet might be used for this.
That has not happened and probably will not happen,
so this patch replaces these obscuring macros with
the regular vnet ones.

There should be no semantics change caused by
this commit.

Discussed with: bz, glebius
MFC after:      1 month
d8d9e1cf5e055433565a7e686bc096a8494d2bb8 Rick Macklem 2026-05-03 21:25:06
unix: Make sure we signal EOF on the write side when disconnecting
Add a regression test.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294014
Reported by:    diizzy
Reviewed by:    glebius
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=d15792780760 ("unix: new implementation of unix/stream & unix/seqpacket")
Differential Revision:  https://reviews.freebsd.org/D56764
476805133f5736c2c8638e41d2b5d8dd2c597f3a Mark Johnston 2026-05-03 15:46:22
execve: Add guard pages around execve KVA buffers
This helps ensure that overflows will trigger a panic instead of
silently corrupting adjacent buffers, as happened in SA-26:13.exec.

Extend kmap_alloc_wait() to support allocation of guard pages on both
sides of a KVA allocation.  Modify the exec_map setup accordingly.  Add
the "vm.exec_map_guard_pages" tunable to provide control over the guard
page allocations.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56711
eca4dd133883c9e9aaeca68e0119a638ba0aaca7 Mark Johnston 2026-05-04 15:38:54
linuxkpi: Implement `module_*()` APIs as static functions
This fixes an "unused variable" warning when building DRM drivers.

Reviewed by:    emaste
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56780
658bb99db9c7872f92ccb86ed2674c72636436d2 Jean-Sébastien Pédron 2026-05-04 07:45:38
nfs_pub: move from vfs_subr.c to vfs_export.c
nfs_pub is used only in vfs_export.c.

Reviewed by:    kib, rmacklem
Differential Revision:  https://reviews.freebsd.org/D56777
6f84579ae4d107635e32fc3fcfc34669adc7b3f5 Ryan Libby 2026-05-05 05:55:11
mac_veriexec_priv_check block proc_write_*regs*
Writing to /proc/$pid/regs can also be leveraged to mess with memory.

Only allow a trusted process to do so.

Sponsored by: Hewlett Packard Enterprise Development LP.

Reviewed by:    olce
Differential Revision:  https://reviews.freebsd.org/D56763
adad6862228d1799e7e12c724b2534b4184f7d45 Simon J. Gerraty 2026-05-05 17:29:54
Commit group #98: eventhandler: Fix a race when pruning eventhandlers
eventhandler: Fix a race when pruning eventhandlers

By default, eventhandler_deregister() blocks until it reaches some point
where no threads are invoking the event.  At this point, it knows that
1) no threads are currently executing the handler,
2) some thread has freed the eventhandler structure by virtue of having
   called eventhandler_prune_list(),
so it is safe to return.

Suppose a thread is trying to deregister an event handler.  A different
thread prunes it, and wakes up the first thread.  Before the first
thread runs, a third thread grabs the event handler lock, and starts
executing handlers.  The first thread observes el_runcount > 0, and goes
back to sleep.  The third thread sees no event handlers to prune, and
doesn't wake up the first thread, which sleeps forever.

This change fixes the race and tries to make eventhandler_invoke() more
efficient: keep a count of the number of dead list entries and only
prune the list if there is at least one dead entry.  Also, in
eventhandler_deregister(), we only need to sleep if some dead entries
are present, rather than sleeping whenever some thread is running
handlers.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56767
735b16d490aee158beb54c415b716475a0d19cda Mark Johnston 2026-05-06 11:48:05

eventhandler: Fix the NODEBUG build

Reported by:    Michael Butler <imb@protected-networks.net>
Fixes:          https://cgit.freebsd.org/src/commit/?id=735b16d490ae ("eventhandler: Fix a race when pruning eventhandlers")
3d8928114c4fec6cefbb1cd566ef8d1b3d2999e2 Mark Johnston 2026-05-06 14:39:52
sys/cdefs.h: Introduce __maybe_unused attribute
The __maybe_unused attribute should be used for variables which may or
may not be used, such as when their only use is in an assertion. This
attribute is functionally identical to __unused, suppressing compiler
warnings for particular variable if it remains unused.

Reviewed by:    Minsoo Choo <minsoo@minsoo.io>, imp
Differential Revision:  https://reviews.freebsd.org/D56517
84a95741805d84f0074a34d61b93ccf86f422cf3 Hans Rosenfeld 2026-04-16 18:22:44
kobj: Assert class passed to kobj_init_static is compiled
Inspired by discussion in
https://github.com/freebsd/freebsd-src/pull/2016

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D56624
5a6e5954d14b589bcba0125d10a6c7b62b588f4b John Baldwin 2026-05-06 20:53:46
kobj: Use M_WAITOK in kobj_init
Blocking allocation is safe in all of the current callers of kobj_init
(most of them do a M_WAITOK malloc of the structure passed as the
first argument to kobj_init just before calling it).  kobj_init
doesn't return an error code but instead panics if the nested malloc
in kobj_class_compile1 fails, so using M_WAITOK here is more robust.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D56625
5df7dae10dc02ade8639b0171e0d3cc8db790e41 John Baldwin 2026-05-06 20:53:46
Remove PROC_CHECK_PRIV macro from sys_process.c
Just put the priv_check calls in the code.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D56864
586838724e4086016ad62f0914248fc58ce26e35 Simon J. Gerraty 2026-05-07 03:49:06
sys: Make priority.h and rtprio.h include all dependencies
This ensures this header can be included without an explicit or implicit
sys/types.h include first. This causes issues building SPEC2017 which
includes sys/rtprio.h and then we get an error due to missing u_char
definition.

Reviewed by:    emaste
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D52041
3daa43b1bb2cf68f32993e342f59eb146afb7c24 Alex Richardson 2026-05-07 04:20:39
p9fs: Move UMA zone initialization to VFS module lifecycle
Previously, the UMA zones required for 9P requests (p9fs_buf_zone,
p9fs_req_zone, etc.) were initialized and destroyed in the
virtio_p9fs transport module. This caused issues when unloading
the core p9fs module.

This change moves p9_init_zones() and p9_destroy_zones() into
p9fs_init() and p9fs_uninit() inside p9fs_vfsops.c so that they
are correctly bound to the VFS filesystem module lifecycle via
vfs_modevent, aligning p9fs with standard FreeBSD VFS semantics.

Found while fixing https://github.com/CTSRD-CHERI/cheribsd/issues/2617.

Reviewed by:    kib
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D56492
1ed2ef42e01771f5d8ca9be61e07dcf0fd47feba Alex Richardson 2026-05-07 04:21:50
bufspace_wait(): only try to help bufdaemon if there is a chance to help
Only call buf_flush() if there are some dirty buffers belonging to the
vnode we are allocating the buffer for.  Otherwise the bd dirty queue
scan cannot find anything and it makes no sense to spend CPU doing it.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
ce4e8c478a261ce6c7af7d81817f86420c5239b9 Konstantin Belousov 2026-04-22 05:09:34
vm_map_growstack(): consistently use local vars instead of curthread/proc
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56863
642dd17ee94377c3d5533d05d0d9a58b88f60387 Konstantin Belousov 2026-05-07 16:00:31
vm_map_growstack(): give a hint to user that stack was blown out
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56863
18c5a26f8a747583b9bca3a6a1ae9db1ed4591a3 Konstantin Belousov 2026-05-06 22:53:59
vm_map_growstack(): use local for p->p_vmspace
Noted by:     alc
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
8eef59db254283eaaee47be94d4ea9f2fef4f2ad Konstantin Belousov 2026-05-07 19:58:18
Fix LOCAL_PEERCRED in 32-bit compat mode
Previously the cr_pid field would be incorrectly copied to userland, due
to a size mismatch between the structure as defined in 32-bit vs 64-bit
builds.  Fix it by converting the structure before copying it to
userland.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294833
Sponsored by:   ConnectWise
MFC after:      1 week
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D56675
1d24638d3e8875e4b99a4b5e39f4241e37221b3d Alan Somers 2026-04-27 23:46:53
types: provide __SIZEOF_{INT{8,16,32,64},TIME,TIME32}_T
Suggested by: kib
Reviewed by:    imp, kib
Discussed with: emaste, jrtc27
Differential Revision:  https://reviews.freebsd.org/D56783
94323513dd5070bf1fc3c191c560bd7e17da8931 Ryan Libby 2026-05-08 19:37:24
sys/time: rework saturation ifdef to avoid direct arch ref
Suggested by: kib
Reviewed by:    imp, kib
Differential Revision:  https://reviews.freebsd.org/D56401
324d53c26b2399d9b44fdd08e9c5af650f4ec3ae Ryan Libby 2026-05-08 19:37:24
vfs_subr: mark uma zone and smr pointers __read_mostly
Reviewed by:  kib
Differential Revision:  https://reviews.freebsd.org/D56892
58e5b4dbd9594f9553cfe9df68a19a294e245ed7 Ryan Libby 2026-05-10 04:25:12
Add O_SYMLINK emulation
for MacOSX partial compatibility, defined as O_PATH | O_NOFOLLOW.
fstat(2) and freadlink(3) works on the resulting file descriptors,
but reads on the regular file do not.

More complete but more hackish version was developed but deemed too
hackish.

Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential revision:  https://reviews.freebsd.org/D56365
428da7d65b1c41c81a8786f66c1ce2f4242ac8bb Konstantin Belousov 2026-04-20 20:02:13
vfs: convert vfs_op_thread_* macros to static inlines
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56611
32cf4514cad66ff69ffc96ede20d8debc9b96790 Konstantin Belousov 2026-04-24 01:26:11
vnode: add VIRF_KNOTE flag
to indicate non-empty vnode knote list.  Use it instead of
VN_KNLIST_EMPTY() and guard note activations with it.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56611
1d5e4020e36e1cc9e906200c9c3c784ef43d977e Konstantin Belousov 2026-04-24 01:31:27
vop_read_pgcache_post(): report inotify IN_ACCESS same as for vop_read_post()
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56611
e9a5eb0e5e44e79d0f8dc71274b0183926abd562 Konstantin Belousov 2026-05-06 20:29:28
vfs: convert VFS_OPs from macros to static inlines
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56611
a57420b214b04de3d066236b555925ffbcb93daa Konstantin Belousov 2026-04-24 01:31:27
sys/vnode.h: remove stale comment
The source sweep is not going to happen.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56611
5e4947f7e08a90ba50f9e8cea9ae5e128717cb5f Konstantin Belousov 2026-04-24 02:06:02
sys/cdefs.h: move __BEGIN_DECLS/__END_DECLS into a helper sys/_decls.h
There are situations where nothing from sys/cdefs.h is needed except for
the declaration braces.  More, the other facilities from sys/cdefs.h
might unnecessarly pollute the namespace.

Reviewed by:    markj, imp
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56889
ea72f6d5a8b9386a09e23fbdc933effb007ca899 Konstantin Belousov 2026-05-08 14:13:35
linux: address executable stack warnings
Mark assembly files as not requiring executable stacks.

This still leaves linux32_vdso.so without a .note.GNU-stack section in
the gcc build for now.

Reviewed by:    imp, kib
Differential Revision:  https://reviews.freebsd.org/D56894
bac7bd5038e09d12dfdbf79a87b25443e02d0ba9 Ryan Libby 2026-05-11 05:39:27
power: Rename sleep types
Make sleep type names clearer and more consistent, and allow space for
something like "os_hibernate" once that gets added to FreeBSD.

Reviewed by:    jaeyoon, olce, markj
Approved by:    jaeyoon, olce, markj
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56920
95b4436e989df29f6368f13832cb13d7cbc52eac Aymeric Wibo 2026-05-11 17:11:36
power: Rename power transition enum
Just so it isn't so long.  Changing now before the API freezes, after
discussion with olce@.

While here, improve the wording in the comments for power transitions
and sleep types a bit.

Reviewed by:    olce
Approved by:    olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56953
6f451c60918f2152ebe89f561f04e5219cecffa6 Aymeric Wibo 2026-05-12 09:46:19
vm: Add flags for unprotected allocations
Unprotected allocations are intended to be accessible outside of the current
VM on systems such as Arm CCA.

Reviewed by:    markj
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56518
cd2512eaab5cd402a0177a8078b9234b215b39bd Sarah Walker 2026-05-12 12:16:00
physmem: Add a way to read all memory
In Arm CCA we need to find all memory to protect it. This needs to find
all memory, ignoring any excluded memory to protect it from the host.

Add physmem_all that reads all physical memory regions.

Co-developed-by: Andrew Turner <andrew@> (writing tests & commit message)
Sponsored by:   Arm Ltd
f9ba99eaa24fb41a69c5480621427fe64333986f Sarah Walker 2026-05-12 11:10:32
arm64: VM/PMAP changes for CCA guest support
When in a realm:

- Mappings with mode VM_MEMATTR_DEVICE and VM_MEMATTR_DEVICE_NP are
  unprotected
- Imported busdma buffers in protected memory are always bounced
- If EARLY_PRINTK is in use, the UART physical address must be in the
  unprotected address space

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56599
56abdbc5f709fc0e18624b3b7586647459922a41 Sarah Walker 2026-05-12 11:29:20
sys: Fix heap disclosure in compat7 kern.proc.filedesc sysctl
Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56976
e68433e1990d5f1bcc1bdd270d65f1e4792a8e1b Ed Maste 2026-05-12 16:25:01
sys/time.h: add bintime2us() helper
Add a microsecond conversion helper to complement the existing
bintime2ns(). The body mirrors bintime2ns().
This will be used by an upcoming eventlog(9) framework as well as
the TCP code in upcoming changes.

Approved by:            gallatin, tuexen
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D56972
d1aee9f1535b02dc3db2a5bd1ac75213068a675a Nick Banks 2026-05-12 19:26:24
vmem: Include param.h in the userspace port as well
It is required at least for NBBY.

MFC after:      1 week
fab4acbb7db8ffc7082d1b60b3c8e446a7cfef90 Mark Johnston 2026-05-12 17:46:24
cpuset: Move userspace declarations out of _cpuset.h
The _*.h headers are for structure definitions and should avoid
dependencies on other headers.  This convention is violated by using
__BEGIN_DECLS/__END_DECLS.

Move the declarations to cpuset.h, I see no reason they can't be there.

Reviewed by:    olce, brooks, kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56856
8b4b995effb7911cc13706dc309d5e03c83b9a94 Mark Johnston 2026-05-12 17:47:25
igmp: Avoid leaving dangling pointers in the state-change queue
When igmp_v3_merge_state_changes() is iterating over state-change
packets, there is a case where it'll free a queued packet but will fail
to remove it from the queue.  Fix that.

Reported by:    Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai
Reviewed by:    pouria, glebius
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56947
beab4a237a45aea809e81802b9e1e9ff30f3d929 Mark Johnston 2026-05-12 17:53:49
power: Power device and ioctl for state transitions
Create new /dev/power node with super simple ioctl for initiating sleep
state transitions.

This is meant as a generic interface to replace the ACPI- and
APM-specific interfaces. This allows for non-ACPI states to be entered,
such as suspend-to-idle when setting kern.power.suspend=suspend_to_idle.

Reviewed by:    markj, olce
Approved by:    markj, olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55508
d649825e83482f796f492f2000b20ce1b5db6f63 Aymeric Wibo 2026-05-10 09:04:32
bq_insert: delay the BUF_UNLOCK if not bd_flush()ing
Reduce bufqueue lock contention by delaying the BUF_UNLOCK to after
dropping the bufqueue lock.  Still do the early BUF_UNLOCK if we
actually have to bd_flush.

Reviewed by:    kib, markj
Sponsored by:   Dell Inc.
Differential Revision:  https://reviews.freebsd.org/D56948
2a56cedac2e43c77e037e2d0c7e5af2ccb083c53 Ryan Libby 2026-05-13 17:43:21
vfs_bio: mark uma zone pointer __read_mostly
Reviewed by:  kib, olce
Sponsored by:   Dell Inc.
Differential Revision:  https://reviews.freebsd.org/D56949
e30e507a7737eb7cc2d2592a26171a2d5cf6c4f5 Ryan Libby 2026-05-13 17:43:21
vnlru: avoid cache line contention
Reviewed by:  kib, olce
Sponsored by:   Dell Inc.
Differential Revision:  https://reviews.freebsd.org/D56951
33355275247c462e1204bd1db5905a7d132eb502 Ryan Libby 2026-05-13 17:43:21
ptrace: clear TDP_USERWR after transparent attach only on attach
The flag indicates that the modifying ptrace op was issued, and clearing
it after transparent attach is needed to not leak the flag to later
operations, since it is cleared on the syscall enter.

But clearing it there unconditionally is too strong.  The clearing
should be only done for attach situation.

Reported by:    Alex S <iwtcex@gmail.com>
Fixes:  https://cgit.freebsd.org/src/commit/?id=99976934274de6fa19f049a0b6eac10856710f96
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56928
cb31a266167c8bde3488fbdd6bf24c38b6f59977 Konstantin Belousov 2026-05-11 01:12:30
linux/io: handle memtype_wc mapping for !DMAP range
The amdgpu driver in drm-kmod will attempt to update/reserve certain GPU
VRAM ranges as write-combining. Depending on the system, this address
range may fall outside of FreeBSD's constructed DMAP. We cannot use
pmap_change_attr() in this case.

When INVARIANTS is enabled, this results in the following:

  panic: physical address 0x880000000 not covered by the DMAP

Add a guard against triggering the KASSERT in PHYS_TO_DMAP().

This limitation in our implementation of arch_io_reserve_memtype_wc() is
already known in drm-kmod's amdgpu_bo_init(), and errors are ignored
there (see "BSDFIXME"). This change is only to eliminate the preventable
assertion failure within this scheme.

Tested by:      kevans
Reviewed by:    kib, emaste
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56971
988c03980452a56fb0fbb15e18b0a644602d0ab3 Mitchell Horne 2026-05-14 14:20:22
Commit group #99: subr_uio.c: Remove a KASSERT() for large NFS server I/O
subr_uio.c: Remove a KASSERT() for large NFS server I/O

When the NFS server is set to allow an I/O size greater
than 1Mbyte (not allowed in FreeBSD's main yet), a
KASSERT() in allocuio() can fail when:
zfs_freebsd_write()->zfs_write()->zfs_uiocopy()
->cloneuio()->allocuio()
is called for a large NFS server write.

Since the userland API callers to allocuio() already
check that the size does not exceed UIO_MAXIOV,
there does not seem to be a need to a KASSERT()
here.

Removing the KASSERT() allows NFS server writes
of greater than 1Mbyte to work, once the NFS code
is patched to allow them.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57005
13d3bd165e225eec9af91b6e3361c2482931f95b Rick Macklem 2026-05-14 22:17:55

nfsd: Allow vfs.nfsd.srvmaxio to be up to 4Mbytes

Without this patch, the maximum setting for
vfs.nfsd.srvmaxio was 1Mbyte.  This patch increases
that to 4Mbytes.

The same as for any setting above 128Kbytes, settings up to
4Mbytes require that kern.ipc.maxsockbuf be increased.
(A message generated after setting vfs.nfsd.srvmaxio via
the /etc/rc.conf variable nfs_server_maxio will indicate
the minimum setting, which will be somewhat greater than
four times the setting of vfs.nfsd.srvmaxio.)

Requested by:   Cedric Blancher <cedric.blancher@gmail.com>
MFC after:      2 weeks
Fixes:  https://cgit.freebsd.org/src/commit/?id=13d3bd165e22 ("subr_uio.c: Remove a KASSERT() for large NFS server I/O")
b92b9da3300655c86dcd42ea8a5ba45badd90847 Rick Macklem 2026-05-14 22:33:23
linux: Fix some problems with header pollution
- Avoid including sys/proc.h in linux_vdso_gtod.c.  It's not needed, but
  the implicit inclusion of sys/param.h via sys/ucred.h->bsm/audit.h was
  bringing in some required definitions.
- Include a couple of required headers: sys/time.h (for struct bintime),
  and limits.h (for INT_MAX).
- Move some helpers from linux.h, which depend on sys/param.h for NODEV,
  to the one CU where they're actually used.

No functional change intended.

Reviewed by:    imp, kib, emaste
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56982
b99954433d42d978b257e846dbfe568e9af7b140 Mark Johnston 2026-05-15 00:39:25
jail: replace PR_ALLOW_ALL_STATIC hex constant with symbolic OR
No functional change intended.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57014
394f8ff461e69e30c36570618bb24fd474856f6a Mariusz Zaborski 2026-05-15 12:31:31
net80211: define a type for rssi values
Due to net80211 keeping values in 0.5dBm relative to the noise floor
an int8_t is not good enough to prevent a double wrap around, which
means the reported rssi values can be wrong (see D50928 or likely
a commit in the future for more information).

In order to address the problem and not break the userspace API,
start by defining a type within the kernel and use that.  In a
next step we will then update the int8_t to int16_t to avoid the
problem up to the ioctl code.  This will then allow us to work
on the the user space API indepedently (see PR 293016 for possible
impact outside the base system).

No functional changes intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    adrian
Differential Revision: https://reviews.freebsd.org/D57021
96eaa6857ffe009c141c5a6dbea88f96efed9b2d Bjoern A. Zeeb 2025-06-19 00:05:27
kernel: address executable stack warnings in amd64 gcc build
Mark assembly files as not requiring executable stacks.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D56946
755c1e039adfd68ecf4d5954e13fe54263c34a03 Ryan Libby 2026-05-16 20:24:45
sys/mount.h: restore KNF_NOKQLOCK in VFS_KNOTE_{,UN}LOCKED() call to KNOTE()
ZFS needs to take internal sleepable lock in its implementation of
VOP_GETATTR().  Due to this, kq must be unlocked around calls to the vfs
filter methods.

Fixes:  https://cgit.freebsd.org/src/commit/?id=1d5e4020e36e ("vnode: add VIRF_KNOTE flag")
Reported and tested by: des
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
43a8585cb2bb0e284df672174a57780e53107d27 Konstantin Belousov 2026-05-16 19:11:43
linuxulator: fix SO_PEERCRED emulation after 1d24638d3e8
For Linux binaries, sopt->sopt_td may be null.  And there's also no
need to check it, since struct l_ucred has the same layout on 32-bit
systems as on 64-bit ones.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295333
Reported by:    Miguel Gomes <miguel.dias.gomes@protonmail.com>
Fixes:          https://cgit.freebsd.org/src/commit/?id=1d24638d3e8 ("Fix LOCAL_PEERCRED in 32-bit compat mode")
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D57032
4cee16d471d47f4673e4d2c66f7a96d4e6d86ee9 Alan Somers 2026-05-16 18:03:49
elf_common.h: Add SHT_LLVM_ADDRSIG
Reported by:  bz
Sponsored by:   The FreeBSD Foundation
22c054c4cce719662d503685138433eb27d40001 Ed Maste 2026-05-18 15:15:59
LinuxKPI: Check the devclass of the parent device in dev_is_pci
Reviewed by:  bz
Fixes:          https://cgit.freebsd.org/src/commit/?id=c41d83548b6c ("LinuxKPI: pci.h add more defines and functions")
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D57066
6a043d0814a29e756f5d26e7b59a360e1d6dfa45 John Baldwin 2026-05-18 18:44:00
Commit group #100: sys: Use is_pci_device instead of direct comparisons to devclasses
sys: Use is_pci_device instead of direct comparisons to devclasses

Reviewed by:    bz
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56997
6dc813301a173e2e1993c3064df162e6218c1231 John Baldwin 2026-05-18 18:52:23

vnic: Add missing #include

Reported by:    bz, olivier
Fixes:          https://cgit.freebsd.org/src/commit/?id=6dc813301a17 ("sys: Use is_pci_device instead of direct comparisons to devclasses")
Sponsored by:   Chelsio Communications
8c9dc47b5fcaf58a89b1511118b78a65737b20cc John Baldwin 2026-05-19 17:18:00

arm64/iommu: Add a missing close parenthesis

Fixes:          https://cgit.freebsd.org/src/commit/?id=6dc813301a17 ("sys: Use is_pci_device instead of direct comparisons to devclasses")
Sponsored by:   Chelsio Communications
8de34a84224b9a353bc0a9d6d3f95540b0e72707 John Baldwin 2026-05-19 17:30:01
linuxkpi: work with numpages > 1 in the set_pages_*() KPIs
These calls are used for buddy pages at least in drm's ttm_pool, which
leads to a panic when we invoke lowmem handlers and drm tries to shrink
the pool.

Cope with numpages > 1 by traversing the contiguous pages and executing
the adjustment there, as well, as suggested by markj@.  Previous
versions have tried to use the corresponding `set_memory_*()` functions,
but it is believed that not updating `md.pat_mode` breaks subsequent
userspace mappings in ways that may result in things like screen tearing
or other artifacts when running i915kms.

This stabilized my amdgpu laptop running two VMs, chromium and a
concurrent buildworld.

Reviewed by:    bz, markj
Differential Revision:  https://reviews.freebsd.org/D57004
67f7f2781daa9bd398b424ffe2bd0be67f37f03d Kyle Evans 2026-05-19 03:22:21
linux/linux_common.h: make header self-contained
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
f6f5eb3190165cea4470048809413b1fdbd97e04 Konstantin Belousov 2026-05-19 02:22:58
linuxkpi: fix 32-bit arm build
The new KPI is only used in <asm/set_memory.h>, but it's provided in
linux_page.c.  The latter only includes the former indirectly by way of
<linux/io.h>, and that's only conditionally included outside of 32-bit
ARM there.

All of our archs have the necessary pmap_page_set_memattr(), so just
move the declaration into <linux/page.h> instead of trying to reason
about the usability of <asm/set_memory.h> directly in linux_page.c.

Reported by:    jenkins (via ivy)
8dad29555a5807bf21941807752e1589e20312de Kyle Evans 2026-05-19 13:35:36
vnlru: avoid trigger calculation when force < 2
Reviewed by:  kib (previous version), olce
Sponsored by:   Dell Inc.
Differential Revision:  https://reviews.freebsd.org/D56950
296c174835cf603b966e48b232715942df9b6934 Ryan Libby 2026-05-19 18:07:57
kern_umtx.c: remove dead code
It was a placeholder for the access control for process-shared umtx
memory, which is not needed.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D57122
d9c31658df8492a5666e799c2b267c425cb8f468 Konstantin Belousov 2026-05-20 00:49:09
kinst/arm64: Fix return values from kinst_invop()
After commit 853cd8723494 it became invalid for kinst_invop() to return
0: dtrace_invop_start() would convert this to a sentinel value
indicating that it did not consume the breakpoint, and so we'd just
call kdb_trap() to handle it.

Change kinst_invop() to return NOP_INSTR after handling a matching
breakpoint.  NOP_INSTR is handled by advancing the ELR, so we have to
compensate by subtracting INSTR_SIZE before returning.

Reviewed by:    christos
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=853cd8723494 ("arm64: Clean up usage of the dtrace invop handler")
Differential Revision:  https://reviews.freebsd.org/D56987
d6f0e671d0797b56011880f84d12ce5fb20bf099 Mark Johnston 2026-05-20 14:49:28
kinst/arm64: Handle an additional PC-relative instruction
"ldr <reg>, <literal>" loads a value from a literal memory address into
a register.  It's PC-relative and so cannot be directly implemented
using the trampoline mechanism.  Unfortunately, on arm64 it can't easily
be emulated either since the return-to-EL1 handler does not restore
callee-saved registers, so like adr/adrp, we simply don't handle it.
These instructions are fairly rare in an arm64 kernel.

While here, refactor the code so that all instruction decoding is done
in one place: introduce an enum type which characterizes the instruction
type, add a helper to map instructions to enum values, and store the
corresponding enum value in the probe description.

Reviewed by:    christos
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56988
e6be6dedeea1e6d2e5206e1e7422e2d556a6da0c Mark Johnston 2026-05-20 14:49:41
procdesc: Make sure to drain selinfo sleepers in procdesc_free()
Otherwise they are left on a freed list after procdesc_free() is called.
This can be exploited to elevate privileges.

Remove the PDF_SELECTED micro-optimization.  doselwakeup() is a no-op if
no one ever called selrecord() on the file description, so I see no
reason to complicate the code to avoid the call.

Add some regression tests.

Approved by:    so
Security:       FreeBSD-SA-26:19.file
Security:       CVE-2026-45251
Reported by:    75Acol, Lexpl0it, fcgboy, and robinzeng2015
Reviewed by:    kib, oshogbo
Fixes:          https://cgit.freebsd.org/src/commit/?id=cfb5f7686588 ("Add experimental support for process descriptors")
Differential Revision:  https://reviews.freebsd.org/D56887
4b6a23eb8a7e4b137d9e1b527d1fa84c950484eb Mark Johnston 2026-05-08 13:03:49
jaildesc: Make sure to drain selinfo sleepers in jaildesc_close()
Otherwise they may be left on a freed selinfo list after the
corresponding jaildesc struct is freed.  This can be exploited to
elevate privileges.

Remove the JDF_SELECTED micro-optimization.  doselwakeup() is a no-op if
no one ever called selrecord() on the file description, so I see no
reason to complicate the code to avoid the call.

Add some regression tests.

Approved by:    so
Security:       FreeBSD-SA-26:19.file
Security:       CVE-2026-45251
Fixes:          https://cgit.freebsd.org/src/commit/?id=66d8ffe3046d ("jaildesc: add kevent support")
Reviewed by:    kib, jamie
Differential Revision:  https://reviews.freebsd.org/D56945
f95da272b8b7138008542022af3dc7ead3ff2ce2 Mark Johnston 2026-05-10 15:15:45
ptrace: Fix validation of PT_SC_REMOTE arguments
- Fix an off-by-one in the system call number check.  A value of
  SYS_MAXSYSCALL was permitted.
- Validate the system call number after we've dealt with
  syscall(2)/__syscall(2), since they pass the syscall number as an
  argument.
- When the syscall number is for syscall(2) or __syscall(2), we must
  make sure that nargs > 0 to avoid an underflow when shifting arguments
  down.

Add regression tests.

Approved by:    so
Security:       FreeBSD-SA-26:21.ptrace
Security:       CVE-2026-45253
Fixes:          https://cgit.freebsd.org/src/commit/?id=140ceb5d956b ("ptrace(2): add PT_SC_REMOTE remote syscall request")
Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by:    kib, emaste
Differential Revision:  https://reviews.freebsd.org/D56978
dea055a0e86fc279a51439b695461b3eda94ad0b Mark Johnston 2026-05-12 17:32:17
vn_lock_pair(): handle the case of vp1->v_vnlock == vp2->v_vnlock
It is not enough to check vp1 == vp2 to detect lock recursion, since
vnodes might share the locks.  This might happen for e.g. stacked
filesystems (nullfs and other), and for FFS snapshots.

Switch from checking vnode equiality to check v_vnlock equiality, and
recheck the condition after vnode relock since reclamation or otner
parallel operation might change the vnode locks under us.

Return a value (not really an error) indicating the case that vnodes
share the lock, to simplify the unlock in caller.

Reviewed by:    jah, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57035
ace4a3e177c0da5efd9ceee0d9f46068562e3f5e Konstantin Belousov 2026-05-16 23:19:50
vfs_domount(): handle the case when vn_lock_pair() only locked once
Reviewed by:  jah, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57035
f5433e784078ee139a37eb43ffa1d9e0e1f4f217 Konstantin Belousov 2026-05-17 21:27:52
vop_read_pgcache_post(): the vnode is unlocked
Reported by:  markj
Fixes:  https://cgit.freebsd.org/src/commit/?id=e9a5eb0e5e44 ("vop_read_pgcache_post(): report inotify IN_ACCESS same as for vop_read_post()")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
0c85df0065146516d5bacfc80d52d9ee6b33b96d Konstantin Belousov 2026-05-22 03:07:59
power: Fix stype name lengths
When updating the names of the sleep types in 95b4436e989d ("power:
Rename sleep types"), I forgot to update the lengths of the buffers they
went into.

Reported by:    mhorne
Fixes:  https://cgit.freebsd.org/src/commit/?id=95b4436e989d ("power: Rename sleep types")
Sponsored by:   The FreeBSD Foundation
f814650aaf788323b3d485d96996fce6cd7b2d7f Aymeric Wibo 2026-05-22 09:58:57
Commit group #101: kernel: Enable -fstack-protector-strong by default
kernel: Enable -fstack-protector-strong by default

This extends stack canary use to all functions which define arrays on
the stack, not just those which operate on byte buffers.  This option
would have made it harder to exploit SA-26:18.setcred and
SA-26:08.rpcsec_gss.

The change bloats the amd64 kernel text by about 350KB and increases the
number of covered functions from ~1500 to ~9000 (within the kernel
itself, i.e., not counting kernel modules).

Reviewed by:    olce, olivier, emaste
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56870
8deebce931fa9b469cf28a082038a64caf972602 Mark Johnston 2026-05-22 14:45:52

vmm/arm64: Compile vmm_nvhe.c without SSP

This file implements a set of EL2 hypercall handlers and is used to
switch between guests and the host kernel when VHE is not in use.  There
is no SSP runtime available there.

Reported by:    Jenkins
Fixes:          https://cgit.freebsd.org/src/commit/?id=8deebce931fa ("kernel: Enable -fstack-protector-strong by default")
bed77cf7c213c3f93a0dc099e4b46c078495a328 Mark Johnston 2026-05-22 16:10:04
sendfile: Fix bug when using headers with SW KTLS offload
When using SW KTLS, we must account for the headers in sf_iodone()
in terms of either freeing or enqueuing them for TLS work.
Not doing so can lead to a situation where we enqueue only
the payload, and not the header, for encryption. Rather than
leaking the header, the socket is left "hung" with the header marked
M_NOTREADY.

Sponsored by: Netflix
Reviewed by: glebius, kib
Differential Revision: https://reviews.freebsd.org/D57134
MFC After: 14 days
fd9af1e7084c550358d9598407f9ee7583e6a53f Andrew Gallatin 2026-05-22 17:57:54
LinuxKPI: 802.11: reset chanctx when recycling
When we no longer need a channel context and put it back on the
reserved list, zero it for all but the vif so that we get the same
state as if it was freshly allocated.

Sponsored by:   The FreeBSD Foundation
Fixes:          https://cgit.freebsd.org/src/commit/?id=e62c92c0a5cf, https://cgit.freebsd.org/src/commit/?id=88cb1e17f471
MFC after:      3 days
8ead19207e56790bd4c64dba4ddbf2e0eb6922f7 Bjoern A. Zeeb 2026-05-23 21:06:32
LinuxKPI: 802.11: add support for suspend/resume
Add support for automatic suspend/resume as we know it for wireless.
The problem is that the PCI driver which would normally gets the code
is the LinuxKPI PCI framework/Linux wireless driver, which we cannot
ammend or generally add extra suspend/resume code to.
A further problem is that with growing support, the LinuxKPI 802.11
(mac80211) layer also is involved in suspend/resume for WoWLAN (not
yet supported) meaning that we need to hook the suspend/resume
framework into that as well.  Unlike Linux we do not have a general
suspend/resume "hook" we can hang into and we need to tie this one
to the hardware so cannot indepedently (after the driver one) run it.

The solution for FreeBSD, in order to not mangle the Linux native
drivers and get extra maintanace overhead, is to add a bus child
which inherits the general framework and thus is 2 lines + #includes
for each driver extra to add to.

The general suspend/resume framework lives in LinuxKPI (linuxkpi_80211_pm)
and imitates the normal suspend/resume path overloading it (there is
a slight code/logic duplication from the PCI code).
Given we are passed the LinuxKPI p(ci)dev, we can go and peel out the
net80211 ic from the native bsddev and that way get access to the
wireless stack.  We then call into LinuxKPI 802.11 in order to do
the suspend/resume dance there, and, if needed also call the
official suspend/resume routine from the device driver after
(reverse for resume).
If any in this fails, suspend will be blocked as we will return the
error (no different to any native driver could do).

The LinuxKPI 802.11 suspend/resume code has the initial code for
doing a WoWLAN suspend (one could change the sysctl) but other bits
like access to ifnet flags etc. has to be sorted out before we can
go and support that.
The default code path calles into net80211 to clear everything
like native wireless drivers do.  The one thing we need to do in
addition is to remove the vif devices from the firmware and restore
them prior to net80211 resume.
We also check for a possible HW SCAN to still be runinng on resume
and warn as that may cause problems though the scan should be stopped
before suspend (we may still get a callback).  You can easily see
these problems if you suspend/resume without stopping the wlan.

Enable the PM framework for iwlwifi in the module Makefile to
be able to use all this; others can follow as tested.

In case anyone has problems with this, they can change the sysctl
back to 0 until we can figure out any further problems.
The linuxkpi_wlan.4 man page got adjusted to document this.

Sponsored by:   The FreeBSD Foundation
Tested on:      Dell XPS 13 (AX200), Lenovo TP X270 (AX210)
MFC after:      3 days
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263632
11d69a4558de2a5427d8191caed315c5f7e9a5d6 Bjoern A. Zeeb 2025-04-09 18:00:20
net80211: create ieee80211_ht_check_bar_exceed_retry_count()
Create a function to check if the BAR retry limit has been reached.
Use this in if_ath_tx instead of a hard-coded value.

I've been meaning to do this for a long time.

Differential Revision: https://reviews.freebsd.org/D57055
e3b4dbb80577fcecb74566d2c1a219dac146f541 Adrian Chadd 2026-05-17 18:40:03
sigqueue: In capability mode, only allow signalling self
This is copied from the check in kern_kill.

Reviewed by:    markj, oshogbo
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57244
b9d16b7fd2fa6bc4b3e8364804cbdc1b76ebe8a5 Ed Maste 2026-05-26 13:24:36
p9fs: Refactor buffer allocations to avoid zeroing large payloads
Allocating large buffers with M_ZERO adds unnecessary overhead since
the data is immediately overwritten. This change embeds the tc and rc
p9_buffer structs directly into p9_req_t so we only zero the small
metadata headers. The actual data payload is allocated with M_NOWAIT.

Embedding the metadata headers by value also allows the p9fs_buf_zone
UMA items to be sized exactly to P9FS_MTU, ensuring they are nicely
aligned.

This also adds proper error handling to p9_get_request() to handle
UMA allocation failures.

Reviewed by:    markj
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D56495
675382f12b67e8b7b2f35bd1f8dfd96b8d8e4aae Alex Richardson 2026-05-26 19:37:39
acpi: Update mentions of s2idle in comments
We use the explicit "suspend-to-idle" name now.

Sponsored by:   The FreeBSD Foundation
7a11a6c64d4f52f41e63e535605d4187650c3651 Aymeric Wibo 2026-05-27 08:47:12
sys: Add td_kstack_top inline helper function
This function returns a pointer to the top of the kstack.

Reviewed by:    kib, andrew (arm changes)
Sponsored by:   AFRL, DARPA
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
8b9023cfc1851a18518111d286ebd59b573008c1 John Baldwin 2026-04-27 19:04:22
ctl: Use CAM_PRIORITY_NORMAL for queued CCBs
Previously this was using CAM_PRIORITY_NONE which tripped over the
assertion added in b4b166b8c46b8.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293076
Reported by:    Ken J. Thomson <thomsonk@yandex.com>
Reviewed by:    imp
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D56995
887841731be60a958e471b9fd79261169b67b7ad John Baldwin 2026-05-27 20:58:05
sys: add safe_read(9)
The MD function with MI interface to provide a way to read arbitrary
(canonical) KVA.  amd64 only for now.

Reviewed by:    markj
Tested by:      aokblast
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D49566
7b2702ee25f5230011fa7f8f650b65b37248fcca Konstantin Belousov 2025-03-29 17:17:01
linuxulator: return EBADF for O_PATH mmap()
This fixes LTP open13, which expects O_PATH mmap() to fail
with EBADF, but FreeBSD returned EACCES.

Signed-off-by:  YAO, Xin <mr.yaoxin@outlook.com>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295571
Reviewed by:    kib
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2233
30c85b7cb9fc52492f2b3a3ae4e0b16ed717c58a YAO, Xin 2026-05-07 06:39:16
LinuxKPI: migrate key data access to functions
* Migrate the k->wk_key and k->wk_keylen access to the new crypto methods
  in net80211
* don't use ic_miclen, use the tx/rx mic len methods
* don't use wk_txmic and wk_rxmic, use the tx/rx mic data methods

This is in preparation to support GTK/IGTK keys and > 128 bit keys.

Reviewed by:    bz
Differential Revision:  https://reviews.freebsd.org/D54485
774543072db4949a4177ad4bbdac9fb712bc86f6 Adrian Chadd 2026-05-28 19:49:31
image activators: pass the current thread
Reviewed by:  markj
Tested by:      Alex S <iwtcex@gmail.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57294
9b729333bb2495afb8821044fa42c9ebe0874703 Konstantin Belousov 2026-05-28 09:06:04
imgact_elf: read program headers if not contained in the first page
PR:   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295629
Reviewed by:    markj
Tested by:      Alex S <iwtcex@gmail.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57294
804daf166406a1b0e22f93b9417b90ed7d3aa1ae Konstantin Belousov 2026-05-28 09:06:33
Commit group #102: MAC/do: Executable paths feature (GSoC 2025's final state)
MAC/do: Executable paths feature (GSoC 2025's final state)

By design, mac_do(4) only authorizes credentials change requests if they
are issued by a process spawned from '/usr/bin/mdo'.  The executable
paths feature introduces some flexibility by allowing to change that
path, thus allowing another executable to make requests, and to use
multiple such paths (up to 8 in the current implementation).  Its
purpose is to enable thin jails scenarios where mdo(1) may not be at its
canonical path ('/usr/bin/mdo') and to allow experimenting with other
userland programs leveraging setcred(2).

Configuration of executable paths is per-jail and intentionally works
completely similarly with rules.  It is accessible from within a jail
through the 'security.mac.do.exec_paths' sysctl knob and from outside
a jail through the 'mac.do.exec_paths' jail parameter.

This commit groups the verbatim changes of the following commits that
Kushagra Srivastava, our GSoC 2025 student, created in his GitHub
repository (https://github.com/thesynthax/freebsd-src), branch
'task/exec-paths-refactor':

mac_do(4): Complete refactor of allowed executable paths feature
mac_do(4): Fixed changing security.mac.do.* knobs in inheritance mode
mac_do(4): Debugging rules and exec_paths leak on destroy
mac_do(4): Deep copy rules
mac_do(4): Fixed leak
mac_do(4): fixed various bugs, structs inlined, leaks remain
mac_do(4): MAC/do working in jail, leaks decreased
mac_do(4): MAC/do fixed, works in host and jails, leaks removed
mac_do(4): style

Frozen log for these commits:
https://github.com/OlCe2/freebsd-src/compare/main...14fdc49fb29265fac5d0daf95a13d0dce325c951.
The corresponding pull request is at:
https://github.com/OlCe2/freebsd-src/pull/2.

The GSoC's final state of this code still has a number of problems that
are fixed in subsequent commits.  It is however committed separately to
clearly delineate Kushagra's work.

Reviewed by:    olce (amendments to come, see above)
MFC after:      1 month
Relnotes:       yes
Sponsored by:   Google LLC (GSoC 2025)
Sponsored by:   The FreeBSD Foundation (review, commit)
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
9818224174c41a434028446fb6fa5516a6291755 Kushagra Srivastava 2025-08-14 14:41:57

MAC/do: Make it style(9) compliant again

Fix too long lines, declarations not at head of block, improper
indentation and superfluous whitespace coming from the previous commit
introducing the configurable executable paths feature.

While here, fix some older improper comment formatting.

Reviewed by:    bapt
Fixes:          https://cgit.freebsd.org/src/commit/?id=6c3def74e2de ("MAC/do: Support multiple users and groups as single rule's targets")
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
f93cd891aefd839da869dcdb450d00050d5e701e Olivier Certner 2026-03-23 11:45:17
MAC/do: Update copyright
Add Kushagra to account for the commit adding the "executable paths"
feature.

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
3e17f37c2cd2064c5db3fb63fad57f40e4e334fa Olivier Certner 2026-05-20 11:41:07
Commit group #103: MAC/do
MAC/do: Fix recently-introduced comments

Reviewed by:    bapt
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
7825338824415153fe29bec30c1d5c1e5fcb638b Olivier Certner 2026-03-23 13:13:22

MAC/do: Expand "conf" to "configuration" in a panic message on INVARIANTS

No functional change.

Reviewed by:    bapt
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
22a0912bb1dc71f18d2e33ec9915a54a8324a3ff Olivier Certner 2026-03-23 14:42:07

MAC/do: check_proc(): Remove a superfluous 'if'

No functional change (intended).

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
d554b89f4096589d00abef584552eff0481418db Olivier Certner 2026-04-28 13:44:53

MAC/do: Document and assert when parse error objects must be built

The invariant is that parse_*() functions must create a parse error
object and return it through their 'parse_error' argument if and only if
they return an error code (non-zero).

Add assertions checking this invariant in various places, and in
particular in the new parse_exec_paths(), to be future proof.

Change the contract of parse_and_set_conf() so that the caller is
required to pass a NULL '*parse_error'.

Remove useless resetting of '*parse_error' to NULL.

While here, remove a test that is always true thanks to this invariant
and that was recently introduced with the "executable paths" feature.

No functional change intended.

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
0aef1c059fae86a7f62b444dc3352eb0d5bdaa31 Olivier Certner 2026-05-19 19:38:41

MAC/do: Executable paths: Accept an empty string

This effectively allows to disable mac_do(4) by setting the executable
paths to an empty string, realizing a symmetry with rules to be
leveraged in subsequent commits.

Reviewed by:    bapt
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
3a4433425e63f88e70078a354bd404d7ea6ca3ce Olivier Certner 2026-04-28 13:37:50

MAC/do: Rename size constants/variables to clear confusion with string lengths

These constants represent buffer sizes in bytes, not string lengths.

While here, move MAX in EXEC_PATHS_MAXLEN at start, like the other
constants.  While here, fix the prefix of the old MAC_RULE_STRING_LEN
accordingly.

No functional change.

Reviewed by:    bapt
Fixes:          https://cgit.freebsd.org/src/commit/?id=8aac90f18aef ("mac_do: add a new MAC/do policy and mdo(1) utility")
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
28ebab7c3730105f06f982950e9aee4130469906 Olivier Certner 2026-03-23 16:13:37

MAC/do: find_conf(): Turn an MPASS() into a KASSERT()

Turn the pre-existing comment into an assertion message, with an update
following the introduction of the "executable paths" feature.

Explain in a comment why this situation cannot happen.

Without INVARIANTS, such a situation would cause an immediate panic()
(NULL is dereferenced in the next iteration of the loop), so leave the
check under INVARIANTS only.

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
cf942ac9e967055286a7076bf76e9a62e1d22d8f Olivier Certner 2026-04-27 12:16:46

MAC/do: Move hold_conf() and drop_conf() earlier

This is in preparation for using hold_conf() in find_conf().

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
cd1ac04409359ec1357e23752f20b22f5055ddfa Olivier Certner 2026-04-27 12:55:05

MAC/do: find_conf(): Return configuration with a true reference

In addition to the applicable configuration, find_conf() was returning
a pointer to the actual jail holding the configuration object, with that
jail's mutex locked in order to ensure liveness of the returned
configuration (if we wouldn't, a concurrent thread modifying the jail's
configuration could destroy this configuration object underneath us).

But:
1. Ensuring configuration stability by owning the holding jail's mutex
   requires callers to either keep that mutex locked for a longer period
   of time than just accessing the corresponding 'struct prison' (in
   general, bad for concurrency with other operations involving jails)
   or to perform an additional dance to acquire a real reference in case
   the jail's mutex, for some reason (in general, LORs or acquiring
   a sleepable lock) must be dropped before use.
2. Most code does not actually need to know which jail holds the
   applicable configuration but for unlocking the jail's mutex.  Having
   to deal with the jail holding the configuration can cause confusion
   about which jail (the current one, or the one holding the
   configuration) must be used (and actually did in the very initial
   version of MAC/do, which had a serious flaw as a consequence).

So, do not keep a lock on the holding jail.  Instead, ensure
configuration stability by always acquiring a true reference from the
start and passing it to the caller.  Those callers not doing the dance
mentioned above now need to free it when finished (but this need
replaces the one to unlock the prison).

Additionally, only return the holding jail if explicitly requested by
the caller.  mac_do_jail_get() is currently the only caller that needs
it, in order to be able to reliably report if the configuration is
inherited.

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
4e4cf18b85cc51f41bcae20114f9c0e7b69f76e0 Olivier Certner 2026-04-27 14:39:15

MAC/do: Fix releasing a nonexistent reference on configuration parsing error

On parsing error, parse_and_set_conf(), introduced with the recent
"executable paths" feature, has been calling drop_conf() on the
being-built configuration.  However, that configuration structure is
allocated through alloc_conf(), which does not grab a reference.
Calling drop_conf() on it, which releases a reference, is thus
erroneous, and causes the underlying counter to saturate, translating
into a memory leak.

To fix this bug, make alloc_conf() grab a reference on the newly-created
'struct conf', and rename it to new_conf() to be more in line with what
it does.  Keep set_conf() as is, i.e., grabbing an additional reference
on behalf of the jail that is going to hold the configuration.
Consequently, make sure that callers of alloc_conf() unconditionally
drop the reference acquired by the latter before returning (i.e., even
if set_conf() has been called).

While here, since hold_conf() is always used to obtain additional
references on a configuration (new_conf() does not use it, instead
directly setting the use count), add an assertion that it is never used
on a configuration that has no references at all (which indicates that
the configuration has been destroyed).

These changes generally simplify the lifecycle of configurations,
reducing the probability of re-introducing reference mismatches (at the
expense of slightly more reference counting operations, but performance
does not matter here).

Reviewed by:    bapt
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
a7a9e6cc64aa90a899aad9ea1395bfc77bb26f48 Olivier Certner 2026-04-28 08:42:01

MAC/do: Constify clone_rules() and clone_exec_paths()'s source argument

Defensive programming.

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
68cc6aa2e93a2a2969eb40b5588452eeb1805fa6 Olivier Certner 2026-04-27 16:24:01

MAC/do: Move static assertions on constants close to their definitions

And document more clearly their purpose.

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
4e27cc086b3f9e029160da8830abacb06a2f9e39 Olivier Certner 2026-05-20 09:38:37

MAC/do: Remove superfluous configuration initialization

Configuration objects would be initialized (zeroed, and some
STAILQ_INIT() called) multiple times.  Make sure they are so only once,
and add assertions to check that this is actually the case for functions
that expect it.

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
11b567e94ad2a1b4baf768d77c6f1fb2018cfe83 Olivier Certner 2026-05-20 09:29:51

MAC/do: clone_rules(): Readability improvements, constification

Constify in order to let the compiler check that source and destination
arguments are passed in the proper order in the different calls.

No functional change (intended).

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
ce59a4181593f59028d3a26f2b63dcf2c8041d79 Olivier Certner 2026-05-20 10:33:41

MAC/do: parse_and_set_conf(): Obey empty parameters; Add doc

parse_and_set_conf() is meant to be used in all situations when there is
a need to set or modify some jail's MAC/do configuration.  This entails
passing the information of whether some parameter was explicitly
specified.  For example, an administrator setting/modifying jail
parameters may not specify executable paths but only rules, in which
case the executable paths value is copied from the currently-applicable
configuration.  The sysctl(8) knobs case always leverages this feature,
since setting a knob changes one parameter at a time.

Currently, a NULL or empty string argument is treated as a non-specified
parameter.  This causes a bug where disabling MAC/do in a jail does not
actually work because, to this end, parse_and_set_conf() is passed an
empty string which it then interprets as a request to copy the currently
applicable configuration's value, which may well not be empty.

Fix this problem by only treating NULL as a marker for a non-specified
parameter, in accordance with the original design for this function.

While here, write some documentation to explain the interface.  While
here, remove the original herald comment for parse_and_set_rules(),
which was inadvertently pushed apart from the replacing
parse_and_set_conf().

Reviewed by:    bapt
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
d254322f6fa46010bb94d658ff13c06ad438ee77 Olivier Certner 2026-04-27 16:12:08

MAC/do: parse_and_set_conf(): Require the model configuration

This change is a prerequisite for the next change in caller
mac_do_jail_set(), which for semantic correctness needs to rely on
a stable model configuration.

The two other callers already call find_conf() to retrieve the
applicable configuration, so for these a second call to find_conf() can
be saved.

However, this does not fix (actually, makes slightly worse) an atomicity
problem when multiple threads concurrently change some jail's
configuration (or the configuration inherited by a jail), which has
existed since the introduction of executable paths due to being able to
change only rules or executable paths independently (and the possibility
of not specifying them and having them copied from the currently
applicable configuration).  Before tackling it in later commits, we
first focus on fixing the semantics of configuration changes in the very
next patches.

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
73215eba8b91fab37c1ad380fca04f082f3f92fd Olivier Certner 2026-04-28 09:55:29

MAC/do: Fix obsolete wording in a comment ("ascendant" => "ancestor")

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
dbf8f0895ad86fea10adbd678873f8af0bd7558c Olivier Certner 2026-04-28 09:58:31

MAC/do: Constify is_null_or_empty()

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
37bc08d5fe9933f41574bf477080d729daf19928 Olivier Certner 2026-05-20 11:12:38

MAC/do: Fix the recent logic to set jail parameters, make it more tolerant

The logic introduced in the initial commit for the "executable paths"
feature did not match the specification we discussed in that specifying
an empty value (for rules or executable paths) on "mac.do" being "new"
would be treated as an absence of value and trigger a copy from the
currently applicable configuration, instead of being an override that
deactivates mac_do(4) in the jail.  Fix that by distinguishing both
cases.

More generally, a non-explicitly specified parameter is set to the same
value it has in the currently applicable configuration (that of the
closest ancestor jail that has one; 'prison0' (the host) always has
one), with an exception in the disable case.

On disable (explicit: "mac.do" to "disable", implicit: no parameters
passed, or at least one is empty), now accept parameters with
a non-empty value as long as at least one of them is empty (which alone
is enough to disable mac_do(4)).  If no parameters are passed, both are
copied from the currently applicable configuration; if none of them is
empty, then the rules are emptied to effectively disable mac_do(4) (see
the inline comment as to why this was chosen).

On explicit enable ("mac.do" to "enable"), allow not specifying any of
the rules and executable paths, in which case both are copied from the
currently applicable configuration (consistently with what is done when
only one is missing).  Note that, as mentioned above, not specifying any
of them by default still resolves to disabling mac_do(4) (i.e., on no
explicit "mac.do" parameter).

On (explicit) inheritance, allow specifying non-empty parameters,
provided they match the values we are going to inherit.  This enables
re-applying jail parameters' reported values verbatim to the current
jail (idempotence) or, e.g., to some sibling jail.

(While here, make some existing code easier to read by leveraging
is_null_or_empty().)

Reviewed by:    bapt
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
7929f364ef5135f712e061d291d1c2c0fb48abde Olivier Certner 2026-04-28 12:40:19

MAC/do: Configuration: Fix default values: Remove jail creation method

mac_do_jail_create() would create a default configuration on the
just-created jail, erroneously causing mac_do_jail_set() to then
retrieve it and use it as a model when determining the default values
for not-specified parameters, instead of using the configuration
applicable to the parent jail.

Setting a default configuration in mac_do_jail_create() had been done as
a kind of defensive measure to prevent a created jail not to have
a configuration (effectively making it inherit from an ancestor jail,
which is a security hazard except if explicitly requested).  However,
this measure was never really effective (osd_jail_call(PR_METHOD_CREATE)
in kern_jail_set() calls the PR_PETHOD_CREATE methods in an unspecified
order, and stops at the first error), so we are forced to rely in any
case on the fact that an error in a PR_METHOD_CREATE or PR_METHOD_SET
method leads to stopping the jail creation process (which is the case
today; see kern_jail_set()).

Reviewed by:    bapt
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
51cc5840b66c9565e1740c1198a0e684d81e3734 Olivier Certner 2026-04-28 13:10:14

MAC/do: Fix reporting of "mac.do" post-"executable paths"

In mac_do_jail_get(), computation of 'jsys' had not been updated to take
into account executable paths.

Reviewed by:    bapt
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
888a84ceeded9ef69903e352827cdef58163027e Olivier Certner 2026-04-28 13:17:18

MAC/do: Visually separate some file sections

With additional empty lines.

No functional change (intended).

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
01e2b0ce1820adf475e372ec72371dffca17a7af Olivier Certner 2026-04-28 13:39:09

MAC/do: Allocate only one default configuration

When mac_do(4) is loaded, all jails get the same default configuration
(disabled, with only one allowed executable path: '/usr/bin/mdo').
Share it between all jails instead of creating a separate copy for each.

Reviewed by:    bapt
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
31ef4ee2e3570b8f438b9b3fb09b3d87c87419ff Olivier Certner 2026-04-29 13:12:10

MAC/do: Comment to explain the main invariant for configurations

Once visible, configuration structures must *never* change.

Spell that out in a comment to help future readers/contributors
understand the design.

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
5bedb5e44757ba83dba9d618f5b951416cf44345 Olivier Certner 2026-04-29 17:11:34

MAC/do: Sequential consistency for configuration retrieval

Since the inception of mac_do(4), find_conf(), used to retrieve the
applicable configuration, has been weakly consistent with respect to
concurrent modifications to configuration inheritance that influence its
result (and it has been sequentially consistent with respect to other
configuration modifications, which the initial executable paths feature
and introduction of implicit parameters broke and which will be fixed in
a subsequent commit).

Indeed, find_conf() climbs the jail tree to find an applicable
configuration, which is not an atomic operation.  It examines the
current jail's configuration pointer for each browsed jail, which does
not prevent concurrent modifications of the configuration pointer for
jails below or above it.  Modifications above the current jail are not
a problem, since if climbing needs to continue (i.e., the current jail
inherits), these modifications will be seen if performed before that
check (and may or may not be seen if performed after that check).
However, modifications below the current jail impair sequential
consistency, because they could be done before other modifications at
the current jail or higher up, and the latter could still be picked up
by the rest of the climb, effectively ignoring that the former should
have blocked the climb earlier, making them look as if they had happened
after for the climbing thread.

As a concrete example of this situation, let's examine a scenario where
some jail A is the parent of some jail B, and B inherits its
configuration from A.  An administrator may want to relax the rules only
for jail A but not B.  To this end, he first copies the current rules on
B over to A and then relaxes the rules on A.  He can intuitively and
reasonably expect that changing B's rules first will prevent A's relaxed
rules to leak to threads in B.  Unfortunately, that is not the case: As
explained in the previous paragraph, there can be a time window where
threads from B can still pick up A's new configuration just after it has
been installed.  This arguably makes changing inheritance in mac_do(4)
in a fully secure fashion almost impossible.

If preserving fine-grained locking of prisons, we could prevent this
problem by having find_conf(), once it has climbed to a non-NULL pointer
(actual, non-inherited configuration), do another climb to check that it
can reach the same configuration on the same jail again.  If the new
climb gives another pointer or jail, it could make it the new candidate
and do a climb check again until the situation stabilizes.  A climb
check detects whether changes in jails below that of the candidate
configuration object happened, catching in particular such changes that
happened before changes to the candidate object.  However, that process
alone would still be subject to ABA problems, and we would additionally
need to tag each prison with some modification timestamp (global, or
local but necessitating allocating memory during the check) to fix them.

In the end, we considered this direction to be unnecessarily complex,
given that configuration changes are to be rare events and most uses
will just be configuration determination.

Consequently, switch protecting jail configurations with a single
read-mostly lock.

While here, adapt set_conf() to accept NULL as the new configuration
object, and have remove_conf() call it, which removes duplicated code.

While here, add a comment explaining why we do not need to take any more
locks when climbing the jail tree.

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
5b194a4ae3190a9954544058dfc0790fd9a16172 Olivier Certner 2026-04-29 17:14:13

MAC/do: Support for atomically modifying configurations

As mentioned in previous commits "MAC/do: parse_and_set_conf(): Require
the model configuration" and "MAC/do: Sequential consistency for
configuration retrieval", the introduction of the "executable path"
feature, more fundamentally, the fact that there is now more than one
per-jail parameter and that parameters can be independently modified or
copied, causes an atomicity problem in case of concurrent accesses to of
a jail's applicable configuration.

Partially modifying a configuration is indeed akin to
a read-modify-write operation, where the read is either to the current
or an inherited configuration.  More precisely, once pointed to by
a jail, a configuration object is immutable, and changing the jail's
configuration means making the jail point to another configuration
object.  To change a jail's configuration, a new configuration object is
thus built, and if only some parameters have been explicitly specified,
those that have not been are set by copying the corresponding values
from an existing configuration object (in case of partial modification
of the existing configuration, from the original configuration object
that is going to be replaced; in case of breakage of inheritance or at
jail creation, from the applicable configuration object, which is on an
ancestor jail).  This process is not immune to concurrent modifications
because nothing prevents changes of configurations between reading
existing values and setting the new configuration.  Thus, some other
thread could change the value of a parameter after a copy of it has been
made into the new object but before that copy is actually installed,
which effectively will erase the other thread's modification.

To avoid this, we introduce support for serializing configuration
changes on a given jail.  To this end, we move the jail climbing process
from find_conf() into find_conf_locked(), and make the former call the
latter in a read-locked section.  Similarly, we isolate setting
a configuration in the new set_conf_locked() function, and make
set_conf() call it inside a write-locked section.  The new *_unlocked()
variants make it possible to prevent any configuration access between
determining and reading an applicable configuration, computing from it
a new configuration object and finally setting it, by holding a write
lock over the whole process (there is a trade-off here, as read-mostly
locks cannot be upgraded), effectively making it atomic and realizing
full sequential consistency of configuration changes.  Also, the
'mac_do_rm' global read-mostly lock is made sleepable so that it can be
write-locked over sysctl_handle*() functions or memory allocations
(eases implementation, at the expense of a potential loss of concurrency
which is most probably irrelevant).

No functional change (intended) at this point.

Reviewed by:    bapt
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
0db7f110cb810b7aa6d29df221edf9091d66b58a Olivier Certner 2026-04-29 16:28:44

MAC/do: Serialize installing/modifying some jail's configuration

See the immediately preceding commit for explanations on what this is
fixing.

When setting 'mac.do' to 'inherit' on a jail with 'mac.do.rules' and
'mac.do.exec_paths' also specified in the same call, ensure that the
check that these passed parameters are the same as those to be inherited
is atomic with respect to enabling the inheritance (i.e., removing the
jail's 'struct conf' object).  (See previous commit "MAC/do: Fix the
recent logic to set jail parameters, make it more tolerant" as for why
this check exists.)

Because we currently only modify a single configuration object per
transaction, we introduce the parse_and_commit_conf() wrapper around
parse_and_set_conf() to remove duplicated code that would ensue from
calling the latter directly, namely, releasing the 'mac_do_rwl' lock and
freeing the old configuration object (if any).

Taking the 'mac_do_rwl' lock for writing as a way to freeze all accesses
to mac_do(4) configurations was deemed too thin an operation to be worth
wrapping.

Reviewed by:    bapt (older version)
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
4c98f7a0025eea550ecf6f93f818cd03c6ac0fd5 Olivier Certner 2026-04-29 18:32:56

MAC/do: Do not skip blanks when parsing executable paths

The kind of tolerance we apply to parsing rules, whose format we have
defined, cannot be applied to paths since blank characters are allowed
there.

There is still the limitation that no escape character is currently
supported, and so it is not possible to configure a path having a ':'
character.

Reviewed by:    bapt
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
1fa1e3f3950fc0593ab73ea075c24c9bfbe8afd6 Olivier Certner 2026-05-07 15:32:28

MAC/do: Update copyright

Update years for the Foundation.

While here, remove the initial '/*-' which has been useless for a long
time.

While here, add a missing space on bapt@'s copyright line (approved by
him).

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
fcb0018634c77fe32ed99bca00f856af18ed240b Olivier Certner 2026-05-20 11:46:45
sys: Renumber MTE SEGV codes
Some third party software expects these to not conflict. As the MTE
support isn't fully in the tree, and these values aren't in a release
we can renumber them without any backwards compatibility issues.

Sponsored by:   Arm Ltd
f6911b941f142aef47479d7ec631724bff138f5c Andrew Turner 2026-05-29 15:22:29
syscalls.master: Allow clock_nanosleep in capability mode
It is akin to nanosleep(2) and does not access global namespaces.
It should be permitted in capability mode.

Reviewed by: vangyzen
Fixes: https://cgit.freebsd.org/src/commit/?id=3f8455b0905a ("Add clock_nanosleep()")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57343
692b0ef1506ba51b72d0a2707cbf8879a6e01d78 Ed Maste 2026-05-29 20:26:06
imgact_elf: add sysctl kern.elfXX.phnums for the number of program headers
that are accepted in the activated image or interpreter.

Requested by:   jhb
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57328
201090678e033237e20d80eb29cc059e0df9a1e1 Konstantin Belousov 2026-05-29 14:47:31
linux: Add support for PR_SET_VMA to prctl(2)
Implement dummy support for PR_SET_VMA with PR_SET_VMA_ANON_NAME in
prctl(2).  This prevents applications from receiving EINVAL when
attempting to name anonymous memory regions.
a64148e21bb4ac976345cbedbd32942f97f07cc1 Pawel Biernacki 2026-05-30 12:15:21
LinuxKPI: 802.11 suspend/resume: fix the is_pci_dev check
Shortly before I committed the works from a year ago, jhb added a
function ("is_pci_device") so that the check against the devclass
does not have to be coded in every driver.  Use this instead in main
(and stable/15 in case the works get MFCed).

At the same time this fixes the check (the old one was wrong) as we
attach to the LinuxKPI 802.11 driver, e.g., iwlwifi and thus we need
to check the parent of the parent and not just the parent to be
of the devclass "pci" in the identify bus function.  The was the
first error.  The second was (and this is why it worked) that we
checked for == instead of != and so the wrong check became true again.

Discussed with: jhb
Fixes:          https://cgit.freebsd.org/src/commit/?id=11d69a4558de ("LinuxKPI: 802.11: add support for s/r")
MFC after:      3 days
X-MFC after:    ffcf5e356644 ("pci: Add is_pci_device helper function")
Sponsored by:   The FreeBSD Foundation
d07460f194835410b6a0e99af6b9721b872fb009 Bjoern A. Zeeb 2026-05-30 21:33:51
LinuxKPi: idr: use macros for lock idr lock operations
Our idr implementation is using a mtx lock which in the past has
already caused problems (613723bac219c).
In order to make it easier to tackle the problem start by factoring
out all the operations related to the idr->lock into macros as we
have often done in other parts of code as well.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    wulf, emaste
Differential Revision: https://reviews.freebsd.org/D55392
b53eab322946e88fb95ea4e143d1147d3de18d04 Bjoern A. Zeeb 2026-02-17 03:06:19
ntsync(4)
The driver implements the ntsync interface as specified in the Linux
7.0-rc3 document Documentation/userspace-api/ntsync.rst.  Only the
documentation and the userspace tests (Linux'
tools/testing/selftests/drivers/ntsync/ntsync.c) were used for
reference.  When the documentation contradicted the tests, tests
behavior was implemented.

One quirk is that Linux API needs to return an error from ioctl() and to
copyout the modified ioctl() argument.  Our generic ioctl() is not flexible
enough to implement this, so the ntsync_ioctl_copyout() hack allows to
copyout the ioctl parameter directly from the ioctl method, instead of
relying on the ioctl infra.

The FreeBSD port of the tests, that can be compiled both on FreeBSD and
Linux, is available at https://github.com/kostikbel/freebsd-ntsync-test.
The Linux binary compiled with the Linux test harness, cannot be run
under linuxolator due to unimplemented syscalls, but the shims in
freebsd-ntsync-test can be compiled on Linux and resulting Linux/glibc
binary run on linuxolator to test linux compat.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57038
03ca6dbdb80da79408f135d823fbd9a00fd4f25b Konstantin Belousov 2026-05-11 09:49:13
ntsync: add kinfo reporting
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57038
d0ea3aff90655be3cdb34d86a4a97be6fc85d919 Konstantin Belousov 2026-05-18 07:13:31
MAC/do: Fix double-free on parse error after "executable paths" feature
parse_rules() has been calling toast_rules() in case of a parse error in
order to deallocate the 'struct rule' objects it has constructed up to
that point.

toast_rules() would take a pointer to a full 'struct rules' object, and
besides freeing all 'struct rule' referenced by it, would also free the
holding 'struct rules' itself.

With the introduction of the "executable paths" feature, and the
embedding of 'struct rules' into 'struct conf', meaning that the
lifecycle for 'struct rules' was no longer independent, toast_rules()
was changed not to free the passed 'struct rules' (as it was a field of
a 'struct conf' object).  Unfortunately, this change was not completed
with a reinitialization of the rules list head, so the 'struct conf'
object would continue to reference just-freed rules, which then would be
freed a second time on destruction of that container.

So, make toast_rules() re-initialize the rules list in 'struct rules',
which it logically has been having to do since not freeing the enclosing
'struct rules'.  This alone is enough to fix the bug, but let's use the
occasion to change the contract of parse_rules() and bring its herald
comment up-to-date: On error, parse_rules() now simply leaves already
constructed 'struct rule' objects in 'conf'.  The latter is eventually
destroyed and the rule objects reclaimed at that point.

Add a test trying to set an invalid rules configuration with the first
rule being valid and the second being invalid, which triggers the bug
(and an immediate panic() on an INVARIANTS kernel).

Reported by:    impost0r(ret2plt) <impostor@ret2p.lt>
Reviewed by:    markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=9818224174c4 ("MAC/do: Executable paths feature (GSoC 2025's final state)")
Sponsored by:   The FreeBSD Foundation
79d0dbc9c6d6a1627c9f3eeab0633c232a6a0a34 Olivier Certner 2026-06-01 08:52:16
get/setpriority: Add capability mode checks
Reviewed by: oshogbo
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57345
72e34b3e3907d5fd63abf7b2246cae80641769b3 Ed Maste 2026-05-29 20:48:34
linuxulator: Return EINVAL for invalid inotify flags
We implement all of the currently-defined Linux inotify mask bits and
flags, with the same values as Linux.  Return EINVAL for unknown bits,
as Linux does.

This also moves the translation inline into linux_inotify_add_watch.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57387
f77d37cffdf3951b7f28b97005467241aa27c183 Ed Maste 2026-06-01 18:22:09
linux: Implement PTRACE_GETREGSET NT_PRFPREG and NT_X86_XSTATE
Implement NT_PRFPREG and NT_X86_XSTATE for PTRACE_GETREGSET on amd64.
Chrome's crashpad handler uses these to collect floating-point and
extended CPU register state for crash dumps.

Other architectures retain the previous EINVAL stub behavior.

Signed-off-by:  Ricardo Branco <rbranco@suse.de>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289285
Reviewed by:    kib
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2165
c515e6040614434a9262ee8b5ac54b81476ec7ff Ricardo Branco 2026-04-26 14:45:35
linux: Fix missing break in lsiginfo_to_siginfo()
Prevent LINUX_SI_TKILL from inadvertently falling through to
LINUX_SI_QUEUE, which incorrectly overwrote si_code with SI_QUEUE
instead of SI_LWP.
5dbbd764c8e116b04c75b79b1eedc0edcbb90435 Pawel Biernacki 2026-06-02 11:08:29
Commit group #104: bindat(2)/connectat(2): allow implicit EMPTYPATH for unix domain sockets
bindat(2)/connectat(2): allow implicit EMPTYPATH for unix domain sockets

path specification.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57370
12c590a9abd770f69da3bc0b8adb4955d79357c8 Konstantin Belousov 2026-05-30 22:11:45

uipc_usrreq: revert addition of EMPTYPATH for bindat(2)

The caller wants the parent vnode, which cannot be provided for emptypath
lookups.

Reported and reviewed by:       markj
Fixes:  https://cgit.freebsd.org/src/commit/?id=12c590a9abd7 ("bindat(2)/connectat(2): allow implicit EMPTYPATH for unix domain sockets")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57448
453968c78d27ed5c90562a1178f34fe8d616bf40 Konstantin Belousov 2026-06-04 17:26:09
Commit group #105: amd64: complete thunderbolt KERNCONF integration
amd64: complete thunderbolt KERNCONF integration

This completes the work so the driver can be integrated into KERNCONFs
properly on amd64.

MFC after: 1 month

Differential Revision:  https://reviews.freebsd.org/D55573
886164895f3f4805dc11171ac7980acaccf6ec77 Enji Cooper 2026-06-03 06:02:01

thunderbolt: Fix INVARIANTS compilation

The problem is that THUNDERBOLT_DEBUG triggers the use of some
variables, but it is independent of INVARIANTS and the variables it uses
were tagged with '__diagused'.

Fix this by using '__maybe_unused' in those places.

Fixes:          https://cgit.freebsd.org/src/commit/?id=183633079178 ("thunderbolt: make code -Wunused clean")
Fixes:          https://cgit.freebsd.org/src/commit/?id=886164895f3f ("amd64: complete thunderbolt KERNCONF integration")
Sponsored by:   The FreeBSD Foundation
9a133eee1ed9cf3220055c1d7543e1074bdc628a Olivier Certner 2026-06-03 15:57:50
i386: Fix build (of 'genassym.o')
i386's genassym.c needs to define some assembly symbols holding the size
of NFS structures to support NFS_ROOT while booting with a nfs_diskless
structure.  For this, it needs to include a few NFS headers, which
require definitions from <sys/mount.h> (fhandle_t, vfs_init_t), which
was removed by commit 72ab129799a2 ("x86: remove sys/mount.h from
genassym.c").

Since recently, <sys/mount.h> has been including <sys/vnode.h>, so needs
"vnode_if.h" to have been generated for the compilation of 'genassym.o'
not to fail.  Make sure this is the case (for all architectures for
simplicity) by tweaking the rule for 'genassym.o' in
'sys/conf/kern.post.mk', leaving a comment there so that it can be
removed when i386 is dropped (or if the above-mentioned dependency is
broken).

Fixes:          https://cgit.freebsd.org/src/commit/?id=72ab129799a2 ("x86: remove sys/mount.h from genassym.c")
Sponsored by:   The FreeBSD Foundation
ce243df20aa8ba94918cafdca2537c8cd18887c8 Olivier Certner 2026-06-03 13:11:52
linuxkpi: Make pm_qos.h self-contained
Include <linux/types.h> for `false`.  This is needed by amdgpu somewhere
between Linux 6.12 and 6.15.

Reviewed by:    Minsoo Choo <minsoo@minsoo.io>, bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57415
67df313015906d84d90df8e37795885e81cf8da5 Sourojeet A 2026-06-03 21:58:53
kern_prot.c: Belatedly add copyright
See the commit log for the why.

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
1c0e5c53ff1672a93fc42988020723bb6bc427c1 Olivier Certner 2026-06-04 09:49:23
MAC/do: Clarify comments about flags attached per-ID or per-ID-type
No functional change.

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
0c2d64ce3da9c042da133c8b6d7391abb177f2c9 Olivier Certner 2026-06-04 10:01:23
linuxkpi: Add dma_unmap_page_attrs
This will be used by amdgpu as of Linux 6.13.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
b551429ad65d73a717c7bfc589cfbe62773a8cb1 Sourojeet A 2026-06-04 16:52:44
arm64: Add exception flag for ksiginfo_t and set in trapsignal
The `ksiginfo_t` flag `KSI_TRAP` is set both for exceptions and when
copying between userspace and the kernel fails. In the latter case, the
exception syndrome register as captured in `struct trapframe` won't be
valid. That means we can't use `KSI_TRAP` to determine whether `tf_esr`
is valid. This motivates the addition of a new flag, here called
`KSI_EXCEPT`, for specifically identifying signals caused by exceptions.
It is added to `ksi_flags` via `trapsignal`.

Signed-off-by: Alex Arslan <ararslan@comcast.net>
Reported by:    andrew
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2053
5cc3fa098856cbb8de72d1027c838ef734030445 Alex Arslan 2026-03-19 23:30:03
audit: Add poll / select support
It was previously not possible to poll() or select() on the trigger
device, which made implementing proper signal handling in auditd
difficult.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans, markj
Differential Revision:  https://reviews.freebsd.org/D57457
0620c99d278b6a2fd6fe995f5bb365158e04ad7c Dag-Erling Smørgrav 2026-06-05 21:50:38
audit: Replace TAILQ with STAILQ
This reduces the size of a trigger entry from 24 bytes to 16 (or from
12 bytes to 8 on 32-bit) with no additional complexity.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans, emaste
Differential Revision:  https://reviews.freebsd.org/D57464
77e894cb09affe828f4bc81b8e4751a7e22860de Dag-Erling Smørgrav 2026-06-05 21:50:46
renameat(2): when retrying, check for pending signals
The vn_start_write() call there is already interruptible.  Check for
user signals before restarting due to ERELOOKUP, or after failed
vn_start_write().  Note that vn_start_write(V_XSLEEP | V_PCATCH)
does not check for signals if not sleeping.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295826
Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57453
5d0ebfe1d97801518755c7025f57ba7d5bf1c8db Konstantin Belousov 2026-06-04 17:53:26
rename(2): do not allow to rename root vnode of the mounted filesystem
Check for tdvp being vp_crossmp.  This cannot happen for the normal
rename cases, but could if the target path specified by the syscall
points to the nullfs mount over the regular file.  In this case namei()
cannot step over crossmp, and keep it in ni_dvp.

Since crossmp VOP_GETWRITEMOUNT() returns NULL mp, we retry the locking
dance since the belief is that NULL return is transient.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295826
Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57453
d53633bfcf24a3eb3711e24b597aa8301f92b958 Konstantin Belousov 2026-06-04 19:56:36
linuxkpi 802.11: Free entire mbuf chain on failure
Reviewed by:  bz
Sponsored by:   The FreeBSD Foundation
Fixes: https://cgit.freebsd.org/src/commit/?id=0936c648ad0ee ("LinuxKPI: 802.11: update the ni/lsta reference cycle")
Fixes: https://cgit.freebsd.org/src/commit/?id=c816f64e66a0d ("LinuxKPI: 802.11: plug mbuf leak")
Differential Revision: https://reviews.freebsd.org/D57477
232021fd093c6e65beee5c0b4281091902022d08 Ed Maste 2026-06-05 21:01:39
fork: Drop an uneeded PHOLD/PRELE pair
Support for swapping out kernel stacks was removed, so the PHOLD has no
purpose.  (And even before that, it's not clear why a swapout here would
have been problematic.)

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57486
1ee4b5fd824aa93f9a20df6bd5dad50c7e32fe05 Mark Johnston 2026-06-06 12:52:15
procctl(): do not allow the process to exit inside kern_procctl_single()
Requested and reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57491
a845480cc122f45cebc5fbbe43de6b1c096d852b Konstantin Belousov 2026-06-06 16:52:20
kern_procctl: add get_reaper_or_p() helper
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57487
261c97b47ea4f120bfa4a04aab7d35c70dde8c8f Konstantin Belousov 2026-06-06 17:08:17
procctl(PROC_REAP_GETPIDS): re-validate reaper after relock of proctree_lock
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57487
390ae06d4f524a6f32383cbc1bcbdecdb3738bc3 Konstantin Belousov 2026-06-05 23:29:23
imgact_elf: handle unaligned phdrs
Althought non-compliant, there are binaries which have the phdrs placed
unaligned in the image.  Since we have the code to allocate memory for
off-page phdrs, the same code path can be used to handle unaligned
phdrs.

Relax the requirement for both the activated image and interpreter.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295629
Reviewed by:    emaste, markj, olce
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57498
0b269737f9ca057826a6c9376c2474b1ae5bc91c Konstantin Belousov 2026-06-08 01:22:51
exit1(9): do not deadlock if exit is called due to PT_SC_REMOTERQ
The remote syscall is executed in the context where debugger owns a
p_lock hold on the target.  Due to this, exit1() waiting for p_lock
going to zero, never happen.

Postpone the exit1() call to ast then, saving the provided rval and
signo in the struct proc.  Mark the async-exiting proc with the new
p_flag P_ASYNC_EXIT.

While p_xexit can be reused, p_xsig can be only set by actual exit1(),
otherwise it breaks the ptrace mechanism. Allocate a dedicated p_asig
for it.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57482
a2cfe535771ded3ca8526bae405a5b61f71f1f33 Konstantin Belousov 2026-06-05 20:21:59
linux: Fix sockopt copyout
The Linux getsockopt did not check the size of the provided buffer when
copying out the value, leading to buffer overflows (e.g., for TCP_INFO).

Fix is to use the smaller of the option value size and the provided
buffer.

MFC after:      1 month
Relnotes:       yes
Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D55881
471fdd91d9156aeab026dc420fb97d97be872d65 Chuck Tuffli 2026-06-08 21:19:34
net80211: create IEEE80211_KEYBUF_128_SIZE / IEEE80211_MICBUF_128_SIZE
The IEEE80211_KEYBUF_SIZE and IEEE80211_MICBUF_SIZE are sprinkled
throughout the net80211 stack, ioctl API and drivers.  This makes it
challenging to (eventually) up IEEE80211_KEYBUF_SIZE to support 256 /
384 bit encryption as, well, it'll break every single driver and the
ioctl API in doing so.

So as part of this, let's start to separate out the current key/mic
buffer size from what drivers and the ioctl layer are using.
Drivers especially shouldn't be using these definitions as their
key sizes are hardware / firmware API limits, not net80211 limits.
Ideally drivers would define their own key buffer / mic buffer
sizes and only copy in keys up to that length (and fail keys
that are too large) but the current net80211 API isn't there yet.

This doesn't yet change what defines / buffer sizes are used in the
ioctl layer.  I'm going to plan out some subsequent work to
separate out those defines and ioctl APIs so they maintain using
the 128 bit key/mic buffer sizes and will copy them in/out of any
larger net80211 key buffer size in the future.

Differential Revision:  https://reviews.freebsd.org/D54593
a653fd5560cfdd68f634cca7352c56f2cf7e1473 Adrian Chadd 2026-06-09 04:26:07
Commit group #106: tty: Add sysctl knob to globally disable TIOCSTI
tty: Add sysctl knob to globally disable TIOCSTI

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57233
c289291a6736c01dd68fb8459ec3801859b0a59a Ed Maste 2026-05-25 13:59:40

vt: Rename sysctl to security.bsd.allow_tiocsti

This is consistent with allow_read_dir and allow_ptrace.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293485
Fixes: https://cgit.freebsd.org/src/commit/?id=c289291a6736 ("tty: Add sysctl knob to globally disable TIOCSTI")
Sponsored by: The FreeBSD Foundation
c94b8eee5bcb5f9d116cce9c831933115cfeeb19 Ed Maste 2026-06-09 18:26:42
thr_kill2: Respect p_cansignal()
Approved by:  so
Security:       FreeBSD-SA-26:25.thr
Security:       CVE-2026-45256
Reported by:    Igor Gabriel Sousa e Souza
Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by:    emaste, kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57237
bf1e2c07977d6b987f7a976bb9e5b6bdd1ad3986 Mark Johnston 2026-05-25 15:12:57
ktls: Don't attempt to modify non-anonymous mbufs on the receive path
Normally, data processed on the KTLS receive path is contained in
anonymous mbufs that can be modified in place.  Either the data
originates in receive buffers from a NIC driver, or for loopback
connections the data is anonymous-backed mbufs created when writing to
a socket.  One potential source of non-anonymous mbufs are mbufs
created by sendfile(2) which borrow the pages of the underlying file,
either via M_EXTPG or EXT_SFBUF that are sent over a loopback
connection.  For a well-formed loopback TLS session, the sender should
only use sendfile(2) if KTLS is enabled.  If TLS is fully handled in
userspace, the sender must use write(2) or send(2) which allocate
anonymous mbufs.  If KTLS transmit is enabled, then sendfile(2) on a
loopback connection will always use crypto via OCF and will allocate
anonymous pages to hold the encrypted data.

However, if sendfile(2) is used to send file-backed data directly over
a loopback connection where KTLS is not enabled on the sender side,
the KTLS receive path can modify the file-backed pages in place
overwriting the file's data.  One potential fix would be to replace
non-anonymous mbufs in a received TLS record with anonymous mbufs
(e.g. via m_dup()) before passing the record to OCF.  However, there
is no legitimate use case for using sendfile(2) over a loopback TLS
connection without using KTLS on the sender side, so instead simply
fail decryption requests and close the connection if non-anonymous
mbufs are encountered in the RX decryption path.

Add a test for this that verifies that the original data backing the
file descriptor used as the source for sendfile() is unchanged after
being processed.

Approved by:    so
Security:       FreeBSD-SA-26:26.ktls
Security:       CVE-2026-45257
Co-authored-by: Drew Gallatin <gallatin@FreeBSD.org>
Sponsored by:   Chelsio Communications
Sponsored by:   Netflix
3444414cb4639ef2028abd9b46641e76eadf363d John Baldwin 2026-06-03 23:22:00
linux: Correct the issetugid check in copyout_auxargs
The runtime linker in glibc relies on the AT_SECURE auxv entry to know
whether the executable is set-ugid, if so then various dangerous
functionality such as LD_PRELOAD is disabled.

The check added in commit 669414e4fb74 failed to take into account the
fact that during execve, P_SUGID may not yet be set for a set-ugid
process.  Correct the test.

Approved by:    so
Security:       FreeBSD-SA-26:30.linux
Security:       CVE-2026-49413
Reported by:    Minseong Kim
Fixes:          https://cgit.freebsd.org/src/commit/?id=669414e4fb74 ("Implement AT_SECURE properly.")
Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57350
d39be1b1b50df91ad7ab62b25a4a30343e94cba5 Mark Johnston 2026-05-29 21:41:35
imgact_elf: Clear no-ASLR and -WXORX flags earlier for setugid images
Otherwise an unprivileged user can disable randomization of the base
address for PIEs even if they are setugid.

Add a regression test.

Approved by:    so
Security:       FreeBSD-SA-26:32.elf
Security:       CVE-2026-49414
Reported by:    David Berard
Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57397
ebb0ea9f4f599be267641e630ea48279e4f531d1 Mark Johnston 2026-06-02 20:29:00
connectat(2): do not enable EMPTYPATH for AT_FDCWD
This restores existing error code for connect(2) over unix domain socket
when the empty string is specified as socket address.

Reported by:    eduardo
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57509
a248c5545f6fb861ea4200b69a58b2abcf815ce4 Konstantin Belousov 2026-06-09 05:27:49
Commit group #107: proc: add tree ref count
proc: add tree ref count

Owning the reference prevents reuse of the struct proc.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57492
85a65e3930924429903e09832d177f8aa09dfb47 Konstantin Belousov 2026-06-06 18:02:29

kern_fork: guard against NULL newproc on the failure path

Reported and tested by: pho
Fixes:  https://cgit.freebsd.org/src/commit/?id=85a65e393092 ("proc: add tree ref count")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
9b48646ab366dcf6089fac653eef963331aa1169 Konstantin Belousov 2026-06-10 10:29:05
reap_kill_subtree_once: when proctree_lock is dropped, reaper might change
Recalculate it to iterate over the right set of processes.

Prevent reaper' struct proc reuse by holding the tree ref on it.
Since our reference is taken under the proctree lock and we know that
the process is reaper, it cannot go away.  The process hold count
(p_lock) cannot be used there because p_lock intent is prevent exit, but
reaper owns its reap-children until reaped itself, i.e. even a zombie
reaper is still on duty.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57492
44970244e6d872103f36eae34218b672b69579dd Konstantin Belousov 2026-06-05 23:57:16
jail: Don't double-free the current prison in kern_jail_set/get
Reported by:  Yuxiang Yang, et al <yangyx22 at mails.tsinghua.edu.cn>
Discussed with: markj
MFC after:      3 days
b52dc2067618fc73e8d4d20e4035d1a67a8b455d Jamie Gritton 2026-06-09 22:31:40
linux: Add TCP_INFO support
Implement the getsockopt for TCP_INFO by mapping FreeBSD's version to
what Linux expects.

MFC after:      1 month
Relnotes:       yes
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D55882
925ca9b8355d10a0dc85175dc865095c9b3370c4 Chuck Tuffli 2026-06-10 00:22:49
compat32 wait4/6(2): only copy out when there is a pid to report
PR:   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295965
Reported and tested by: mandree
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57513
89fa97f0a71d4988891766c4e69eeb9687016b14 Konstantin Belousov 2026-06-09 21:33:56
mac_portacl: do not reject unspecific family directly
Reviewed by: imp,emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1659
6b61852b4f000431eb83ce26584da806f64d4643 K Rin 2025-04-12 02:28:52
elf_common: Add FDO package metadata note type
Reviewed by:  fuz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57525
6365c45d951dd50ca411160b03c3a0427bd54449 Ed Maste 2026-06-10 13:21:06
Pause failpoint: replace mtx_sleep with tsleep
Eliminate panic when re-setting a paused failpoint to pause
(address of feq_mtx changes whilst in mtx_sleep, triggering
assertion when reacquiring mtx).

Reviewed by:    rlibby
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2267
331613ddd8a516e8eaf841f293754fa47cb339aa Mark Ranger 2026-05-25 22:32:50
LinuxKPI: sync linuxkpi_video with Linux 6.12
MFC after:    1 week
511d749ecc02c6fad142e10f6c8227361b844a01 Vladimir Kondratyev 2026-06-13 18:08:58
vfs: work around the race between vget() and vnlru
Specifically, do not let vtryrecycle() to recycle a used vnode. It is
possible for a vnode to be vref-ed or vuse-ed lockless after it is held
by vhold_recycle_free(). Then, since vtryrecycle() does not recheck the
hold count, we might end up freeing vused vnode.

Since vget_finish() increments v_usecount after obtaining the vnode
lock, we would observe the hold reference anyway when the parallel
vget() is blocked waiting on the vnode lock.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281749
Reported and tested by: Steve Peurifoy <ssw01@mathistry.net>, Vladimir Grebenshchikov <vova@zote.me>
Reviewed by:    olce
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57305
36b155a2b3baa747c1968a9094df9fa7fb0d02b3 Konstantin Belousov 2026-05-28 09:42:38
sys/rangelock.h: explicitly enumerate padding at the end of the structure
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56912
3d505310b1bb259c3e5f39d8c88a465cf1403934 Konstantin Belousov 2026-04-26 02:22:52
struct vnode: assign v_rl.resv1 as v_type and v_rl.resv2 as v_state
Use the avaliable space to introduce vnode-locked flag v_v2flag.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56912
da6aa0648c0265d6f7bcba44a26f13ed0453dd7a Konstantin Belousov 2026-04-26 02:31:50
vnode: move VIRF_KNOTE to v_v2flag
The semantic of the flag has the natural march to the code scope that is
protected by the vnode lock.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56912
64467d2ec3ede11430554fea68b317d27bf4b5c3 Konstantin Belousov 2026-05-09 19:14:56
linudebugfs: fix simple_attr_write_common() kernel buffer
With 2cf15144daf7e we added a kernel buffer for parsing input copying the
user buffer into that.  The problem is that we only copy exactly as many
bytes as the user supplied.  printf 1 would have a write_size of 1, while
echo 1 would have a write_size of 2 (1\n).  But in order to check and
parse we need a terminating '\0'.

Overallocate the kernel buffer by 1 and make sure it is always '\0'
terminated.

Remove the check that the string needs to be of different length than
the write_size as this will always fail unless the user passes in, e.g.,
"1\02\n\0" somehow in which case we won't bother as kstrto*ll() will
not only handle the '\n' but also stop at '\0' and should be fine or
it will fail and we will error.

In theory we could use a static buffer here as well as we know a maximum
possible length of digits plus \n and \0 and take a min of that buffer
length and write_size and then error on a small buffer but given this is
an optional debug interface, do not bother with any alloc (size).

Fixes:          https://cgit.freebsd.org/src/commit/?id=2cf15144daf7e ("lindebugfs: Pass user buffer pointers ..")
Sponsored by:   The FreeBSD Foundation
Reviewed by:    dumbbell
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D57522
3fa40c5eb8f57972bf0b329fd2d36af4d2700b8d Bjoern A. Zeeb 2026-06-10 11:04:20
lindebugfs: improve an error message
In case the fill function fails do not report (read/write) but the
actual operation only given we can easily determine it.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell, emaste
Differential Revision: https://reviews.freebsd.org/D57523
84008e34ce5fb92c69b63cdf1ce2938c5006320b Bjoern A. Zeeb 2026-06-10 11:18:47
callout: ddb: resolve symbol of callout function
In the ddb show callout function try to resolve the symbol of the
callout function to improve debugging.  In my case I went through
various callouts from show ktr to check what they were and this saved
me opening lldb/gdb next to it (and still having the old kernel as
the panic to debug was upon reboot).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    rlibby
Differential Revision: https://reviews.freebsd.org/D57521
b8ec4929e9f4c83bf02f412de1f9022b17abf867 Bjoern A. Zeeb 2026-06-10 11:57:09
LinuxKPI: 802.11: lock down mac80211 downcalls
Add lock assertions and "might_sleep" annotations to various
mac80211 operation downcalls into the driver.

Make sure the code to these is all covered by locks--pushing more wiphy
lock into the code--or lock assertions as well.  Split up parts of the
MC code up into an unlocked and locked version to avoid recurive locking.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
1c601bf516ebefb1670f5612316c501f2ae2654a Bjoern A. Zeeb 2026-06-05 10:22:38
kldload: Improve error handling
Address a failure in linker_load_module (sys/kern/kern_linker.c) to
verify that an already-loaded module matches the version requirement,
which caused the method to return the error (EEXIST).  This was then
propagated back up to kldload, which incorrectly printed that the module
had already been loaded.

Add a lookup to modlist_lookup2 to distinguish between the two cases:
- A module is already loaded that is of the correct version, so the
  error EEXIST should be returned
- An already-loaded module is of the incorrect version, so the error
  ENOEXEC is returned (changed from ENOENT)

Reviewed by:    imp, kib
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57002
db887713de2bf5c77494220a9e0ddfa7d4290155 Jim Huang Chen 2026-05-25 16:23:29
LinuxKPI: add KERNEL_VERSION() macro
Add a KERNEL_VERSION() macro which normally would be in linux/version.h.
On Linux that file is auto-generated and we are supporting more than
one Linux version in LinuxKPI anyway so any further defines in there
would likely be wrong.

Adding the macro helps to support (vendor/out of tree) drivers more
easily which are supporting multiple Linux versions.

MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D57590
c5d6e2085a471cbb75cc7b88b37a2fe6276c16f8 Bjoern A. Zeeb 2026-06-13 11:08:00
LinuxKPI: scatterlist.h: implement sg_init_marker()
Add sg_init_marker() which is needed by mt76 drivers USB attachment.

Sponosored by:  The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D57594
3d0b6c69dced4936fccff6733912a0ef93214dbe Bjoern A. Zeeb 2026-02-03 18:29:09
rpcsec_tls: Avoid a socket reference underflow in rpctls_server()
The upcall_sockets tree owns a ref on any resident socket.  When a
socket is removed after a TLS handshake failure, rpctls_rpc_failed()
thus calls soclose().

rpctls_server() does not acquire an extra ref to compensate for this.
So, if the upcall fails, e.g., because rpc.tlsservd is not running,
we'll call soclose() to drop the reference, but this effectively
releases the xprt layer's reference.

Fix the problem by explicitly acquiring a socket reference when adding
a socket to the upcall tree.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289734
Reviewed by:    rmacklem, glebius
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57555
fc7993cf2d6ddba9f94683565838bf8fabc0145c Mark Johnston 2026-06-15 15:52:24
netexport: Move struct netexport in a .h file and refcnt it
This patch moves "struct netexport" into a separate
netexport.h file and refcounts the structure, plus adds
a few fields that will be used in a future NFS server
commit.

The patch also includes some helper functions for
handling the netextport structure:
vfs_netexport_alloc(), vfs_netexport_acquire(),
vfs_netexport_release() and vfs_netexport_reset().

Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D57553
2e6615b26bb51ceadc99121f16856aad9345a3cf Rick Macklem 2026-06-16 15:35:30
sys: Reserve EXTERR_CAT_LINKER for kld linker exterrors
Reviewed by:  imp, kib (in D57002)
Sponsored by:   The FreeBSD Foundation
6616c7a9a17d1870a7f15aded0b499b1373ba8b0 Jim Huang Chen 2026-05-25 16:23:29
acpi: Constify acpi_stype_to_sstate() and some users
Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57413
554a459ff59969e0f66b1b1c6695d249e2eecd84 Olivier Certner 2026-06-17 03:03:20
kern_linker.c: re-apply some more bits from db887713de2bf5
The definition of the EXTERR_CATEGORY symbol in the .c file is needed
for the script to regenerate identical context of
gen/exterr_cat_filenames.h.

Sponsored by:   The FreeBSD Foundation
9889fac5b82c8de5b55c9ae708d57bc64c10c87a Konstantin Belousov 2026-06-17 07:12:29
socket: Tag all socket option comments consistently
For all the socket options that have a fixed type, add the type of the
socket option arg to the comment. Most of them already had this, but a
few did not. The ones that don't have a tag use a variable length data
structure of some kind, and are beyond the scope of this
commit. Slightly expand the syntax to allow a comma separated list for
those sockopts that have multiple fixed-length versions.

Sponsored by:           Netflix
Reviewed by:            pouria, peter.lei_ieee.org, tuexen
Differential Revision:  https://reviews.freebsd.org/D57545
52c0d52b91e34f9190c9ba8fab7b6bc463bc4cbb Warner Losh 2026-06-17 13:39:05
RDMA: Fix link active_speed size
According to the IB spec active_speed size should be u16 and not u8 as
before. Changing it to allow further extensions in offered speeds.

Linux commit:
376ceb31ff87 RDMA: Fix link active_speed size

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
MFC after:      1 week
Sponsored by:   NVIDIA Networking
Differential revision: https://reviews.freebsd.org/D57084
e5d8b775bbf6f378a591211e373859ec44f74149 Slava Shwartsman 2026-05-13 14:54:51
ibcore: Add support for XDR link speed.
Add new IBTA speed XDR, supporting signaling rate of 200Gb.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah@nvidia.com>
MFC after:      1 week
Sponsored by:   NVIDIA Networking
Differential revision: https://reviews.freebsd.org/D57085
b3c09af215ee4803fa67ca94301f662d5eca03a0 Slava Shwartsman 2026-05-13 14:20:35
witness: actually set read-only tunables in time for witness_startup
SYSCTL_XXX with CTLFLAG_RDTUN and without CTLFLAG_NOFETCH should not be
used for values that are needed before SI_SUB_KLD.  Otherwise they are
tuned after they are needed.  Set CTLFLAG_RDTUN | CTLFLAG_NOFETCH for
the debug.witness.witness_count and debug.witness.skipspin sysctls and
add separate tunables for them, which run at SI_SUB_TUNABLES time, i.e.,
in time for witness_startup.

Reviewed by:    kib, markj
Sponsored by:   Dell Inc.
Differential Revision:  https://reviews.freebsd.org/D57613
08180f1b613b6fe000135efa28b7c3293cbf1683 Ryan Libby 2026-06-18 03:52:53
witness: add tunables debug.witness.lock_order_{data_count,hash_size}
Add tunable debug.witness.lock_order_data_count to allow adjusting the
number of witness lock order data entries (stacks) without recompiling
the kernel.  This may help to display stacks when a lock order reversal
is reported but the number of entries is exhausted before recording the
first lock order, by allowing the user to reboot with an adjusted
tunable and try again.

Tunable debug.witness.lock_order_hash_size is also provided to allow the
hash table load factor to be managed, though that is not required.

Also tweak witness_lock_order_add to avoid computing a hash when it
won't be needed because the lock order data entries are exhausted.

Reviewed by:    kib, markj
Sponsored by:   Dell Inc.
Differential Revision:  https://reviews.freebsd.org/D57600
ca8a1c3c27b0d5915e0dcfd02ea4ef703db4fe9a Ryan Libby 2026-06-18 03:54:26
busdma_bounce: Allocate bounce buffers as unprotected
Reviewed by:  andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56519
8fdaa1b16367d809bca8d4d3ac5e08443353eac1 Sarah Walker 2026-06-18 15:34:14
unix: implement basic SO_PASSRIGHTS functionality
With exception to sockopt functionality, implement the so_options flag
in unix(4) itself.  The general argument for the flag is that SCM_RIGHTS
can be used maliciously for, e.g., a DoS that the receiving side can't
avoid if it is expecting other control messages.

This option gives the receiver a way to disable SCM_RIGHTS on the
sender-side, surfacing an EPERM to them instead.  This seems to match
the semantics that Linux offers.

If an SCM_RIGHTS was already sent before we disabled SO_PASSRIGHTS, then
a subsequent recvmsg(2) will silently discard any in-flight files.  This
has the downside of punting a file with the potential to hang over to
the deferred-close task, but perhaps usage of the option would
discourage folks from attempting to take advantage of that possibility
anyways.

Various manpages updated to describe the new behavior.

The ru_msgsnd accounting here might need to be re-evaluated: some error
paths will increment it while others will not, and it isn't really
clearly labelled.  At some point in the operation enough work has been
done that one could consider it enough resources to count, but it's not
obvious that it should work this way.  This change doesn't attempt to
address that.

Reviewed by:    glebius
Differential Revision:  https://reviews.freebsd.org/D57423
9b16399225f8acfba675cf0a9312dd9eac563ce3 Kyle Evans 2026-06-19 04:03:30
sockets: plumb SO_PASSRIGHTS into *sockopt(2)
This is a little different than the others in that it's not valid for
anything but unix(4) sockets.  New cases were added that jump into the
more standard case out of a light preference for not taking advantage of
case FALLTHROUGH with the additional logic- it doesn't scale very well
for new cases added that might be slightly special, so we might as well
just add the labels up-front.

Reviewed by:    glebius, markj
Differential Revision:  https://reviews.freebsd.org/D57424
0ae7df3708dd97515a5bc2a068d25a733c9b2b10 Kyle Evans 2026-06-19 04:03:30
linux: implement SO_PASSRIGHTS
We have a native version now, plumb it through to the Linuxolator.

Reviewed by:    glebius, markj
Differential Revision:  https://reviews.freebsd.org/D57427
59bd4840df037a6898b4e9d917a530bce113f053 Kyle Evans 2026-06-19 04:03:30
socket: remove tautological condition in so_unsplice()
so2rele was introduced in 1000cc4a0d3 and it was necessary there, but
the cleanup in a837d1fe49e0255 rendered it redundant if our own KASSERT
is to be believed: we've asserted that `so2->so_splice_back == sp` and
`sp` has been dereferenced above, so there's no condition left where
we shouldn't release the socket reference at the end.  Indeed, the
change in so_splice() to NULL out sp->dst removes that possible state of
a partially constructed splice: if sp->dst is set, it has been ref'd.

Reviewed by:    gallatin, markj
Differential Revision:  https://reviews.freebsd.org/D57558
8a3d28375450946e4b0de239c9239df54c22d298 Kyle Evans 2026-06-19 04:03:30
jail: call PR_METHOD_ATTACH again (with old jail) if the first call fails
jail_attach lets modules do attachment-specific work by calling
osd_jail_call(PR_METHOD_ATTACH).  If one of the modules returns an
error, the call needs to be repeated with the thread's current prison,
so possible earlier modules and undo any changes they may have made.

MFC after:      5 days
e91e8ebefadcce9d57c8ff945ff70050cbbe1ce1 Jamie Gritton 2026-06-19 19:45:27
imgact_elf.c indicate that interpreter is an interpreter
Use a value that do_execve will ignore since there's nothing there to do.
With this we can set the 'indirect' flag on rtld, to prevent direct execution
being used to bypass the 'indirect' flag on python3:

root@vuefi:~ # /libexec/ld-elf32.so.1 /usr/bin/python3 -c 'print("pwned")'
pwned
root@vuefi:~ # veriexec -z enforce
root@vuefi:~ # /libexec/ld-elf32.so.1 /usr/bin/python3 -c 'print("pwned")'
/libexec/ld-elf32.so.1: Operation not permitted.
root@vuefi:~ #

load_file seems missnamed since it is only used by load_interp
so rename it to load_interp_file.

Reviewed by:    imp
Sponsored by:   Hewlett Packard Enterprise Development LP
Differential Revision:  https://reviews.freebsd.org/D57649
389c124fecb04cf6ae2b0f8ab1047c19badec40c Simon J. Gerraty 2026-06-19 20:21:46
Commit group #108: libc
libc: Add atomics C23 feature test macro

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
85becdacf3b043849b240eb1b1b2cde63add0690 Faraz Vahedi 2026-05-01 01:01:20

libc: Restrict ATOMIC_VAR_INIT for C23 conformance

Omit `ATOMIC_VAR_INIT` when targeting C23, where it has been removed.
Retain it for earlier C standards and for C++ (as it still remains in
C++23, albeit marked as deprecated since C17 and C++20.)

Also separate `atomic_init` definitions from `ATOMIC_VAR_INIT` to
avoid coupling with a deprecated initialisation mechanism.

No functional change intended for `atomic_init`; this is purely a
conformance and cleanup adjustment.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
28cecfe27964fdb67497800f5dcd5d3e1033727f Faraz Vahedi 2026-05-01 14:34:44

libc: Add missing kill_dependency macro

Add `kill_dependency` as specified by C11 §7.17.3.1.

The macro is required to break dependency chains in
expressions without affecting the value.

No functional impact beyond providing the required,
value-preserving definition.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
9d87c1aac4a84ac5e82acf872f645a7202977204 Faraz Vahedi 2026-05-01 15:41:49

libc: Reorganise memory_order enumeration constants

Place the `memory_order` enumeration constants alongside the corresponding
typedef under the §7.17.3 heading.

The previous layout separated the fallback constant definitions from the
enum, which could obscure their relationship. These fallbacks exist only
to provide values when the compiler does not supply the builtins.

The removed comment encoded implementation-specific assumptions about
compiler-provided definitions and implied a relationship between Clang/GCC
macros and fallback values. In practice, the fallback definitions exist
solely to ensure the enumerators are defined when compiler intrinsics are
absent, and do not depend on any particular numeric mapping.

No functional change; this is a mere structural and clarity improvement.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
e17fddce8978efbc70fc473425bad59b111f4b16 Faraz Vahedi 2026-05-01 17:49:27

libc: Reorder atomic operations to match ISO C standard

Reorder definitions of specified generic operations on atomic types
so they follow the sequence in ISO/IEC 9899:2024 §7.17.7:

1. `atomic_store`
2. `atomic_load`
3. `atomic_exchange`
4. `atomic_compare_exchange`
5. `atomic_fetch`

This aligns the header layout with the standard, making it easier
to cross-check against the normative text and maintain consistency
with the rest of the header.

The behaviour of the macros remains unchanged; this is purely a
reorganisation and documentation improvement.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
cb88e7b8cdd6b4c707e47abee4ba8541d9fccea6 Faraz Vahedi 2026-05-02 03:40:27

libc: Enforce lock-free atomic_flag and C23-safe initialisation

Select the `atomic_flag` backing type according to the C standard
requirements that `atomic_flag` operations be lock-free.

C11 §7.17.1.5 defines `atomic_flag` as:

> a structure type representing a lock-free, primitive atomic flag

and §7.17.8.2 further requires:

> Operations on an object of type atomic_flag shall be lock free

Therefore:

- Prefer `atomic_bool` when `ATOMIC_BOOL_LOCK_FREE == 2`
- Fall back to `atomic_uchar` when `ATOMIC_CHAR_LOCK_FREE == 2`
- Trigger a translation failure if neither type is lock-free

Adjust `ATOMIC_FLAG_INIT` for C23 initialisation rules:

- Use `{ ATOMIC_VAR_INIT(0) }` in pre-C23 modes
- Use `{ 0 }` in C23 and later

Preserve `atomic_flag_test_and_set_explicit()` semantics by
normalising the exchanged value with `!= 0`, ensuring consistent
boolean results regardless of whether the underlying
representation is `atomic_bool` or `atomic_uchar`.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
640ddf8571291ab2965de85f67e6065a4d7efbf8 Faraz Vahedi 2026-05-07 10:25:56

libc: Fix atomic_init for GCC atomic objects

Add a dedicated `__GNUC_ATOMICS` path that initialises via
`atomic_store_explicit(obj, value, memory_order_relaxed)`.

This ensures the required initialisation semantics without
assuming any particular object representation.

Previously, `atomic_init` on GCC fell through to the legacy
`__val` member path intended only for old struct-backed
atomic objects. For current atomic objects, this caused the
following compilation error:

> error: request for member '__val' in something not a
  structure or union

As a result, valid code such as `atomic_init(&x, 1)` failed
to compile when using GCC.

This fix restores compatibility with standard-conforming
callers while other code paths remain unchanged.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
54ac231419cf09557d2f5826b1539e83db552410 Faraz Vahedi 2026-05-07 23:00:47

libc: Fix GCC pointer semantics for atomic_fetch_add/sub

Correct the GCC implementation of `atomic_fetch_add_explicit()`
and `atomic_fetch_sub_explicit()` for atomic pointer types.

The previous implementation passed the operand directly to the
builtins. For pointer objects, this could result in raw byte-wise
address arithmetic rather than the required C atomic pointer
semantics, where the operand is interpreted as a `ptrdiff_t`
element count.

As a result, operations such as `atomic_fetch_sub_explicit(&p, 2, ...)`
could produce an incorrect post-operation pointer value.

Fix this by applying pointer scaling in the GCC path before invoking
the builtin, mirroring the existing legacy fallback implementation.
Pointer operands are now scaled by the size of the pointed-to type,
while integer atomic behaviour remains unchanged.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
26bf9fc3a40275a7aca0ce1809751a90c84b643a Faraz Vahedi 2026-05-08 02:54:23

libc: Fix ATOMIC_VAR_INIT visibility

Fixes:          https://cgit.freebsd.org/src/commit/?id=28cecfe27964 ("libc: Restrict ATOMIC_VAR_INIT for C23 conformance")
Reviewed by:    fuz, imp
Differential Revision:  https://reviews.freebsd.org/D57724
4c860db34a1b8cff79e7f0d5184423221613e8e1 Dag-Erling Smørgrav 2026-06-21 19:51:14
sys: Add `isgraph()` to <sys/ctype.h>
Quote from https://pubs.opengroup.org/onlinepubs/7908799/xbd/locale.html:

    "graph": Define characters to be classified as printable characters,
    not including the space character.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57578
4831a8d792d4ac2cbf4d49d9d220947fb53e2e86 Jean-Sébastien Pédron 2026-06-12 14:39:21
rights(4): fix our representation of the unused bits
The current format seems to be a little confusing, and the version of it
for index 0 was broken by the below-referenced commit.  Break our
UNUSED macros out into one per unused bit to enumerate the entirety of
the space and make it easier to claim an unused one.

Fixes:  https://cgit.freebsd.org/src/commit/?id=b165e9e3ea4e327fc ("Add fchroot(2)")
Reviewed by:    oshogbo (previous version), kib, markj
Differential Revision:  https://reviews.freebsd.org/D57505
57fefbee1f959d0c65376dbdad309d01c182d710 Kyle Evans 2026-06-20 13:55:26
Commit group #109: pNFSd: Add a directory of newly created files for the pNFSd
pNFSd: Add a directory of newly created files for the pNFSd

When an NFSv4.1/4.2 server is configured as a pNFS server,
new file creation (via Open/Create from an NFS client) is
slow, due to the fact that the NFS server (MDS) must do
RPCs against the DS(s).

This patch precreates files in a directory called ".pnfshide/numfiles",
so that the NFS server can just rename them for the Open/Create.
A kernel process called a "replenisher" creates more files in
".pnfshide/numfiles" as required. (At this point, the MDS must
still do Setattr RPC(s) on the DS(s), but that will change when
the pNFS server is converted to the loosely coupled configuration.

This patch only affects the pNFS server and only if the directory
.pnfshide/numfiles exists in the exported file system.

Reviewed by:    kib
Discussed with: markj
Differential Revision:  https://reviews.freebsd.org/D57554
d8e8f9251975b68fe9c73e39074e0f211ec2145e Rick Macklem 2026-06-20 18:43:45

nfs_nfsdport.c: Do unnecessary initializations to quiet gcc

Fixes:  https://cgit.freebsd.org/src/commit/?id=d8e8f9251975 ("pNFSd: Add a directory of newly created files for the pNFSd")
61152df00aee248bec2ef267c092b6004e25f6d6 Rick Macklem 2026-06-21 00:06:45

nfs_nfsdport.c: One more unnecessary initialization for gcc

Fixes:  https://cgit.freebsd.org/src/commit/?id=d8e8f9251975 ("pNFSd: Add a directory of newly created files for the pNFSd")
fa515f60fce0edd09d0b1078852ec06b1cd0a74c Rick Macklem 2026-06-21 02:53:06
da: Put the SYNC CACHE probing behind bootverbose
These have turned out to be too noisy, so put them behind bootverbose

Event: BSDCan 2026 (noticed during UFS demo)
Sponsored by: Netflix
MFC After: 2 weeks
eafa181d51f712f189ae4558014d8d00de7c5624 Warner Losh 2026-06-20 20:53:32
Commit group #110: execve_block(): a mechanism for mutual exclusion with execve() on the process
execve_block(): a mechanism for mutual exclusion with execve() on the process

A consumer of execve_block(9) is synchorized with the execution of
execve(2) family of syscalls, ensuring that execve_block region is
mutually exclusive with the execve processing. Either execve_block() or
execve() would sleep until other finishes.

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
e1a84b7708c2514769625c2af6c5034694013b6a Konstantin Belousov 2026-05-26 17:36:20

kern_exec.c: explicitly include sys/limits.h for UINT_MAX

While there, remove unneeded manual inclusion of sys/cdefs.h.

Fixes:  https://cgit.freebsd.org/src/commit/?id=e1a84b7708c2 ("execve_block(): a mechanism for mutual exclusion with execve() on the process")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
f5fce0bcc370a9700249e64901eabf2e0be4ecb0 Konstantin Belousov 2026-06-21 14:17:41
execve_block_pass(9): a helper to wait for the execblock to pass
Tested by:    pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
450fe67d19eb2ea8e27109214ff21064fdcf808c Konstantin Belousov 2026-06-17 19:06:50
proc: Allow to make proc_rwmem() operate on a consistent address space
Provide proc_vmspace_ref() to safely obtain the reference to the target
process vmspace, optionally
- requiring that the target cannot execve(2) and thus cannot change its
  vmspace until vmspace in unreferenced
- requiring the check of permissions of the caller after the vmspace
  reference is obtained, since the process lock might have been dropped
  in the process.

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
e1b0d051bbf7e4e730470cbd6622f71a639834c3 Konstantin Belousov 2026-06-07 17:57:06
Commit group #111: kern_proc.c
kern_proc.c: ensure stability of the vmspace we read the strings from

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
a22c044cce41864a32af6b8281a3c416a2664d7f Konstantin Belousov 2026-06-07 19:12:54

kern_proc.c: ensure stability of the vmspace for sysctl kern.proc.vmmap

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
5fe6e08d2db56b530f0df2903ef24cfabab7b8ea Konstantin Belousov 2026-06-14 23:49:20

kern_proc.c: ensure stability of the vmspace for sysctl kern.proc.vm_layout

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
31fa677e4af00b795bf671847b4dc72960c90f14 Konstantin Belousov 2026-06-14 23:49:20

kern_proc.c: make kern.proc.osrel atomic

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
80626f34ee985671bb8c60ee986b89587b7a1511 Konstantin Belousov 2026-06-15 17:28:15

kern_proc.c: disallow execve around sysctl kern.proc.kstacks

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  htts://reviews.freebsd.org/D57497
8b5abd9027b8b1f6290c756730ee3adebed007f4 Konstantin Belousov 2026-06-15 17:57:47

kern_proc.c: disallow execve around sysctl kern.proc.rlimit

Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  htts://reviews.freebsd.org/D57497
5a91fa5a7656c99e527fe7e6f6bf6bd9e85ab589 Konstantin Belousov 2026-06-16 04:30:10
kern_event: block the target process from execing for sysctl kern.proc.kqueue
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
79b384bd8fdff4869ce4799edb0342ff5c25b6fa Konstantin Belousov 2026-06-16 03:48:29
kern_resource.c: disallow execve around sysctl kern.proc.rlimitusage
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  htts://reviews.freebsd.org/D57497
836749817036b90b60af0584fa21f2d9dbd60ff7 Konstantin Belousov 2026-06-16 04:34:16
kern_procctl(PROC_WX_MAPPINGS_PERMIT): ensure stability of the target vmspace
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
6a572920f251ac8ac6a80a55d4d039736ea7dd65 Konstantin Belousov 2026-06-15 13:32:47
linux_prlimit(): block execve for the target
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
e41c28e67fac9cd22a85b160c5c9d0477ed03600 Konstantin Belousov 2026-06-07 19:21:40
procfs, linprocfs: ensure target process vmspace stability
Reviewed by:  markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
5db31f1b47b586a5091eb41fc957236f28b78dba Konstantin Belousov 2026-06-07 18:48:59
sys_set*id(9): wait for the execblocks to pass
to ensure stability of the process uid/gids during the
p_cansee()/p_candebug()-protected regions.

Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57497
d0384f50dad25d3358d76f7556969ea1d515ba68 Konstantin Belousov 2026-06-17 19:07:22
uiomove_*: centralize the copy function selection
Add a uiomove_step() for the central set of switch statements which
choose between userspace and kernel and if data is going to or from the
iovec.

Refactor uiomove_fromphys loops to unconditionally free per-iteration
resources and drop gotos.

While here, switch from bcopy to memcpy.

Reviewed by:    kib
Suggested by:   emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57688
fc9b28879e8935cc830b83d8a36d85b9b98b276a Brooks Davis 2026-06-21 15:47:53
uipc_socket: prefer memcpy to bcopy
Reviewed by:  kib, emaste
Suggested by:   emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57689
8b47939b952248e68c3ee64b8577c636bc90ca53 Brooks Davis 2026-06-21 15:48:33
gss_impl.c: Fix a nfsd hang when the kgssapi.ko is loaded, but no gssd
After the conversion to using netlink, the kgssapi had
no way of knowing if the gssd daemon was running.
As such, a boot where the kgssapi is loaded, but the
gssd is not enabled would hang the nfsd for a very
long time. (Many timeouts at 300sec each.)

This patch adds a Null RPC upcall with a 200msec
timeout to check to see if the gssd is running.
If the gssd is not running, the nfsd starts up
(without Kerberos support) with only a 200msec
delay.)

Also, move the svc_svc_nl_create() and svc_reg() calls in gssd.c
to before the daemon() call, so they are guaranteed to have
been done before the nfsd(8) daemon is started by
the rc scripts.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295714
Reviewed by:    glebius
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57455
455c354dd4dbba9b9ec9c68e335ab3aa46dca438 Rick Macklem 2026-06-21 23:15:23
Commit group #112: OFED
OFED: Use prandom_u32() to reduce diff with upstream

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
1a9ef1a3430036581b5a136091fc492bf2fa50ac John Baldwin 2026-01-20 20:42:55

OFED: Implement ib_process_cq_direct

This is largely pulled from the original Linux commit to add cq.c.
Note that irq_poll is still not supported, but polling should now be
possible whereas it wasn't really before.

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Obtained from:  Linux commit 14d3a3b2498edadec344cb11e60e66091f5daf63
Sponsored by:   Chelsio Communications
259a763e343d36a6030e0bba5ae7ed05c123c2fe John Baldwin 2025-12-05 20:56:35

OFED: Use vmalloc() and vzalloc() in various places

This contains changes from the following Linux commits:

10313cbb9220 IPoIB: Allocate priv->tx_ring with vmalloc()
b1404069f644 IPoIB/cm: Use vmalloc() to allocate rx_rings
948579cd8c6e RDMA: Use vzalloc() to replace vmalloc()+memset(0)

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
fbe76ea44c4b35ff1226b19c8e3913716686e4f4 John Baldwin 2026-05-28 15:52:03
IB/ipoib: Prevent hung task or softlockup processing multicast response
Tested by:    Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Obtained from:  Linux commit 3874397c0bdec3c21ce071711cd105165179b8eb
Sponsored by:   Chelsio Communications
49ee94b291b424caaafd456d52f0aa9da6ba168c John Baldwin 2026-05-28 15:50:58
RDMA: dma-mapping: use unsigned long for dma_attrs
Tested by:    Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Obtained from:  Linux commit 00085f1efa387a8ce100e3734920f7639c80caa3
Sponsored by:   Chelsio Communications
e4c4c6eeb2a29f7549d28e6ce51fc36125c08e68 John Baldwin 2026-05-28 15:51:30
kern: add a security knob to disable unprivileged access to kenv
We sometimes store sensitive things in the kenv that get zapped, but we
really shouldn't rely on that zapping to actually happen.  Most
unprivileged processes don't really need to read from the kernel
environment in the first place, so add a knob that allows it to be
disabled.

Note that we consider jailed root to be unprivileged from this
perspective; they have their own meta/env concepts and we should
encourage users to take advantage of those for passing information to
jails.

"Hey we should do something about that":      dch
Reviewed by:    imp, ziaee, zlei (all slightly previous version)
Differential Revision:  https://reviews.freebsd.org/D57697
4fd518fcb2bbee4c8c41215d6993b923ef57a0e5 Kyle Evans 2026-06-22 20:22:25
power: Make POWER_STYPE_COUNT equal to POWER_STYPE_UNKNOWN
This avoids having to list POWER_STYPE_COUNT, which is semantically not
an allowed value, in 'switch' statements along with POWER_STYPE_UNKNOWN.

No functional change (intended).

Reviewed by:    obiwac
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://github.com/OlCe2/freebsd-src/pull/8
f7eff1236d5fc0895c38dac4bb7f6b8d0eedbec3 Olivier Certner 2026-06-04 11:17:32
Commit group #113: sys: use curthread_pflags_set/restore to manage TDP_DEADLKTREAT for uio
sys: use curthread_pflags_set/restore to manage TDP_DEADLKTREAT for uio

For i386, remove now unused label.
Remove unneeded initialization of the 'save' local.

Reviewed bu:    brooks
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57726
4c419570024951ad1e477c8d6c3d9968199faf4a Konstantin Belousov 2026-06-21 18:48:06

uiomove_fault(): initialize save with ~0 when no flags are cleared

Reported by:    markj
Fixes:  https://cgit.freebsd.org/src/commit/?id=4c4195700249 ("sys: use curthread_pflags_set/restore to manage TDP_DEADLKTREAT for uio")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
3377f38cfe284a8490b49611614aae3a2bea78e4 Konstantin Belousov 2026-06-24 22:27:45
ktls: Make ktls_mbuf_crypto_state private and simplify
Sponsored by: Chelsio Communications
1a03b40a134318f26c93d85087de6a588b65f217 John Baldwin 2026-06-23 15:51:43
LinuxKPI: Retire <linux/dma-attrs.h>
Move the attribute constants to <linux/dma-mapping.h> to match
upstream.

Reviewed by:    bz, emaste
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D57749
0e0d46422657c5042fcb33729305d3fb60dd76b6 John Baldwin 2026-06-23 15:52:57
sched_ule: sched_priority(): More accurate __unused annotation
Change a '__unused' to '__diagused', which is more precise for that use.

No functional change.

MFC after:      1 week
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
83a6946595829407c80075f33e49329d1b621522 Olivier Certner 2026-06-15 21:07:00
sched_ule: sched_clock(): Remove a superfluous space
MFC after:      1 week
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
5f376d52f2c86fd19e3f774a02c4b0debeb3f2cf Olivier Certner 2026-06-16 16:11:58
linuxkpi ioctl handler: restore the user data pointer
instead of trying to hack around it with LINUX_IOCTL_MIN_PTR.  Since
linux file ioctl methods expect the user address in the data argument,
this should work for all ioctls, including the variable-length cases
like ibcore.

Only do it for the FreeBSD ABI, where we know how to reliably access the
original syscall arguments.

Reviewed by:    Ariel Ehrenberg <aehrenberg@nvidia.com>, markj
Discussed with: zishun.yi.dev@gmail.com
Sponsored by:   NVidia networking
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57612
91413e8e6311b4d4891dc2299d144feb31e04628 Konstantin Belousov 2026-06-16 22:12:01
vfs: rename vop_mmapped() to vop_update_atime()
This reflects the actual functionality of the VOP.  While there, add the
explicit struct timespec argument for the VOP allowing the caller to set
specific atime, not just request an update for it.

Requested by:   rmacklem
Reviewed by:    rmacklem
Discussed with: jah
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57681
8177936ac293210251390e44d109ece0f3868df9 Konstantin Belousov 2026-06-19 19:52:45
qat: driver updates to enhance qat infrastructure
- Updated QAT infrastructure FW version/AE mask/num_banks fields
  to facilitate integration of future QAT products.
- Exposed service as sym;asym instead of cy for gen4
- Enhanced cpaGetInstances() for accurate instance retrieval
- Added 57-bit virtual address support to lac_lock_free_stack
- Minor bug fixes and improvements

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

Reviewed by:    markj
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D57746
682f135f5de39cfc24cfd529ea8a161e94c76c8e Hareshx Sankar Raj 2026-06-24 15:08:16
p9fs: Remove the "cancel" transport method
Nothing calls it, and the existing virtio transport doesn't implement
it.  No functional change intended.

MFC after:      1 week
94989248641a17f5c2afc367df4845e4113779a1 Mark Johnston 2026-06-24 16:54:20
Commit group #114: OFED
OFED: Use _ib_modify_qp to implement ib_modify_qp

This was missed when merging in ib_modify_qp_with_udata() previously.

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Fixes:          https://cgit.freebsd.org/src/commit/?id=b633e08c705f ("ibcore: Kernel space update based on Linux 5.7-rc1.")
Sponsored by:   Chelsio Communications
eaf9f1aafa82b110a38fe3cb7cf4fa8b820e5bf4 John Baldwin 2026-06-24 19:30:55

OFED: Various changes from Linux 4.10

This contains changes from the following Linux commits:

850d8fd76507 IB/mlx4: Handle IPv4 header when demultiplexing MAD
a0b3455fcb2d IB/core: Remove debug prints after allocation failure
74226649f42d IB/ipoib: Remove and fix debug prints after allocation failure
870b28524552 IB/mthca: Remove debug prints after allocation failure
aa6aae38f7fb IB/core: Release allocated memory in cache setup failure
f73a1dbc45a5 infiniband: remove WARN that is not kernel bug
5f24410408fd rdma_cm: add rdma_consumer_reject_data helper function
5042a73d3e9d rdma_cm: add rdma_is_consumer_reject() helper function
d3f4aadd614c RDMA/core: Add the function ib_mtu_int_to_enum

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
38d9ce1f58ea6e2dc185fda0d9541a38d594ffc1 John Baldwin 2026-06-24 19:30:55

OFED: Various changes from Linux 4.11

This contains changes from the following Linux commits:

55efcfcd7776 RDMA/core: Fix incorrect structure packing for booleans
aaaca121c7cf RDMA/core: add port state cache
9e2c3f1c7f3e RDMA/core: export ib_get_cached_port_state
93b1f29de71f RDMA/cma: resolve to first active ib port
d43dbacfc063 IB/core: Change the type of an ib_dma_alloc_coherent() argument
6532c380bf40 IB/core: Remove ib_dma_*map_single_attrs()
0bbb3b7496ea IB/rxe, IB/rdmavt: Use dma_virt_ops instead of duplicating it
f57e8ca50e23 IB/mad: Add port_num to error message
828f6fa65ce7 IB/umem: Release pid in error and ODP flow
19b752a19dce IB/cma: Allow port reuse for rdma_id
21d6454a392d RDMA/core: create struct ib_port_cache
25bf14d6f589 IB/core: Add implicit MR flag
d9d0674c0f8a IB/umem: Indicate that process is being terminated
d07d1d70ce1a IB/umem: Update on demand page (ODP) support
a748d60df32e IB/mlx4: Take source GID by index from HW GID table
89052d784bc9 IB/cma: Add default RoCE TOS to CMA configfs
6df6b4a9ce43 IB/cma: Destination and source addr families must match

On FreeBSD, the default RoCE TOS setting is available as per-port
sysctls similar to the existing default RoCE mode sysctls.

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
8d57de34d51eeb70d758f2d463cf7cf2d829dd49 John Baldwin 2026-06-24 19:30:55

OFED: Various changes from Linux 4.12

Most of the changes involve renaming InfiBand address handles (AH) to
RDMA address handles including renaming various types and functions.
Address handles now also include type-specific fields and a set of
wrapper accessor functions for getting and setting fields.  For some
of the type and function renames, drivers in sys/dev had to be updated
directly (typically via sed).

This contains changes from the following Linux commits:

f039f44fc331 IB/core: Add support for draining IB_POLL_DIRECT completion queues
fedd9e1f7582 IB/cq: Don't process more than the given budget
403cd12e2cf7 IB/umem: Add contiguous ODP support
0008b84ea9af IB/umem: Add support to huge ODP
3e7e1193e28a IB: Replace ib_umem page_size by page_shift
cb8637660ae8 IB/SA: Move functions update_sm_ah() and ib_sa_event()
680562b56939 IB/SA: Remove unwanted braces
dbb6c91fd8e0 IB/SA: Add braces when using sizeof
f96a31871449 IB/SA: Fix lines longer than 80 columns
94d595c56077 IB/core: Add rdma_cap_opa_ah to expose opa address handles
ee1c60b1bff8 IB/SA: Modify SA to implicitly cache Class Port info
aa4656d9a429 IB/core: Move opa_class_port_info definition to header file
2196f2716292 IB/SA: Add support to query opa classport info.
64b4646eaf3d IB/core: Define 'opa' rdma_ah_attr type
44c58487d51a IB/core: Define 'ib' and 'roce' rdma_ah_attr types
d8966fcd4c25 IB/core: Use rdma_ah_attr accessor functions
2224c47ace23 IB/core: Add accessor functions for rdma_ah_attr fields
365231593409 IB/core: Rename ib_destroy_ah to rdma_destroy_ah
bfbfd661c9ea IB/core: Rename ib_query_ah to rdma_query_ah
67b985b6c755 IB/core: Rename ib_modify_ah to rdma_modify_ah
0a18cfe4f6d7 IB/core: Rename ib_create_ah to rdma_create_ah
766b7f6cf0c0 IB/mthca: Rename to_ib_ah_attr to to_rdma_ah_attr
38349389fece IB/mlx5: Rename to_ib_ah_attr to to_rdma_ah_attr
71d53ab47ee6 IB/mlx4: Rename to_ib_ah_attr to to_rdma_ah_attr
90898850ec4e IB/core: Rename struct ib_ah_attr to rdma_ah_attr
4ba66093bdc6 IB/core: Check for global flag when using ah_attr
cf0b9395d084 IB/core: Add braces when using sizeof
cfd519358f50 IB/IPoIB: Remove 'else' when the 'if' has a return.
82ffc226483c IB/CM: Add braces when using sizeof
dfa834e1d97e IB/SA: Introduce path record specific types
c2f8fc4ec440 IB/SA: Rename ib_sa_path_rec to sa_path_rec
9fdca4da4d8c IB/SA: Split struct sa_path_rec based on IB and ROCE specific fields
4c33bd1926cc IB/SA: Add support to query OPA path records
57520751445b IB/SA: Add OPA path record type
87f0faadc685 IB/SA: Add OPA addr header
eed7624552ca RDMA/mlx4: Fix MAD tunneling when SRIOV is enabled
f937d93a9122 RDMA/uverbs: Declare local function static and add brackets to sizeof
d3957b86a406 RDMA/SA: Fix kernel panic in CMA request handler flow

The IPoIB portions of ee1c60b1bff8 were already present in FreeBSD
from an earlier sync with OFED.  Likewise, the ib_uverbs_cmd.c
changes from 4ba66093bdc6 were also already present.

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
774a6620632ff621bd840c6945b705420efcd55d John Baldwin 2026-06-24 19:30:55

OFED: Various changes from Linux 4.13

This contains changes from the following Linux commits:

28b5b3a23ba6 RDMA/core: Document confusing code
5fff41e1f89d IB/core: Fix race condition in resolving IP to MAC
b1a89257f28e IB/umem: update to new mmu_notifier semantic

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
ba5c6caae735d9658d193eaac9243e3f6d556efe John Baldwin 2026-06-24 19:30:55

OFED: Various changes from Linux 4.14

This contains changes from the following Linux commits:

1cb2fc0db764 IB/mad: Change slid in RMPP recv from 16 to 32 bits
7e93e2cb835c IB/IPoIB: Increase local_lid to 32 bits
d541e45500bd IB/core: Convert ah_attr from OPA to IB when copying to user
6b3c0e6e6d5a IB/CM: Create appropriate path records when handling CM request
e92aa00a5189 IB/CM: Add OPA Path record support to CM
7db20ecd1d97 IB/core: Change wc.slid from 16 to 32 bits
db58540b021a IB/core: Change port_attr.sm_lid from 16 to 32 bits
582faf3150f5 IB/core: Change port_attr.lid size from 16 to 32 bits
ac3a949fb2ff IB/CM: Set appropriate slid and dlid when handling CM request
06f8174a9782 IB/core: Protect sysfs entry on ib_unregister_device
62ede7779904 Add OPA extended LID support
13c19222889d IB/rdmavt, hfi1, qib: Modify check_ah() to account for extended LIDs
d98bb7f7e6fa IB/hfi1: Determine 9B/16B L2 header type based on Address handle
dcc9881e6767 RDMA/(core, ulp): Convert register/unregister event handler to be void
f808c13fd373 lib/interval_tree: fast overlap detection

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
687057e712edbbc31e33613d99d9f8cc436cfa1f John Baldwin 2026-06-24 19:30:55

OFED: Various changes from Linux 4.15

This contains changes from the following Linux commits:

c0b64f58e8d4 RDMA/cma: Avoid triggering undefined behavior
c0348eb06968 IB: Let ib_core resolve destination mac address
5a3dc3237243 IB/cm: Fix memory corruption in handling CM request
fec99ededf6b RDMA/umem: Avoid partial declaration of non-static function
19b57c6c4499 IB/core: Convert OPA AH to IB for Extended LIDs only
e08ce2e82b2f RDMA/core: Make function rdma_copy_addr return void
4190b4e96954 RDMA/core: Rename kernel modify_cq to better describe its usage

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
85893a8399bce2dd66e8693037395e1979277967 John Baldwin 2026-06-24 19:30:55

OFED: Various changes from Linux 4.16

This contains changes from the following Linux commits:

c5c4e40e90b5 IB/CM: Change sgid to IB GID when handling CM request
54a6d63f14bd IB/mlx4: Potential buffer overflow in _mlx4_set_path()
56d0a7d9a0f0 IB/core: Depend on IPv6 stack to resolve link local address for RoCEv2
1060f8653414 IB/{core/cm}: Fix generating a return AH for RoCEE
981b5a2384b7 RDMA/cma: Introduce and use helper functions to init work
c42388053758 RDMA/cma: Avoid setting path record type twice
4367ec7fe2dd RDMA/cma: Simplify netdev check
151ed9d70097 IB/core: Refactor to avoid unnecessary check on GID lookup miss
b0dd0d335364 IB/core: Avoid unnecessary type cast
86937fcd6ed2 RDMA/core: Avoid redundant memcpy in rdma_addr_find_l2_eth_by_grh
1c43d5d308f0 IB/core: Avoid exporting module internal ib_find_gid_by_filter()
dbb12562f7c2 IB/{core, ipoib}: Simplify ib_find_gid to search only for IB link layer
f6bdb14267ba IB/{core, umad, cm}: Rename ib_init_ah_from_wc to ib_init_ah_attr_from_wc
4ad6a0245ec8 IB/{core, cm, cma, ipoib}: Rename ib_init_ah_from_path to ib_init_ah_attr_from_path
33f93e1ebcf5 IB/cm: Fix sleeping while spin lock is held
16c72e402867 IB/cm: Refactor to avoid setting path record software only fields
af808ece5ce9 IB/SA: Check dlid before SA agent queries for ClassPortInfo
8d20a1f0ecd5 RDMA/cma: Fix rdma_cm raw IB path setting for RoCE
fe75889f2794 RDMA/{cma, ucma}: Simplify and rename rdma_set_ib_paths
9327c7afdce3 RDMA/cma: Provide a function to set RoCE path record L2 parameters
89838118a515 RDMA/cma: Fix rdma_cm path querying for RoCE
cd2a6e7d384b IB/core: Fix ib_wc structure size to remain in 64 bytes boundary
f2290d6d522d IB/core: Attempt DMAC resolution for only RoCE
a6532e713966 RDMA/core: Clarify rdma_ah_find_type
246d8b184c10 IB/cq: Don't force IB_POLL_DIRECT poll context for ib_process_cq_direct
aaebd377c0e9 IB/core: postpone WR initialization during queue drain
15cbc5197693 RDMA/core: Simplify rdma_addr_get_sgid() to not support RoCE
7a2f64ee4a95 RDMA/ucma: Use rdma cm API to query GID
411460ac50b0 RDMA/cma: Introduce API to read GIDs for multiple transports
2493a57bc10f RDMA/cma: Refactor to access multiple fields of rdma_dev_addr
00db63c128dd RDMA/cma: Check existence of netdevice during port validation
925f7ea7a6ba RDMA/cm: Fix access to uninitialized variable
87daac68f77a IB/core: Map iWarp AH type to undefined in rdma_ah_find_type
87915bf82eea RDMA/verbs: Return proper error code for not supported system call
d3b9e8ad425c RDMA/core: Reduce poll batch for direct cq polling

Parts of 1060f8653414 were already merged into FreeBSD.  Cosmetic
changes made in rdma_addr_find_l2_eth_by_grh while merging this change
were just to reduce the diff with Linux to ease merging future
changes.

The merge of 56d0a7d9a0f0 differs slightly from the Linux commit as
FreeBSD was missing the original changes to check for link-local
addresses in ib_resolve_eth_dmac.

The merge of 2493a57bc10f is mostly a cosmetic change to reduce diffs
with upstream as local changes in FreeBSD passed the dev_addr as the
last argument instead of the dev_type and if_index already.

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
1d99feddd681da05dfa9091870403bc9ceb94550 John Baldwin 2026-06-24 19:30:56

OFED: Various changes from Linux 4.17

This contains changes from the following Linux commits:

a3b641af72ba RDMA/CM: move rdma_id_private to cma_priv.h
6612b4983f7e IB/core: Fix comments of GID query functions
b26c4a1138df IB/{core, ipoib}: Simplify ib_find_gid() for unused ndev
5ac08a341303 IB/cma: Use rdma_protocol_roce() and remove cma_protocol_roce_dev_port()
a9c06aeba997 IB/core: Remove rdma_resolve_ip_route() as exported symbol
a22af59ea9a5 IB/cm: Add and use a helper function to add cm_id's to the port list
cb12a8e2fa5f IB/cm: Introduce and use helper function to get cm_port from path
0a5141593567 IB/core: Refactor ib_init_ah_attr_from_path() for RoCE
e41a7c41947d IB/core: Move rdma_addr_find_l2_eth_by_grh to core_priv.h
98f1f4e0ed26 IB/core: Refer to RoCE port property instead of GID table property
114cc9c4b182 IB/cma: Resolve route only while receiving CM requests
9137108cc3d6 RDMA/rdma_cm: Fix use after free race with process_one_req
190fb9c4d130 IB/core: Refer to RoCE port property to decide building cache
22d24f75a193 IB/core: Search GID only for IB link layer
4ab7cb4bf362 IB/core: Refer to RoCE port property instead of GID table property
3401857ea347 IB/core: Generate GID change event regardless of RoCE GID table property
218b9e3eb8b5 RDMA/cma: Move rdma_cm_state to cma_priv.h
8435168d50e6 RDMA/ucma: Don't allow setting RDMA_OPTION_IB_PATH without an RDMA device
72e1ff0fb7e0 RDMA/core: Update query_gid documentation for HCA drivers
0e1f9b924471 RDMA/providers: Simplify query_gid callback of RoCE providers
598ff6bae689 IB/core: Refactor GID modify code for RoCE
f35faa4ba956 IB/core: Simplify ib_query_gid to always refer to cache
14169e333e71 IB/providers: Avoid zero GID check for RoCE
414448d249d8 RDMA: Use ib_gid_attr during GID modification
ee6548d1d98d RDMA/rdma_cm: Delete rdma_addr_client
44e75052bc2a RDMA/rdma_cm: Make rdma_addr_cancel into a fence
e19c0d237873 RDMA/rdma_cm: Remove process_req and timer sorting
a66ed149b0da IB/core: Don't allow default GID addition at non reseved slots
dc5640f294e4 IB/core: Fix deleting default GIDs when changing mac adddress
22c01ee4b8a8 IB/core: Fix to avoid deleting IPv6 look alike default GIDs
9aa169213d11 RDMA/cma: Do not query GID during QP state transition to RTR
aec05afe641b IB/core: Remove redundant return

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
75cde38e949345c9d63e400bd4707d6eec817941 John Baldwin 2026-06-24 19:30:56

OFED: Various changes from Linux 4.18

This contains changes from the following Linux commits:

e822ff213fe6 IB/cm: Store and restore ah_attr during CM message processing
0e225dcb7681 IB/cm: Store and restore ah_attr during LAP msg processing
a5c57d327272 IB/cm: Avoid AV ah_attr overwriting during LAP message handling
724631a9c6e9 IB/core: Introduce and use rdma_gid_table()
25e62655c793 IB/core: Reduce the places that use zgid
08bb558ac11a IB/core: Make testing MR flags for writability a static inline function

Commit 0e225dcb7681 was partially merged previously as
cm_init_av_for_lap() already existed in FreeBSD matching the version
from the Linux commit.

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
cd567a22e28a68aebf12cc320d83648b5b68c274 John Baldwin 2026-06-24 19:30:56

OFED: Malloc API cleanups from Linux 4.18

This contains changes from the following Linux commits:

acafe7e30216 treewide: Use struct_size() for kmalloc()-family
fad953ce0b22 treewide: Use array_size() in vzalloc()
6396bb221514 treewide: kzalloc() -> kcalloc()
6da2ec56059c treewide: kmalloc() -> kmalloc_array()

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
f08a98090229a7d13a8ff2e320696458f6b7c126 John Baldwin 2026-06-24 19:30:56

OFED: Various changes from Linux 4.19

Many of these changes deal with shifting from fetcing SGID attributes
via an index in drivers to including references to SGID attributes in
other structures passed to driver callbacks which can be used directly
avoiding the need for fetching attributes via lookup functions.  I had
to fixup the ROCE GID management code directly as the version in
FreeBSD is very different from Linux.

I also tweaked the change from commit
475c8de7bf2dc86d9806709a04e9c8f524d4ec32 to use a goto to reduce diffs
with upstream to minimize conflicts when merging upstream changes.

This contains changes from the following Linux commits:

a1a4caeebac9 IB/core: Do not set the gid type when reserving default entries
1c36cf912ad1 IB/core: Store default GID property per-table instead of per-entry
1dfce2945771 IB: Replace ib_query_gid/ib_get_cached_gid with rdma_query_gid
83f6f8d29dd3 IB/core: Make rdma_find_gid_by_filter support all protocols
c3d71b69a75c IB/core: Provide rdma_ versions of the gid cache API
77e786fcbe2e IB/core: Replace ib_query_gid with rdma_get_gid_attr
bf399c2cadfa IB/core: Introduce GID attribute get, put and hold APIs
f4df9a7c34d8 RDMA: Use GID from the ib_gid_attr during the add_gid() callback
b150c3862d21 IB/core: Introduce GID entry reference counts
47ec38666210 RDMA: Convert drivers to use sgid_attr instead of sgid_index
d97099fe53ed IB{cm, core}: Introduce and use ah_attr copy, move, replace APIs
947c99ecfcb4 IB/core: Tidy ib_resolve_eth_dmac
8d9ec9addd6c IB/core: Add a sgid_attr pointer to struct rdma_ah_attr
89af969a6653 RDMA: Convert drivers to use the AH's sgid_attr in post_wr paths
1a1f460ff151 RDMA: Hold the sgid_attr inside the struct ib_ah/qp
7492052a186b IB/mlx4: Use GID attribute from ah attribute
59d40813328f IB/core: Free GID table entry during GID deletion
881456789248 RDMA/cma: Consider net namespace while leaving multicast group
4ed13a5f2d60 IB/cm: Keep track of the sgid_attr that created the cm id
aa74f4878d61 IB: Make init_ah_attr_grh_fields set sgid_attr
f685c19529f0 IB: Make ib_init_ah_from_mcmember set sgid_attr
b7403217656d IB: Make ib_init_ah_attr_from_wc set sgid_attr
ea8c2d8f6014 RDMA/core: Remove unused ib cache functions
a8872d53e9b7 IB/cm: Use sgid_attr from the AV
398391071f25 IB/cm: Replace members of sa_path_rec with 'struct sgid_attr *'
815d456ef21a IB/cm: Pass the sgid_attr through various events
4eefd62c17a9 include/rdma/opa_addr.h: Fix an endianness issue
f8c2d2280cf6 RDMA/core: Remove set-but-not-used variables
28e39894ed4f RDMA/core: Remove ib_find_cached_gid() and ib_find_cached_gid_by_port()
07e7056aff6c IB/core: Simplify check for RoCE route resolve
40ddacf2dda9 RDMA/umem: Don't hold mmap_sem for too long
1215cb7c88ec RDMA/umem: Refactor exit paths in ib_umem_get
c012691508f5 IB/cm: Remove cma_multicast->igmp_joined
4b4671a0f269 IB/IPoIB: Simplify ib_post_(send|recv|srq_recv)() calls
1fec77bf8fcd RDMA/core: Simplify ib_post_(send|recv|srq_recv)() calls
bb039a870c05 IB/core: Allow ULPs to specify NULL as the third ib_post_(send|recv|srq_recv)() argument
643d213a9a03 RDMA/cma: Do not ignore net namespace for unbound cm_id
d274e45ce1ed RDMA/cma: Consider netdevice for RoCE ports
cee104334c98 IB/core: Introduce and use sgid_attr in CM requests
7150c3d5544b RDMA/core: Remove {create,destroy}_ah from mandatory verbs
854633165164 RDMA/core: Prefix _ib to IB/RoCE specific functions
7582df826734 RDMA/core: Avoid holding lock while initializing fields on stack
79d684f02647 RDMA/core: Simplify gid type check in cma_acquire_dev()
ca3a8ace2b12 RDMA/core: Return bool instead of int
05e0b86c413d RDMA/cma: Get rid of 1 bit boolean
e7ff98aefc9e RDMA/cma: Constify path record, ib_cm_event, listen_id pointers
2df7dba855e1 RDMA/core: Constify dst_addr argument
219d2e9dfda9 RDMA/cma: Simplify rdma_resolve_addr() error flow
26e551c5aec5 RDMA: Fix return code check in rdma_set_cq_moderation
58796e67d5d5 IB/ucm: Initialize sgid request GID attribute pointer
dd81b2c8a333 IB/core: Change filter function return type from int to bool
93065ac753e4 mm, oom: distinguish blockable mode for mmu notifiers
0d23ba6034b9 RDMA/ucma: check fd type in ucma_migrate_id()

Part of cee104334c98 was previously merged into FreeBSD.  Namely, SGID
index fields had been added to the two param structures instead and
roce_get_net_dev_by_cm_event was implemented using SGID indices.

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
6a75471dbcf0fb187cf7918ee1a918fd7c9d002d John Baldwin 2026-06-24 19:30:56

OFED: Various changes from Linux 4.20

This contains changes from the following Linux commits:

627212c9d49b RDMA/core: Replace open-coded variant of get_device
adee9f3f3bbb RDMA/core: Depend on device_add() to add device attributes
954a8e3aea87 RDMA/cma: Protect cma dev list with lock
722c7b2bfead RDMA/{cma, core}: Avoid callback on rdma_addr_cancel()
f9d08f1e1939 RDMA/core: Rate limit MAD error messages
e1f540c3ed0e RDMA/core: Define client_data_lock as rwlock instead of spinlock
2d65f49ff961 RDMA/core: Use simpler spin lock irq API from blocking context
4512acd0d34c RDMA/core: Remove context entries from list while unregistering device
f7b65d9bf2db RDMA/core: Use simplified list_for_each
93688ddbe1da RDMA/core: No need to protect kfree with spin lock and semaphore
50704e039ab1 RDMA/umem: Restore lockdep check while downgrading lock
eb93c82ed8c7 RDMA/core: Document QP @event_handler function
4269024639f6 RDMA/core: Document CM @event_handler function
77addc524473 RDMA/core: Rename rdma_copy_addr to rdma_copy_src_l2_addr
a362ea1d9e1a RDMA/core: Introduce and use rdma_set_src_addr() between IPv4 and IPv6
89c5691cdd95 RDMA/core: Let protocol specific function typecast sockaddr structure
caf1e3ae9fa6 RDMA/core Introduce and use rdma_find_ndev_for_src_ip_rcu
c31d4b2ddf07 RDMA/core: Protect against changing dst->dev during destination resolve
0e9d2c19bff1 RDMA/core: Consider net ns of gid attribute for RoCE
d6b1764a8c5a RDMA/core: Introduce rdma_read_gid_attr_ndev_rcu() to check GID attribute
6aaecd385685 RDMA/core: Simplify roce_resolve_route_from_path()
0965cc953a23 RDMA/core: Properly return the error code of rdma_set_src_addr_rcu
d4b4dd1b9706 RDMA/umem: Do not use current->tgid to track the mm_struct
c9990ab39b6e RDMA/umem: Move all the ODP related stuff out of ucontext and into per_mm
597ecc5a0954 RDMA/umem: Get rid of struct ib_umem.odp_data
41b4deeaa123 RDMA/umem: Make ib_umem_odp into a sub structure of ib_umem
b5231b019d76 RDMA/umem: Use ib_umem_odp in all function signatures connected to ODP
56ac9dd9177c RDMA/umem: Avoid synchronize_srcu in the ODP MR destruction path
be7a57b41ad8 RDMA/umem: Handle a half-complete start/end sequence
ca748c39ea3f RDMA/umem: Get rid of per_mm->notifier_count
f27a0d50a4bc RDMA/umem: Use umem->owning_mm inside ODP

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
4726b80d9379cdefd00ae77d0b91973bde573790 John Baldwin 2026-06-24 19:30:56

OFED: A few channges from Linux 5.0

The main point of these changes is the last commit adding a couple of
helper functions used in ROCE drivers.

This contains changes from the following Linux commits:

a70c07397fd8 RDMA: Introduce and use GID attr helper to read RoCE L2 fields
8f9748602491 IB/cm: Reduce dependency on gid attribute ndev check
adb4a57a7a1d RDMA/cma: Use rdma_read_gid_attr_ndev_rcu to access netdev
b4fb4cc5ba83 RDMA/cma: Fix unbalanced cm_id reference count during address resolve
d5665a21250e RDMA/core: Add hash functions to calculate RoCEv2 flowlabel and UDP source port

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Sponsored by:   Chelsio Communications
45c0d87c57298599397204179c2c4fa0f580a5d9 John Baldwin 2026-06-24 19:30:56

OFED: Calculate UDP source port based on flow label or lqpn/rqpn

Calculate and set UDP source port based on the flow label. If flow label
is not defined in GRH then calculate it based on lqpn/rqpn.

Tested by:      Wafa Hamzah <wafah@nvidia.com> (mlx5_ib)
Tested by:      John Baldwin <jhb@FreeBSD.org> (iw_cxgbe)
Obtained from:  Linux commit 18451db82ef7f943c60a7fce685f16172bda5106
Sponsored by:   Chelsio Communications
b6354f04081823cc0ccf2af573a59a826d7763c8 John Baldwin 2026-06-24 19:30:56
cpufreq: Fix the incorrect format
Event:          Halifax Hackathon 202606
Location:       jrm@'s dining room
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57275
35255280e51ca8f7a8f350b944aa6ffe42a7e5b5 ShengYi Hung 2026-06-25 01:13:17
kern: osd: abstract away the math for locating a slot method
It's relatively simple, but we'll do it a couple of times; pull it
out into a macro.

Reviewed by:    imp (previous version), jamie
Differential Revision:  https://reviews.freebsd.org/D48074
72ebcfae48c42cb28ab6142980416082f8d70abc Kyle Evans 2026-06-25 03:08:05
kern: osd: trash a slot's methods upon deregistration
This both lets us quickly identify a slot that's been deallocated while
debugging, and forces us to take a fault if something tries to call one
of the methods anyways somehow with osd_destructors[slot - 1] == NULL.

Reviewed by:    imp, jamie
Differential Revision:  https://reviews.freebsd.org/D48075
4ffa7e126ed0081b804bda6fb71a60acf49dabda Kyle Evans 2026-06-25 03:08:05
jail: clean up locking around do_jail_attach
jail_attach_jd passed PD_DEREF to do_jail_attach, assuming it would take
care of freeing the held prison. This is not true, as do_jail_attach
immediately cleared that flag, leaving the jail stock in dying state
when it is later removed.

Reported by:    markj
Reviewed by:    markj
MFC after:      3 days
Differential Revision:  <https://reviews.freebsd.org/D57674>
3584cde63e416d150214192721cead4b735ca0b5 Jamie Gritton 2026-06-25 03:21:18
sched_ule: Fix off by one in preempt_thresh definition
Since 'preempt_thresh' is set to PRI_MIN_KERN by default, and comparison
of the considered thread's priority with that threshold is done with
'<=', PRI_MIN_KERN threads actually can preempt other threads, contrary
to other non-interrupt kernel ones (between PRI_MIN_KERN + 1 and
PRI_MAX_KERN).

So, replace the comparison operator '<=' by '<'.  The alternative would
be to change the default value, but changing the comparison instead has
the benefit to be consistent with the 0 setting (which forbids
preemption entirely), since allowing only threads with priority 0 to
preempt becomes possible.

Consequently, we also change the default value for the FULL_PREEMPTION
option by adding 1 to PRI_MAX_IDLE (in practice, that does not make any
difference in the current setting, since no preemption will happen if
the new priority value is not strictly lower than the current one, and
PRI_MAX_IDLE is PRI_MAX, the highest possible priority).

Reviewed by:    markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=ae7a6b38d53f ("ULE 3.0:  Fine grain scheduler locking and affinity improvements. (...)")
MFC after:      2 weeks
Event:          Halifax Hackathon 202606
Location:       jrm@'s dining room
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57828
961f4814286820f242d8d5407b9fd7238e896936 Olivier Certner 2026-06-19 01:51:32
sys/systm.h: use __nodiscard consistently and correctly
__nodiscard is closer to (and sometimes expands to) [[nodiscard]] from
C23 and C++17 so prefer it to the homegrown __result_use_check and put
it in the right place so it is correct when expanded to [[nodiscard]].

Reviewed by:    markj, emaste
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D57882
b207b1562a2f099b4e763460891fa6761549091a Brooks Davis 2026-06-26 16:42:06
files: riscv, arm64: Remove redundant 'ofw_cpu.c'
Should have been removed when that line was moved from 'files.arm' to
'files'.

Fixes:          https://cgit.freebsd.org/src/commit/?id=14e1a2cd295d ("Move ofw_cpu file to the main files conf file.")
MFC after:      2 weeks
Event:          Halifax Hackathon 202606
Location:       Seat 36K in AC667, over Maine near Canadian border
Sponsored by:   The FreeBSD Foundation
10213f01773f22ab948ec1e87c880b1d19a1fc45 Olivier Certner 2026-06-26 21:23:57
VOP_VPUT_PAIR(): handle the case when dvp == vp
Reviewed by:  jah, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57824
be9295deedd1e837ee3645583d07e1dffbe1ead0 Konstantin Belousov 2026-06-24 18:21:49
CHERI: declare copy{in,out}ptr{,_nofault}
These provenance-preserving functions are to be used when copying
objects that are expected to contain pointers.  Data buffers which do
not contain pointers should be copied by the traditional copyin/copyout
functions which *do not* preserve pointer provenance (on CHERI they
clear validity tags).

NOTE: Going forward, this requires changes when adding new syscalls or
ioctl that take pointers to objects containing pointers.  Fortunately,
the vast majority (>90%) of copyin and copyout statements do not copy
pointers and require no change.  Failure to make the chance will have no
effect on non-CHERI architectures.

Reviewed by:    kib, markj
Effort:         CHERI upstreaming
Sponsored by:   DARPA, AFRL, Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57663
b517edb8deed23b8c616f0ad4453e4dee7b0ac0f Brooks Davis 2026-06-29 12:58:52
Commit group #115: CHERI: declare fueptr and suptr
CHERI: declare fueptr and suptr

These should replace fueword and suword when manipulating pointers in
memory.  On CHERI targets they will be implemented using capability
aware instructions and otherwise they are defined to fueword and suword.

Reviewed by:    kib, markj
Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57664
a1c52e05f571607db361f49993b36b0288f1d8f3 Brooks Davis 2026-06-29 12:59:44
witness: harden tunables for large settings
Harden witness against reasonable tunable settings causing boot panics
or scribblers.  For now, don't bother to harden this completely.  Panics
are still achievable by setting the tunables to negative or very large
values.

The recent change to respect the setting of debug.witness.witness_count
(08180f1b613b) exposed that there are no guard rails on that setting,
setting it to large but plausible values can cause integer overflow or
cause attempted use of memory beyond what is actually available.  Add
some guard rails, fall back to default configuration if the tuned values
are too large, and fall back to a minimum memory allocation if even the
defaults are too large.  Also don't allow witness to use over half of
the memory segment, as there are other early allocators after witness
too.

Reported by:    asomers
Reviewed by:    kib, markj (previous version)
Fixes:  https://cgit.freebsd.org/src/commit/?id=08180f1b613b ("witness: actually set read-only tunables in time for witness_startup")
Sponsored by:   Dell Inc.
Differential Revision:  https://reviews.freebsd.org/D57793
2407abc9fb3b45d6d734d564706c76aa793b102a Ryan Libby 2026-06-29 16:54:30
device_pager: Avoid double-insertion of pages into the pager list
Unmanaged device pager objects maintain a linked list of pages that were
returned from the fault handler.  Initially, such pages are valid, but
msync(MS_INVALIDATE) can mark them invalid (and clean).  They are not
removed from page tables (since they are unmanaged), but a subsequent
mlock() call can trigger a page fault that is handled by the pager.
dev_pager_getpages() then re-inserts the page into the linked list even
though it's already present there.

This patch fixes the problem by removing the linked list.  OBJ_PG_DTOR
is set, so vm_object_terminate_pages() does nothing, and
dev_pager_dealloc() instead handles cleanup of the object.

Add a regression test case which triggers a queue.h assertion failure in
unpatched kernels.

Note, in stable branches we should avoid changing the layout of struct
vm_object.

Approved by:    so
Security:       FreeBSD-SA-26:37.vm
Security:       CVE-2026-49418
Reported by:    slidybat
Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57743
97a064125e8a0326159dcc35e9c522c049eb3b95 Mark Johnston 2026-06-22 14:40:22
unlinkat: Pass flags down to the work functions
The unlinkat(2) and funlinkat(2) system calls were ignoring
AT_RESOLVE_BENEATH.

Also pass pathseg through instead of assuming it's UIO_USERSPACE.

Add some tests which make sure that AT_RESOLVE_BENEATH is handled
properly by various system calls.

Approved by:    so
Security:       FreeBSD-SA-26:42.unlinkat
Security:       CVE-2026-49421
Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57790
8b24b19d08f9dc10e6af9a1695b9b0d62fb80cc2 Mark Johnston 2026-06-23 20:43:53
Commit group #116: posixshm
posixshm: Disallow fspacectl() on largepage objects

As with truncation, the operation isn't supported, but nothing prevented
it.

Add a regression test.

Approved by:    so
Security:       FreeBSD-SA-26:44.posixshm
Security:       CVE-2026-49428
Reported by:    Chris Jarrett-Davies <chrisjd@openai.com>
Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57830
713747f87c85e9b961e460cb9a496c094a6aa375 Mark Johnston 2026-06-24 19:56:07

posixshm: Disallow truncation of largepage objects

We correctly handled ftruncate(), but not open(O_TRUNC).

Add a regression test.

Approved by:    so
Security:       FreeBSD-SA-26:44.posixshm
Security:       CVE-2026-49428
Reported by:    Chris Jarrett-Davies <chrisjd@openai.com>
Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57831
1491dec424e72a2f429d84d11b0d248abc6c6cda Mark Johnston 2026-06-23 22:47:02

posixshm: Fix handling of sendfile() with largepage objects

sendfile(2) can transmit POSIX shared memory objects.  Typically it will
look up and wire each page before sending it to a socket; once
transmission is complete, the page is unwired and typically released
back into the page queues.  sendfile() has an advisory flag, SF_NOCACHE,
which means, "try to free the page once transmission is complete."  This
is implemented in vm_page_release(), which expects to operate on managed
pages.

Pages belonging a largepage object are de-facto wired not explicitly so.
Thus, vm_page_release() will unwire and, having found no additional
references, free the page.  Because mappings of largepage objects are
unmanaged, userspace can still access the now freed page.

Fix the problem by explicitly wiring largepage pages.  Make the VM
object destructor responsible for unwiring and freeing them.

Add a regression test.

Approved by:    so
Security:       FreeBSD-SA-26:44.posixshm
Security:       CVE-2026-49427
Reported by:    Chris Jarrett-Davies <chrisjd@openai.com>
Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57832
1bad1d8c14cdff127d97accd49b0e6da22501b99 Mark Johnston 2026-06-24 19:57:00
kern: fix auditing of ptrace(2) syscall requests
`error` here is the return value of syscall_thread_enter() rather than
the syscall itself, so the committed audit records do not reflect
reality.  This is less harmful than them recording an error when the
operation actually succeeded, but it could still possibly be used to
throw off IDS techniques with things like bsmtrace.

Approved by:    so
Security:       FreeBSD-SA-26:45.audit
Security:       CVE-2026-49426
Reviewed by:    des, kib, markj, csjp
Differential Revision:  https://reviews.freebsd.org/D57847
bcbbee810fc9733da27b31b23baeaa2e1af53232 Kyle Evans 2026-06-25 17:02:47
ktls CBC decrypt: Only increment iovec index when an entry is used
If an mbuf in the chain was skipped because it only contained bytes
from the header, the iovec index ('i') was incremented even though the
entry was not populated.  Only increment 'i' when an iovec entry is
consumed.

Add a new type of KTLS receive test which writes a single TLS record
via two separate write(2) calls over a TCP_NODELAY socket to trigger
a split in the mbuf chain in the kernel.  Test various split locations
including after the "plain" TLS header (5 bytes), after the full TLS
header, in the middle of the data payload, just before the start of
the trailer, and in the middle of the trailer.  These tests are also
run against all supported ciphers, not just CBC.  The 'header' test
for CBC ciphersuites was able to trigger the bug.

Approved by:    so
Security:       FreeBSD-SA-26:46.ktls
Security:       CVE-2026-49423
Sponsored by:   Chelsio Communications
ba4c8cc6e810fc64e53d6ca539649932016ed1f7 John Baldwin 2026-06-24 01:14:11
ktls CBC decrypt: Avoid creating zero length iovec entries
If an mbuf's length in the chain for an encrypted TLS record exactly
matches the remaining length of header bytes to skip, skip the mbuf
entirely rather than adding a zero-length iovec entry.

Sponsored by:   Chelsio Communications
1756d1cab3ce28085eec94a45c557e1af265ccd0 John Baldwin 2026-06-30 18:11:29
kern: syscall_thread_enter() cannot fail
Attempting to handle the error gracefully can easily result in missing
SIGSYS, so this was made to always succeed in
39024a89146 ("syscalls: fix missing SIGSYS for several ENOSYS errors")
and returns the nosys entry on failure.

Drop the pretense of returning an error and clean up a few dead error
paths.

Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D57848
eca26803d880060555393ab89b44b967cd467a0e Kyle Evans 2026-06-30 19:12:10

Build system

src.opts.mk: !CROSS_COMPILER implies !LLVM_BINUTILS_BOOTSTRAP
This fixes the build when WITHOUT_CROSS_COMPILER is set.

Reported by: fuz, vishwin
Fixes: https://cgit.freebsd.org/src/commit/?id=17494c6e6b7d ("build: Boostrap LLVM_BINUTILS for cross-tools")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56219
7d82731e4311880845b0109484df6562ab0cd213 Ed Maste 2026-04-01 18:27:05
release: Restore licenses for kyua and ncurses
These were modified to avoid triggering a libucl bug which is now fixed.

MFC after:      1 week
Reviewed by:    ivy, kevans
Differential Revision:  https://reviews.freebsd.org/D52824
d7259292ae0b9c2aef4bdc1b8bd62674c38f7ad4 Dag-Erling Smørgrav 2026-04-02 21:42:10
libsamplerate: Only build when virtual_oss is built
Gate libsamplerate behind MK_CUSE and MK_SOUND, like virtual_oss.
Nothing else uses this library, so there's no point building it
if we aren't building virtual_oss.

This avoids building a useless FreeBSD-sound package containing
only this library when WITHOUT_SOUND is set.

MFC after:      1 week
Reviewed by:    christos, emaste
Differential Revision:  https://reviews.freebsd.org/D56164
Sponsored by:           https://www.patreon.com/bsdivy
baa7a870d65db324d4dd781702e7ccefde20a3ee Lexi Winter 2026-04-03 13:42:20
libauditd: Don't build if WITHOUT_AUDIT is set
When WITHOUT_AUDIT is set, nothing is built that uses this library,
so don't build the library.  This avoids building the FreeBSD-audit
package when WITHOUT_AUDIT is set.

MFC after:      never
Reviewed by:    csjp, imp, emaste
Differential Revision:  https://reviews.freebsd.org/D56157
Sponsored by:           https://www.patreon.com/bsdivy
b13d7062b3a65ba600745fef6a2b4058444e5f6c Lexi Winter 2026-04-03 13:43:18
Remove WITHOUT_BZIP2, WITHOUT_BZIP2_SUPPORT
WITHOUT_BZIP2_SUPPORT only affects a single binary, gzip(1); it doesn't
remove bzip2 support from other bits (e.g., libarchive) and there are
no similar options for gzip, xz or zstd.

WITHOUT_BZIP2 has not done anything at all since it was first added
in 2007.

MFC after:      never
Discussed on:   arch@
Reviewed by:    imp, des, adrian, delphij, emaste
Differential Revision:  https://reviews.freebsd.org/D56148
Sponsored by:           https://www.patreon.com/bsdivy
ab9257599a551cf4be8738ec52205998f4e7dd81 Lexi Winter 2026-04-03 13:50:09
packages: Fix build with libucl 0.9.3
In libucl 0.9.3, macros and includes are disabled by default when
creating a new UCL parser.  This breaks the package build, which
relies on includes.  Fix this by explicitly passing zero flags
to ucl.parser().

MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=abda442d92fd ("contrib/libucl:  Import libucl 0.9.3")
Reviewed by:    kevans, bapt
Reported by:    freebsd@walstatt-de.de
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56266
63d0e3e3aa2483420f828686336d6615616363d5 Lexi Winter 2026-04-06 17:11:22
We also get _HOST_OSREL from host-target.mk
b2751d956e5b32507bb63aff2db3e5d6b3b38ad1 Simon J. Gerraty 2026-04-06 18:50:11
Commit group #117: flua: Always build as a bootstrap tool
flua: Always build as a bootstrap tool

We want to use flua from the source tree (not the host) during package
build, firstly to protect us from breaking changes in lua or libucl,
and secondly to allow (in future) cross-building of packages from
Linux or macOS.

Since we don't know if the user will be building packages during the
bootstrap phase, and because flua is fairly small and generally useful,
build it as a bootstrap tool unconditionally.

MFC after:      2 weeks
Reviewed by:    kevans, emaste
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56270
50de0bf50512aa98d18f21ac1347941396596944 Lexi Winter 2026-04-07 10:41:53

tools/build/Makefile: Always add md4.h to SYSINCS

Since libmd was added to the bootstrap, building main on stable/14
fails because of an incompatibility in its old md4.h.  Fix this by
always including md4.h in the bootstrap headers, instead of only
doing so when building on a non-FreeBSD host.

Fixes:          https://cgit.freebsd.org/src/commit/?id=50de0bf50512 ("flua: Always build as a bootstrap tool")
Reported by:    olce
Reviewed by:    olce, kevans
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56327
0dd9c4abf0e56b9d4f6f7204a68b1475f2bbf1fc Lexi Winter 2026-04-09 14:30:20
packages: Always use the bootstrap flua
To avoid breaking the build due to incompatible changes in flua or lua
libraries on the host, use the bootstrap flua for the package build.

MFC after:      2 weeks
Reviewed by:    kevans, emaste
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56271
359d6e31afe3d28addedf9a8f550b382a5faa478 Lexi Winter 2026-04-07 10:42:44
libc: Add missing MLINK for stravis(3)
MFC after:    1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=8dfeba04eb36 ("Update to a June 8th snapshot of (un)vis form NetBSD.")
Reviewed by:    ziaee
Differential Revision:  https://reviews.freebsd.org/D56260
a09d06bc5bff64baab76220a66c3501b89899134 Dag-Erling Smørgrav 2026-04-07 11:04:37
lib/msun: centralize addition of the arch-specific symbol map files
This also adds the aarch64 symbols, exporting them.

Reported and tested by: fluffy
Reviewed by:    emaste
Fixes:  https://cgit.freebsd.org/src/commit/?id=3a01e1e1a50cb9a9594aac2148dc920a6b295428
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56283
c913dce86e7b6ff9c0c3265631529586aaf8520a Konstantin Belousov 2026-04-06 17:46:45
crypto/openssl: add new manpage from release 3.5.6
MFC after:      1 day (the security issues warrant a quick backport).
MFC with:       10a428653ee7216475f1ddce3fb4cbf1200319f8
9f7080ba6bcf18d013ae3b91dc9d92cfa731a8c0 Enji Cooper 2026-04-09 02:00:10
nlsysevent: add manpage
Reviewed by:  des
72d701eb1d83cfb3479e4c839412325ff9efc97c Baptiste Daroussin 2026-04-09 08:50:41
[OpenSSL] Add missing header file (openssl/ml_kem.h)
Add missing header file (openssl/ml_kem.h) of OpenSSL 3.5

Reviewed by:    fluffy, ngie
Approved by:    ngie (maintainer)
Differential Revision:  https://reviews.freebsd.org/D56291
98118af4f08a020c8c5925e933bdd523d6a6e8aa Po-Chuan Hsieh 2026-04-12 18:07:14
geneve.4: Add geneve manual
Reviewed by: ziaee, adrian
Differential Revision: https://reviews.freebsd.org/D55182
adecd4c4cd05b404ff81dbfce88b772e2b754a7f Pouria Mousavizadeh Tehrani 2026-04-11 18:51:58
release: remove Oracle Cloud Infrastructure build targets
Oracle's previous support is no longer available to the project.
Repeated attempts to find a sponsor within Oracle's cloud business
have not been successful.

The last published official images are from 15.0-RELEASE.

https://marketplace.oracle.com/app/freebsd-release

Relnotes:       yes
Sponsored by:   SkunkWerks, GmbH
Differential Revision:  https://reviews.freebsd.org/D56360
MFC after:      3 days
3b108068121ba30fb3dbed569d6757da2ab529a4 Dave Cottlehuber 2026-04-12 22:29:44
pkgbase: remove incorrect clang shlib requires
The FreeBSD-clang package contains a 32-bit shared object at
/usr/lib/clang/19/lib/freebsd/libclang_rt.asan-i386.so

This is expected, since clang uses this object when compiling for i386
targets with asan enabled.

What is not expected is that the FreeBSD-clang package currently depends
on 32-bit libc packages due to pkg's shared library analysis, making it
impossible to install pkgbase on x86_64 without any lib32 packages.

This commit leverages a new pkg feature implemented in [1], but could
be landed before a pkg version including that feature is released
without any ill effects. Unknown keys in package manifests are ignored.

[1]: https://github.com/freebsd/pkg/pull/2594

Reviewed by:    ivy
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54792
2018ae4e3b6a2d7c147933cb36642f6a54830907 Isaac Freund 2026-01-20 14:57:17
pkgbase: only provide shlibs from /lib,/usr/lib,/usr/lib32
Reviewed by:  bapt
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54793
e11eba76cfbd6b439ad40faeb8ffccf4241e7034 Isaac Freund 2026-01-20 14:57:11
rockchip: support CM3588 board
Signed-off-by: Martin Filla <freebsd@sysctl.cz>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2086
aa462efde6dc009eed0e09272b5359950193b0be Martin Filla 2026-03-16 14:35:06
br.lenovo.kdb: add it to Makefile
This keyboard was implemented but wasn't actually installed to the
system.

Fixes: https://cgit.freebsd.org/src/commit/?id=9357c694e8dca627c25b15529e8435b2ab3dd48b
MFC after: 1 day
Relnotes: yes
6fb5df548e4a581f958f60544b7fa8ba1716c4c6 Alfredo Dal'Ava Junior 2026-04-17 03:44:46
us.intl.acc.kbd: add it to Makefile
This keyboard was implemented but wasn't actually installed to the
system.

Fixes: https://cgit.freebsd.org/src/commit/?id=a049678039e40bdf523230852f78887a12435def
Discussed with: imp
MFC after: 1 day
Relnotes: yes
3b373d484046a94d050a7901feadc001f35fa97f Alfredo Dal'Ava Junior 2026-04-17 05:01:54
bnxt_en: fix module Makefile for LinuxKPI
Rather than manually including the include directory for LinuxKPI
use the provided macro.  Before there was no -I for the dummy
directory and as files synced from Linux under a permissive license
may include them the build would fail.  overflow.h will include
linux/const.h which only exists as a dummy header at this point
on FreeBSD.

Sponsored by:   The FreeBSD Foundation
Fixes:          https://cgit.freebsd.org/src/commit/?id=35b53f8c989f6
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D56424
f5cd992fa902ebb27a3a1042ee8e0d4d351bb361 Bjoern A. Zeeb 2026-04-16 10:05:51
rtw88: update module Makefile for v7.0 driver version
Update LINUXKPI_VERSION to reflect that the driver is based on
Linux v7.0.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
90383181aae908d2c696f8d66c19645011b4c388 Bjoern A. Zeeb 2026-04-18 13:40:21
boot1.chrp: Specify --image-base
This is required for LLVM 22's ld.lld to avoid a build error:

ld.lld: error: section '.text' address (0x38000) is smaller than image base (0x10000000); specify --image-base
ld.lld: error: section '.rodata' address (0x3b308) is smaller than image base (0x10000000); specify --image-base
ld.lld: error: section '.data' address (0x3b610) is smaller than image base (0x10000000); specify --image-base
ld.lld: error: section '.bss' address (0x3f618) is smaller than image base (0x10000000); specify --image-base

Use 0x38000 for the image base, which is the address of the lowest
(and only) LOAD segment in the file.

Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56459
aa0bc7cca153f67f8becec8a8fb259ff5fd30fd0 Lexi Winter 2026-04-18 20:07:40
iwlwifi: update module Makefile for v7.0 driver version
Add the new file for nan in the mld subdriver.

Update LINUXKPI_VERSION to reflect that the driver is based on
Linux v7.0.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
9ed3331fb5822b93313edae42cc529eb25e1a6cc Bjoern A. Zeeb 2026-04-18 20:37:11
rtw89: update module Makefile for v7.0 driver version
Update LINUXKPI_VERSION to reflect that the driver is based on
Linux v7.0.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
3780e6f9db01cc4f7d53d67ed1fc992a8f64c53f Bjoern A. Zeeb 2026-04-18 20:50:30
mt76: update module Makefile for v7.0 driver version
Update LINUXKPI_VERSION to reflect that the driver is based on
Linux v7.0.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
1c50cb1d75625bea2ba928697ea1cbafa29dd245 Bjoern A. Zeeb 2026-04-18 21:02:57
athk_common / ath10k: update module Makefiles for v7.0 driver version
Update LINUXKPI_VERSION to reflect that the driver is based on
Linux v7.0.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
4546eb0c27f22236be8179616e1f0a3e88ddfbbe Bjoern A. Zeeb 2026-04-19 15:12:15
brcm80211: update module Makefiles for v7.0 driver version
Update LINUXKPI_VERSION to reflect that the driver is based on
Linux v7.0.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
634a48f3673ff8af9848846a6bff1a8c068d205d Bjoern A. Zeeb 2026-04-19 15:17:29
ath11k: update module Makefiles for v7.0 driver version
Update LINUXKPI_VERSION to reflect that the driver is based on
Linux v7.0.

Add optional support for the new cfr (channel frequency response)
file/option.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
20cf11812ac722852322f2f2994698d7a5fa8dc6 Bjoern A. Zeeb 2026-04-19 15:28:50
ath12k: update module Makefiles for v7.0 driver version
Update LINUXKPI_VERSION to reflect that the driver is based on
Linux v7.0.

Handle the file changes and the extra wifi7/ subdirectory.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
5cfadb6633128dccc32b1e4f84386ad705adc721 Bjoern A. Zeeb 2026-04-19 15:48:58
src.opts.mk: Sort options
Sort the options in each of the sections alphabetically.

Sponsored by:           Netflix
3d2fd7178663fa5314f6e90bb041c3bfb3b1bbaf Warner Losh 2026-04-21 15:23:20
makeman.lua: catch up to REQUIRED_OPTIONS change
161f8edc651c7 ("bsd.mkopt.mk: Prepare a list of all build options")
restructured things and now we should simply strip the leading double
underbar.  This fixes the oddity noticed in
4ed20e0236dd0 ("kshim/usb: Add build option."), where WITH_CASPER made
a surprise appearance.

This is a part of D56558, but not the meat of the change.

Reviewed by:    emaste, imp
8bbba9f681ecccc6f6adcdb820c28df71f028e37 Kyle Evans 2026-04-22 02:29:07
Commit group #118: pkgconf: import into the base system
pkgconf: import into the base system

This introduces the following option:

* MK_PKGCONF: determines if pkgconf and bomtool should be built

The objective is to allow the creation of SBOM information while
building FreeBSD's src tree. The build system cannot rely on the
presence of bomtool (and eventually also spdxtool) in the build
environment, except for having it as part of the src tree directly.

The framework implementing the generation of SBOM files is under review
in D56474.

This will also help simplifying the build, with the introduction of
another framework relying on the availability of pkgconf.

Sponsored by:           Alpha-Omega, The FreeBSD Foundation
Reviewed by:            bapt, philip
Approved by:            philip (mentor)
Differential Revision:  https://reviews.freebsd.org/D56404
b8352da33f3434f0ba6093df361261d1b1f973a1 Pierre Pronchery 2026-04-08 16:52:29

packages: Register pkgconf

This should fix the creation of the new packages introduced by the
import of pkgconf into the base system.

Fixes:          https://cgit.freebsd.org/src/commit/?id=b8352da33f34 ("pkgconf: import into the base system")
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294724
Reviewed by:    ivy, ngie
Approved by:    ngie
Sponsored by:   The FreeBSD Foundation
Differential revision:  https://reviews.freebsd.org/D56589
c875afcbcdf70e61826f3461aa77008f9f08ae75 Pierre Pronchery 2026-04-22 20:59:55

libpkgconf: Fix paths

${LOCALBASE:U} evaluates to exactly the same thing as ${LOCALBASE}.
Presumably what was meant was ${LOCALBASE:U/usr/local}.

Fixes:          https://cgit.freebsd.org/src/commit/?id=b8352da33f34 ("pkgconf: import into the base system")
Reviewed by:    khorben
Differential Revision:  https://reviews.freebsd.org/D56642
4dd97955e68df02b26d59e4e7c9a8167947a5164 Dag-Erling Smørgrav 2026-04-26 13:41:47

depends-cleanup: Fix typos in comment

Fixes:          https://cgit.freebsd.org/src/commit/?id=4dd97955e68d ("libpkgconf: Fix paths")
1abfe75860d586b4aec3a6894f500281d5c63045 Dag-Erling Smørgrav 2026-04-26 18:14:03
tests/sys/arch/aarch64: set TESTSDIR so Kyuafile is installed correctly
Fixes:                https://cgit.freebsd.org/src/commit/?id=0ddaa4c86d68 ("arm64: Add arm64 SVE tests")
Sponsored by:   The FreeBSD Foundation
81abe47cd5cd0e15813fc53b18a6cd744ceefa9e Li-Wen Hsu 2026-04-22 20:15:01
OpenSSL: move `-DOPENSSL_PIC` from `PIC_FLAG` to `SHARED_CFLAGS`
`PIC_FLAG` should be used strictly for `-fPIC`, `-fpic`, etc, options.
`SHARED_CFLAGS` is the more appropriate place to this flag to be set.

Requested by:   jrtc27
MFC after:      3 days
MFC with:       3797fe720a
48d6db4932c8ec04ca3df79119803f8c7c1570d7 Enji Cooper 2026-04-21 23:46:19
Remove `/usr/share/examples/oci` when MK_EXAMPLES == no
MFC after:    1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=d03c82c28da86 ("release: add optional OCI images")
ab53a4e9b95de1f6f58a8316b4c4eccf0b1760a2 Enji Cooper 2026-04-22 20:51:48
Preen/update list for share/examples/sound under `MK_EXAMPLES`
- Update sources to match current installed files list. This involved
  adding and removing some example files.
- Sort the list alphabetically so it'll be easier to spot future updates.

MFC after:      1 week
b9495bd8c13e95035366b4e699b9ebe9f3d5c543 Enji Cooper 2026-04-22 21:00:52
Remove all of /usr/tests/share/examples/... when MK_EXAMPLES == no
- Remove the generated files (`file1`).
- Remove the top-level example `Kyuafile`.

MFC after:      1 week
fb7df70a479f7cf972073f3a779adba2b4517c31 Enji Cooper 2026-04-22 21:06:37
makeman: switch over to the .lua implementation
Nobody will test it as long as it's not tied into the top-level target,
and we don't really have a good reason not to cut over to it since it
does produce identical results.  Switch over but do not remove the old
sh implementation yet, just in case.

Note that this replacement is driven by a significant speedup from how
the new version is designed: tha lua version actually tries to
parallelize its data collection efforts to speed up generation.

Reviewed by:    imp (previous version), emaste
Differential Revision:  https://reviews.freebsd.org/D56558
1f41f56991a1a8cc836fa41fa7bb59150b46e8d5 Kyle Evans 2026-04-23 02:56:05
packages: Convert world to a subdir build
Instead of driving the world package build from Makefile.inc1,
use a subdir build where each package has a subdirectory under
packages/ using the new <bsd.pkg.mk>.

Convert some metadata that was previously in the UCL files (e.g.
sets and dependencies) to Makefile variables.

Build the packages under objdir (not repodir), and use the new
stagepackages target to copy them to repodir when creating the
repository.

Determine an explicit list of packages to build in packages/Makefile
based on enabled src.conf options, and add logic to abort the build
if we attempt to build an empty package.  This inverts the previous
logic in Makefile.inc1 which would simply skip empty packages.

There are a few advantages to doing it this way:

* The package build works more like the rest of the build system,
  so it's more accessible to developers.

* We can customise the packages we build based on src.conf options,
  e.g. skipping a package entirely, or adjusting its dependencies
  based on what it actually requires.

* We have a specific list of packages that we want to build, and an
  unexpectedly missing package results in a build error, instead of
  silently producing a broken repository.

* It's possible to build (and in the future, install) an individual
  package without having to rebuild the entire repository.

This doesn't apply to the dtb, kernel-* or src-* packages; those
have their own build systems in Makefile.inc1 and will be converted
later.

MFC after:      4 weeks (stable/15 only)
Reviewed by:    jlduran, sjg, brooks
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56087
bb75b0d581f74e22a68d7868ad1f5da1146a8de0 Lexi Winter 2026-04-24 14:10:01
Remove -fms-extensions throughout the tree
During a discussion about using -fms-extensions jhb pointed out that
we have them enabled in the kernel for gcc by default (even multiple
times in one part). I had missed all that and clang still failed on
my use case (needing another option).

The original cause for enabling them for our tree back then was that
we needed to support C11 anonymous struct/unions.
Our in-tree gcc 4.2.1, despite later patches, needed the
-fms-extensions to support these even though this was not the expected
use case for that option ( cc4a90c445aa0 enabled it globally for the
kernel).
clang at that time (or at least when it became default for 10.0)
already was fine (with C11).

Any later gcc (4.6.0 onwards) did not need that option anymore, even
when compiled for -std=iso9899:1990 (which does not support anonymous
structs/unions) unless one would add -pedantic (see gcc git 4bdd0a60b27a).
This is also the reason why userland cddl sources now compile with the
option removed despite CSTD=c99.

The only driver which needed the option recently was ccp, but that was
fixed in 8d3f41dbcb2a by jhb.

So cleanup all uses cases of -fms-extensions for the moment as they are
no longer needed given all compilers currently supported seem to be
fine without them and gcc-4.2.1 was removed from the tree in stable/13
in 2020 (a9854bc3812b).

Reported by:    jhb (all this but possibly the world CDDL parts)
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste (earlier), imp, jhb, glebius
Differential Revision: https://reviews.freebsd.org/D55072
93d301d95ab230ea159b21b5412aac2ce5362ac5 Bjoern A. Zeeb 2026-02-03 01:51:40
Remove `cam.d` when MK_DTRACE == no
MFC with:     efb77950fdd
Fixes:  https://cgit.freebsd.org/src/commit/?id=efb77950fdd ("dtrace: Add definitiosn for the cam dtrace provider")
Differential Revision:  https://reviews.freebsd.org/D56588
944a4de2d2114954599d8220e87f09e9102f55d3 Enji Cooper 2026-04-22 21:09:25
Tentative fix for powerpc boot1.chrp linking problem.
4822a2cf990048c6eed7822fd34a1aeeb7c39cdf Dimitry Andric 2026-01-10 15:36:48
Revert "Tentative fix for powerpc boot1.chrp linking problem."
This reverts base 4822a2cf990048c6eed7822fd34a1aeeb7c39cdf. The change
in base aa0bc7cca153f67f8becec8a8fb259ff5fd30fd0 already fixed the
original issue, which is that newer versions of lld complain "section
'.text' address (0x38000) is smaller than image base (0x10000000);
specify --image-base".

Reported by:    ivy
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
7f207b6443fe92c31a75b491272a0fad032d39ae Dimitry Andric 2026-04-25 17:06:55
Commit group #119: revert-pair-packages
packages: Register pkgconf

This should fix the creation of the new packages introduced by the
import of pkgconf into the base system.

Fixes:                  https://cgit.freebsd.org/src/commit/?id=b8352da33f34 ("pkgconf: import into the base system")
Sponsored by:           The FreeBSD Foundation
Differential revision:  https://reviews.freebsd.org/D56589
970cef9f652ec4d902b20cba6d99dce48458d7b6 Pierre Pronchery 2026-04-22 20:59:55

Revert "packages: Register pkgconf"

This reverts commit 970cef9f652ec4d902b20cba6d99dce48458d7b6.

I made a mistake when rebasing 1342eb5a832fa10e689a29faab3acb6054e4778c;
I did not mean to re-introduce this one.
e0b74e7b17393988120d86e20e91bd38f03c93ad Pierre Pronchery 2026-04-25 19:23:23
pkgconf: fix the build with GCC 14
Building pkgconf with GCC 14 currently fails with:
no option '-Wincompatible-pointer-types-discards-qualifiers'

This relaxes warnings for libpkgconf, pkgconf(1), and bomtool(1) until
the improvements are published upstream (see PR #444).

Co-authored-by: ngie
Approved by:    ngie
Sponsored by:   The FreeBSD Foundation
Event:          Wiesbaden Hackathon 202604
Differential Revision:  https://reviews.freebsd.org/D56591
1342eb5a832fa10e689a29faab3acb6054e4778c Pierre Pronchery 2026-04-22 23:42:43
apm: Only install rc script on i386
The apm(8) rc script only works on i386, but it's installed on all
platforms.  Only install it on i386, which avoids creating a useless
FreeBSD-apm package on other platforms.

While here, build the acpi package on i386.

MFC after:      2 weeks
Reviewed by:    imp
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56629
b7daab8be1d4555f23a297e60e4128c01caabf82 Lexi Winter 2026-04-26 16:47:27
packages: make bhyve depend on acpi
bhyve(8) on amd64 needs iasl(8) to run, otherwise it fails with:

  /bin/sh: /usr/sbin/iasl: not found
  bhyve: BASL failed @ build_dsdt:484
      Failed to execute basl_compile(ctx, basl_fwrite_dsdt): Unknown
  error: 32512
  bhyve: BASL failed @ acpi_build:899
      Failed to execute build_dsdt(ctx): Unknown error: 32512
  Assertion failed: (error == 0), function bhyve_init_platform_late, file
  /home/pkgbuild/worktrees/main/usr.sbin/bhyve/amd64/bhyverun_machdep.c,
  line 394.

Register the "acpi" package which provides iasl(8) as a dependency for
bhyve on amd64.

Reviewed by:            markj (previous revision), ivy
Differential Revision:  https://reviews.freebsd.org/D56498
Sponsored by:           The FreeBSD Foundation
8a9c94cd59eed09477049635663a7113ab0582a5 Roman Bogorodskiy 2026-04-25 16:03:58
init: build dynamically
This makes it easier to downgrade kernel when it stops providing some
syscall required by libc.  In this case, it is enough to downgrade libc
as well, our crt1 delegates all non-trivial work to
libc::__libc_start1().  With static init, the /sbin/init should be
downgraded as well, which might be not easy.

This does not mean that we support forward compatibility.

Reviewed by:    imp, jilles, zlei
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56536
24d887436dcd5b6c18a7505e477c79cae3002c3a Konstantin Belousov 2026-04-20 17:52:59
packages: Don't build quotacheck if WITHOUT_QUOTAS=yes
PR:   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294775
Fixes:  https://cgit.freebsd.org/src/commit/?id=bb75b0d581f7 ("packages: Convert world to a subdir build")
MFC after:      2 weeks
Reported by:    Alastair Hogge <agh@riseup.net>
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56635
221b1d4156a2bfe71a473e5abf6a739c063e60d8 Lexi Winter 2026-04-27 05:45:48
makeman.lua: Downgrade `make showconfig` error to warning
The sh-based makeman silently ignored errors from `make showconfig`.
Ignore errors also from makeman.lua (but emit a warning).

We may want to revisit this in the future, but want makeman.lua to
behave identically for now.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294822
Reviewed by:    kevans
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56663
ea27ec183d0ff26e1273202841a02041b6d93955 Ed Maste 2026-04-26 19:30:17
pkg-stage: Improve symlink creation
Invoke ln with -n and -f.  In normal use it doesn't matter, but during
development this might be run in a partially populated leftover tree.

Reviewed by:    ivy
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52883
4846afc9104a1b4aeec31dc7c324f69ad5ffab1b Ed Maste 2025-05-05 18:01:21
make-pkg-package: Add set -e; abort if a cmd fails
This makes it less likely we will silently generate broken artifacts.

Reviewed by:    ivy
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56671
0068c706f8ce872c735ddcc383c5cd5ab85acc88 Ed Maste 2025-10-04 20:14:43
Makefile.inc1: Use ln -n instead of ln -h
We support both -h and -n, but GNU coreutils only supports -n,
so use that instead.  This fixes the package build on Linux.

MFC after:      2 weeks
Reviewed by:    (wosch, imp) (previous version), emaste
Better fix than the original patch suggested by: jrtc27
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56656
d455c4bb69eca975854262207687db50a5edc434 Lexi Winter 2026-04-27 21:26:45
Makefile.inc1: Always use ${PKG_CMD}
Previously we had a mix of ${PKG_CMD} and bare 'pkg', which is
wrong, and breaks the build when 'pkg' isn't in the tools path,
e.g. when cross-building.

MFC after:      2 weeks
Reviewed by:    wosch, emaste
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56655
b866d05ea2860f9ccc27c75ff0501372896b5bf2 Lexi Winter 2026-04-27 21:29:43
libzpool: Set -Wno-error=typedef-redefinition for clang
In some versions of LLVM (at least 21), the <*intrin.h> headers contain
unguarded duplicate typedefs; this isn't permitted prior to C11, and
libzpool is built as C99.  FreeBSD's LLVM backported LLVM PR #153820
to fix this, but other versions of LLVM (e.g., upstream, or on Linux)
don't have the patch, so this breaks the build.

Add -Wno-error=typedef-redefinition to downgrade this from an error
to a warning.

MFC after:      2 weeks
Reviewed by:    dim, emaste
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56653
036ff38ebd5a52f26fc2f20238a492a9d0c5f2e6 Lexi Winter 2026-04-27 21:31:47
packages: Fix clang conditional
Various src.conf options can cause us to build something that ends up
in the clang package, but MK_TOOLCHAIN is not one of them; copy the
proper conditional from lib/Makefile to decide if we need to build
the package.

This fixes the build when LLVM/clang is entirely disabled.

Fixes:  https://cgit.freebsd.org/src/commit/?id=bb75b0d581f7 ("packages: Convert world to a subdir build")
MFC after:      2 weeks
Reviewed by:    emaste
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56657
e6d112bbbbf0b09f0f18a85a0a3c6d5a49aff653 Lexi Winter 2026-04-27 22:15:13
groups.7: New manual page of standard group names
Import groups(7) from NetBSD, with tweaks for our system. The group
list is sorted by GID. All the group names from /usr/src/etc/group
are described, except "uucp". The FILES section was added on top of
the original manual page.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264966
Relnotes:               yes
MFC after:              3 days
Obtained from:          NetBSD
Reviewed by:            des, ziaee
Differential Revision:  https://reviews.freebsd.org/D54114
e09104dfb76a36b65a64bd315bd1520941c4beed Artem Bunichev 2026-04-28 13:48:52
acpi: Remove userland bits on non-ACPI platforms
ACPI is only supported on amd64, arm64 and i386.  Don't install the
power_profile rc script or devd configuration on other platforms.

This avoids creating a useless FreeBSD-acpi package on those platforms.

MFC after:      2 weeks
Reviewed by:    imp
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56650
c4b244af42a1f20937939a824b753a92c9c0a46f Lexi Winter 2026-04-28 19:37:33
llvm: Move libprivatelldb to the lldb package
Set PACKAGE=lldb in lldb.pre.mk rather than in individual Makefiles;
change lib/clang/Makefile.inc from PACKAGE=clang to PACKAGE?=clang to
avoid overwriting it.

This is safe to MFC to stable/15 since the moved library will be
picked up automatically by pkg.

MFC after:      2 weeks
Reviewed by:    emaste
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56674
7970815be40b1fa604a6554f5ee0f95f834454b5 Lexi Winter 2026-04-28 19:38:36
packages: Make create-sets.sh more robust
Use ${PKG_CMD} rather than bare 'pkg' to fix the build when pkg is
not in the tools path.  Provide a default in case it's not set for
some reason (e.g., running the script by hand).

Since set -- $(...) does not trigger an exit from set -e if the
command fails, this failure was silent and resulted in sets not
being built correctly if we failed to run pkg.  Use a temporary
variable, which does trigger set -e, to fail correctly.

MFC after:      2 weeks
Reviewed by:    sjg
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56676
d1c176fedfc99d61c1dc8037ab549bec48c17bea Lexi Winter 2026-04-28 19:39:14
Makefile.inc1: Only copy locales to INSTALLTMP on FreeBSD
Makefile.inc1 copies locales to ${INSTALLTMP} to avoid issues when
running make installworld on a live system.  However, this can break
on non-FreeBSD systems, e.g. on openSUSE where /usr/share/locales
has mode 0555, which means after we copy it, we can't delete it,
so the build fails.

Since this functionality is only useful when installing over a
live system, disable it when the build host is not FreeBSD.

MFC after:      2 weeks
Reviewed by:    kevans, emaste
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56677
4429630d1ca9d90c886bae1eaa0d8ee32d0fee12 Lexi Winter 2026-04-28 19:42:39
bc: Fix tests
Stop generating test scripts at build time.  The dc test script is
broken and simply fixing the code that generates it won't help as there
is no reliable way to ensure it gets regenerated if it already exists in
the object tree.

MFC after:      1 week
Reviewed by:    se
Differential Revision:  https://reviews.freebsd.org/D56511
67a63eae7b2d10d29983c9698894f1bfff4ffc6e Dag-Erling Smørgrav 2026-04-29 15:14:13
Commit group #120: llvm-*: Move all LLVM_BINUTILS symlinks to toolchain package
llvm-*: Move all LLVM_BINUTILS symlinks to toolchain package

Some of the LLVM binary utilities were included in the Clang package
(because they did not set an explicit PACKAGE).

Add a new Makefile under clang/toolchain to create the symlinks and man
links for ar, c++filt, nm, and so on (without the llvm-* prefix) when
LLVM_BINUTILS is enabled (as it is by default).

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293610
Reviewed by:    bapt, ivy, brooks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55692
c4f08d46c7f717cc8c66bf702c006765a5b6b1a9 Ed Maste 2026-03-06 14:46:18

toolchain: Correct LLVM_BINUTILS pkg pkg dependency

The LLVM binutils are in the clang package.

Reported by: jlduran
Fixes: https://cgit.freebsd.org/src/commit/?id=c4f08d46c7f7 ("llvm-*: Move all LLVM_BINUTILS symlinks to toolchain package")
9b0d9401e6a46456a84500375c36008cfcfcc508 Ed Maste 2026-05-02 02:30:15
libzpool: force inlining of xxhash after removing xxhash.c
libzpool had a number of undefined symbols related to xxhash after
xxhash.c was removed from the build.

Fixes:  https://cgit.freebsd.org/src/commit/?id=8a62a2a5659d ("zfs: merge openzfs/zfs@https://cgit.freebsd.org/src/commit/?id=f8e5af53e")
Reviewed by:    jhb
Differential Revision:  https://reviews.freebsd.org/D56770
050b3ff753e04ce142ac751a0d76b5ee3beda9c5 Ryan Libby 2026-05-02 16:59:06
Commit group #121: bsd.endian.mk: Optimize the handling of big/little endian determination.
bsd.endian.mk: Optimize the handling of big/little endian determination.

Add variables to contain lists of MACHINE_ARCH values to use
to determine little or big endian.

Only error out about not being able to determine endianess if
TARGET_ENDIANNESS is empty and not cross-compiling.

Reviewed by:    sjg
Obtained from:  Hewlett Packard Enterprise Development LP
Differential Revision:  https://reviews.freebsd.org/D44629
01674e15dedb15f8ce498af0680c50bb075c5482 Stephen J. Kiernan 2024-04-03 23:25:19

bsd.endian.mk: Avoid use of M_ListToSkip

While the src build works fine with M_ListToSkip, it can break the
ports build. For now, it is safer just to do the actual variable
modifiers in place.

Reported by:    se
Fixes:          https://cgit.freebsd.org/src/commit/?id=01674e15dedb ("bsd.endian.mk: Optimize the handling...")
b89155be25a7f501980a165e225b28abd886c1e5 Stephen J. Kiernan 2026-05-03 19:35:22
tests/timerfd: Serialize
At least one of these tests changes the system clock, which potentially
interferes with concurrently running tests and causes them to fail.

MFC after:      1 week
001cfc7b8aa38122c4e0fe8ae48fae3556a1f2b6 Mark Johnston 2026-05-03 15:46:52
llvm: Don't install /usr/bin/{gcov,objdump} twice
Commit c4f08d46c7f7 moved the symlinks for the LLVM binutils from LLVM
itself to the toolchain (usr.bin/clang/toolchain), but did not remove
the links for /usr/bin/gcov and /usr/bin/objdump from the llvm version,
meaning we installed them twice, once in the clang package and once in
the toolchain package.

Remove the links from the llvm version and move the MLINKs to toolchain,
which is where the other MLINKs dwell.

While here, fix toolchain to use the correct build option for llvm-cov,
MK_LLVM_COV.

Fixes: https://cgit.freebsd.org/src/commit/?id=c4f08d46c7f7 ("llvm-*: Move all LLVM_BINUTILS symlinks to toolchain package")
Reported by:    jrm
Reviewed by:    jrm, dim, emaste
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56788
045a9ef829fa30c2ba7af47ab34d3b2443024207 Lexi Winter 2026-05-04 13:49:20
packages: Make create-sets.sh more robust during release
Commit d1c176fedfc9 made create-sets.sh exit when it encounters an
error, instead of creating an empty repository.  However, this turns
out to cause some issues:

1. A package not having any sets is considered an error, but during
   the release build, we stuff a 'pkg' package into the repository
   which doesn't have any sets, which causes a failure.  Avoid this
   by simply ignoring the pkg package.

2. No error was printed in this case, which made the problem hard
   to diagnose.  Add an explicit error message.

3. A similar problem occurred running on a repository which already
   contained sets, which is not usually done during the build, but
   is not necessarly an inappropriate thing to do.  Fix this one by
   ignoring set packages when looking for sets.

While here, fix another issue that might cause packages to be wrongly
skipped if the path to the repository contains a '-' character, since
we didn't strip the path before testing the package name.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294966
Fixes:  https://cgit.freebsd.org/src/commit/?id=d1c176fedfc9 ("packages: Make create-sets.sh more robust")
MFC after:      2 weeks
Reported by:    Alastair Hogge <agh@riseup.net>
Reviewed by:    emaste
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56792
8e8d87856241f69c277dc5fab48c5c66312475d6 Lexi Winter 2026-05-05 00:31:20
ath{10,11,12}k: Add missing header in Makefile
Reviewed by:    bz
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56693
efc0ced5c46f3332bf1847f2889659e7f5412852 ShengYi Hung 2026-04-28 14:27:21
Makefile.vm: Split error condition
Make it clear which of two possible cases applies.

Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D56837
76d756eaa6823aad282cc53ec4e41a9777d89adc Ed Maste 2026-05-05 21:12:25
dtrace: Document the syscall provider
MFC after:    1 week
Differential Revision:  https://reviews.freebsd.org/D56831
242050278a377f5ca6906545ddc924b60ad8aa58 Mateusz Piotrowski 2026-05-05 12:57:53
dtrace_mib.4: Document the DTrace MIB provider
Reviewed by:  kp
MFC after:      1 week
Obtained from:  60d8dbbef075 netinet: add a probe point for IP, IP6, ICMP, ICMP6, UDP and TCP stats counters
Differential Revision:  https://reviews.freebsd.org/D53709
ef19cae25337e7449f338914650bbfab0fbea99f Mateusz Piotrowski 2025-07-18 15:46:25
stand/libsa/zfs: disable ZSTD_TRACE and DYNAMIC_BMI2 code paths
Enabling ZSTD_TRACE leaves behind undefined weak symbols, which causes a
problem for gcc builds.  The bfd linker emits an obscure error about
overlapping FDEs.  We don't need ZSTD_TRACE for libsa, so just disable
it.

Also disable BMI2 instruction optimizations.  The addition of the
optional BMI2 code paths caused the boot loader binaries to grow larger
(28 KiB for clang, 32 KiB for gcc).  The boot loader binaries are size
constrained, and this pushed the gcc-generated lua_loader.bin over the
500000 byte limit, and the clang one to within 4k of the limit.

Fixes:  https://cgit.freebsd.org/src/commit/?id=8a62a2a5659d ("zfs: merge openzfs/zfs@https://cgit.freebsd.org/src/commit/?id=f8e5af53e")
Reviewed by:    delphij, imp, mm
Differential Revision:  https://reviews.freebsd.org/D56866
944a4eb089b33241b21979253e0a373ce0bdf984 Ryan Libby 2026-05-07 17:30:05
uio.9: Document uiomove_fromphys()
Reviewed by:  kib
Discussed with: markj, royger
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54070
076e44839160f74f96fda83fa81c3acb41b9ebc8 Mateusz Piotrowski 2026-03-20 07:52:28
Make "make update-packages" idempotent
If the user runs "make update-packages" without bumping BRANCH, then it
isn't possible to copy packages from the old location to the new one
(because the two locations are the same).  So just skip that step.

Sponsored by:           ConnectWise
PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295085
MFC after:              1 week
Reviewed by:            ivy, emaste
Differential Revision:  https://reviews.freebsd.org/D56872
bd1e789b8452a8c2f166a3b4defb95330c71dadd Alan Somers 2026-05-07 18:18:29
dtrace_dtmalloc.4: Document the DTrace dtmalloc provider
MFC after:    1 week
Discussed with: christos, markj, ziaee
Differential Revision:  https://reviews.freebsd.org/D51396
03bc95b060a91ed9d410270d00d1dd4f8edcdcc7 Mateusz Piotrowski 2025-07-17 20:55:49
Cirrus-CI: Bump toolchain to LLVM 21
Cirrus-CI is shutting down at the end of the month, but we can still
finish with an up-to-date working build with an LLVM version matching
the in-tree toolchain.

Sponsored by:   The FreeBSD Foundation
e6475c8f353981baeddb544f5a9deb48956f2815 Ed Maste 2026-05-12 23:35:11
src.opts.mk: Comment about CTF & DTRACE relationship
WITH_CTF enables building userland components with CTF, and not the ctf*
tools as one might expect.  The tools are actually included with the
DTRACE knob.  Add a comment where the dependency is handled, as this has
caused confusion.

Reported by:    ivy
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56977
f6178451eea5b1ce6802fbb0e6eceb555c7b4841 Ed Maste 2026-05-12 17:19:46
Commit group #122: Cloud releases: Switch to firstboot_pkg_upgrade
Cloud releases: Switch to firstboot_pkg_upgrade

Cloud images are deployed with base system packages. Introduce a
firstboot package auto updater to patch the base system on first boot.

MFC after:              1 hour
MFC to:                 stable/15
Reviewed by:            cperciva
Sponsored by:           Google Cloud
Differential Revision:  https://reviews.freebsd.org/D56890
464a351267dc0d1843b919dd72ad1c70c24815ce Alexander Ziaee 2026-05-14 21:05:07

Cloud releases: More firstboot_pkg_upgrade

Update a couple more cloudware images which I forgot about earlier.

Reviewed by:    ziaee
Fixes: https://cgit.freebsd.org/src/commit/?id=464a351267dc ("Cloud releases: Switch to firstboot_pkg_upgrade")
Differential Revision:  https://reviews.freebsd.org/D57006
4080419d9a2d88d44d20baaf3ea01934561819c1 Colin Percival 2026-05-14 21:14:09
EC2: Don't enable firstboot_pkgs in small flavour
The EC2 "base" flavour installs the devel/py-awscli package at boot
time by default; we don't do this in the "small" flavour, so the
default behaviour was to update the FreeBSD-ports repository and
then do nothing with it.

Turn off firstboot_pkgs by default; if someone is using the "small"
flavour of AMIs and wants to install packages at instance launch
time, they simply need to add 'firstboot_pkgs_enable="YES"' to
/etc/rc.conf (which they must already be editing via user-data, in
order to provide the list of packages they want installed).

Sponsored by:   Amazon
MFC after:      3 days
MFC to:         stable/15
Relnotes:       EC2 "small" images now have firstboot_pkgs_enable="NO".
61df4be487cfbfd27b0959e1eb66ef0d8f84562f Colin Percival 2026-05-16 18:58:13
p9fs.4: MLINK to virtio_p9fs.4
Technically, virtio_p9fs is an emulated device that masquerades
as a p9fs mount, but it does not make sense to have two separate manual
pages.

Reviewed by:    bnovkov, dfr
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57013
30f500e97b57d36ebb8483cb8b8921507350cd0f Mateusz Piotrowski 2026-05-15 12:05:46
tests/if_carp: Run all tests with execenv=jail
Otherwise failures can occur when running tests in parallel since some
tests reuse jail names.

MFC after:      1 week
eeffed5aa0d9a67adb21bf188515cb374340e9cb Mark Johnston 2026-05-19 14:28:34
universe: allow moving build logs to UNIVERSE_LOGDIR
This allows `make universe` or `make tinderbox`
to build from a read-only src tree.

Reviewed by:    ziaee, imp, delphij
Approved by:    lwhsu (mentor), emaste (mentor)
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55566
02ef0b6d76e9717b8e3182dd706e23fd2702701d Siva Mahadevan 2026-05-20 20:05:53
universe: emit warning instead of error for bad/missing KERNCONF
When doing a large `make universe` build with multiple KERNCONFS,
it should not be an error when a particular target has a missing
KERNCONF.

In this example,

```
$ make universe TARGETS='arm64 riscv' KERNCONFS='QEMU VIRT'
```

Currently, arm64 does not have a QEMU conf, and riscv
does not have a VIRT conf. However, this command should still
succeed instead of failing with the following message:

```
make[2]: /usr/src/Makefile:767: Target architecture for riscv/conf/VIRT unknown.  config(8) likely too old.
        in .for loop from /usr/src/Makefile:761 with kernel = VIRT
        in make[2] in directory "/usr/src"

make[2]: stopped making "universe_kernels" in /usr/src
```

Since the opposite is true, we should build whatever confs are available
from the requested list of KERNCONFS, while making sure to still
emit warnings along the way.

Reviewed by:    imp
Approved by:    lwhsu (mentor), emaste (mentor)
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55571
c170a96dbeeb3b0d36456d21beee6c551957a456 Siva Mahadevan 2026-05-21 14:08:32
tests/net: Run all tests with execenv=jail and enable parallelism
This has been stable in my testing, and enabling parallelism speeds up
test runs considerably.  In particular, with -v parallelism=16 in a
16-vcpu bhyve VM my test runs go from ~50m to ~40m; the exact numbers
depend on the kernel config in use.

Reviewed by:    pouria
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57094
6ab30433a73b5e52a0562010b75257bcfc57bcbd Mark Johnston 2026-05-22 14:44:08
bsd.sys.mk: suppress some clang warnings for C++ for >= 19
I just tried building with system clang on one of my Linux systems which
happens to be version 19, and these warning suppressions are needed for
that version too: same errors as in the original commit.

Reviewed by:    imp
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D56874
004b5935a6e643033526cab623c6005b69ab11aa Alex Richardson 2026-05-26 19:37:06
Fix building with LLVM_BINUTILS_BOOSTRAP but without CLANG_BOOTSTRAP
Without this change I get various undefined symbol errors when trying to
link llvm-nm and llvm-objcopy during the cross-tools stage.

Test Plan: builds now
Reviewed by:    dim, emaste
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D56873
3525c619abdb646601e74194a6e15e8407a677da Alex Richardson 2026-05-26 19:38:58
tests/ipsec: Run in parallel
Use execenv=jail to enable this.

MFC after:      1 week
f048a1a1decb9140ec779951e886ec41ae34cec4 Mark Johnston 2026-05-29 22:25:02
Commit group #123: libarchive: Clean up the build configuration
libarchive: Clean up the build configuration

* Move settings duplicated in libarchive, bsdcat, bsdcpio, bsdtar, and
  bsdunzip into libarchive's Makefile.inc.

* Drop some CFLAGS that merely duplicated some of the contents of our
  platform configuration header.

MFC after:      1 week
Reviewed by:    mm
Differential Revision:  https://reviews.freebsd.org/D57307
eb3a0a74a069d0f294e1596504676459282bb308 Dag-Erling Smørgrav 2026-06-04 13:12:23

libarchive: Fix typo in sed command

MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=eb3a0a74a069 ("libarchive: Clean up the build configuration")
Reported by:    Shawn Webb <shawn.webb@hardenedbsd.org>
ba0d22eacd6008e9f3b7395b41056de2423aef3d Dag-Erling Smørgrav 2026-06-04 22:35:50
libmsun: Fix incorrect MLINK for sincosl(3)
fa3f69fa4cabf50d667631b4b8083673bccc874f Steve Kargl 2026-06-04 16:31:26
check-old-libs: Show information about packages
If pkg is installed, for each old library found to still be present,
check if any installed packages either provide or require the library,
and inform the user.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D53977
8d9dff23f206cb86aed9857a985ed09cd38eb5ac Dag-Erling Smørgrav 2026-06-06 07:54:21
libc/riscv64: temporarily unhook strrchr() from the build
A bug was discovered in the riscv64 assembly implementation of
this function.  Fall back to the generic implementation until a
fix can be developed.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295823
Reported by:    siva
MFC after:      1 week
4996ebdb720042239a197ebec2d265cdfdf1bbf3 Robert Clausecker 2026-06-07 19:00:33
depend-cleanup.sh: rebuild strrchr.o on riscv64 if it came from strrchr.S
We have to switch back to the previous rule once the temporary
build fix has been replaced with a permanent fix.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295823
See also:       4996ebdb720042239a197ebec2d265cdfdf1bbf3
Reported by:    siva
MFC after:      1 week
93221c277608d2612511eaabbf2bfc1f4b4250f7 Robert Clausecker 2026-06-07 20:58:31
GCE: Apply public-image label on GCE images
Update the GCE image creation process to automatically apply the
'public-image=true' label when publishing new images. This aligns
with standard labeling expectations for images hosted in public
projects.

MFC after:      3 days
c85542b92acd286d9e4b034b2ab4d6b6cd46c740 Xin LI 2026-06-10 02:33:03
src.opts.mk: enable OPENSSL_KTLS by default on riscv64
1e649491b8567151270095fda3bce8faea394952 enabled KERN_TLS in
riscv/conf/GENERIC, but didn't enable OPENSSL_KTLS.

This passes all testcases in the sys/kern/ssl_sendfile suite and
fixes CI failures seen here:
https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/16606/testReport/sys.kern/ssl_sendfile/

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293810
Fixes:  https://cgit.freebsd.org/src/commit/?id=1e649491b8567151270095fda3bce8faea394952
MFC after:      3 days
Reviewed by:    gallatin, ngie
Differential Revision:  https://reviews.freebsd.org/D57316
b61ab2d693c04d4be5468e7db4b03d5777228f95 Siva Mahadevan 2026-06-10 22:30:14
amdsmu(4): Add manpage
Sponsored by: The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57366
4733b4dca5519920a4effa82a62d319c47ef50af Aymeric Wibo 2026-06-11 20:39:37
vmimage.subr: Add ability to install src in VM image
In some cases having a src tree in a VM image is convenient
for development or debugging. Add a WITH_SRC variable,
which, when set, will cause the vm-release target to include
FreeBSD-set-src in the list of packages installed in an image.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Sponsored by:   Intel Corporation

Reviewed by:    cperciva
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57143
4ea4116f8d2069194563c8692c1f28d88c319ca8 Krzysztof Galazka 2026-06-12 18:21:14
packages: Fix building packages when WITHOUT_BLOCKLIST is set
Reviewed by:  emaste
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D57601
cd0a101b01d685092d073a367f0e7374f7259256 Brad Davis 2026-06-15 17:59:19
build: provide a FORTIFY_SOURCE.<src file> override
For native files we can do more minimal fixes to avoid this large of a
hammer, but for third party files it may not be worth the effort to try
and patch them.  NetBSD has the original _FORTIFY_SOURCE implementation
that ours is based on, for instance, but tests sourced from there can't
do an __ssp_real(foo) without being certain that `foo` actually has a
fortified definition.

This change does always define _FORTIFY_SOURCE as a result, so gate it
on CFLAGS not already containing _FORTIFY_SOURCE definitions.

This re-applies c46a0b59071614, but without re-defining _FORTIFY_SOURCE
needlessly.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294881
Reviewed by:    markj, sjg (both previous version)
Differential Revision:  https://reviews.freebsd.org/D57356
13184a69faa700319ab16357cd39708a0e89fc15 Kyle Evans 2026-06-17 22:40:46
Update dirdpes.mk et al
Update to latest dirdeps related makefiles.

dirdeps.mk tweaks useful for universe among other corner cases.
           also additional filtering for bogus paths ending in /

gendirdeps.mk allow more debugging
           also additional filtering for bogus paths ending in /

install-new.mk fix bug when isPOSIX_SHELL is true

meta2deps.?? handle file names with spaces by ignoring them

Reviewed by: stevek
Differential Revision:  https://reviews.freebsd.org/D57683
7386c0675c89b12cac1da8e16fc8fc32eb42ca07 Simon J. Gerraty 2026-06-19 20:29:25
Source upgrade doc: etcupdate no longer needs -B
Note: We confusingly have the instructions to build the system in the
build manual, the UPDATING file, and the Makefile. These will get out
of sync and will be harmful when they do.

Fixes:  https://cgit.freebsd.org/src/commit/?id=ddf6fad0295a ("etcupdate: Make nobuild the default")
Reviewed by:            jhb
Differential Revision:  https://reviews.freebsd.org/D57644
704db3fe9840ee3e51b080b7c35defd1a74c0c2d Alexander Ziaee 2026-06-21 17:54:12
meta.autodep.mk remove extra }
remove extra } from GENDIRDEPS_ENV

more debug output for gendirdeps.mk

Reviewed by:    stevek
Differential Revision:  https://reviews.freebsd.org/D57727
c37839dc7b6a4d5f2c4d5bddda6595782a83dae4 Simon J. Gerraty 2026-06-21 19:19:29
vgrind: Tear down vgrind support
vgrind has been disconnected from the build for a while.  Remove from
the build, and gc vgrid support in the few remaining places.

Reviewed by:            jhb
Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D57648
198637a6869c703c2d01cd87e222c1dc3761c853 Warner Losh 2026-06-22 22:16:55
qemu: Add tools to generate useful tables from FreeBSD sources
This generates a table of all the socket options with fixed types
so that programs like qemu can use those tables rather than having
to free code thigs.

Sponsored by:           Netflix
7f5539d6a66471f59de0550f4b8e3369e0b1b2c7 Warner Losh 2026-06-22 22:17:07
ntsync.4: add the man page
Reviewed by:  ziaee
Discussed with: Alex S <iwtcex@gmail.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D57659
f6b37f47c09903413bd980a5ebd4c7c3e19ba8a5 Konstantin Belousov 2026-06-19 12:40:03
Add kernel manpages for bcopy, memcpy, and memmove
We will add variants of memcpy and memmove to support CHERI so
bootstrap the manpages from section 3.

Mark bcopy as deprecated.

Reviewed by:    imp, kib, emaste
Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57661
b94f438906451d4826d190d36b07e870443439ac Brooks Davis 2026-06-25 10:05:02
Commit group #124: memory_model(7): create and document pointer provenance
memory_model(7): create and document pointer provenance

Add a skeleton manpage intended to describe the FreeBSD memory model.

To start out, add documentation of pointer provenance and a cross link
to atomic(9).

Provide some advice on preserving provenance in CHERI and reference
more detailed discussions elsewere.

Effort:         CHERI upstreaming
Reviewed by:    kib, adrian, markj, emaste
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D57812
1366a87c9cb5ed47910636d17972f1bcad27fb9f Brooks Davis 2026-06-26 11:23:48

memory_model.7: Correct typo

perserving -> preserving

Reviewed by: jrm
Event: Halifax Hackathon 202606
Fixes: https://cgit.freebsd.org/src/commit/?id=1366a87c9cb5 ("memory_model(7): create and document pointer provenance")
2f7a8222b6a5c7bedf6835eb6a93b35346e50777 Ed Maste 2026-06-26 13:10:13
loader: Don't need add these flags to ZSTD_SRC
These are zfs-only flags, don't add them when we're building ZSTD.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D57860
01ef8f4555cfa46c8030cf623e6e3e857fa25430 Warner Losh 2026-06-26 14:45:37
pxeldr: Bump the limit by 30k for loader size
We have a ltitle wiggle room, so go ahead and bump the pxeldr size.
It should be a little larger than the limit we have for the /boot/loader
since we embed that in this loader...

Sponsored by:           Netflix
4e9d303c8300c6674230ff1cdcb317edb27b48cc Warner Losh 2026-06-26 14:48:04
loader: Test GCC cross builds as part of universe.sh
Sicne we have gcc15 in Jenkins, and since people are actually using it,
add cross building tests to universe.sh to avoid build breakage when
hacking on loader.efi (and others). UEFI makes it too easy to mix
pointers and integers since it deals in an odd mix of
EFI_PHYSICAL_ADDRESS and pointers...

Sponsored by:           Netflix
1fc6923e6a40cf0ba9b6cb5aaeee3d87cacab507 Warner Losh 2026-06-26 23:12:55
locale: Do not strip the suffix from CLDRVERSION
The upstream CLDR directory structure requires the full version string.
Remove the ':R' modifier to fix the fetch paths.

Previously this worked because major releases were published in a
directory without the ".0" suffix, while the filenames included it.
Starting with CLDR 47, the upstream layout changed to use the full
version string exclusively, causing the fetch URLs to break for point
releases.

MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57625
77ca1ce66283aa84258ef2323b692711df16158c Jose Luis Duran 2026-06-28 23:07:23
locale: Update Unicode to CLDR 48.2
Notable changes:

- Group separator for number formatting was updated to ' in fr-CH
  consistent with other Swiss locales.
- Some fixes to date formats including: Hv available formats were
  updated to match behavior in CLDR 47 due to web compatibility issues
  related to current JS capabilities.
- Emoji annotations fixes including collisions between emoji short
  names.
- Updated AM/PM for ko & ps to be consistent with how the wide forms are
  localized.

Reviewed by:    bapt
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57626
9edbff33aa299dfe7693e18f5bff682bd7ac6b40 Jose Luis Duran 2026-06-28 23:07:30
OptionalObsoleteFiles: Add missing headers
The header files for dialog, figpar, dpv were never listed.

Fixes:          https://cgit.freebsd.org/src/commit/?id=bc6c827078b7 ("OptionalObsoleteFiles: Add figpar to dialog section")
acf6518a2d6f33fb56c861861cbad0c0cb56817e Dag-Erling Smørgrav 2026-06-29 19:17:52

Internal organizational stuff

CONTRIBUTING.md: Make quality expectations section more concise
FreeBSD has not yet established an AI submission policy.  For now remove
text that implies we have.
fba8bd02340f0111a4f81c538718edcc46554794 Ed Maste 2026-04-04 21:19:28
Add myself as a committer
Approved by:    makc (mentor)
c84049c0bef5be3a59159e9a9ae88e22caff429b Kenneth Raplee 2026-04-04 21:07:53
Remove usr/include/c++/v1/__fwd/get.h from ObsoleteFiles.inc.
b99d02027a0fe2e9f9a4aeb6fa3484847ddc5a57 Dimitry Andric 2026-02-10 14:34:48
git-arc: Add a create-draft mode
Make it possible to create a review without publishing it.  This should
be useful when one wants to restrict the visibility of a review, as that
cannot be done via the command line.  Note that a draft review is still
publicly visible if one can guess the URL, but creating one does not
result in email notifications to subscribers etc., nor does a draft
appear in the creating user's activity log.

Once a draft is ready, one can publish it via the web UI.

Reviewed by:    jrm
Differential Revision:  https://reviews.freebsd.org/D56664
448ec129bcef6bf147b76956ec588e357a21d310 Mark Johnston 2026-04-28 14:02:58
README.md: Add packages/ directory
Fixes:        https://cgit.freebsd.org/src/commit/?id=bb75b0d581f7 ("packages: Convert world to a subdir build")
MFC after:      2 weeks
Reviewed by:    des, emaste
Differential Revision:  https://reviews.freebsd.org/D56839
e3e5b86e3b9e00f1fe89e54d13dcd665e63eb4c6 Lexi Winter 2026-05-06 14:45:54
git-arc: Update the usage message to mention create -d
Fixes:        https://cgit.freebsd.org/src/commit/?id=448ec129bcef ("git-arc: Add a create-draft mode")
54625dfb363a4a00841ef7d7ee8e5cc5ea1156e0 Mark Johnston 2026-05-07 17:18:32
mtree: Remove unused MANSUBDIRs
MFC after:    3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=809504f331fd ("man: Kill off MANSUBDIRs")
Reviewed by:    ziaee
Differential Revision:  https://reviews.freebsd.org/D57029
1dc1b95163b9e5cf5cbd52c2b979568724746eac Dag-Erling Smørgrav 2026-05-16 16:16:57
bsd-family-tree: add OpenBSD 7.9
9958d0f1dc64fafe73ff6f93c65b3a9f8b39f960 Sergey A. Osokin 2026-05-19 14:33:30
ObsoleteFiles: Add some ancient locale symlinks
These were dropped in 2021 but were never listed in ObsoleteFiles.inc,
so systems that have been upgraded from source since before that date
(or from 13.x) may still have them.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295668
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=0a36787e4c1f ("locales: separate unicode from other locales")
Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D57331
1cef7e9eb0822c606fc34f975efd14b6daeff756 Dag-Erling Smørgrav 2026-06-02 08:36:53
MAINTAINERS, CODEOWNERS: Add myself to fts and stdio
b3a8659f3692977b2d4689d3d1388860c868dc4c Dag-Erling Smørgrav 2026-06-04 13:03:49
OpenSSL: update MAINTAINERS/CODEOWNERS
I've been the quasi-defacto component maintainer for OpenSSL since
14.0-RELEASE. Make it official via CODEOWNERS/MAINTAINERS.

The goal is to help guide those interested in making changes in this
space to solicit my input with the new vendor import process and
coordinate fixes with upstream until things are at a point where most of
this is automated a system of automated checks and balances to confirm
that the updates being made to the component help maintain a security
supply chain for this given component.

Thank you benl and jkim for your past efforts in this component area.
Hopefully I can do my part to help improve this critical space further
as you both did in your respective tenures.

MFC after:      3 days
8f9aabbdbcd55b25b698bd762e8693d43f295bbd Enji Cooper 2026-06-09 19:34:41
bsd-family-tree: add FreeBSD 15.1
f8b5df434e419e00272bfce343bf7da239081276 Maxim Konovalov 2026-06-16 12:34:28
.git-blame-ignore-revs: Reverted accidental commits
82c38777319f601c9b88e6d7dd3aec499c5085bf Dag-Erling Smørgrav 2026-06-29 15:59:34
tools: Add git-mfc
This is a utility that effectively wraps git-cherry-pick for performing
MFCs, though it has some other usages.  In addition to actually
cherry-pick the specified commits, it looks at the upstream branch for
fixup commits, denoted by a `Fixes:` tag which references the fixed
commit.

Aside from actually cherry-picking commits, git-mfc can also be used to
list pending MFCs (commits in the upstream branch which are eligible for
MFC based on the `MFC after` tag), and "dangling" MFCs, where a commit
was MFCed to the currently checked out stable branch, and the upstream
branch has one or more fixup commits which have not been merged.

The utility requires python and the gitpython module.

Reviewed by:    des
Differential Revision:  https://reviews.freebsd.org/D57845
1361901baac43997daafd6ed41d3cdec6c119110 Mark Johnston 2026-06-30 19:27:06

Testing

yes: fix argv test race between fork and exec
The argv test checks ps(1) output immediately after backgrounding yes(1), but
the forked child briefly shows the parent shell's argv before exec(2) replaces it.
This caused intermittent failures where ps(1) captured the atf shell wrapper
command line instead of "yes y".

Approved by:    des
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D56231
c5961b6fcfe0f3587be11187a9c666a7fa200f4b Olivier Cochard 2026-04-06 17:17:49
pf tests: explicitly test zeroing counters within an anchor
While here fix the match pattern in the existing test.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
6642ba36f1860599a4c5562dc24f5dff080bbb42 Kristof Provost 2026-04-07 14:07:45
stat: Nits in readlink tests
* The f_flag test may fail if a component of the full path to the
  temporary directory is a symbolic link.

* The n_flag test had an empty head; give it a description.

* Use consistent quoting.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D56293
1c793e7cbe2ecded388fd51fb20274891620a6f4 Dag-Erling Smørgrav 2026-04-08 11:26:23
libc/tests/string: add a more comprehensive unit test for strrchr()
The unit tests are patterned after those for memrchr().
This catches the issue found in 293915.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293915
Reviewed by:    strajabot
Reported by:    safonov.paul@gmail.com
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56037
8b5d77bbcbd98e684226950be1c779e108059d8d Robert Clausecker 2026-03-22 21:39:42
stat: Nits in stat tests
* Use ourselves as test file instead of /COPYRIGHT, which may or may not
  be present in the test environment.

* atf-check understands \n in strings, use it.

* Some file systems don't like creating small holes, so create large ones
  instead.  This means we need two variables: ps (page size) is the
  minimum size of a data region and the alignment for a hole, while hs
  (hole size) is the minimum size of the holes we create.  This makes no
  difference on FreeBSD but makes it easier to port the test to other
  platforms.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D56304
8cbd3949297d56e3960dcde73bd7e2277ac4bee8 Dag-Erling Smørgrav 2026-04-08 15:35:35
tests: kqueue: add a basic test for CPONFORK
Just copy over a timer and a write-filter, be sure that we can observe
both in the child.  Maybe the timer should check for a minimum time
passed, but I don't know that we'd be likely to get that wrong.

This also adds a negative test with a kqueue that is *not* set for
CPONFORK being added to the first one, made readable, and confirming
that we don't see a knote for it in the child.

Some other improvements to the test noted in the review are planned in
the short term, but they're not particularly worth blocking adding this
as a basic sanity check.

Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D56223
0c9cec8b66e7033f50059329704515d5222b9ff4 Kyle Evans 2026-04-09 02:37:00
geneve: Add tests for geneve
Add tests for each combinations of geneve modes, address families
and multicast.

Differential Revision: https://reviews.freebsd.org/D55183
aa9f669d09a7a193d470477398815f45a42c0270 Pouria Mousavizadeh Tehrani 2026-04-11 18:45:08
CTL: add ATF tests for REPORT SUPPORTED OPCODES
This includes a regression test for CVE-2024-42416

MFC after:      2 weeks
Sponsored by:   ConnectWise
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D46613
6dd86310e54d3f2dd9f688670913b9176176246c Alan Somers 2026-04-14 17:35:54
du: Fix t_flag test case
MFC after:    1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=3e5550d25c6d ("du: Add regression tests")
Sponsored by:   Klara, Inc.
e99b3f5e318626b45510e29993aabca1d161bfa0 Dag-Erling Smørgrav 2026-04-15 14:50:32
tests/fusefs: appease gcc -Wcast-qual
Fix gcc build error.

Reviewed by:    asomers, kib
Fixes:  https://cgit.freebsd.org/src/commit/?id=7e68af7ce2c1 ("fusefs: redo vnode attribute locking")
Differential Revision:  https://reviews.freebsd.org/D56370
0c09c6527b16953d355125bee7a839f743a39dad Ryan Libby 2026-04-15 16:32:22
tests: kqueue: improve diagnostics for our CPONFORK test
Notably, confirm in the child that our close-on-fork fd is actually
closed, and break RECV_ALL out into a table and check each bit
individually to provide a better message when the test fails.

While we're here, just switch to waitid() rather than trying to identify
the point where we have to make the switch.  This reduces maintenance
slightly, as keeping our assertion static would require still adding to
a _RECV_ALL mask *just* for that purpose.

Reviewed by:    kib, markj (both slightly earlier version)
Differential Revision:  https://reviews.freebsd.org/D56372
51d2c38010824b90d7462711896a88165db9d015 Kyle Evans 2026-04-17 03:57:06
pf tests: test having multiple state limiters
Sponsored by: Rubicon Communications, LLC ("Netgate")
95fe1ba5579df2fe204ad30d892160966677ae98 Kristof Provost 2026-04-16 13:46:59
tests/socket_afinet: Remove a conditional skip
The test runs without any unexpected results when mac_portacl is loaded.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238781
MFC after:      1 week
9f6041fb579106aa6fa358071a14eddabd581998 Mark Johnston 2026-04-17 12:48:39
tests/netinet6: Add SLAAC and RA validation tests to ndp
* RA hop limit validation
* RA source address validation
* Multi router RA validation
* Two hour rule RA validation
* SLAAC onlink prefix switching test

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D56128
c173f02045c8cfae219b26be99f9e02f291965fa Pouria Mousavizadeh Tehrani 2026-04-17 20:25:18
tests/netinet6: Add test for route information option
Test handling of receiving multiple route information options in RA.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D56216
f6bcc0925f0ea838da5183dc503f847e56d15cc8 Pouria Mousavizadeh Tehrani 2026-04-17 20:27:50
du: Set BLOCKSIZE before running tests
Several testcases assume BLOCKSIZE=K, so set it at the top of the
script.  This fixes an issue where the tests would sometimes fail
when run under sudo.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D56476
d618ba314d1452c1cb4360e15ae1c80adac48306 Dag-Erling Smørgrav 2026-04-18 12:48:04
tests/socket_afinet: Fix the bind_connected_port test
The test verifies that a socket can bind to a local address assigned by
connect(2) to a different socket.  It was however trying to bind to the
wrong address, and the check of the result was inverted, so this went
unnoticed.  It also needs to set SO_REUSEADDR for this to succeed.

Reported by:    glebius
MFC after:      1 week
d3d0466cae546254c50c80cf3e0c060bbbbba53c Mark Johnston 2026-04-20 15:07:20
tests/aio: Avoid skipping zvol tests
The underlying bugs which caused them to be flaky are now fixed.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258766
9592b0870c83c1e70f162cf16a5f0645895d1d9b Mark Johnston 2026-04-20 16:16:28
tests/sys/net: Set require.kmods where appropriate
30b7621d46cc06053c0cb40bb691fbcecbfdab7f Mark Johnston 2026-04-21 14:30:36
tests/netinet6: fix missing require.progs
Approved by:  pouria
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D56569
d8651498746e2b9f69abf664f540cbc9daa0aec1 Olivier Cochard 2026-04-22 07:35:56
ctl: require ctladm in addition to sg_opcodes
Each test case in opcodes.sh uses ctladm to create and remove the LUN it
exercises, but only sg_opcodes was listed in require.progs.
On systems where ctladm is not builded the tests would fail at setup instead of
being skipped cleanly.

Approved by:    asomers
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D56568
19213b8eb33f8cb692abb1ee857778af347ddfeb Olivier Cochard 2026-04-22 14:14:04
ctladm tests: Only use allowed chars in IQN
_ isn't part of the allowed IQN format, but - is.

None functional change.

Reviewed by:            asomers, ngie
Approved by:            asomers (mentor)
MFC after:              1 week
Sponsored by:           ConnectWise
Differential Revision:  https://reviews.freebsd.org/D56557
51b65c6af2e19f1e944c67aa2b5252cd9dc9e2f7 Johan Söllvander 2026-04-22 14:19:42
jail: tests: cosmetic-ish improvements
The new version of incrementing `jid` is a little cleaner and harder to
mess up, and also fix a nwlin omission while we're here.

These comments were dropped on D51502; ngie takes a co-author credit
so that they're not blamed for the commit message, but I can't claim
that I tweaked their suggestions.

Co-authored-by: ngie
8d680381c89d8a8d1c0519a7eaa14ba41724b930 Kyle Evans 2026-04-23 02:59:21
tests/pf/nat: endpoint_independent: wait for tcpdump to start
This matches pflog.sh tests and fixes flaky tests found in CI[0].

[0] https://ci.freebsd.org/job/FreeBSD-main-amd64-test/28126/testReport/junit/sys.netpfil.pf/nat/endpoint_independent_exhaust/

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289628
Reviewed by:    glebius
Approved by:    lwhsu (mentor)
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56145
60000d94b4e85caf931230a8a7ae86888db00d01 Siva Mahadevan 2026-04-22 17:20:38
tests/ipfw: Make tests run more reliably in parallel
- Don't use /dev/null as the pidfile for inetd, that doesn't work
  properly.  Create a pidfile in the per-test scratch directory.
- Use atf_check to validate results from setup commands.

MFC after:      1 week
bea17411473bc58608badd425c223ee59d40a465 Mark Johnston 2026-04-26 00:33:45
tests/net/if_clone_test: Add a test for races between if_detach() and if_vmove_reclaim()
Ideally we shall have tests for all possible races. It is races between
if_detach(), if_vmove_loan(), if_vmove_reclaim() and vnet_if_return().
Well that requires too many tests and it appears to be less valuable to
have them all. So focus on potential in future regressions related to
recent fixes [1] and [2] only.

[1] ee9456ce3753 ifnet: Fix races in if_vmove_reclaim()
[2] ba7f47d47dc1 ifnet: if_detach(): Fix races with vmove operations

MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56606
f4be16983dea4904f85ac20e921ad2a8c18a0f79 Zhenlei Huang 2026-04-27 19:17:21
tests/netgraph: Add a test for races between if_detach() and vnet_if_return()
A ng_eiface(4) or physical interface does not involve the cloner hence
the detaching is a bit different with epair(4). Add more tests to cover
that.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292993
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56609
0988abd52352ae0977cd3e5c10316b7d94e1cac8 Zhenlei Huang 2026-04-27 19:17:22
tests: Temporarily skip two testcases
The changes [1] and [2] made to CURRENT introduce races between ifnet
detach and vmove operations. That requires extra effort to fix. They
are not MFCed to stable branches so the latter are not affected.
Temporarily skip two affected tests on CURRENT right now.

[1] 0bf42a0a05b9 bpf: virtualize bpf_iflist
[2] a4d766caf711 bpf: add a crutch to support if_vmove

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292993
Discussed with: kp
afa4648b6a30603faab56b649605a3393eac9986 Zhenlei Huang 2026-04-27 19:17:22
sys.net.if_wg.wg_key_peerdev_makeshared: Add require metadata
Add require.user root and require.kmods if_wg to
wg_key_peerdev_makeshared_head(), consistent with the other wg tests.

Without if_wg.ko causes ifconfig wg create to fail with EINVAL.  The
test also needs root to create jails.

Sponsored by:   The FreeBSD Foundation
41c5a4a2f888765b513efb13befe32fa084ad7cb Li-Wen Hsu 2026-04-28 17:06:25
tests/sys/arch/amd64: add a program to check INT $0x80 behavior on amd64
Requested and reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56654
2c2ec6bbc9cc7762a250ffe903bda6c2e44d25ff Konstantin Belousov 2026-04-27 04:23:36
tests/netlink: Add nexthop group tests for multipath
Added tests:
* Test for creating multiple routes.
* Test for merge multiple nexthops into a single nexthop group.
* Test for nexthop expirations from a nexthop group.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D56190
23b8d16c6641362833a8decdcb98b643006c3f5c Pouria Mousavizadeh Tehrani 2026-04-19 11:04:01
ping: fix listing test cases when scapy is not installed
The ATF-python test program was attempting to list test cases that
require scapy.  But it attempted to import the scapy module before the
test cases had been listed, resulting in an ImportError that kyua
interpreted as a test program crash.

Fix this behavior by handling that ImportError well enough to list test
cases, but not run them.  If scapy isn't present, Kyua will refuse to
run the test cases.  But it needs to be able to list them in order to
know to skip them.

Sponsored by:           ConnectWise
MFC after:              2 weeks
Reviewed by:            maxim
Differential Revision:  https://reviews.freebsd.org/D56765
3e845b1090565912375c5578cf0399d27b7fa70c Alan Somers 2026-05-01 23:06:35
tests/carp: Rework unicast_v4
For unicast tests, it is sufficient to use wait_for_carp() to verify
the setup is sane. Additional sanity checks are not necessarily
required but can serve purpose for redundancy.

For some unclear reason routed(8) is advertising route to carp BACKUP.
That makes the test flaky. Also routed(8) is marked deprecated and may
be removed from base in the future. Let's just add static route entry
manually for additional sanity checks.

Other noticeable changes:
  1. Add atf_check to configuration steps to prevent potential failure
on setup. That helps diagnosing on failure.
  2. Shorten the names of jails to improve readability.
  3. Prefer `[ifconfig|route|sysctl] -j` over `jexec [ifconfig|route|sysctl]`
to make the lines shorter.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294817
Reviewed by:    glebius (previous version), pouria, markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=93fbdef51a13 tests: carp: Update test case unicast_v4 to catch PR https://cgit.freebsd.org/src/commit/?id=284872
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56761
9137c66c2ea6cc09e3a6f8a042ecdc5a62e0f39e Zhenlei Huang 2026-05-03 11:02:15
lockf: Test that lockf does not spin on fd
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294832
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56723
0733afdb4dad58cfe7ad7f5994e26bf148d78199 Dag-Erling Smørgrav 2026-05-03 15:35:15
tests/if_lagg: Minor improvements
- Set require.kmods instead of relying on ifconfig to load if_lagg.ko,
  as this doesn't work when running within a jail.
- Simplify helper functions which create tap and lagg devices.

MFC after:      1 week
47ae0135d461854b72b905ac77bf3e1f5b2868bc Mark Johnston 2026-05-03 15:48:49
amd/int0x80 test: fix inline asm for gcc
Gcc complained about the unused %0 asm argument.

Fixes:  https://cgit.freebsd.org/src/commit/?id=2c2ec6bbc9cc ("tests/sys/arch/amd64: add a program to check INT $0x80 behavior on amd64")
Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D56781
d5728351a58b87764f3302eb8c4ca9f35e99e8b6 Ryan Libby 2026-05-04 16:34:41
tests: Add a simple regression test for an execve overflow bug
MFC after:    2 weeks
41b03932e59068decf03b7975889841f71c73ec4 Mark Johnston 2026-05-04 15:39:55
stat: Set the timezone before testing -t flag
The test assumes UTC, which is what I use on my development systems and
clearly what is used on our CI runners.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D56836
49e496d2776870fb36ed8ea4c8139b5eb9f7f747 Dag-Erling Smørgrav 2026-05-05 17:59:36
md5: Don't generate test cases just to skip them
Don't waste time generating Perl test cases for algorithms that are not
supported in Perl mode only to skip them when they are run.

MFC after:      1 week
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D56687
fd386e76fa2b29d99525c246cbfc05768a1f4a76 Dag-Erling Smørgrav 2026-05-05 19:44:29
stat: Expand devname test case
Test what happens when we ask for the rdev of a non-device.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D56838
2c88636e0e7a0316d5e6d146874bdb2751f75c40 Dag-Erling Smørgrav 2026-05-07 18:45:14
tests/ip_mroute: Remove test timeouts
The configured timeout of 30s is a bit too low for a couple of tests
which create 4+ VNET jails when running tests in parallel and with
kernel sanitizers enabled.  There's no reason to have custom timeouts,
just use the default.

MFC after:      1 week
3b16e96b005c723717aa6a4ebc48000354e64fa1 Mark Johnston 2026-05-12 17:45:08
tests/sys/arch/amd64: Add a basic ptrace syscall tampering test
Signed-off-by: Alex S <iwtcex@gmail.com>
Reviewed-by: kib
Pull-request: https://github.com/freebsd/freebsd-src/pull/2190
96f262dcacdbfb56e94c60985b07f9f8ee2d046b Alex S 2026-05-11 23:52:20
amd64/ptrace-sce-tamper test: get rid of PT_TRACE_ME
PT_TRACE_ME is only useful in combination with exec and there is no
exec in this test.

Signed-off-by:  Alex S <iwtcex@gmail.com>
MFC after:      1 week
8dd43304b397715a4313bcaebbf493b607a7099f Alex S 2026-05-16 01:16:32
routing: Add tests for metric
Add tests to make sure:
* Default metric is enforced.
* Lowest metric wins.
* Deleting routes by specifying gateway/metric works.

Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D57016
bc301fee4cb2c3e9ce220dc3e0cbb9d7d5a83d6f Pouria Mousavizadeh Tehrani 2026-05-15 14:03:37
tests/ndp: fix ndp_routeinfo_option testcase flakiness
Since we are sleeping for an indefinite period of time waiting
for the default route to appear, the expire times may be gone
past 1+ seconds, causing the Expire column to show <1800 or <600.

Fixes:  https://cgit.freebsd.org/src/commit/?id=f6bcc0925f0ea838da5183dc503f847e56d15cc8

Reviewed by:    pouria
Approved by:    lwhsu (mentor)
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56712
a8c74d6c64dfddae95b9c6d48a8ea82b7c4d7b25 Siva Mahadevan 2026-05-21 14:22:22
Commit group #125: MAC/do: Add basic tests on setting rules
MAC/do: Add basic tests on setting rules

MFC after:      1 minute
Sponsored by:   The FreeBSD Foundation
cba191e291c17b32247e12d6f94dcde56994bfe6 Olivier Certner 2026-05-21 13:34:14

BSD.tests.dist: Add the new sys/mac/do directory

Without that, 'make distributeworld' fails ('make buildworld' and 'make
installworld' do not need it).

Fixes:          https://cgit.freebsd.org/src/commit/?id=cba191e291c1 ("MAC/do: Add basic tests on setting rules")
MFC after:      1 minute
Sponsored by:   The FreeBSD Foundation
ad3d7666e00bb0261dd2b80f5f2d56ceeb84aba7 Olivier Certner 2026-05-21 20:18:19
tests/procdesc: Use a more efficient mechanism to block
Reviewed by:  kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57149
c9546bb61910d40f4cb0dfb9716ba6eba44d1a0d Mark Johnston 2026-05-22 14:56:47
lib/libc/tests/gen: add fts_open() error and edge case tests
Add ATF test cases covering fts_open() error conditions and
edge cases:

- invalid option bits (outside FTS_OPTIONMASK) yield EINVAL
- empty argv yields EINVAL
- empty path string yields FTS_NS with ENOENT
- nonexistent path yields FTS_NS, not open failure
- trailing slash does not crash (SVN r49851 regression)
- unreadable directory yields FTS_D then FTS_DNR, never FTS_DP
- multiple root paths are all visited left to right

Sponsored by: Google LLC (GSoC 2026)
Reviewed by:    asomers
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2217
113c262b2ad157790e19188bf298b7205bd1887b Jitendra Bhati 2026-05-21 01:40:13
lib/libc/tests/gen: add fts_children() tests
Add ATF test cases covering fts_children() behaviour:

- before fts_read returns root entry list
- empty directory returns NULL with errno 0
- non-empty directory returns all children in order
- called twice returns equivalent results
- FTS_NAMEONLY fills only fts_name, fts_info is FTS_NSOK
- non-directory node returns NULL with errno 0
- invalid options returns NULL with EINVAL

Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    asomers
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2218
e624417db8a136849caa31fc34266645ed6c3429 Jitendra Bhati 2026-05-21 01:44:04
tftp: Add test case with over-long URL
This adds a test case that passes a very long URL on the command line,
which would previously have resulted in a benign buffer overflow in
urihandling(), detectable only by compiling tftp with ASAN enabled.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57074
b94689d036c5f5bdc04d080ff7dd5d0e9df9b8d4 Dag-Erling Smørgrav 2026-05-22 17:57:27
sh/tests: Cut down builtins/read12.0 by 2 seconds
Since the test assumes a 250 ms response time, there is no need to delay
for 3 seconds. Instead, delay for the minimum possible 1 second.

Also, fix some assertions in builtins/read11.0 and builtins/read12.0. If
`set -e` is in effect, `foo` in `foo && bar` is considered tested and
therefore a failure does not cause the shell to exit.

Reviewed by:    bdrewery
Differential Revision:  https://reviews.freebsd.org/D55191
1df431576f99c3cc26dd4ceb1a6eda864cc9f196 Jilles Tjoelker 2026-05-23 19:47:15
sh/tests: Add a test for long line in history
cc145f5d8425f19fbe07110fed89ecde8d70ce78 Jilles Tjoelker 2026-05-22 14:07:20
ping: fix test timestamp_origin when tstamprepl is disabled
The timestamp_origin test sends an ICMP Timestamp Request (ping -Mt) and parses
the tso/tsr fields out of the reply.
When the sysctl net.inet.icmp.tstamprepl is 0, the kernel silently drops the
request, ping receives no reply, and the sed extraction yields an empty $tso.
The test then fails inside atf_check test -n "$tso" with the unhelpful message

Approved by:    maxim
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D57287
ff873565bc2c3e47fe1d070305aa851189ee8bcf Olivier Cochard 2026-05-28 10:40:48
tests: Fix reliability issues in POSIX ACL tests
The ACL tests use UIDs and GIDs 41 through 49 and expect them to be
unassigned.  Since GID 43 is now assigned to the audio group, some
tests have begun to fail.

While here, also fix a benign Perl syntax issue in the test runner.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57297
05039fda7ee12f3b857e55a461607b5af7b6c91f Dag-Erling Smørgrav 2026-05-28 12:26:26
ptrace_test: expect PT_STEP tests to fail on riscv
ptrace_single_step currently returns EOPNOTSUPP on riscv.

This temporarily fixes the following CI failures:
https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/16606/testReport/sys.kern/ptrace_test/ptrace__PT_STEP_with_signal/
https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/16606/testReport/sys.kern/ptrace_test/ptrace__step_siginfo/

Reviewed by:    kib
Approved by:    emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D57288
a7df326619ef9caa2ed00bf2d103dd278e7b32ec Siva Mahadevan 2026-05-28 16:32:24
Commit group #126: MAC/do
MAC/do: Tests: Remove shebang lines

They are automatically added by <bsd.test.mk>.

Reviewed by:    bapt
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
79a987aba154aca5965e4746ec5f867be8f22997 Olivier Certner 2026-05-22 16:47:04

MAC/do: Tests: Fix copyrights

No comma needed after a single year.  Add SPDX.

Reviewed by:    bapt
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
b0c948fe92acc8bd295cc53584e25c082c749cd1 Olivier Certner 2026-05-26 17:06:55

MAC/do: Tests: Declare required programs closer to use

Reviewed by:    bapt
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
6159187329b56a9b550db193796ae4d76c1a306c Olivier Certner 2026-05-22 14:19:57

MAC/do: Tests: Quote the source directory

In a standard test suite installation, this is not necessary, but be
bullet-proof to custom ones, however improbable.

Reviewed by:    bapt
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
33daea3f862d7fe996602756805a92a600356f94 Olivier Certner 2026-05-22 14:21:39

MAC/do: Tests: Add support for exec paths, jail parameters, subjails

And also allow configuration of the mdo(1) executable path.

This commit only contains new or modified infrastructure.  No functional
change intended at this point.

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
a95ff5ef7d1ffcb701913028253a4700cd9a1459 Olivier Certner 2026-05-22 14:23:31

MAC/do: Add consistency tests

Test that:
1. Concurrent changes to different parameters on the same jail are
   independent/atomic.
2. Inheritance works.
3. Relaxing only parent jail rules does not leak to a subjail thanks to
   sequential consistency.
4. Sysctl knobs and jail parameters stay consistent.

Some of these tests may be extended in the future with several layers of
jails (there is only a single subjail currently).

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
851499046d25fbe5841a55fb7bfcc879522f59a8 Olivier Certner 2026-05-22 14:33:18
tools/test/stress2/misc: Add msdosfs tests (currently failing)
Test msdos22.sh creates 1000 files with long random names consisting
of only ASCII characters. The mount is performed without -L option,
therefore no use of iconv to convert between character sets.

Test msdos23.sh mixes some non-ASCII characters into the file names.
The file system is therefore mounted with -L C.UTF-8 to include tests
of the conversions between UTF-8 and UTF-16.

Test msdos24.sh adds emojis to the names to test the (not yet
committed) support of UTF-16 surrogate pairs in filenames.

All 3 tests succeed with a small number of files (e.g., 10), but fail
most of the time when testing with 1000 files.

The tests have been added to all.exclude since they are expected to
fail. They shall be enabled as regression tests, when the msdosfs code
has been fixed.
aa029088ec130d71b406c4118346fbd933940826 Stefan Eßer 2026-05-29 15:52:05
fts: Add some depth to the options test
MFC after:    1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57323
7ec549870f2adeb0e896885220d4af6b47c4c9ba Dag-Erling Smørgrav 2026-05-29 17:45:01
tools/test/stress2/misc: Fix and enable new tests
The previously committed versions of these tests failed to prevent
duplicate file names in the list of files to process, leading to
missing files when a "mv" commando tried to operate on a file that
had already been renamed.

The test for filenames containing UTF-16 surrogate pairs stays
disabled, since the required kernel changes have not been committed,
yet.
11f23d7c078b319285727d277f05b6962280bcce Stefan Eßer 2026-05-29 23:05:04
Commit group #127: lib/libc/tests/gen: add fts_set() tests
lib/libc/tests/gen: add fts_set() tests

Add ATF test cases for fts_set():

fts_set:
- invalid instruction returns non-zero with EINVAL
- FTS_AGAIN revisits the current node
- FTS_AGAIN consecutive visits node three times
- FTS_FOLLOW on symlink to file yields FTS_F
- FTS_FOLLOW on symlink to directory causes descent
- FTS_FOLLOW on dead symlink yields FTS_SLNONE
- FTS_SKIP prevents descent into directory
- fts_set_clientptr/fts_get_clientptr round-trip
- fts_get_stream returns parent FTS* from FTSENT*

Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    asomers
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2242
940142d6103746bb1158c408da443d0240b836d9 Jitendra Bhati 2026-05-20 15:40:51

fts: address post-merge feedback on fts_set_test.c

Per review by des@:

- Remove fts_check_debug() which has no effect in fts_set_test.c, and
  remove unused #include "fts_test.h"
- Add errno = 0 before fts_read() so errno check is meaningful
- Remove fts_lexical_compar where traversal order does not matter
- Change int boolean flags to bool throughout
- Use !saw_inside instead of saw_inside == false
- Move fts_set_clientptr/fts_get_clientptr test inside fts_read()
  loop so the pointer is exercised during active traversal

Fixes:          https://cgit.freebsd.org/src/commit/?id=940142d6103 ("lib/libc/tests/gen: add fts_set() tests")
Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    des, asomers
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2258
ee213339f4b21782cd1b44086ff9b7fe1fd682c5 Jitendra Bhati 2026-06-03 22:39:45
xinstall: Add test for -d -s not allowed together
Reviewed by:  des
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57403
4908bea5b7f5de70032e201e718958ef40bc3b03 Ed Maste 2026-06-03 14:13:45
tests: Avoid sleep when causing a write error
Cause a write error using a fifo and wait, rather than needing a sleep
to wait for something to terminate. This is faster and avoids a
potential test failure on a heavily loaded system.

Using /dev/full would be simpler, but it is not portable enough (it
tends not to be available in jails, even). Starting programs with stdout
not open or only open for read/execute/search may have unexpected side
effects.

Reviewed by:    ngie, des
Differential Revision:  https://reviews.freebsd.org/D57213
73e0d6b44038d1c7764c5013a54ae17a8f680a69 Jilles Tjoelker 2026-06-03 22:10:08
fts: address post-merge feedback on fts_children_test.c
- Remove fts_check_debug() which is only needed by test cases
  that use the fts_test() helper; fts_children_test.c does not
  call fts_test()
- Remove fts_lexical_compar where traversal order does not matter
  for the test result
- Drop fts_test.h and copy fts_lexical_compar locally
- Pull up NULL argument onto same line as fts_open

Fixes:          https://cgit.freebsd.org/src/commit/?id=e624417db8a1 ("lib/libc/tests/gen: add fts_children() tests")
Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    des, asomers
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2260
c606eb37135d3e9cfea4d34c147699e0713dd5d2 Jitendra Bhati 2026-06-04 17:04:51
fts: add misc fts traversal tests
Extend fts_misc_test.c with additional test cases:

- FTS_NOCHDIR with absolute paths allows application chdir freely
- fts_name is always NUL-terminated with correct fts_namelen
- FTS_D/FTS_DP are paired and fts_level increments correctly
- FTSENT fts_errno/fts_dev/fts_ino/fts_nlink are correct
- circular symlink loop under FTS_PHYSICAL terminates
- cycle via symlink under FTS_LOGICAL yields FTS_DC
- fts_close after root deletion must not crash
- fts_close after root rename restores CWD (SVN r77497)
- FTS_NOCHDIR + empty directory does not corrupt path (SVN r49772)
- FTS_NS entry has non-zero fts_errno
- FTS_XDEV and FTS_WHITEOUT stubbed pending mount setup

Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    asomers, jillest
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2248
b45654c6a4d3b2a322b5787e3233b1b22ef4d128 Jitendra Bhati 2026-05-26 11:23:53
fts: add fts regression tests
Add ATF regression tests for previously-fixed fts(3) bugs:

- PR 45723: directory with read but no execute is traversed via
  FTS_DONTCHDIR fallback, not silently skipped
  (commit 1e03bff7f2b7)
- PR 196724: FTS_SLNONE must not be returned for a non-symlink;
  time-bounded race test runs for 1 second with concurrent
  file creation/deletion
  (commit bf4374c54589)
- PR 262038: readdir(2) errors produce FTS_DNR with fts_errno
  set, not silently treated as end-of-directory
  (commit 0cff70ca6654)
- SVN r246641: normal traversal works correctly with O_DIRECTORY
  fix in fts_safe_changedir()
  (commit f9928f1705ee)
- SVN r261589: no crash when tree modified during traversal;
  time-bounded race test runs for 1 second with concurrent
  file creation/deletion
  (commit c6d38f088e5c)

Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    asomers
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2257
670738a17568f2579b866878f39d2a824a386297 Jitendra Bhati 2026-06-03 19:47:18
tests/ptrace: Validate PT_SC_REMOTE with some tricky syscalls
Reviewed by:  kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57485
6cd8a1bf4f15ff8a9b646dc94ac90b3fe0926650 Mark Johnston 2026-06-08 22:45:54
mac_portacl tests: rewrite the test program and test unspecific family.
Reviewed by: imp,emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1659
ce08af63788da219c0c5826fc3f2345fb2ce29f4 K Rin 2025-04-12 03:05:47
libc/tests: copy ieeefp tests out from contrib/netbsd-tests and rename them as FreeBSD test convention.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1656
85e449cfcfdf3a3ea99bae7fed9f3cd436eb21ec K Rin 2025-04-10 02:33:21
libc/tests: Enable fpsetround_basic which was never triggered since ported.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1656
2671607f1b5c6e787eb754b0d291a2b5e28e8ac9 K Rin 2025-04-10 04:34:47
libc/fortify_uio_test: replace stdin in base readv tests
This fixes the readv_before_end and preadv_before_end test
timeout failures on riscv.

See https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/lastCompletedBuild/testReport/lib.libc.secure/fortify_uio_test/readv_before_end/

Reviewed by:    kevans, emaste
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57420
9f2a38cf40f2632472b3889505fd1ab5d6ba9e1b Siva Mahadevan 2026-06-10 22:27:42
memfd_test: skip hugetlb testcase when large page requests are not supported
64b053f879a8b3c4aa31e1ab99340dfe0ddfea0c Siva Mahadevan 2026-06-11 00:08:37
tools/test/stress2/misc/all.debug.inc: skip undefined variables
On my ZFS based systems, no allocations occur with tags "newblk" or
"freework". This leads to errors executing the tests that check for
memory leaks. Skip the checks if the output of wmstat -m does not
contain lines corresponding to those allocations.

MFC after:      3 days
6e5b990c509777544b790cc8e490965166d04684 Stefan Eßer 2026-06-11 11:15:12
tools/test/stress2/misc/msdos24.sh: improve surrogate pair test
Instead of varying only the low surrogate do also randomly choose a
suitable high surrogate.

MFC after:      3 days
596dadbbb5a711477f811fed65a6c463801d16c5 Stefan Eßer 2026-06-11 11:36:09
tools/test/stress2/misc/all.exclude: remove msdos24.sh
Remove test for UFC-16 surrogate pairs in file names from this exclude
list, since kernel support has been committed and the test can be now
expected to succeed.

MFC after:      3 days
3260c42c4183ac817cf08fcaa236d4d21b4fc0d2 Stefan Eßer 2026-06-11 11:39:19
tools/test/stress2/misc/msdos12.sh: fix permission issue
This test runs with rights of an un-privileged user writing to a file
system only writable by the owner. Since no UID was provided in the
mount command, the owner of the file system was "root", and thus
writing was not allowed for $testuser. Fix this issue by mounting
with "-u $testuser".

MFC after:      3 days
b440741db4ea1ccfa17acc2b3c37863dd819dcf3 Stefan Eßer 2026-06-11 11:42:23
tests/jaildesc: Add some more test scenarios
MFC after:    1 week
Differential Revision:  https://reviews.freebsd.org/D57147
fe03a78c5d5966992c8df482d984bae83dc92b45 Mark Johnston 2026-06-12 14:58:19
tests/jaildesc: Use a more efficient mechanism to block
MFC after:    1 week
Differential Revision:  https://reviews.freebsd.org/D57148
75b23c102e8d797654025affdfada0b6771a95ba Mark Johnston 2026-06-12 14:58:43
tests: Fix build if TIOCSTI is not defined
Some downstream projects (e.g. ElectroBSD) have removed the TIOCSTI

We already have some components (such as mail and tcsh) that build
without TIOCSTI defined.  This is (existing portability support in those
projects.

Simplify things for downstreams by extending this approach to this
additional TIOCSTI user.

Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D50614
52a2b4bc5da21d7a54cb16b9450196244b59b8c0 Ed Maste 2025-05-30 15:58:41
tests/pf/route_to: check_random: rely on test timeout to fail
This test is known to be flaky if 10 attempts happens to be
not enough for the test to pass. Usually, this test passes in ~4-6 attempts.
See https://ci.freebsd.org/job/FreeBSD-main-amd64-test/28664/testReport/junit/sys.netpfil.pf/route_to/random_table/

Rely on the timeout (default 5 mins) to catch a failure here, rather than just 10
attempts. It's very unlikely that 5 mins worth of attempts still isn't enough.

For a history of flakiness, see
https://ci.freebsd.org/job/FreeBSD-main-amd64-test/lastSuccessfulBuild/testReport/junit/sys.netpfil.pf/route_to/random_table/history/

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289477
Reviewed by:    kp
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57408
1294f332aec02e111b47d69e0d91e32dc2624001 Siva Mahadevan 2026-06-17 16:52:00
tests: unix: pull a recvfd_payload_cmsg out of recvfd_payload
This is almost a trivial factoring, but it's still a bit of boilerplate
that we don't care to rewrite- the SO_PASSRIGHTS test will still receive
some data, so the iovec construction still saves us a few lines.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57544
2f363febf8bf5c3e9ffad95b5998b461adc77c28 Kyle Evans 2026-06-19 04:03:30
tests: unix: add SCM_RIGHTS tests for SO_PASSRIGHTS
We test both the standard case where we want to reject any SCM_RIGHTS
message, as well as the case where the kernel discards the unwanted file
upon receipt.

Reviewed by:    glebius (previous version), markj
Differential Revision:  https://reviews.freebsd.org/D57426
c08a86e0c6d989c926c2777c978155dde7d0697a Kyle Evans 2026-06-19 04:03:30
tools/regression: Expand stdatomic conformance tests
Extend the existing test utility to cover recent stdatomic
changes and improve validation of interface semantics,
compile-time assertions, and behavioural conformance.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
0f8941fedce6c622f0fa71464b7790225aefa3e6 Faraz Vahedi 2026-05-08 11:40:02
Commit group #128: sound tests: Add PROT_EXEC rejection test
sound tests: Add PROT_EXEC rejection test

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj, kib
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/30
730eaf466493315c1d1164eb6b59b14766f49322 Christos Margiolis 2026-06-12 06:20:26

sound tests: Remove trailing PROT_EXEC

Fixes:          https://cgit.freebsd.org/src/commit/?id=730eaf466493 ("sound tests: Add PROT_EXEC rejection test")
Reported by:    Oliver Pinter <oliver.pntr@gmail.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      6 days
f6b3bd1f3384d262b893af123f3fc2df21c5b9ee Christos Margiolis 2026-06-21 12:17:39
Commit group #129: tests: Fix race condition in aslr_setuid
tests: Fix race condition in aslr_setuid

Use a cloexec pipe to block the parent until the child is ready.

While here, redirect the output from ping to /dev/null, and mark the
test as requiring the inet feature since we ping the IPv4 loopback.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296116
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57734
080a4087014e1d19136cc77028019d98b5c69e1e Dag-Erling Smørgrav 2026-06-22 13:23:31

tests: Fix race condition in aslr_setuid, take 2

Instead of a cloexec pipe, ingest ping's stdout and block until it has
printed its initial summary, then close the pipe and return to the main
test loop.  Run ping in quiet mode so it won't mind that stdout is gone.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296116
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=080a4087014e ("tests: Fix race condition in aslr_setuid")
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57763
86950cf9ffe89b7978fca019019692b3ea492044 Dag-Erling Smørgrav 2026-06-23 15:20:26
Commit group #130: fusefs: fix a race in the pre-init tests
fusefs: fix a race in the pre-init tests

These tests allow the user to customize the INIT response.  But it's
necessary to block the daemon's service loop from running until those
expectations have been set.  This race has never caused failures before
simply due to luck.  But now it's failing on slower platforms.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296236
Reported by:    siva
MFC after:      2 weeks
Sponsored by:   ConnectWise
Reviewed by:    siva
Differential Revision: https://reviews.freebsd.org/D57781
2c1482e305368af182a7bde0e53d0d180b319326 Alan Somers 2026-06-23 17:12:04

fusefs: proofread an error message in the tests

Reported by:    otis
Fixes:          https://cgit.freebsd.org/src/commit/?id=2c1482e3053 ("fusefs: fix a race in the pre-init tests")
MFC after:      2 weeks
Sponsored by:   ConnectWise
381ebe25f0b9fae5b3470e9c6e0767909e0fa85a Alan Somers 2026-06-23 20:48:06
fusefs: fix two intermittency bugs in the destroy tests
* Though undocumented, statfs(2) can sometimes return EBADF or ENOENT
  while an unmount is in progress.

* In MockFS::write_response, write(2) may fail if m_fuse_fd has already
  been closed.  This doesn't happen in the normal sequence of events,
  but it can happen if some process unrelated to the test nosily decides
  to access the test file system while it's being unmounted.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296237
Reported by:    siva
MFC after:      2 weeks
Sponsored by:   ConnectWise
Reviewed by:    siva
Differential Revision: https://reviews.freebsd.org/D57787
b7d2f7c1a68c270ae5f46b8cfcfb85aa792b6b12 Alan Somers 2026-06-23 20:42:25
tests/test_rtsock_l3: fix flaky temporal route addition tests
If RTM_DELETE arrives before RTM_ADD, the test will skip the first
reply and then timeout after attempting to read another message from
the rtsock_fd.

See the CI test failure[0] for more details.

[0] https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/16628/testReport/sys.net.routing/test_rtsock_l3/rtm_add_v6_temporal1_success/

Reviewed by:    pouria
Fixes:          https://cgit.freebsd.org/src/commit/?id=e02d3fe70c7247027c85d60179c331618554ba34
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
9e2d8ec2df414a8019d9c31a9a09a5cc728b4c19 Siva Mahadevan 2026-06-18 15:33:00
ping/tests: expect bell chars from stderr after initial status
After 141bb85798 and 8bda488114f3, ping(8) first writes and flushes the
initial status to stdout, then writes notification bell characters to stderr.

This patch corrects the expected order of the output to stdout and stderr.
This is a temporary fix; the test should be rewritten to separate the output
streams and run expectations on each individually.

Reviewed by:    des
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
5b8c28adb829b50fb8ac065637fa99f717858bab Siva Mahadevan 2026-06-26 12:22:57
ping: Fix bell char ordering in -A test cases
Previously, these tests expected the bell chars to arrive
before the initial status line. This appeared to be ok because
ping(8) incorrectly mixed unbuffered and buffered writes by using
printf(3) calls for the initial status, but direct write(2) calls
for the bell chars. 141bb85798 revealed that the test's assertions
only passed because the buffered writes did not get flushed before
the direct writes in the test runs.

8bda488114f3 fixed ping(8) to use POSIX stdio buffered writes
in all cases and guarantee a deterministic output ordering to stdout
observers. This patch fixes the test to match the correct ordering.

Reviewed by:    des
Sponsored by:   The FreeBSD Foundation
f7f916d755fe5b48a2a68a937beea770b7bafa95 Siva Mahadevan 2026-06-26 12:22:57
libc: gen: add a test for rtld underflowing our posix_spawn thread
This is a distillation of the environment described in the PR, using
a dummy shlib and mapping it repeatedly.  This takes advantage of the
guard page added in 2767a1f3686e5b16 to reliably crash if rtld tries to
scale its stack usage excessively with the # DSOs loaded.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295991
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57954
3de9dc5bf4b438e0d98222dc028982380d5a25d2 Kyle Evans 2026-06-30 13:12:51
tests/libalias: Add a regression test for an alias_smedia bug
Approved by:  so
Security:       FreeBSD-SA-26:41.libalias
Security:       CVE-2026-49420
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57747
5c7a97aaf1ca4b8bc078bc18f73e04499d48598f Mark Johnston 2026-06-22 17:25:56

Style, typos, and comments

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

pause.3: Fix a typo in the manual page
- s/reimplemeted/reimplemented/

MFC after:      3 days
9eea5eccf40d408ad22ac06d9962b3a98a0f0628 Gordon Bergling 2026-04-04 07:02:01
bhnd(4): Fix a typo in a source code comment
- s/impementations/implementations/

MFC after:      3 days
04be4d04bbcbd061455b4424488b06927487a948 Gordon Bergling 2026-04-04 07:03:51
isci(4): Fix a couple of typos in source code comments
- s/THis/This/
- s/impementation/implementation/

MFC after:      3 days
adc41a72b8843047d02265a6ab2d8a5025a9ce89 Gordon Bergling 2026-04-04 07:05:51
ixl(4): Fix a typo in a source code comment
- s/seperated/separated/

MFC after:      3 days
ef3703a8cd9ade13d0c7a685577100e1fc18ee09 Gordon Bergling 2026-04-04 07:06:58
shlib-compat: Fix two typos in error messages
- s/implemeted/implemented/

MFC after:      3 days
3957e233dd9cf7b7599dd0a5efc59a78adfa9441 Gordon Bergling 2026-04-04 07:08:25
bsdconfig(8): Fix a typo in a source code comment
- s/THis/This/

MFC after:      3 days
b427b661be01e7b112531ba0b1ea27377a963bb8 Gordon Bergling 2026-04-04 07:09:56
virtio.4: fix typo
Reviewed by:  tuexen
Fixes:          https://cgit.freebsd.org/src/commit/?id=c70755bc0d8f ("virtio: add loader tunables to sysctl")
MFC after:      3 days
39c44fc55f0ed595623fb6d66a4060b7be32fa51 Timo Völker 2026-04-04 14:43:07
CONTRIBUTING.md: Correct typo
Reported by:  vladlen
cb813145f0ad72705cb4ccf80222a408abe3d54c Ed Maste 2026-04-05 12:21:44
mfiutil.8: Fix typo - missing macro for dev node
MFC after: 3 days
2bcdab574598e729273f7ddc7d898ffdb43b63b9 Alexander Ziaee 2026-04-02 03:20:45
tuning.7: Fix suds typo in manual pages
MFC after:            3 days
Fixes:                  https://cgit.freebsd.org/src/commit/?id=fc32c802158f Add two new manual pages
Differential Revision:  https://reviews.freebsd.org/D55814
f9160912415eef078c32317e02695bc0cc775d39 Alice Cariboni 2026-04-09 15:35:47
rc.conf: Fix typo in comment
The correct path is /etc/defaults/rc.conf (defaults in plural).

Reviewed by:    netchild
Fixes:          https://cgit.freebsd.org/src/commit/?id=cc4eb1ea1040 ("Add support for a /etc/defaults/vendor.conf override file")
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56456
8e08080ee581dfd30c128d032035da7b6ae44463 Jose Luis Duran 2026-04-17 13:55:16
sctp(4): Fix a typo in a source code comment
- s/initited/initiated/

Obtained from:  NetBSD
MFC after:      3 days
a154d72775cbf3f0679fb2f989b3d1a035ae41c9 Gordon Bergling 2026-04-17 14:59:26
librpcsec_gss: Fix a typo in a source code comment
- s/verfier/verifier/

MFC after:      3 days
59dacd7f008f54a335ec49e747bb8ddac67b0a83 Gordon Bergling 2026-04-19 07:57:03
stand/powerpc: Fix a typo in a source code comment
- s/limitiations/limitations/

MFC after:      3 days
4177af3b0e2db36238bbd6f973943f830d1ff46f Gordon Bergling 2026-04-19 08:01:18
thunderbolt: Fix a typo in a source code comment
- s/Inititalize/Initialize/

MFC after:      3 days
33e0180a306b9ed60df5eae1818c40ef65750525 Gordon Bergling 2026-04-19 08:04:12
msdosfs(4): Fix two typos in source code comments
- s/unititialized/uninitialized/

MFC after:      3 days
96246330c1c47ea06b7e781ddd87de45d541494f Gordon Bergling 2026-04-19 08:06:45
rpcsec_gss(3): Fix a typo in a source code comment
- s/verfier/verifier/

MFC after:      3 days
6323e2be6102e2a152b4420db272f7e880017cf0 Gordon Bergling 2026-04-19 08:08:56
conf: remove trailing whitespace
This prevents unwanted change when saving files on IDEs (e.g. VSCode,
Zed)

Signed-off-by: Minsoo Choo <minsoo@minsoo.io>
Sponsored by:   The FreeBSD Foundation
Pull request:   https://github.com/freebsd/freebsd-src/pull/2152
a338f5a0e7b1b5c22595aacbac44582ed5e0fe86 Minsoo Choo 2026-04-20 03:08:01
CONTRIBUTING: fix typos in GitHub contribution guide
Signed-off-by: Roman <nnov.brody@gmail.com>
Pull-request: https://github.com/freebsd/freebsd-src/pull/2156
b6dd9d3593f3286d8225b3bd2ae9248dcf92864c Roman 2026-04-21 19:16:15
Commit group #131: fix typo
fix typo: remove duplicate 'the' in ffs_vfsops comment

Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
82525a8ead6b778f4eb0f7a6a2dbe327fa69fcfe Felipe Matarazzo 2026-04-29 16:14:29

fix typo: duplicate 'the' in OP_NOTROOT comment

Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
713332b4eb79be2ca6de36c47853eef099214913 Felipe Matarazzo 2026-04-29 16:14:32

fix typo: lenght -> length in netlink comment

Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
e1841a50d6a570517c2f3c9b94b9496cb5b60a9e Felipe Matarazzo 2026-04-29 16:14:35

fix typo: seperate -> separate in tcp_ratelimit comment

Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
0e235f77360c5c72dac28af105e6c9ed3cb66c09 Felipe Matarazzo 2026-04-29 16:14:37

fix typo: remove extra 'the' in rack.c comment

Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
a8cb5cb40005e698c7c4e21d1eb761822ad8c82c Felipe Matarazzo 2026-04-29 16:14:40

fix typo: writting -> writing in sack_filter

Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
092528b05d1fb0776fecb345ce99b1b68e8122b1 Felipe Matarazzo 2026-04-29 16:14:43
fix typos in rtsx.c comments: freqency and wich
Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
deb17abdeffef072a0c45eb92c798d1f7b3ce7c5 Felipe Matarazzo 2026-04-29 16:14:46
fix typo: recieved -> received in test comment
Signed-off-by: Felipe Matarazzo <felipemps@protonmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2174
0e680203d59aac1a0e77f0d297d3ccb9777be749 Felipe Matarazzo 2026-04-29 16:14:49
blocklistd: Fix RFC1918 typo
The address in the configuration file example was intended to be from
the 192.168.0.0/16 range of IPv4 private addresses (RFC1918).

Reported on mastodon.social at
https://mastodon.social/@asmodai/116316630762241486.

Fix submitted upstream by emaste@.  Fixing locally first.

Reviewed by:    emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56773
5a6d9479ae2271a97dd23ceee8ad284770302874 Jose Luis Duran 2026-05-03 05:31:51
sysctl: Fix typo in DDB help text example
96840278032f856669597129e9d16c818e40dc15 Justin Hibbits 2026-05-03 18:49:31
Fix typo in curthread
8334d46162e46f400b04b93d79e310153380d643 Simon J. Gerraty 2026-05-05 20:14:36
freebsd-base.7: style
09d81767e32cb437da0ac7d1c3b51eed01591b82 Maxim Konovalov 2026-05-07 01:50:45
thunderbolt: Fix typo in comment
Reported by:  adrian
Sponsored by:   The FreeBSD Foundation
fdd7daa2318ed3177e2674b9a3d18d21e2035ee1 Aymeric Wibo 2026-05-09 17:22:41
clock_gettime.2: Fix a couple of typos
Reviewed by:  emaste
Differential Revision:  https://reviews.freebsd.org/D56990
52fa2f9f8d57e4dde555567794c6b3e0e242b8a1 John Baldwin 2026-05-13 18:11:26
cap_fileargs: fix typo
69e9d5d306699d40148256722d7240dbb5da8fb5 Mariusz Zaborski 2026-05-13 19:51:44
cap_dns: fix typos
4569c022db0bd2242eed883c33207980ddb00019 Mariusz Zaborski 2026-05-13 19:55:29
cap_net: fix typos
efc1f50ec4999e4222e1f1b3d6d2f668f9169afb Mariusz Zaborski 2026-05-13 19:56:09
cap_sysctl: fix typo
45fa572b94e7c61de5797ea877af3dade91af23f Mariusz Zaborski 2026-05-13 19:57:20
style.mdoc: Explain why not to abuse Nm
MFC after:            3 days
Reviewed by:            0mp
Differential Revision:  https://reviews.freebsd.org/D55299
bcd50fe5c3c6e70c710e13378999814e9df43d3c Alexander Ziaee 2026-05-15 12:49:20
dpaa: Restore Semihalf license header
This is a "new" file, but is mostly copied from if_dtsec_fdt.c, so need to
retain the original license header in addition to the new one.

Reviewed by:    ziaee
Differential Revision:  https://reviews.freebsd.org/D57123
31855427d93425a699ff9f53cb5eaf2f4e1be200 Justin Hibbits 2026-05-08 19:02:18
tftp: Style cleanup
MFC after:    1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57073
29aaaa5e6660310311fe443d8792b31181e1dd3c Dag-Erling Smørgrav 2026-05-22 17:57:23
lpd: Style and whitespace cleanup
No functional change intended.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57186
123591e41c559fc2ae0f179f1385df05132881da Dag-Erling Smørgrav 2026-05-25 16:51:58
nfs: Fix argument typo to avoid a crash
A typo resulted in the wrong argument for a bytewise
comparison that could result in a crash if
the incorrect argument was not a valid pointer.

This patch fixes the argument.

While investigating this, I noticed that the
correct argument was not being filled in as
required, so this patch fixes that, as well.

Somehow, recovery from a NFSv4.1/4.2 server
crash worked during testing, so this was not
detected.  The bug/patch only affects NFS
client mounts using NFSv4.1/4.2.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294925
Reported by:    Jov <amutu@amutu.com>
MFC after:      3 days
4d80d4913e79c8b5918b1f04c1c7b38e6c76b9b4 Rick Macklem 2026-05-25 19:22:32
nanobsd: Minor style fixes
- Use $(...) notation instead of legacy backticked `...`
- Use tabs for indentation
- Indent continuation lines with 4 spaces

Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57039
1dac971fbdfbe0acc8289eceddc383172a9aac44 Jose Luis Duran 2026-05-27 00:12:07
arm64 locore: Fix a comment typo: Of -> If
Reviewed by:  kib, andrew
Sponsored by:   AFRL, DARPA
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
fce595344c51850a7113430c77e70c8777383a98 John Baldwin 2026-03-26 13:03:51
certctl: Style nits
MFC after:    1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57298
39f23af2ba4b845eb7f4ec7ae4079a67557eb63d Dag-Erling Smørgrav 2026-05-28 12:28:22
style.9: Fix a typo (missing word)
Fixes:          https://cgit.freebsd.org/src/commit/?id=af2c7d9f6452 ("style.9: Encourage style changes when doing significant modifications")
MFC after:      1 day
Sponsored by:   The FreeBSD Foundation
1876f629b97608679f1bd71b9aa88a57b55c4574 Olivier Certner 2026-06-01 07:23:08
assert.h: style(9): Space after #define, between #endif and comment
style(9) still allows TAB after #define but this is a historical
artifact and by far the minority of uses cases.  Going forward, we would
like to promote the use of a single space, as it allows alignment to
survive line prefixing (such as in diffs).

style(9) also has prescribed a single space between '#else' or '#endif'
and a comment recalling the guard since 2002.

So, commit 157c184689ea ("assert.h: Remove leading tabs for whitespace
consistency") was good, and in line with rules about whitespace changes
(since the file was heavily modified by surrounding commits).

This commit is thus basically a revert of 439710cf003b ("assert.h:
Revert "Remove leading tabs for whitespace consistency"), which extended
replacing spaces with TABs in the code introduced in the meantime (after
commit 157c184689ea).

Reviewed by:    fuz, imp
Fixes:          https://cgit.freebsd.org/src/commit/?id=439710cf003b ("assert.h: Revert "Remove leading tabs for whitespace consistency")
MAC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57391
7487932f4fbc5a71231d3b1fc93d160253f38c83 Olivier Certner 2026-06-02 10:01:05
Commit group #132: .git-blame-ignore-revs: <assert.h> whitespace changes
.git-blame-ignore-revs: <assert.h> whitespace changes

Reminded by:    brooks
Sponsored by:   The FreeBSD Foundation
8ee0f80252d162e1db6a2def73c5b956f5b7307e Olivier Certner 2026-06-04 13:05:38

.git-blame-ignore-revs: <assert.h> whitespace changes: Fix comment

Fixes:          https://cgit.freebsd.org/src/commit/?id=8ee0f80252d1 (".git-blame-ignore-revs: <assert.h> whitespace changes")
Sponsored by:   The FreeBSD Foundation
4f7d987015ddf92ec6a56c7573132a8548474b78 Olivier Certner 2026-06-04 13:31:40
mxge(4): Fix a typo in a source code comment
- s/deterimine/determine/

MFC after:      3 days
14e93e3e360718f2272028fbf99775df3c192e83 Gordon Bergling 2026-06-11 04:03:02
style.mdoc.5: Document Nd style
The Nd macro takes the rest of the line as an argument,
so there is no need for extra quoting.

MFC after:      3 days
4ef1a73c22f8cd07f733bdeb6ff49da28ea8aa93 Mateusz Piotrowski 2026-06-13 10:54:09
aic7xxx: Fix two typos in source code comments
- s/Diable/Disable/
- s/connonical/canonical/

MFC after:      3 days
49ced8d765f46c3f81214590ad384846cfdfbbf8 Gordon Bergling 2026-06-14 08:45:52
sdhci(4): Fix a typo in a source code comment
- s/freqency/frequency/

MFC after:      3 days
dd8ba1f2fc513cea3ef18b6cdfed0e7d4260bb1a Gordon Bergling 2026-06-14 08:47:14
ufshci(4): Fix a typo in a source code comment
- s/Diable/Disable/

MFC after:      3 days
54e4b9c9faf0d4d478eea41fed0a7c7f0bac5eda Gordon Bergling 2026-06-14 08:48:18
qcom_clk: Fix a typo in a source code comment
- s/freqency/frequency/

MFC after:      3 days
6280a0630089d6e1726f9942ce9118556a32bb59 Gordon Bergling 2026-06-14 08:50:02
et(4): Fix a typo in a source code comment
- s/Diable/Disable/

MFC after:      3 days
0ea84e9cce72e9df9d621b731ddd7247e175b3a7 Gordon Bergling 2026-06-14 08:50:59
clk: Fix a typo in a source code comment
- s/freqency/frequency/

MFC after:      3 days
58cf810066c850131d29de2eee32239e6f817c58 Gordon Bergling 2026-06-14 08:51:59
acpi(4): Fix a typo in a source code comment
- s/freqency/frequency/

MFC after:      3 days
f2574978567e63a1eb518c6d325ddf424a22a5e0 Gordon Bergling 2026-06-14 08:52:48
umass.4: Correct a typo in the manual page
- s/Sotrage/Storage/

MFC after:      5 days
89234ff7bd09053627727d577eaaa143ccdd5668 Gordon Bergling 2026-06-14 09:34:06
d.7: Correct a few typos in the manual page
- s/occurance/occurrence/
- s/Univeristy/University/

MFC after:      5 days
8a13adf80cb0dffb9fa7ca515664171c2362ad5e Gordon Bergling 2026-06-14 09:36:36
jail.8: Fix two typos in the manual page
- s/Similarily/Similarly/
- s/passtrough/passthrough/

MFC after:      5 days
d9e0452f0c8af6b0c03b0bb2e3b824095021e168 Gordon Bergling 2026-06-15 09:07:24
mixer.8: Fix a typo in the manual page
- s/thet/the/

MFC after:      5 days
10b1a35d11866462b5e776015a1b79f4f8f704a6 Gordon Bergling 2026-06-15 09:10:52
pnfs.4: Fix a typo in the manual page
- s/Wihout/Without/

MFC after:      5 days
f930d8a6540648423288567ff473123ff5647484 Gordon Bergling 2026-06-15 09:14:20
pwd.1: Fix a typo in the .dD
- s/Februrary/February/

MFC after:      1 week
586a5bc03541397c432ce98a1551ebeee7c04ef2 Gordon Bergling 2026-06-15 13:40:05
rtw88: Fix typo in portability glue
Fix typo in if statement for compiling rtw88 against a Linux target.

Signed-off-by: Lambert Lim <lambert@sanesecurityguy.com>
Reviewed by: imp,ziaee
Pull Request: https://github.com/freebsd/freebsd-src/pull/2262
4b146555d39d9fb826bf4524df9e00eb8dad2bfe Lambert Lim 2026-06-05 09:00:20
.git-blame-ignore-revs: sys/kern/kern_cpu.c whitespace changes
Event:          Halifax Hackathon 202606
Location:       jrm@'s kitchen
Sponsored by:   The FreeBSD Foundation
5f43a84d049ec3451c7c5fa5b4f00a299d5f4c34 Olivier Certner 2026-06-25 01:25:31
heimdal: Fix some manpage typos
Reviewed by:  hrs
Event:          Halifax Hackathon 202606
Location:       jrm@'s couch
e4fdaaaed14e6b11cf622bde87e1da102e5b3257 Aymeric Wibo 2026-06-25 01:32:59
nfs_nfsdport.c: Fix a typo in a KASSERT
Reported by:  rlibby
fe7426b2c9f7c0242aa32e47de5f78967563833c Rick Macklem 2026-06-26 00:55:31
hwpstate_amd(4): Style: End brace of struct initializers on new line
Fixes:          https://cgit.freebsd.org/src/commit/?id=191f47bcd650 ("hwpstate_amd: Refactor the cpufreq code by using delegation pattenr")
MFC after:      2 weeks
Event:          Halifax Hackathon 202606
Location:       Dalhousie CS Faculty building
Sponsored by:   The FreeBSD Foundation
bdc3dca135c239cbbce3a437f49bc4e08828833f Olivier Certner 2026-06-26 14:15:57
hwpstate_intel(4): Fix comment for 'req', whitespace
MFC after:      2 weeks
Event:          Halifax Hackathon 202606
Location:       Seat 36K in AC667, over Thetford Mines
Sponsored by:   The FreeBSD Foundation
6b54e961528d83bcc7fd41051e66d01aa9c6d3fe Olivier Certner 2026-06-26 21:31:17
ps(1): Fix a few typos in the manual page
- s/occurence/occurrence/
- s/occurences/occurrences/
- s/ouput/output/

MFC after:      3 days
dd2127b54f97fd7445bb4f4187a148e979c9c944 Gordon Bergling 2026-06-27 10:48:11
bectl(8): Fix a typo in the manual page
- s/envionments/environments/

MFC after:      3 days
c94302609a5999786f0be77d1bd0b016153b6b11 Gordon Bergling 2026-06-27 10:49:15
ipfilter(4): Fix a couple of typos in the manual pages
- s/heirarchical/hierarchical/
- s/itnerface/interface/
- s/conjuction/conjunction/

MFC after:      3 days
0223ae33ad6dd29215bbb6efd041aa5b6c67dc1f Gordon Bergling 2026-06-27 10:51:19
ipfw(8): Fix a typo in the manual page
- s/exept/except/

MFC after:      3 days
1e36ffffe21042983304290a5742ad7e0e0ffe05 Gordon Bergling 2026-06-27 10:53:14
devd.conf(5): Fix a typo in the manual page
- s/betwen/between/

MFC after:      3 days
050962ab04a68756b45ff967af42eb2541b0ff5f Gordon Bergling 2026-06-27 10:54:18
natd(8): Fix a typo in the manual page
- s/appplications/applications/

MFC after:      3 days
be8c82bc8e83570474afa78c07f7583bb6813046 Gordon Bergling 2026-06-27 10:56:02
ggated(8): Fix two typos in the manual page
- s/colunm/column/
- s/operaions/operations/

MFC after:      3 days
e2339370737bdbebc8bd34a84f5b869da3a9ed43 Gordon Bergling 2026-06-27 10:58:09
nvmecontrol(8): Fix typos in the manual page
- s/givne/given/
- s/assocation/association/
- s/reporing/reporting/

MFC after:      3 days
26ffa3d4e70358e49811158d7d36f3c9b9097d8d Gordon Bergling 2026-06-27 10:59:32
iwlwifi.4, rtw88.4, rtw89.4: Fix xref typos
MFC after:    3 days
Reviewed by:    bz, ziaee
Fixes:  https://cgit.freebsd.org/src/commit/?id=0a2f7683bf0c ("man: iwlwifi/rtw88/rtw89: update man pages for Linux v7.0 based updates")
Differential Revision:  https://reviews.freebsd.org/D57720
d036b3b348d3f7be21f79461d7ad48e97b088ba8 Artem Bunichev 2026-06-29 00:42:30
pf.conf.5: Fix typo
Fix small typo in pf.conf(5)

MFC after:              3 days
Reviewed by:            ziaee
Differential Revision:  https://reviews.freebsd.org/D57938
bbc2d15857b8c44cf8558bf00663b508d421c94c Oleksandr Kryvulia 2026-06-29 09:51:18

Contrib code

MFV: xz 5.8.3.
Security:     CVE-2026-34743
MFC after:      3 days
f81c1f4339cd20ea89dad51c0f7d96e0e34313a9 Xin LI 2026-04-01 01:45:14
contrib/expat: import expat 2.7.5
Changes: https://github.com/libexpat/libexpat/blob/R_2_7_5/expat/Changes
         https://github.com/libexpat/libexpat/blob/R_2_7_4/expat/Changes

Security:       CVE-2026-32776
Security:       CVE-2026-32777
Security:       CVE-2026-32778
Security:       CVE-2026-24515
Security:       CVE-2026-25210
MFC after:      3 days
ae04c7bbf065278687fa930e81a96767e9009d38 Philip Paeps 2026-04-02 00:12:18
posix_spawn test: switch to POSIX spelling for addchdir and addfchdir
Reviewed by:  dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56222
e56858f05fd7071a39de7f7b1e632426fdf0624d Konstantin Belousov 2026-04-03 02:56:19
contrib/libucl: Import libucl 0.9.3
Differential Revision: https://reviews.freebsd.org/D54583
Approved by: bapt
MFC after:  3 days

Changelog: https://github.com/vstakhov/libucl/releases/tag/0.9.3
abda442d92fdbadcf81c79bc9ddba001d133c429 Muhammad Moinur Rahman 2026-04-03 11:53:18
Merge bmake-20260313
Merge commit 'fe271bdb43cf88ee129d94c0e286fe618fd28e89'
34a3834eadd03bec7703b8fbf9123f27b1114986 Simon J. Gerraty 2026-04-06 18:29:01
libfido2: Update to 1.16.0
Sponsored by: The FreeBSD Foundation
febb0da5bf4bc99828ebede7abcb039514ac367a Ed Maste 2026-04-07 13:14:41
contrib/libucl: Revert to old behavior of macros
Enable macros and includes by default as this is breaking package
building on HEAD. libucl 0.9.3 by default changed the behavior of
includes and macros. These were previously enabled but it switched to
disabled which breaks the package building in HEAD. This is a temporary
workaround for now to fix the package building specially for
releng/15.0. This might be reverted post EOL of 15.0 in the coming
months.

Reported by:    ivy
Fixes: https://cgit.freebsd.org/src/commit/?id=abda442d92fd ("contrib/libucl: Import libucl 0.9.3")
Tested by:      ivy
Approved by:    ivy, kevans
Differential Revision:  https://reviews.freebsd.org/D56294
a71fea51cecfe3bb70247ad62668e380e0f069ad Muhammad Moinur Rahman 2026-04-07 18:27:20
MFV: zstd 1.5.7.
MFC after:    2 weeks
Relnotes:       yes
c0d9a07101a1e72769ee0619a583f63a078fb391 Xin LI 2026-04-08 21:22:45
MFV: crypto/openssl: update to 3.5.6
This change brings in version 3.5.6 of OpenSSL, which features
several security fixes (the highest of which is a MEDIUM severity
issue), as well as some miscellaneous feature updates.

Please see the release notes [1] for more details.

PS Apologies for the confusing merge commits -- I was testing out a
new automated update process and failed to catch the commit message
issues until after I pushed the change.

1. https://github.com/openssl/openssl/blob/openssl-3.5.6/NEWS.md

MFC after:      1 day (the security issues warrant a quick backport).
Merge commit 'ab5fc4ac933ff67bc800e774dffce15e2a541e90'
10a428653ee7216475f1ddce3fb4cbf1200319f8 Enji Cooper 2026-04-09 01:44:24
crypto/openssl: update artifacts to match 3.5.6 release artifacts
A new manpage and any associated links will be added in the next commit.

MFC after:      1 day (the security issues warrant a quick backport).
MFC with:       10a428653ee7216475f1ddce3fb4cbf1200319f8
5254e16213ff1bb136ef24e0b0fe30625ac53563 Enji Cooper 2026-04-09 01:54:40
sys/contrib/zstd: further narrow FREEBSD-Xlist
We don't need any docs or examples in tree, as well
as any upstream-specific build infrastructure.

Differential Revision: https://reviews.freebsd.org/D55836
7c9418613a31571e4eceda55a417f7183d26acb5 Siva Mahadevan 2026-04-09 04:43:42
MFV: zstd: Remove entries listed in FREEBSD-Xlist
111a42d7d78a88ba6ff7b5d61b0867faccc00276 Xin LI 2026-04-09 04:48:39
Fix default for .MAKE.SAVE_DOLLARS
NetBSD make defaults this to "yes",
bmake defauts it to "no" to retain the traditional behavior.

The default is dealt with in bmake's Makefile but that does not
address boot-strap.

For now, just change the ifdef in main.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294436
e272f4a61e78037ec8477ba9e9afcbe3ae2cd8e3 Simon J. Gerraty 2026-04-13 17:38:50
rtw89: add a warn about beacon_int or dtim_period being 0
While after the changes to LinuxKPI 802.11 we should never be assoc
and not have dtim_period set, we have seen before that this could
happen.  Add a WARN as that will help debugging the following DIV 0.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
99bbfb77e3c395805fe0a7f19006c5c29136f9fc Bjoern A. Zeeb 2026-04-17 02:40:03
libarchive: Staticize some variables
This code was not being built due to errors in our libarchive
configuration.  Now that those have been addressed, staticize some
variables that trip a “no previous extern declaration” error.  This
is a subset of upstream PR 2962.

MFC after:      1 week
Reviewed by:    mm
Differential Revision:  https://reviews.freebsd.org/D56471
7e9d974bc023755161742f66c8c77546bab88586 Dag-Erling Smørgrav 2026-04-18 08:25:35
rtw88: update Realtek's rtw88 driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
41b641cc0537d1288cc05332bb4c5de3dcb12589 Bjoern A. Zeeb 2026-04-18 14:21:04
iwlwifi: update Intel's mvm/mld drivers
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
b2bd08185e4984c70179c195f712cef5a136d21b Bjoern A. Zeeb 2026-04-18 20:35:37
rtw89: update Realtek's rtw89 driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
422e9c5d878e14ec16bb89ef6df65d964d5ce2f1 Bjoern A. Zeeb 2026-04-18 20:48:44
mt76: update Mediatek's mt76 driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
63a40b65c9be74193bb07a76fd66c249bd562eae Bjoern A. Zeeb 2026-04-18 21:01:39
zfs: merge openzfs/zfs@1644e2ffd
Notable upstream pull request merges:
 #18148 d1b0a6982 draid: add failure domains support
 #18167 f203fedde Add zoned_uid property with additive least privilege
                  authorization
 #18191 -multiple FreeBSD: Fix a couple of races involving zvol creation
                  and teardown
 #18213 33ed68fc2 zpool create: report which device caused failure
 #18235 931deb290 Prevent range tree corruption race by updating
                  dnode_sync()
 #18282 b44a3ecf4 zpool: Change zpool offline spares policy
 #18310 -multiple Fix s_active leak in zfsvfs_hold() when z_unmounted is
                  true
 #18351 ce837a28e Bridge speculative and prescient prefetchers
 #18380 fc659bd6d draid: fix import failure after disks replacements
 #18385 16858492e FreeBSD: Implement relatime property
 #18390 a22b3f670 abd: Fix stats asymmetry in case of Direct I/O
 #18399 7b1682a82 Add support for POSIX_FADV_DONTNEED
 #18403 5cb95ad89 fix memleak in spa_errlog.c
 #18405 0752cf067 draid: allow seq resilver reads from degraded vdevs
 #18407 e635d27eb Add ability to set user properties while changing
                  encryption key
 #18414 2abf469be draid: fix cksum errors after rebuild with degraded disks
 #18415 -multiple Fix snapshot automount deadlock during concurrent zfs recv
 #18421 1644e2ffd Fix read corruption after block clone after truncate

Obtained from:  OpenZFS
OpenZFS commit: 1644e2ffd2640fa3e2c191ceaf048a5fc8399493
d8fbbd371ca11d9ad4b29b9d3a316885a5da0b15 Martin Matuska 2026-04-18 22:21:01
ath-common: update common Atheros/QCA code
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
ff18554fd6e616f5d965322be477dc406a2906bc Bjoern A. Zeeb 2026-04-19 15:07:36
ath10k: update Atheros/QCA's ath10k driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
02b46313fd1461338703a1e02c667b8dbcc36237 Bjoern A. Zeeb 2026-04-19 15:09:30
brcm80211: update Broadcom wireless brcmsmac and brcmfmac drivers
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
117d9331fedeb5c5657a796423c4f7b311f40770 Bjoern A. Zeeb 2026-04-19 15:16:04
ath11k: update Atheros/QCA's ath11k driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
4ed5b949d5e25456124a4d280d27e9719f90e9be Bjoern A. Zeeb 2026-04-19 15:27:01
ath12k: update Atheros/QCA's ath12k driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
60bac4d6438b6bcb3d7b439684211d05396d90ce Bjoern A. Zeeb 2026-04-19 15:38:33
zfs: Fix the build on 32-bit platforms
Fixes:                https://cgit.freebsd.org/src/commit/?id=d8fbbd371ca1 ("zfs: merge openzfs/zfs@https://cgit.freebsd.org/src/commit/?id=1644e2ffd")
Reported by:    Jenkins
019a4878831cee46a8df79bd4b7c1ea93db0a7a8 Mark Johnston 2026-04-20 16:17:08
rtw89: fix mismerge
Due to FreeBSD-specific code it seems a code update was not applied
to the FreeBSD part during the v6.17 driver update.
Add the missing lines.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=b35044b38f74c
adb16cd389c3456cbd538b658c3c0af5145dde91 Bjoern A. Zeeb 2025-12-03 22:13:10
Add 'contrib/pkgconf/' from commit '6294b6ab217a2d5f1d2bc23a64505a228294c508'
git-subtree-dir: contrib/pkgconf
git-subtree-mainline: 45827f9ad2e32ec8e4cdde62cbf722a48fb1b396
git-subtree-split: 6294b6ab217a2d5f1d2bc23a64505a228294c508
a3cefe7f2b4df0f70ff92d4570ce18e517af43ec Pierre Pronchery 2026-04-22 13:13:42
contrib/tzdata: import tzdata 2026b
9b95cab0a2927dfe07dbe6dc0056a80d5c730414 Philip Paeps 2026-04-23 15:44:33
ncsw: Allow pmap_kextract to handle direct map addresses
Effort:               CHERI upstreaming
Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2068
bee1aae0b3f19df40452ee91096fa957104db12f John Baldwin 2026-04-23 17:05:55
Fix memory corruption bugs in BSM record parsing
fetch_newgroups_tok(3): clamp group count to AUDIT_MAX_GROUPS before the
loop to prevent a stack buffer overflow when a crafted record specifies
more than 16 groups.

fetch_execarg_tok(3), fetch_execenv_tok(3): add a bounds check at the
top of the string-walking loop to prevent an out-of-bounds read when the
previous string's nul byte is the last byte of the record buffer.

fetch_sock_unix_tok(3): clamp the memchr search length to the number of
bytes remaining in the buffer to prevent an out-of-bounds read on short
tokens. Also clamp slen to sizeof(path) to prevent a one-byte overflow
when no nul byte is found within the path data.

fetch_socket_tok: fix copy-paste error where the remote address was
written into l_addr instead of r_addr.
Previously reported by: @haginara

Define AU_UNIX_PATH_MAX as 108 (the largest sun_path across all
supported platforms) and use it in au_socketunix_t instead of the
hardcoded 104.

Update fetch_sock_unix_tok to derive its search bound from
sizeof(tok->tt.sockunix.path) so cross-platform records from Solaris and
Linux with paths up to 108 bytes parse correctly without truncation.

REF: https://github.com/openbsm/openbsm/pull/87

Reviewed by:    kevans, markj
Differential Revision:  https://reviews.freebsd.org/D56510
a46205a100b3201a60aaca26e4ac8097e1e136a7 Christian S.J. Peron 2026-04-23 20:26:50
tzcode: Update to 2026b
MFC after:    1 week
76f642310d55b1d3892c1b1626c427d12f97de3a Dag-Erling Smørgrav 2026-04-24 20:07:20
Merge llvm-project main llvmorg-21-init-19288-gface93e724f4
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-21-init-19288-gface93e724f4, the
last commit before the upstream release/21.x branch was created.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
700637cbb5e582861067a11aaca4d053546871d2 Dimitry Andric 2025-12-07 15:15:22
Adjust llvm-project main llvmorg-21-init-19288-gface93e724f4, part 1
This adjusts the llvmorg-21-init-19288-gface93e724f4 import: add partial
third-party/ top-level directory.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
3f16c588d1d8c46d7025f95003602807d9c1ddb9 Dimitry Andric 2025-12-07 19:01:02
Adjust llvm-project main llvmorg-21-init-19288-gface93e724f4, part 2
This adjusts the llvmorg-21-init-19288-gface93e724f4 import: add partial
libc/ top-level directory.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
8f6978f83cc64a2e644d9bdf380a6996d3acdc4b Dimitry Andric 2025-12-09 13:44:39
Adjust llvm-project main llvmorg-21-init-19288-gface93e724f4, part 3
This adjusts the llvmorg-21-init-19288-gface93e724f4 import: add more
items to the libc/ top-level directory.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
bb722a7d0f1642bff6487f943ad0427799a6e5bf Dimitry Andric 2025-12-09 14:04:07
Fixups after llvm-project main llvmorg-21-init-19288-gface93e724f4 merge
Fix various configuration fails, update generated headers, Makefiles, etc.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
770cf0a5f02dc8983a89c6568d741fbc25baa999 Dimitry Andric 2025-12-09 09:38:16
Merge llvm-project release/21.x llvmorg-21.1.7-0-gcd708029e0b2
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/21.x llvmorg-21.1.7-0-gcd708029e0b2,
a.k.a. 21.1.7 release.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
e64bea71c21eb42e97aa615188ba91f6cce0d36d Dimitry Andric 2025-12-27 23:23:22
libcxx-compat: revert llvmorg-21-init-19251-g0c3a2faa8505:
  [libc++] Simplify the implementation of __libcpp_{,de}allocate (#147989)

  GCC 15 also supports `__buitin_operator_{new,delete}` now, so the
  `#else` cases are dead code. This patch inlines the calls to the wrapper
  functions and simplifies some surrounding code.

This is part of making libc++ 21 build with GCC 14.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
ad1f6ee5d7230a63c216cd9ad3b89d5b7d1c4a3a Dimitry Andric 2026-01-02 18:40:05
libcxx-compat: revert llvmorg-21-init-17684-gae9990ed9651:
  [libc++] Remove dead code from <type_traits> (#143854)

  Since we've upgraded to GCC 15 now, we can remove a bunch of dead code
  from `<type_traits>`.

This is part of making libc++ 21 build with GCC 14.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
f7bcd8d8c9336b97569265e5ad36b73b30357beb Dimitry Andric 2026-01-02 20:25:42
llvm-libc-macros: work around gcc defining LDBL_MANT_DIG as 53 on i386
Otherwise, gcc will not be able to compile parts of libc++ 21 in -m32
mode, resulting in errors similar to:

    In file included from /usr/src/contrib/llvm-project/libc/shared/str_to_float.h:13,
                     from /usr/src/contrib/llvm-project/libcxx/src/include/from_chars_floating_point.h:14,
                     from /usr/src/contrib/llvm-project/libcxx/src/charconv.cpp:12:
    /usr/src/contrib/llvm-project/libc/src/__support/str_to_float.h: In function 'void __llvm_libc::internal::set_implicit_bit(__llvm_libc::fputil::FPBits<T>&) [with T = long double]':
    /usr/src/contrib/llvm-project/libc/src/__support/str_to_float.h:77:10: error: 'struct __llvm_libc::fputil::FPBits<long double>' has no member named 'set_implicit_bit'
       77 |   result.set_implicit_bit(result.get_biased_exponent() != 0);
          |          ^~~~~~~~~~~~~~~~

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
718e5874be0306ea302fd2b8e1d97fc79682abbe Dimitry Andric 2026-01-02 20:32:05
Merge commit 598f21e9fcf7 from llvm git (by zhijian lin):
  [PowerPC] need to set CallFrameSize for the pass  PPCReduceCRLogicals when insert a new block (#151017)

  In the [ [CodeGen] Store call frame size in
  MachineBasicBlock](https://reviews.llvm.org/D156113), it mentions When a
  basic block has been split in the middle of a call sequence. the call
  frame size may not be zero, it need to set the setCallFrameSize for the
  new MachineBasicBlock. but in the function `splitMBB(BlockSplitInfo
  &BSI)` in the llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp , it do
  not setCallFrameSzie for the new MachineBasicBlock `NewMBB`, we will
  setCallFrameSzie in the patch.

  the patch fix the crash mention in
  https://github.com/llvm/llvm-project/pull/144594#issuecomment-2993736654

This fixes "error in backend: Found 1 machine code errors" while
crypto/openssh/packet.c for PowerPC64.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
48c35ae6ebfc6d9a2259979d915fd3bc5d6c01db Dimitry Andric 2026-01-10 14:45:16
Merge llvm-project release/21.x llvmorg-21.1.8-0-g2078da43e25a
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/21.x llvmorg-21.1.8-0-g2078da43e25a,
a.k.a. 21.1.8 release.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
7351d001fc7f5a77a18a102e12a3ca2cbfd6988c Dimitry Andric 2026-01-10 15:55:44
Commit group #133: libcxx-compat
libcxx-compat: revert llvmorg-21-init-9130-g9e3982d9ae81:

  [libc++] Replace __libcpp_{ctz, clz} with __builtin_{ctzg, clzg} (#133920)

  `__libcpp_{ctz, clz}` were previously used as fallbacks for `__builtin_{ctzg, clzg}` to ensure compatibility with older compilers (Clang 18 and earlier), as `__builtin_{ctzg, clzg}` became available in Clang 19. Now that support for Clang 18 has been officially dropped in #130142, we can now safely  replace all instances of `__libcpp_{ctz, clz}` with `__count{l,r}_zero` (which internally call `__builtin_{ctzg, clzg}` and eliminate the fallback logic.

  Closes #131179.

This is part of making libc++ 21 build with clang 18.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
821fc643b3cad922e5438760eed9cad0d6d9b3b0 Dimitry Andric 2026-01-04 19:43:38

libcxx-compat: revert llvmorg-21-init-15984-g650b451d0065:

  [libc++] Simplify the implementation of pointer_traits a bit (#142260)

This is part of making libc++ 21 build with clang 18.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
bb6713d38cc0d988378394f599d81d3a83dbaf03 Dimitry Andric 2026-01-04 19:43:58

libcxx-compat: revert llvmorg-19-init-5639-ga10aa4485e83:

  [libc++] Simplify the implementation of remove_reference (#85207)

  GCC 13 introduced the type trait `__remove_reference`. We can simplify
  the implementation of `remove_reference` a bit by using it.

This is part of making libc++ 21 build with clang 18.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
a114ece3e6158f49088b0704b4afef07040d83f3 Dimitry Andric 2026-01-05 19:54:32

libcxx-compat: revert llvmorg-21-init-10154-ge43e8ec7afbd:

  [libc++] Remove dead implementation of is_nothrow_convertible and merge the remaining code into is_convertible.h (#137717)

  We can use the `__is_nothrow_convertible` builtin unconditionally now,
  which makes the implementation very simple, so there isn't much of a
  need to keep a separate header around.

This is part of making libc++ 21 build with clang 18.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
035396ceda495f456ca570fb715b04a7fc3b25c2 Dimitry Andric 2026-01-05 19:55:12

libcxx-compat: revert llvmorg-21-init-8400-g703cfe745b96:

  [libc++] Replace __libcpp_popcount by __builtin_popcountg (#133937)

  `__libcpp_popcount` was previously used as a fallback for `__builtin_popcountg` to ensure compatibility with older compilers (Clang 18 and earlier), as `__builtin_popcountg` became available in Clang 19. Now that support for Clang 18 has been officially dropped in #130142, we can now safely  replace all instances of `__libcpp_popcount` with `__builtin_popcountg` and eliminate the fallback logic.

This is part of making libc++ 21 build with clang 18.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
5465db314a03c11b15e00f22be1609027dfc152c Dimitry Andric 2026-01-05 20:14:13

libcxx-compat: fix llvmorg-21-init-18351-gfcc09b6f0267:

  [libc++] Fix std::make_exception_ptr interaction with ObjC (#135386)

  Clang treats throwing/catching ObjC types differently from C++ types,
  and omitting the `throw` in `std::make_exception_ptr` breaks ObjC
  invariants about how types are thrown/caught.

  Fixes #135089

  Co-authored-by: Louis Dionne <ldionne.2@gmail.com>

Only use lambdas when in !defined(_LIBCPP_CXX03_LANG), so this will
compile with clang 18 and lower, in C++03 mode and earlier.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
987ac31018cba9f1763ad3acfb68b933f58a4c52 Dimitry Andric 2026-01-05 20:31:45

libcxx-compat: fix llvmorg-21-init-12415-g3a86e0bd29f3:

  [libc++] Optimize std::getline (#121346)

  ```
  -----------------------------------------------
  Benchmark                   old             new
  -----------------------------------------------
  BM_getline_string        318 ns         32.4 ns
  ```

Move the __bump_stream() lamda in <istream> to a separate function, so
this will compile with clang 18 and lower, in C++03 mode and earlier.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
17f1a5e638f845e171ab4e3db2a07bf8c6ac3388 Dimitry Andric 2026-01-05 21:07:58
Merge commit 924f773f5e26 from llvm git (by Younan Zhang):
  [Clang] Don't diagnose missing members when looking at the instantiating class template (#180725)

  The perfect matching patch revealed another bug where recursive
  instantiations could lead to the escape of SFINAE errors, as shown in
  the issue.

  Fixes https://github.com/llvm/llvm-project/issues/179118

This fixes compile errors in the www/qt5-webengine port.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
3fd796204fe6aa2e8a2b70bb9ea95f7497247fa3 Dimitry Andric 2026-02-10 19:54:38
Merge commit d803c61aca0d from llvm git (by Corentin Jabot):
  [Clang] Fix a regression introduced by #147046 (#150893)

  Static functions have an implicit object argument during deduction.

This fixes an assertion while compiling the devel/corrade port.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
1dfe63e4f75fa2a8c94aaf4aefaf48d164bc90db Dimitry Andric 2026-02-14 20:42:18
Fixup mismerge in __cxx03/__type_traits/add_[lr]value_reference.h.
0f15398d123a9cf02711efddf5e4040f0066c6de Dimitry Andric 2026-02-14 23:19:40
Merge commit 787ba2426148 from llvm git (by Matheus Izvekov):
  [clang] create local instantiation scope for matching template template parameters (#183219)

  This fixes a bug where a partial substitution from the enclosing scope
  is used to prepopulate an unrelated template argument deduction.

  Fixes #181166

This fixes an expected error when building the devel/catch port.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
5ac874516b27474ab5b3d195544c72fb04b4b86e Dimitry Andric 2026-02-25 18:06:51
Merge commit c1d26c3c2510 from llvm git (by Nikolas Klauser):
  [libc++] Fix iostream size ABI break (#185839)

  In #124103 we changed the size of various iostream objects, which turns
  out to be ABI breaking when compiling non-PIE code.

  This ABI break is safe to fix, since for any programs allocating more
  memory for the iostream objects, the remaining bytes are simply unused
  now.

  Fixes #185724

This fixes the ABI break that causes programs that use the standard
streams to terminate in various interesting ways, usually by throwing an
unexpected std::bad_cast exception.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
4fc1fdd206c3db60ca521e3966f31044c7711398 Dimitry Andric 2026-03-12 13:24:01
Merge commit b0d2b57f7e47 from llvm git (by Phoebe Wang):
  [Headers][X86] Remove more duplicated typedefs (#153820)

  They are defined in mmintrin.h

This fixes a -Werror warning in openzfs, which compiles for C99, and C99
does not allow for typedef redefinitions.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
20450c2e792084f06974cff9d2338e2d0406883f Dimitry Andric 2026-03-23 14:58:06
Add a comment to llvm's OptParser.td, so dependent files get rebuilt.
3cbf898fb49fe087cdcafe2745cca3f7a20f4388 Dimitry Andric 2026-04-23 12:39:31
netbsd-tests: Fix the mmap_truncate_signal test
Add a volatile qualifier in the loop which triggers SIGBUS, as otherwise
the compiler is smart enough to elide it, replacing it with a check for
page != 0.

MFC after:      1 week
e3b8e55e710bf355f371d798aa943281007a7ea9 Mark Johnston 2026-04-26 01:53:45
contrib/expat: import expat 2.8.0
Changes: https://github.com/libexpat/libexpat/blob/R_2_8_0/expat/Changes

Security:       CVE-2026-41080
MFC after:      1 week
e3935639d8d8b6556cad18e1c90e419a65f26b40 Philip Paeps 2026-04-27 10:38:10
contrib/openresolv: MFV openresolv 3.17.4
Reviewed by:  pfg
Approved by:    lwhsu (mentor)
Differential Revision:  https://reviews.freebsd.org/D56269
cb0e3a5fba5fe48607db8c1042bfe6a1164e0db7 Siva Mahadevan 2026-04-28 19:25:49
libnv: fix heap overflow in nvlist_recv()
nvlist_check_header() validated nvlh_size for overflow before
performing conversion. An mallicous user can set
NV_FLAG_BIG_ENDIAN in the header and craft nvlh_size so that
the orginall value passes the check, but after the conversion the
sizeof(nvlist_header) + size can overflow.
This can lead to a heap buffer overflow.

Approved by:    so
Security:       FreeBSD-SA-26:17.libnv
Security:       CVE-2026-35547
Fixes:          https://cgit.freebsd.org/src/commit/?id=36fa90dbde0060aacb5677d0b113ee168e839071
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56342
e2219bbd634f673f774ddf118dfe19e531e08a45 Mariusz Zaborski 2026-04-28 14:36:09
zfs: merge openzfs/zfs@84ffe564d
Notable upstream pull request merges:
 #18387 656285140 Handle raidz errors <= nparity rather than ignoring
 #18401 1cebe8a38 libzfs: report invalid permission name in zfs allow
 #18430 513710ed2 Fix "panic: cache_vop_rename: lingering negative entry"
 #18440 37e3a260f dmu_direct: avoid UAF in dmu_write_direct_done()
 #18445 2eee4ac1e Fix: draid autopkgtests fail on s390x architecture
 #18448 8da472973 key lookup failure should always return EACCES
 #18456 4a58ab8ce zfs.4: document five missing module parameters

Obtained from:  OpenZFS
OpenZFS commit: 84ffe564dff1b7f69d397817ef292cbe2c5ebad3
f9590540c524607d22fa7e718c758725c4365375 Martin Matuska 2026-05-02 07:17:59
zfs: merge openzfs/zfs@a12c6ed62
Notable upstream pull request merges:
 #18473 b8d959640 Fix rare cksum errors after rebuild
 #18477 e78a51dd6 Fix off-by-one in PREVIOUSLY_REDACTED handler that drops
                  last block
 #18482 d5099c330 Initialize vr_last_txg for rebuild
 #18483 872f01019 Zstd: rework ZSTD_isError symbol renaming
 #18489 366b1f9a3 Fix long POSIX_FADV_DONTNEED for single block files

Obtained from:  OpenZFS
OpenZFS commit: a12c6ed62fcd06093b95616515e4716b0b0bc038
efa8679e7f69c9cc225613827d9f75644cca5b3b Martin Matuska 2026-05-06 21:46:01
Merge commit 871038759afb from llvm git (by Marco Elver):
  Thread Safety Analysis: Fix pointer handling of variables with deprecated attributes (#148974)

  de10e44b6fe7 ("Thread Safety Analysis: Support warning on
  passing/returning pointers to guarded variables") added checks for
  passing pointer to guarded variables. While new features do not
  necessarily need to support the deprecated attributes (`guarded_var`,
  and `pt_guarded_var`), we need to ensure that such features do not cause
  the compiler to crash.

  As such, code such as this:

          struct {
            int v __attribute__((guarded_var));
          } p;

          int *g() {
            return &p.v;  // handleNoMutexHeld() with POK_ReturnPointer
          }

  Would crash in debug builds with the assertion in handleNoMutexHeld()
  triggering. The assertion is meant to capture the fact that this helper
  should only be used for warnings on variables (which the deprecated
  attributes only applied to).

  To fix, the function handleNoMutexHeld() should handle all POK cases
  that apply to variables explicitly, and produce a best-effort warning.

  We refrain from introducing new warnings to avoid unnecessary code bloat
  for deprecated features.

  Fixes: https://github.com/llvm/llvm-project/issues/140330

This fixes an assertion while building the net/openvswitch port:
"Assertion failed: ((POK == POK_VarAccess || POK == POK_VarDereference)
&& "Only works for variables"), function handleNoMutexHeld, file
/usr/src/contrib/llvm-project/clang/lib/Sema/AnalysisBasedWarnings.cpp,
line 2120.'

Reported by:    cy
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295101, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
d9b272a19d39f71665b529860bfed731bcfd99f5 Dimitry Andric 2026-05-08 17:59:54
Fix some memory leaks when fetching the mibII.
Reviewed by:  glebius
Sponsored by:   Netflix
Differential Revision:  <https://reviews.freebsd.org/D55998>
7906084ba2fd50022f38ce2e8d0bcef212a4ff19 Chuck Silvers 2026-05-09 15:52:14
Document some more OIDs that are used by bsnmp.
27ad506d26209e72d3cb2055de98f8a2eccc83be Hartmut Brandt 2026-05-09 16:04:45
Add 'contrib/smart/' from commit 'eb3b1302382b1d0cbe37eeebabfcdd546aa2fc4e'
git-subtree-dir: contrib/smart
git-subtree-mainline: 95b4436e989df29f6368f13832cb13d7cbc52eac
git-subtree-split: eb3b1302382b1d0cbe37eeebabfcdd546aa2fc4e
7419d6e463fee40f0f52cd5bc46a93cbb7ac6114 Chuck Tuffli 2026-05-11 21:50:04
acpica: Merge ACPICA 20260408
Merge commit '69ae37302ee98839857791a261546e19d078cdb8'
7697e6c4df7188ee3a2aa66f73c572c27479bdf2 Jung-uk Kim 2026-05-11 23:29:58
smart: Merge smart 1.0.3
Merge commit 'd2d20bb5099dc1c443a4b783d43b8a45338c85d2'
346be36e8861e26bfed44cbf960903d0055f6660 Chuck Tuffli 2026-05-12 14:33:03
Commit group #134: OpenSSH: Update to 10.1p1
OpenSSH: Update to 10.1p1

Full release notes are available at
https://www.openssh.com/txt/release-10.1

Selected highlights from the release notes:

Potentially-incompatible changes

 * ssh(1): add a warning when the connection negotiates a non-post
   quantum key agreement algorithm.

 * ssh(1), sshd(8): major changes to handling of DSCP marking/IPQoS

 * ssh(1), sshd(8): deprecate support for IPv4 type-of-service (ToS)
   keywords in the IPQoS configuration directive.

 * ssh-add(1): when adding certificates to an agent, set the expiry
   to the certificate expiry time plus a short (5 min) grace period.

 * ssh-agent(1), sshd(8): move agent listener sockets from /tmp to
   under ~/.ssh/agent for both ssh-agent(1) and forwarded sockets
   in sshd(8).

Security

 * ssh(1): disallow control characters in usernames passed via the
   commandline or expanded using %-sequences from the configuration
   file, and disallow \0 characters in ssh:// URIs.

New features

 * ssh(1), sshd(8): add SIGINFO handlers to log active channel and
   session information.

Sponsored by:   The FreeBSD Foundation
644b4646c7acab87dc20d4e5dd53d2d9da152989 Ed Maste 2026-05-12 20:24:10

pam_ssh: Fix build - chase OpenSSH function signature change

Reported by: dch
Fixes: https://cgit.freebsd.org/src/commit/?id=644b4646c7ac ("OpenSSH: Update to 10.1p1")
Sponsored by: The FreeBSD Foundation
b76b05c04cc9ed2cd053c7b367c92628447ede6f Ed Maste 2026-05-12 22:49:29
OpenSSH: Update to 10.2p1
Full release notes are available at
https://www.openssh.com/txt/release-10.2

Selected highlights from the release notes:

Bugfixes
--------

 * ssh(1): fix mishandling of terminal connections when
   ControlPersist was active that rendered the session unusable.
   bz3872

Sponsored by:   The FreeBSD Foundation
e68aa5ab80ab57bdbcbe94dd2922a018d675e7f0 Ed Maste 2026-05-12 21:12:09
contrib/expat: import expat 2.8.1
Changes: https://github.com/libexpat/libexpat/blob/R_2_8_1/expat/Changes

Security:       CVE-2026-45186
MFC after:      1 week
9cc9b8b372842b9a941d235c5e9949a214e5284f Philip Paeps 2026-05-13 03:17:00
Merge bmake-20260508
Merge commit 'ef402bba84260816d3e8d6e2439b0bc7eddc9446'
1729d2f741a12a42c61ed5308ee156a0d1cd1918 Simon J. Gerraty 2026-05-13 04:24:08
mandoc: Add an entry for libsys to lib.in
Reviewed by:  brooks, emaste
Obtained from:  CheriBSD
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D56849
538f0564c1197605d7ab80ba39cbf27cc9c90fed John Baldwin 2026-05-13 16:33:12
mandoc: Updating FreeBSD thead library descriptions
Remove libkse as it has been obsolete for many years and drop 1:1 from
description of libthr.

Reviewed by:    brooks
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D56850
8766e2122ac02ff4d86c254d8ef1c41d4a7f76a0 John Baldwin 2026-05-13 16:33:29
Commit group #135: OpenSSH: Update to 10.3p1
OpenSSH: Update to 10.3p1

Full release notes are available at
https://www.openssh.com/txt/release-10.3

Selected highlights from the release notes:

 * ssh(1), sshd(8): remove bug compatibility for implementations
   that don't support rekeying. If such an implementation tries to
   interoperate with OpenSSH, it will now eventually fail when the
   transport needs rekeying.

 * ssh(1), sshd(8): support IANA-assigned codepoints for SSH agent
   forwarding, as per draft-ietf-sshm-ssh-agent. Support for the new
   names is advertised via the EXT_INFO message. If a server offers
   support for the new names, then they are used preferentially.

 * ssh(1): add a ~I escape option that shows information about the
   current SSH connection.

 * sshd(8): add 'invaliduser' penalty to PerSourcePenalties, which is
   applied to login attempts for usernames that do not match real
   accounts. Defaults to 5s to match 'authfail' but allows
   administrators to block such attempts for longer if desired.

 * Support the ed25519 signature scheme via libcrypto.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56999
2574974648c68c738aec3ff96644d888d7913a37 Ed Maste 2026-05-14 18:59:30

blocklist: Add back probes

The banner exchange was moved to the sshd-auth process in upstream
commit bb781f02d4efd178e329a62a838962bee16e3e9b.  Add it back.

Add back fatal exit probe.

NetBSD PR:      bin/60270 (GNATS)
Reviewed by:    emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=2574974648c6 ("OpenSSH: Update to 10.3p1")
Differential Revision:  https://reviews.freebsd.org/D57027
3d246db08333c06df343281d5aaebfd07ea08252 Jose Luis Duran 2026-05-16 22:00:02
rtw89: firmware: extend script to extract fwget entries
The so far so consistent (file)names got an outlier so add the
one character longer pattern as well to catch that.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
56460a6a420a066ea6eeadc3725bfdaf49f8142b Bjoern A. Zeeb 2026-05-17 23:16:33
iwlwifi: firmware: reduce script to extract fwget information
Due to driver changes it is no longer feasible to extract the full
PCI ID / firmware / card type information in one go as we used to
be able to.
We have already changed the way we extract firmware information for
ports and marked the iwlwififw.4 man page as obsolete.

Reduce the script to simply extarct the fwget(8) information and,
compared to the old times, sort each section so diffs will be easier
to see in the future.  This was particular helpful this time to make
sure we do not lose entries with the change of technique.

We also keep the script in the best perl spirit to do the job but
not to win a price, especially given it seems we have to change
matters every (other) year.

Given we can no longer extract firmware information for the PCI IDs,
we need to "manually" check against the ports that names match.
Ideally we will simplify things for everything "mld-only" one day
to only have a single firmware package for these (even if size
increases slightly).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
4f6c60c3d3c44aa3df23f280f2fe247f7a930efa Bjoern A. Zeeb 2026-05-17 23:25:21
ldns: Belatedly update for OpenSSL 3.0.0
MFC after:    1 week
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D57168
cbe037c970580efc40eeca4715ac51e4d0fea082 Dag-Erling Smørgrav 2026-05-22 13:56:16
Commit group #136: ldns: Update to 1.9.0
ldns: Update to 1.8.4

Merge commit '3dcfa5af412125cd1bad1d383ff7c18c5effbd77'

MFC after:      1 week
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D57169
d44c9549ef31884ac069b0306bad248a74bb2825 Dag-Erling Smørgrav 2026-05-22 17:54:09

ldns: Update to 1.9.0

Merge commit '5eb18e8576462f5bb33fbd60fcbd752fe5791f33'

MFC after:      1 week
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D57170
9ed998a81bab54203604d08293089db875758686 Dag-Erling Smørgrav 2026-05-22 17:54:58

ldns: Regenerate configuration after update

MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=d44c9549ef31 ("ldns: Update to 1.8.4")
Fixes:          https://cgit.freebsd.org/src/commit/?id=9ed998a81bab ("ldns: Update to 1.9.0")
70739f3499b03cfff6bdd985db0d81cde76be15a Dag-Erling Smørgrav 2026-05-22 18:12:26

ldns: Fix unused variable on big-endian

MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=9ed998a81bab ("ldns: Update to 1.9.0")
dd64155367840a3747d812577457a7ed7c8e9acb Dag-Erling Smørgrav 2026-05-22 19:38:34
Commit group #137: unbound
unbound: Tweak freebsd-configure script

Regenerating the configure script is optional and can introduce noise
if the installed versions of autoconf, automake, and libtool do not
match those used upstream.  Tweak our script slightly so it will skip
this step if libtoolize is not found.
cd69bc03cf67b958e08206d49562903c57b5bd28 Dag-Erling Smørgrav 2026-05-22 19:55:22

unbound: Regenerate for 1.24.1

No functional changes intended.

Fixes:          https://cgit.freebsd.org/src/commit/?id=8b29c373e6ab ("unbound: Vendor import 1.24.1")
290190b26c09c307a9cd70703fa20ad2b2b600a6 Dag-Erling Smørgrav 2026-05-22 20:04:22

unbound: Update to 1.24.2

Merge commit 'ec5b94f552d7cb2a9d456c67e9941bcf5e3698bf'

This is purely cosmetic as we already had the functional changes.

MFC after:      1 week
22fa41b4e81ad91d11e28f1837764730d744d4e4 Dag-Erling Smørgrav 2026-05-22 20:16:26
unbound: Update to 1.25.0
Release notes at
        https://nlnetlabs.nl/news/2026/Apr/29/unbound-1.25.0-released/

Merge commit '4dd0a17edce60370304a45f2c40251e09e193bd6'

MFC after:      1 week
5fa84c6ec176d186ddad25d31f8760e50f48157f Dag-Erling Smørgrav 2026-05-23 01:54:22
unbound: Update to 1.25.1
Release notes at
        https://nlnetlabs.nl/news/2026/May/20/unbound-1.25.1-released/

Merge commit '22e58f330a151944c24e010d23ec3881df6681b6'

Security:       CVE-2026-33278
Security:       CVE-2026-42944
Security:       CVE-2026-42959
Security:       CVE-2026-32792
Security:       CVE-2026-40622
Security:       CVE-2026-41292
Security:       CVE-2026-42534
Security:       CVE-2026-42923
Security:       CVE-2026-42960
Security:       CVE-2026-44390
Security:       CVE-2026-44608
MFC after:      1 week
50caa0ea0c16499c40e785b5aa37053b180b2830 Dag-Erling Smørgrav 2026-05-23 01:57:43
sqlite3: Vendor import of sqlite3 3.53.1
Release notes at https://www.sqlite.org/releaselog/3_53_1.html.

Obtained from:  https://www.sqlite.org/2026/sqlite-autoconf-3530100.tar.g

Merge commit 'b00eb376e3fb28e738f9370552dae9d92c1fdd76' into sqlite3
5b8f59e648431715e8f5f60ef09c0be4508b3ae6 Cy Schubert 2026-05-25 17:19:28
libarchive: Force GNU iconv compatibility on FreeBSD
When libarchive is compiled with FreeBSD's native iconv instead of
libiconv, as happens with libarchive in the base system, we need to
configure iconv(3) to handle invalid sequences by returning -1, as
iconv_strncat_in_locale() assumes GNU iconv semantics.

This corresponds to upstream PR 3056.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294577
MFC after:      1 week
bd15d6ef126ee4c0eac931117f6bbbf6f9a3fc72 Mark Johnston 2026-05-20 16:39:40
dma: support relaying to an LMTP endpoint
Approved by:          bapt
Differential Revision:  https://reviews.freebsd.org/D55627
Upstream:               https://github.com/corecode/dma/pull/152
84dd0acd1c8c93b8e5074f895a30dc49bc00c8d3 Pietro Cerutti 2026-06-01 12:19:57
Merge commit 63c29df8eceb from llvm git (by Dmitry Polukhin):
  [Serialization] Fix assertion on re-deserialized friend template spec… (#200566)

  …ialization in PCH (#198133)

  A friend function-template specialization declared inside a class
  template is serialized into a PCH. When the class template is later
  instantiated while loading the PCH, the friend specialization can be
  deserialized re-entrantly (VisitFriendDecl -> VisitFunctionDecl -> ...
  -> VisitFunctionDecl for the same specialization) at the same time as
  the canonical copy, producing two redeclarations of the same
  specialization in the template's specialization set.

  ASTDeclReader::VisitFunctionDecl asserted that this collision could only
  happen when merging declarations from different modules. Since
  38b3d87bd384, friend functions defined inside dependent class templates
  are loaded eagerly, so the collision can now also occur within a single
  PCH/AST file (non-modules build), tripping the assertion:

    Assertion failed: (Reader.getContext().getLangOpts().Modules &&
    "already deserialized this template specialization"), function
    VisitFunctionDecl

  The merge that follows (mergeRedeclarable) already links the two
  redeclarations correctly regardless of whether modules are enabled, so
  the fix is to drop the modules-only assumption and let the merge run.

  Fixes https://github.com/llvm/llvm-project/issues/198133

This fixes (well, simply removes :) an assertion when building the
cad/OrcaSlicer port with precompiled headers turned on.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295296
MFC after:      3 days
86326398b73b81f84831fb5fc4c12d9219bc0f57 Dimitry Andric 2026-06-01 17:10:11
Commit group #138: MFV: file 5.47.
MFV: file 5.47.

MFC after:      3 days
e949ce9dc0e6fff26e83904f1008b76d36ba0a37 Xin LI 2026-06-03 04:54:25

file: normalize .result files to ensure trailing newline on install

Some upstream result files introduced in file 5.47 (e.g., bgcode.result)
lack a trailing newline, causing the contrib_file_tests ATF test to
fail with "cmp: EOF on bgcode.result".  Generate normalized copies
of the expected results and install those instead.

MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=e949ce9dc0e6fff26e83904f1008b76d36ba0a37
f7c0bd206fe4f3a956b3ecb4dc11a7386b85fa22 Xin LI 2026-06-05 04:47:08
zfs: fix sysctl_os.c
Correctly declare vfs.zfs.metaslab.condense_pct

The following sysctls have moved to metaslab.c:
vfs.zfs.metaslab.df_alloc_threshold
vfs.zfs.metaslab.df_free_pct
vfs.zfs.metaslab.sm_blksz_no_log
vfs.zfs.metaslab.sm_blksz_with_log

Reported by:    dim@FreeBSD.org
b1b4871f373e9f2a5defdc1242543be291f5e9d9 Martin Matuska 2026-06-07 19:15:40
auditd: Fix signal handling
Rewrite the main loop to use ppoll() instead of just blocking on read,
blocking the signals we care about when we aren't polling.

I didn't bother replacing alarm() with setitimer(); the alarm code
is dead anyway since there is no way for max_idletime to acquire a
non-zero value.

While here, avoid leaking the pid file and trigger descriptors to the
log child.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295840
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57451
5bd78cfc800339fd7f3945498052d67553af9e3c Dag-Erling Smørgrav 2026-06-08 22:45:34
openssl: Fix multiple vulnerabilities
This is a rollup commit from upstream to fix:
  Reject oversized inputs in ASN1_mbstring_ncopy()
  cms: kek_unwrap_key: Fix out-of-bounds read in check-byte validation
  cms: kek_unwrap_key: test for fix out-of-bounds read in check-byte validation
  Avoid length truncation in ASN1_STRING_set
  pkcs12: verify that the pbmac1 key length is safe
  Reject potentially forged encrypted CMS AuthEnvelopedData messages
  QUIC stack must limit the number of PATH_CHALLENGE frames processed in RX
  Fix NULL dereference in QUIC address validation
  Fix potential NULL dereference processing CMS PasswordRecipientInfo
  Fix potential NULL dereference in OSSL_CRMF_ENCRYPTEDVALUE_decrypt()
  Enforce implicit rejection for CMS/PKCS#7 decryption
  Use the correct issuer when validating rootCAKeyUpdate
  Match the local q DHX parameter against the peer's q
  Apply the buffered IV on the AES-OCB EVP_Cipher() path
  Fix handling of empty-ciphertext messages in AES-GCM-SIV and AES-SIV
  Fix possible use-after-free in OpenSSL PKCS7_verify()

Approved by:    so
Obtained from:  OpenSSL
Security:       FreeBSD-SA-26:35.openssl
Security:       CVE-2026-7383
Security:       CVE-2026-9076
Security:       CVE-2026-34180
Security:       CVE-2026-34181
Security:       CVE-2026-34182
Security:       CVE-2026-34183
Security:       CVE-2026-42764
Security:       CVE-2026-42766
Security:       CVE-2026-42767
Security:       CVE-2026-42768
Security:       CVE-2026-42769
Security:       CVE-2026-42770
Security:       CVE-2026-45445
Security:       CVE-2026-45446
Security:       CVE-2026-45447
e508c3431d8e1ace6118e150837a0d0d67f1672a Gordon Tetlow 2026-04-29 08:23:24
ldns: Fix query response validation
Approved by:  so
Security:       FreeBSD-SA-26:36.ldns
Security:       CVE-2026-10846
980ba4177b69655726485daa5ff3e931f19aa738 Gordon Tetlow 2026-06-07 15:09:39
MFV: openssl 3.5.7
This change is a security release which resolves several issues with OpenSSL 3.5,
the highest severity issue being ranked "High". Users are strongly encouraged to
update to this release.

More information about the release (from a high level) can be found in
the release notes [1].

1. https://github.com/openssl/openssl/blob/openssl-3.5.7/NEWS.md

All conflicts were resolved with `--theirs`, taking the release diff
over the local diff; the conflicts occurred due to preemptive security
fixes applied by so@ in e508c343.

MFC after:      3 days (the important security issues have been
preemptively addressed)
Merge commit '3a71a35ad9dad0e5d2cad8efecc8ba9d57c42d43'

Conflicts:
        crypto/openssl/include/internal/quic_channel.h
        crypto/openssl/ssl/quic/quic_channel_local.h
        crypto/openssl/ssl/quic/quic_rx_depack.c
        crypto/openssl/test/cmsapitest.c
        crypto/openssl/test/evp_extra_test.c
1523ccfd9c8c254f7928143d31c305384b05fd11 Enji Cooper 2026-06-10 15:25:28
crypto/openssl: update artifacts to match 3.5.7 release
MFC after:    3 days
MFC with:       1523ccfd9
0881f6cf3f44883b03c21dc7e5ab2140275b5afd Enji Cooper 2026-06-10 15:32:04
Remove `$FreeBSD$` from upstream-provided config file
This diff reduces with the content provided by upstream (OpenSSL).

MFC after:      1 week
2de6d07e16aa4d902b7b322a869f89a07348e851 Enji Cooper 2026-06-12 05:45:28
Remove fips-module related diff
This particular change didn't come from upstream. It was added locally
in 7a991ecd1 when attempting to enable the fips provider with 3.0.

Given the fact that we no longer build the fips provider and the fips
provider build process (including sources) is very prescribed to
specific build steps and source versions, there's no reason why we need
to continue carrying around this diff anymore.

MFC after:      1 week
Signed-off-by: Enji Cooper <ngie@FreeBSD.org>
d6e3662bc1f5054d81b1ceab641396047c2cad94 Enji Cooper 2026-06-12 05:48:19
Merge commit 93a67259cf23 from llvm git (by ShengYi Hung):
  [ToolChains][FreeBSD] Set default Linker to LLD for FreeBSD (#190596)

  When the linker is specified as ld, toolchain applies special handling
  by invoking (triple)-ld instead of resolving ld via standard PATH
  lookup. This causes GNU ld installed via the system package manager to
  take the precedence (since (triple)-ld appears earlier in the search
  path), effectively overriding ld.lld.

  As a result, we set the default Linker on FreeBSD to ld.lld to indicate
  we want to use lld by default.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      3 days
2b619b7c7b5300cbaf59e4e9d75bc8472df014e9 Dimitry Andric 2026-06-13 10:03:11
mt76: mt7921: prevent PM from scheduling another delayed work on detach
Amongst others mt76_connac_pm_unref() is calling mt76_connac_power_save_sched()
which will (normaly) re-schedule the pm_work.
In various parts we also cancel that work, also during PCI detach ("shutdown",
"remove" in LinuxKPI terms).
However we also keep calling mt76_connac_pm_unref() in the detach path and thus
we get to a point where we re-scheduled the work but then the device goes away.
At that point LinuxKPI delayed work has a callput pending which is embedded in
the work structure (pm_work).  The moment we free the device that structure
and callout is gone but the callout is still on the list and once that list
is walked we panic.

Simply prevent mt76_connac_power_save_sched() from getting to the point of
possibly re-scheduling the pm_work by setting pm->enable to false in the
beginning of the detach path.

The are likely more paths which will need the same treatment as the code
is by far anything from "symmetric" (that is the attach path is highly
bus independent while the detach path is implemented per-bus).  Also
other chipsets share the same "logical paths" with their own names, so
they will need this too once we get to them.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
009d92b25f7c2d6ddf3fb4202d0a6a4612a716f1 Bjoern A. Zeeb 2026-06-14 16:37:10
Commit group #139: mt76
mt76: ensure net80211 com instance before returning from driver load

Do as we have done for iwlwifi (f808c43ad923,  bee60c989745) add a
completion event for device registration which calls into 802.11
and creates the wifi "device" (net80211 com instance).
This is needed as otherwise the deferred work in the mt76 drivers
(mt7915, mt7921, mt7925, mt7996; but not the 7615 [*]) would make
driver loading return before the wifi device is there.  We would then
continue, e.g., during rc startup and race possibly trying to create
a vap (wlan interface) with the underlying device not being registered
yet and fail.

[*] the 7615 does not seem to do this asynchronously so is fine.

Sponsored by:   The FreeBSD Foundation
Tested on:      7921, others to be tested at time
MFC after:      3 days
baf8561bdc3f39c542a82cd1235fbf4bf97b4310 Bjoern A. Zeeb 2026-06-08 06:50:30

mt76: mt7921: terminate fw log messages with \n

In order to make the firmware messages spewed on the console readable
write one message per line and not one very long line.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
b662295ecb620b8ebf00188a111ff16701b0375d Bjoern A. Zeeb 2026-06-10 11:22:44

mt76: mt7921: depend on lindebugfs and turn debugfs support on

Add the missing MODULE_DEPEND() calls for lindebugfs.
It is unfortunate that they are shared code between various bus
implementations.  Ideally we would leave the MODULE_DEPEND() calls
in the debugfs.c file instead of adding extra #ifdef guards to the
bus attachment files.

Turn debugfs support on for mt76(core) and the mt7921 module for now.

Sponsonred by:  The FreeBSD Foundation
MFC after:      3 days
134e90e01da181a6048f0ca3368e466818def1b3 Bjoern A. Zeeb 2026-06-10 11:24:04
ldns: Update to 1.9.1
Merge commit '026e5b88eb0cde54d9fc22b9a1ebc79ea0f67aec'
4593470d16714d83ac06a3ccc319f998a02ced07 Dag-Erling Smørgrav 2026-06-19 07:24:23
lsnd: Update to 1.9.2
Merge commit '3750aed65c1f5a610b44d29c92236ca119b62780'
63442ceae5ed31ad45e401f5fe0010b824bc2b38 Dag-Erling Smørgrav 2026-06-19 07:26:20
mt76: mt7925: prevent PM from scheduling another delayed work on detach
This duplicates 009d92b25f7c from mt7921 which has the full description.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
482fda9814937691557ebadd0930535ff3d301b0 Bjoern A. Zeeb 2026-06-21 20:05:04
edk2: Fixup imported files line endings
Since these files were a direct commit, I don't have to fix the vendor
branch. Remove the DOS line endings. It doesn't matter one way or another,
but we should be consistent within the tree.

Sponsored by:           Netflix
c7b1b95a8ca6cdbb5bf48d32c8c7e25c36f5ba6c Warner Losh 2026-06-22 21:56:47
edk2: Bring in some more files from edk2-stable202502
These are needed for memdisk support, so import them separately.
These are from 202502, like all the other files here.

Sponsored by:           Netflix
e985c628a0e4082d9b953897d6f56c81d177cea7 Warner Losh 2026-06-22 22:06:24
libcxxrt: Fix diagnostics for derived classes
In terminate_with_diagnostics the cast_to arguments were swapped, so it
always failed.  The diagnostic handler produced output like "Terminating
due to uncaught exception 0x24891e08000 of type std::runtime_error".

Now, e->what() will actually be included in the output, e.g.
"Terminating due to uncaught exception 0x2bba49208000 'Model file
doesn't exist' of type std::runtime_error".

Reviewed by:    dim
Event:          Halifax Hackathon 202606
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57822
3a5c2899fc7bd0865b5aacccc3465e46e9bc6df3 Ed Maste 2026-06-24 15:06:51
contrib/expat: import expat 2.8.2
Changes: https://github.com/libexpat/libexpat/blob/R_2_8_2/expat/Changes

Security:       CVE-2026-50219
Security:       CVE-2026-56131
Security:       CVE-2026-56132
Security:       CVE-2026-56403
Security:       CVE-2026-56404
Security:       CVE-2026-56405
Security:       CVE-2026-56406
Security:       CVE-2026-56407
Security:       CVE-2026-56408
Security:       CVE-2026-56409
Security:       CVE-2026-56410
Security:       CVE-2026-56411
Security:       CVE-2026-56412
MFC after:      1 week
c82aeee8a6d39371006f5eeb1b51704e7b97e2b7 Philip Paeps 2026-06-25 14:34:28
libdtrace: Fix dt_print_sym() not printing symbols in non-oformat mode
dt_print_sym() fills the symbol string via snprintf() in non-oformat
mode but the guarding `dtp->dt_oformat != 0 &&` for the dt_printf()
call causes the symbol is computed but never emitted.

This fixes tests:

- common.profile-n.t_dtrace_contrib.tst_sym_ksh
- common.profile-n.t_dtrace_contrib.tst_func_ksh

Reviewed by:    markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=93f27766a7e1 ("dtrace: Add the 'oformat' libdtrace option")
MFC after:      3 days
Event:          Halifax Hackathon 202606
Location:       Room 208, Computer Science Building, Dalhousie University
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57895
8e61d8707f8a10acc143210089fea2502a3f2922 Li-Wen Hsu 2026-06-27 02:26:05
openresolv: Trim leading dot from domain name
Merge upstream change d9f6b1a2d292

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296305
MFC after:      1 week
4b26ea54713941243b3a0d4263bebbf192ee68c7 Dag-Erling Smørgrav 2026-06-27 21:15:29
iconv(3): Draft some automatic tests.
Based on a report by Nick Wellnhofer.

Approved by:    so
Security:       FreeBSD-SA-26:49.iconv
Reviewed by:    markj, kevans
Differential Revision:  https://reviews.freebsd.org/D57948
2ee2274244e7f09a7bd04d1aaf9b04dfa678921a Taylor R Campbell 2026-06-22 19:44:55
iconv: Fix a stack buffer overflow in _ISO2022_sputwchar()
In the ISO2022-CN encoding, characters may require at least seven bytes,
and MB_LEN_MAX==6 is insufficient.  From code inspection,
_ISO2022_sputwchar() can emit 10 bytes in the worst case, so use that to
size buffers.

Add a regression test.

Approved by:    so
Security:       FreeBSD-SA-26:49.iconv
Security:       CVE-2026-58082
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57950
150df709c28ca10a7ccec02482441257ec9c13da Mark Johnston 2026-06-23 17:45:28

Reverted commits

inpcb: move local address assignment out of in_pcbdisconnect()
The logic of clearing local address at the protocol level makes sense.  It
is feature of UDP, not of any protocol, that local address is cleared on
disconnect.  This code can be tracked down to pre-FreeBSD times.

For example, for TCP we want a disconnected socket to return previously
used local address with getsockname(2).  The TCP has successfully evaded
that by not calling in_pcbdisconnect() and calling in_pcbdetach() in the
very old code and in_pcbdrop() later.   After D55661 TCP again has this
potential bug masked.  Better make it right than rely on such
unintentional evasions.

The raw IP sockets don't use in_pcbdisconnect(), but they are going to in
the near future.  If in_pcbdisconnect() clears local address for them,
that would be a larger bug than just getsockname().  A raw socket may be
bound with bind(2) and then connect(2)ed, and then disconnected, e.g.
connect(INADDR_ANY).  And when we run raw IP socket through
in_pcbdisconnect() we don't want to lose local address.

This reverts D38362.
This reverts commit 2589ec0f365777faacf36bd1eb24706538836b17.

Reviewed by:            rrs, markj
Differential Revision:  https://reviews.freebsd.org/D56170
edece33b38ebcba46bd4d81382ebdb5a634a0c6d Gleb Smirnoff 2026-04-12 18:34:57
Revert "EC2: Add clibs-lib32 pkg to small/builder images"
This should no longer be necessary after 2018ae4e3b6a.

This reverts commit cfe0b7d37e552d78762c029f5b15e0f36d9d0d38.
fa31e76a4c147eb5148595c9f3615040fcac74e5 Colin Percival 2026-04-13 19:42:57
Commit & revert pair: sound: Remove some forward declarations from sound.h and uaudio.h
sound: Remove some forward declarations from sound.h and uaudio.h

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
602249f033d146d9c731d8b1cb4b2e0899c61ad9 Christos Margiolis 2026-04-18 10:50:03

Revert "sound: Remove some forward declarations from sound.h and uaudio.h"

This reverts commit 602249f033d146d9c731d8b1cb4b2e0899c61ad9.
ec077230fd941336c37f8bfdce3bb3e4c9d809b4 Christos Margiolis 2026-04-18 11:30:20
Commit & revert pair: Import tzdata 2026b
Import tzdata 2026b
5417f0bbde91c148b3c3982eb2ab23a675b5e8d1 Philip Paeps 2026-04-23 14:59:30

Revert "Import tzdata 2026b"

This reverts commit 5417f0bbde91c148b3c3982eb2ab23a675b5e8d1.
5cfcccf767304b874c98b8c991ed3db2221407ec Philip Paeps 2026-04-23 15:26:56
Commit & revert pair: speaker(4): move static data to bss
speaker(4): move static data to bss

Signed-off-by: Raphael Poss <knz@thaumogen.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
690ef95b3354ac7a80aa469fa7a8f15f07962f83 Raphael 'kena' Poss 2026-01-11 21:07:35

Revert "speaker(4): move static data to bss"

This reverts commit 690ef95b3354ac7a80aa469fa7a8f15f07962f83.

The commit message was wrong.
45a12d8a2656bdf38e95f8e481c72aea0db6997f Warner Losh 2026-04-24 22:04:14
Commit & revert pair: nda: Filter non-storage nvme drives
nda: Filter non-storage nvme drives

Non-stroage drives have namespaces, but no storage attached. These
drives have a different interface type than storage drives, so ignore
them for the nvme_sim, which just handles storage.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D56461
b40205855e100a4bd95f89e97c15d268ef5b3a35 Warner Losh 2026-04-24 18:31:38

Revert "nda: Filter non-storage nvme drives"

This reverts commit b40205855e100a4bd95f89e97c15d268ef5b3a35. There's an
aparent path lifetime issue in it that needs to be investigated.

Sponsored by:           Netflix
1f72d525fc7d26c1c605b50519b9da1c78fec437 Warner Losh 2026-04-26 03:16:05
Commit & revert pair: imgact_elf: Fix uninitialized variable use in note_procstat_auxv
imgact_elf: Fix uninitialized variable use in note_procstat_auxv

Found building with latest clang

MFC after:      3 days
753a166bdeb3aeba02fd9678e7360f0929007368 Alex Richardson 2025-09-15 06:27:12

Revert "imgact_elf: Fix uninitialized variable use in note_procstat_auxv"

This reverts commit 753a166bdeb3aeba02fd9678e7360f0929007368. It appears
to be unnecessary now.
e5e636cf5eb666a733592bd0ff85052904eb9287 Dimitry Andric 2026-04-25 14:06:34
Commit group #140: Revert "libcxx-compat
Revert "libcxx-compat: update libcxx.imp for headers that were reintroduced by reverts"

This reverts commit caf0ccccc304e3e7938c9722f1deb0a362fd70d5, in
preparation for merging llvm 21.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
5945da0bc9ac42f531b1079a246eb8ce4f0d63db Dimitry Andric 2025-12-06 20:24:14

Revert "libcxx-compat: install headers that were reintroduced by reverts"

This reverts commit 8ad38d5eb3985ef778a7d36093878b0b373ccedf, in
preparation for merging llvm 21.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
d6d48190ec6a62a20ef603011f215015c1d999fb Dimitry Andric 2025-12-06 20:24:14

Revert "libcxx-compat: don't remove headers that were reintroduced by reverts"

This reverts commit 2b3703a4f4519e202c3bdf12e7e13d9b5fdbc3f3, in
preparation for merging llvm 21.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
3f6219840dbea7712554982a3c9f852c1c9664f4 Dimitry Andric 2025-12-06 20:24:14

Revert "libcxx-compat: revert llvmorg-19-init-4003-g55357160d0e1:"

This reverts commit fd17362f6225085e60eabed8af7421838100b457, in
preparation for merging llvm 21.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
a24406d2e0e8eee8db03ed8d1ae7fb482cf912ab Dimitry Andric 2025-12-06 20:24:15

Revert "libcxx-compat: revert llvmorg-19-init-4504-g937a5396cf3e:"

This reverts commit a7455c47801ea1e4c4eed10cab2072375f6f92a2, in
preparation for merging llvm 21, in preparation for merging llvm 21.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
3ca6facafc4c96fa9d6027b6f3b50b7c3e3a5dbf Dimitry Andric 2025-12-06 20:24:15

Revert "libcxx-compat: revert llvmorg-19-init-5639-ga10aa4485e83:"

This reverts commit 267fa9ab814c23ca97b8b7e1740f4da51485ac72, in
preparation for merging llvm 21.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
3ac42330b1da72d68cc6d7c3f65e24a882ccfd47 Dimitry Andric 2025-12-06 20:24:15

Revert "libcxx-compat: revert llvmorg-19-init-8667-g472b612ccbed:"

This reverts commit f7570f1eb0dc056dfce9d7500157538c670edaf6, in
preparation for merging llvm 21.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
a843ea3f246f3f137722db556aa07710e6a84b71 Dimitry Andric 2025-12-06 20:24:15

Revert "libcxx-compat: revert llvmorg-19-init-17473-g69fecaa1a455:"

This reverts commit cab3680acf8e6ea40c686d4f26db4429e26a5331, in
preparation for merging llvm 21.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
501871ebf9d725ab1c6fb2c4da9bac77f60b37a7 Dimitry Andric 2025-12-06 20:24:15

Revert "libcxx-compat: revert llvmorg-19-init-17727-g0eebb48fcfbc:"

This reverts commit f12b6acbe1ea1c425c0e21d80097115e4ad33017, in
preparation for merging llvm 21.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
1f9c1cd08dba0c46c1e1cea43b3bbea23af4fbaa Dimitry Andric 2025-12-06 20:24:15

Revert "libcxx-compat: revert llvmorg-19-init-17728-g30cc12cd818d:"

This reverts commit 198b947ebc6834eade6acc52c5441a38693b8822, in
preparation for merging llvm 21.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
f8152c67d4272e155460e4b3057b41924df8af1c Dimitry Andric 2025-12-06 20:24:15

Revert "libcxx-compat: revert llvmorg-19-init-17853-g578c6191eff7:"

This reverts commit 2facc097b9b28a81b925c924f27f09b40f29fd4d, in
preparation for merging llvm 21.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
3b0a0e64bd9f0a65f0dd62dc157597e6d9ecc933 Dimitry Andric 2025-12-06 20:24:15

Revert "libcxx-compat: revert llvmorg-19-init-18062-g4dfa75c663e5:"

This reverts commit 6933315cf57fc3f505431bff7a0075df471d7453, in
preparation for merging llvm 21.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
f3b0cac70b80116e691ad1e6daa5110186233206 Dimitry Andric 2025-12-06 20:24:16

Revert "libcxx-compat: revert llvmorg-19-init-18063-g561246e90282:"

This reverts commit 1d99ada3215dbc28665fe051f9ccf028a2a02ce8, in
preparation for merging llvm 21.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292067
MFC after:      1 month
6243d755fb82e62d2a3a2e031801e0443150454a Dimitry Andric 2025-12-06 20:24:16
Commit & revert pair: loader.efi(8): Document LoaderEnv and NextLoaderEnv EFI variables
loader.efi(8): Document LoaderEnv and NextLoaderEnv EFI variables

Describe how the LoaderEnv and NextLoaderEnv variables can be used.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293054
Reviewed by:            imp
Sponsored by:           Wiesbaden Hackathon 202604
Differential Revision:  https://reviews.freebsd.org/D56633
cf7d4b04e9ae890f2a0f5811234e926f75a0c237 Bill Blake 2026-04-25 14:56:24

Revert "loader.efi(8): Document LoaderEnv and NextLoaderEnv EFI variables"

This reverts commit cf7d4b04e9ae890f2a0f5811234e926f75a0c237.

I attributed the wrong author of the patch.
ed82c433efee1080fc5587325754afd6fcabd5d6 Paarth Shirsat 2026-04-25 15:06:39
Commit & revert pair: Vendor import of smart at 1.0.2
Vendor import of smart at 1.0.2

smart/diskhealth is a command line application to monitor disk health
from a storage device via SMART.

Reviewed by:    fuz, jrm
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D56638
68e5b71517e947b4e3f349c970af362b47b45f27 Chuck Tuffli 2026-04-28 16:55:50

Revert "Vendor import of smart at 1.0.2"

This reverts commit 68e5b71517e947b4e3f349c970af362b47b45f27.
e139a49b5d8e9385b4d42ea1ec3850bc80d7f989 Chuck Tuffli 2026-04-28 18:49:22
Commit & revert pair: build: provide a FORTIFY_SOURCE.<src file> override
build: provide a FORTIFY_SOURCE.<src file> override

For native files we can do more minimal fixes to avoid this large of a
hammer, but for third party files it may not be worth the effort to try
and patch them.  NetBSD has the original _FORTIFY_SOURCE implementation
that ours is based on, for instance, but tests sourced from there can't
do an __ssp_real(foo) without being certain that `foo` actually has a
fortified definition.

This change does always define _FORTIFY_SOURCE as a result, so gate it
on CFLAGS not already containing _FORTIFY_SOURCE definitions.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294881
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56733
c46a0b590716144d772eeba83ca88d96ee12c2f1 Kyle Evans 2026-05-01 02:57:51

Revert "build: provide a FORTIFY_SOURCE.<src file> override"

This reverts commit c46a0b590716144d772eeba83ca88d96ee12c2f1.  It broke
the build and I'm not awake yet.
8583bcb5b400c4e4d18a563cd749ee9b23750e0a Kyle Evans 2026-05-01 12:19:17
Revert 00bee6fcd77f, which partially reverted libc++ commit aa7f377c965c
After base 966fb94cb357, this revert is no longer necessary: stdint.h
will unconditionally define macros such as `SIZE_MAX`, `UINT64_C`, and
others.

Submitted by:   Nikolas Klauser <nikolasklauser@berlin.de>
MFC after:      1 month
Reviewed by:    imp
Differential Revision: https://reviews.freebsd.org/D56746
19ff93c921a9d31770bcfc194c078e7a42a5f14f Dimitry Andric 2026-05-01 18:12:55
Commit & revert pair: sys/vnode.h: remove stale comment
sys/vnode.h: remove stale comment

The source sweep is not going to happen.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56611
f193f5a749b696e6c05fa2c47c24522b1624b1a7 Konstantin Belousov 2026-04-24 02:06:02

Revert erronously pushed series of commits, which should not be.

Sorry for the mess.

Revert "sys/vnode.h: remove stale comment"
This reverts commit f193f5a749b696e6c05fa2c47c24522b1624b1a7.

Revert "vfs: convert VFS_OPs from macros to static inlines"
This reverts commit 48bf024f2ef5afeba3500bd92a04283370479edf.

Revert "vnode: add VIRF_KNOTE flag"
This reverts commit 7fe74a02764e5899b10cdc45ab34182b961d5d19.

Revert "vfs: convert vfs_op_thread_* macros to static inlines"
This reverts commit a61a696e78a967b149a6e39b1f98ada26217a6bb.

Revert "struct vnode: assign v_rl.resv1 as v_vrflag"
This reverts commit d990e8f0e9478194569ba28c366b0c0c0f414e7b.

Revert "sys/rangelock.h: explicitly enumerate padding at the end of the structure"
This reverts commit a770638ecf16515d8922111c3fdd417aba6c045e.

Revert "bufspace_wait(): only try to help bufdaemon if there is a chance to help"
This reverts commit 067cfac2e7bd9dc857fb6cc504c01b0249bcd1b7.

Revert "Add O_SYMLINK emulation"
This reverts commit f9458655e78f6532e962a13d28d6a6086b4156de.

Revert "libc: add freadlink(3)"
This reverts commit ae6a13deb8e33a52188643e09171207e1d7171e8.

Revert "Add O_SYMLINK emulation"
This reverts commit 2213820b6f4cd22bbfdc0f45741c3e7d17ae82c0.
9ca9a79ea67e8569c31ecc328e001b35908f491c Konstantin Belousov 2026-05-03 20:10:06
Revert "virtio_net: Use bus_dma for command/ack buffers"
This reverts commit b5bad6df467cc95bea641afe674c55cd5b9f1510.

Revert until we can fix reported issues
c8167ebb742c36cb1fc32cc543afb4016b4fc174 Andrew Turner 2026-05-05 09:16:23
Revert "virtio_net: Use bus_dma for rxq/txq buffers"
This reverts commit c16c95192f01237a876eb7bc336e3bbda9310171.

Revert until we can fix reported issues
dc00f118405e8638ceb13b288e14164a8a9ba669 Andrew Turner 2026-05-05 09:17:51
Commit & revert pair: libusb: change callback register handler to int
libusb: change callback register handler to int

libusb upstream uses int for register handler. This causes some library
user (like pyusb) to assume that we have int in all implementations and
therefore provides a 4 byte storage only. This causes Segmentation
fault as we will right the pointer.

Reviewed by:    adrian
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54211
ce9ced951a0b9d004a3b007d4ac6e9087a1301a2 ShengYi Hung 2025-12-13 15:12:11

Revert "libusb: change callback register handler to int"

This reverts commit ce9ced951a0b9d004a3b007d4ac6e9087a1301a2.

We should handle backward compatibility before introducing this patch as
people may rely on old ABI.
bf2c6d23ad0988a8b5dccebccdbc6fda9482c6a2 ShengYi Hung 2026-05-05 16:46:07
Revert "zstd: disable weak-symbol tracing hooks in the kernel"
This reverts commit de2ea5423cc63b62e7e42d11b667aa634109fc28 which is
no longer needed after 1dddb580f950 .

Tested by:      mmel
822366134658ee59922d7f3e37db7bbb8956aaaf Xin LI 2026-05-06 08:27:55
Revert "Skip sys.netinet6.frag6.frag6_19.frag6_19 in CI"
Per [siva@'s comment on the PR][1], this testcase now passes cleanly in CI.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274941
MFC after:      1 week

[1]: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274941#c6

This reverts commit 86e87c3bd1b377242aafe7e2222ae17ca0be96d9.
3348fa7a45fdf14a7af509e306229bd211444f1e Enji Cooper 2026-05-06 23:08:26
Revert "mlx5e: Ensure rx timestamps are monotonically increasing"
This reverts commit ce33f96fcf2f2d0d49c406274bcc64df72fe530e.

It turns out that doing it this way did indeed prevent backwards
movement of timestamps, however it also lead to an ever increasing
error, eventually yielding timestamps hundreds or thousands of
seconds in the future.

Back this out until we can come up with a solution that prevents
backards timestamps and also avoids accumulating error.

Sponsored by: Netflix
23b263dfbf5ec24de2f6e1abc2a4eb04869b3e07 Andrew Gallatin 2026-05-12 12:55:54
Revert "nvme: Only attach to storage NVMe devices"
This reverts commit 0a19464bf7afa35ce2aa7649152bc3a7629faa98. It's
incorrect for ahci attachments. Reverting to merge to stable/15
to merge to releng/15.1 for the release.

Sponsored by:           Netflix
fb4e7898a359a5044e6794c7fe8a698d29af1fd3 Warner Losh 2026-05-14 15:35:35
Commit & revert pair: asmc: fix asmc_key_dump() page fault on T2 MMIO backend
asmc: fix asmc_key_dump() page fault on T2 MMIO backend

asmc_key_dump() used I/O port macros (ASMC_DATAPORT_WRITE/READ,
asmc_command()) unconditionally. On T2 Macs, sc_ioport is NULL
(MMIO backend is used instead), causing a page fault when
ASMC_DEBUG triggers asmc_dumpall() during attach.

Add an MMIO guard at the top of asmc_key_dump(): delegate to
asmc_key_dump_by_index() + asmc_key_read() for MMIO devices,
consistent with the rest of the T2 code paths.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D56748
3abc07947c14f5c30e5328d56a2da8dbf8412ebf Abdelkader Boudih 2026-05-18 14:01:20

Revert "asmc: fix asmc_key_dump() page fault on T2 MMIO backend"

This reverts commit 3abc07947c14f5c30e5328d56a2da8dbf8412ebf.

I'm not sure how this built locally for me but obviously failed
in CI; I'll go figure that out with the submitter and come back.
af5cdcd8b18c9a24cc317f1886dd3c32b253ef27 Adrian Chadd 2026-05-18 16:58:59
Revert "loopback: Clear hash unconditionally."
This reverts commit 2fe37927d41990abe8d1c336e75fd75873285e90.

This turns out to have been misguided.  First, clearing the
hash results in all loopback ip/ip6 traffic being hashed
to the netisr queue associated with the if_index of the loopback
interface.  Eg, it bottlenecks loopback traffic. When the
hash is kept, traffic is spread evenly among netisrs.

Also, it is safe to keep the hash here.  The clearing was only
needed when RSS core selection is enabled; we only enabled the
consistent hashing parts of RSS globally, not the cpuid mapping
stuff.  So there is no need to clear it.

Reviewed by: glebius
Sponsored by: Netflix
d7cde43f95bf432b6894c3cf804a8dffe99461e4 Andrew Gallatin 2026-05-21 13:28:46
Commit & revert pair: import ldns 1.8.3
import ldns 1.8.3

MFC after:      1 week
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D57169
2bc6aa3c41d0dc330fefa6363a23d2cfa0253f73 Dag-Erling Smørgrav 2026-05-22 13:36:27

Revert "import ldns 1.8.3"

Pre-push rebase bungled the metadata

This reverts commit 2bc6aa3c41d0dc330fefa6363a23d2cfa0253f73.
f103898935e1b709adbdaed5e0b10f99a17b9a4a Dag-Erling Smørgrav 2026-05-22 17:53:11
Commit & revert pair: import ldns 1.9.0
import ldns 1.9.0

MFC after:      1 week
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D57170
597a090ff2ab868242e4ec1cdec7469edbe41c50 Dag-Erling Smørgrav 2026-05-22 13:37:52

Revert "import ldns 1.9.0"

Pre-push rebase bungled the metadata

This reverts commit 597a090ff2ab868242e4ec1cdec7469edbe41c50.
399f9ca49b6ecc7fc9bd8b2a0fd487fea4570a65 Dag-Erling Smørgrav 2026-05-22 17:52:00
Revert "sh/tests: Cut down builtins/read12.0 by 2 seconds"
Dag-Erling Smørgrav does not like this, but I do not understand why.

This reverts commit 1df431576f99c3cc26dd4ceb1a6eda864cc9f196.
be9f35396449129ebe952fdd1c080f7856dee030 Jilles Tjoelker 2026-05-25 19:15:51
Commit & revert pair: edk2: enable static asserts for *INT64 alignment
edk2: enable static asserts for *INT64 alignment

The ia32 loader is now built with -malign-double, so these should pass.

Differential Revision:  https://reviews.freebsd.org/D55386
2fa4bdd7f9e99698a6652db405c3165fdcd41c1d Ahmad Khalifa 2026-05-30 02:40:58

Revert "edk2: enable static asserts for *INT64 alignment"

This fails when using WITH_BEARSSL. It seems like we build the EFI bits
of libsecureboot (which is really just part of libsa in this case), even
when building the BIOS loader. Revert for now to unbreak the build.

This reverts commit 2fa4bdd7f9e99698a6652db405c3165fdcd41c1d.

Reported by: freebsd@walstatt-de.de
aef014de3ff8be3ef06a45cb48a7f2386167456f Ahmad Khalifa 2026-05-31 11:29:34
Commit & revert pair: assert.h: Remove leading tabs for whitespace consistency
assert.h: Remove leading tabs for whitespace consistency

Signed-off-by:  Faraz Vahedi <kfv@kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
157c184689ea3d7b8b6bd89aff849e94f004aa0e Faraz Vahedi 2026-05-28 07:17:28

assert.h: Revert "Remove leading tabs for whitespace consistency"

This reverts commit 157c184689ea3d7b8b6bd89aff849e94f004aa0e.

As per style(9), a tab goes after #define.  This should not have been
removed.

Reported by:    kib
Fixes:          https://cgit.freebsd.org/src/commit/?id=157c184689ea3d7b8b6bd89aff849e94f004aa0e.
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
439710cf003b7849d2119e9a7694d7b27ab6d70f Robert Clausecker 2026-05-31 19:47:36
Commit & revert pair: defaultroute: Fix dual-stack and IPv6-only handling
defaultroute: Fix dual-stack and IPv6-only handling

Since IPv6-only setups are becoming more common, and IPv6
connectivity is often sufficient for tasks such as DNS
resolution and NTP time synchronization, update defaultroute
rc.d script to support IPv6-only environments.

Reviewed by:    pouria, ae
Differential Revision: https://reviews.freebsd.org/D56797
5b5a836e72ec2614def23409674822c907cf3740 Pouria Mousavizadeh Tehrani 2026-06-04 07:58:07

Revert "defaultroute: Fix dual-stack and IPv6-only handling"

This reverts commit 5b5a836e72ec2614def23409674822c907cf3740.

Despite using arcpatch for this commit, I attributed the wrong
author of the patch.
4258829c8f588e502d90fe19a0c18ba81a3761d9 Pouria Mousavizadeh Tehrani 2026-06-04 08:46:02
Commit & revert pair: libc: Constify the getcap API
libc: Constify the getcap API

MFC after:      1 week
Inspired by:    NetBSD
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D57252
823d00b2d447247f1c5860e3bbc61f6fd19a70e5 Dag-Erling Smørgrav 2026-06-04 22:41:22

Revert "libc: Constify the getcap API"

This broke cross-building on Linux and macOS.

This reverts commit 823d00b2d447247f1c5860e3bbc61f6fd19a70e5.
641e8e39560d2acd2a52658af422bfd30aabb2bd Dag-Erling Smørgrav 2026-06-05 17:15:46
Commit & revert pair: improve renice user error messages
improve renice user error messages

Improve error handling for invalid user names and UIDs in renice:
- Use warnx() and err() for consistent error reporting
- Set errno = EINVAL for invalid input
- Provide clearer error messages for invalid user names and UIDs
- Add test cases for invalid user input

Signed-off-by: androvonx95 <androvonx95@tutamail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1768
925f53682469ea12c017b48114b16e8f1627fb0b androvonx95 2025-07-15 18:01:28

Revert "improve renice user error messages"

This reverts commit 925f53682469ea12c017b48114b16e8f1627fb0b. The tests are wrong,
so I'm reverting and reopening the pull request.
0d644b41d6e485a482040c5e249ec12ff305c8a1 Warner Losh 2026-06-11 05:58:02
Revert "kldload: Improve error handling"
It broke the test suite, and will be recommitted when fixed.
This reverts commit db887713de2bf5c77494220a9e0ddfa7d4290155.

Reported by:    markj
9a10af53dbf5b1268d6b74e94f2f8054caab9243 Ed Maste 2026-06-16 15:06:17
Revert "rpc.tlsservd.c: Pin max threads at 1 for now"
This reverts commit 7a289fe3cd5c6de7ddbe394b7700b20b0bafdb3e.

Hopefully, commit fc7993cf2d6d has fixed the underlying
problem reported by PR#289734, so I am reverting this
temporary work-around.

I will delay MFC'ng this for a while, to see if the
problem occurs again.

MFC after:      3 months
62e7ac83ae14fcc1847d607e98284bd4a98e7127 Rick Macklem 2026-06-16 16:15:25
Commit & revert pair: fts: refactor to use fd-relative operations internally
fts: refactor to use fd-relative operations internally

Replace all _open() calls with _openat() in __fts_open(), fts_read(),
and fts_children().

Add fts_dirfd to FTSENT. Callers can use
openat(ent->fts_dirfd, ent->fts_name, ...) to access files
safely without relying on fts_accpath, which enables:

1. Capsicum capability mode where path-based operations fail
2. Security-sensitive programs that avoid TOCTOU races

Replace statfs(ent->fts_path) with _fstatfs(ent->fts_dirfd) in
fts_ufslinks() when fts_dirfd is valid, falling back to statfs() for
root-level entries where fts_dirfd is -1

This is a preparatory change for fts_openat() which will allow
callers to provide a pre-opened directory fd, enabling fts(3)
traversal inside Capsicum capability mode.

Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    asomers, jillest
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2278
e03ed9daeb49fffa1d16b8d00240c65e92650d01 Jitendra Bhati 2026-06-12 17:07:55

Revert "fts: refactor to use fd-relative operations internally"

This reverts commit e03ed9daeb49fffa1d16b8d00240c65e92650d01.

The change to the size of struct FTSENT is breaking backwards
compatibility for some binaries.  Jitendra is working on a new version
that will move the new field into a private struct.

Reported by:    bdrewery
Fixes:          https://cgit.freebsd.org/src/commit/?id=e03ed9daeb4 ("fts: refactor to use fd-relative operations")
Sponsored by:   ConnectWise
bd1c0ff49c48950dbd999c024a17199022f81d36 Alan Somers 2026-06-24 16:56:50
Commit & revert pair: resolver(5): Overhaul
resolver(5): Overhaul

* Modernize the markup

* Describe the comment syntax

* Drop obsolete advice

* Capitalize sentences

* Improve the language

* Replace no_tld_query with no-tld-query; both are supported, but all the
  other multi-word options use hyphens rather than underscores.

* Add missing ENVIRONMENT section

* Redo the example

MFC after:      1 week
066bef580b21bed9100c727045e1dbfdeb9bf1a9 Dag-Erling Smørgrav 2026-06-27 18:55:46

Revert "resolver(5): Overhaul"

This reverts commit 066bef580b21bed9100c727045e1dbfdeb9bf1a9.
51a4a96f63dabc786abe4dd2dac74b2872165ceb Dag-Erling Smørgrav 2026-06-29 15:54:01
Commit & revert pair: libc/resolv: Drop Solaris 2 compatibility
libc/resolv: Drop Solaris 2 compatibility

MFC after:      1 week
b27e21f304f260d539288756c5bb85421a549d44 Dag-Erling Smørgrav 2026-06-25 10:57:11

Revert "libc/resolv: Drop Solaris 2 compatibility"

This reverts commit b27e21f304f260d539288756c5bb85421a549d44.
208c43d6f57b036cfd207a54de54c4dd7b8123da Dag-Erling Smørgrav 2026-06-29 15:54:01
Commit & revert pair: libc/resolv: Refactor the option parser
libc/resolv: Refactor the option parser

Start the loop by finding the end of the option name, the name-value
separator (if any), and the end of the option.  Use those pointers to
simplify matching the option name and parsing the option value.

This means that:

* We no longer accept trailing garbage in an option name or value.  For
  instance, we would previously interpret “edns0123” as “edns0” and
  “timeout:3xyz” as “timeout:3”.  This was actually quite lucky because
  we also failed to recognize the newline at the end of the option line
  as a whitespace character.

* For options that take a numerical value, we would previously happily
  set a numerical option to a negative value and treat non-numerical
  arguments as 0, while a numerical argument that happened to exceed
  the maximum for the option would result in the option being set to its
  default value.  Now, any failure to parse the argument, including
  overflow, results in the option being set to its default value.

MFC after:      1 week
40e10af6c6dc46d9c0835db3dc95368ce7d69b55 Dag-Erling Smørgrav 2026-06-25 11:33:47

Revert "libc/resolv: Refactor the option parser"

This reverts commit 40e10af6c6dc46d9c0835db3dc95368ce7d69b55.
550dacea138e5df66780a152ab1ba91c466d7395 Dag-Erling Smørgrav 2026-06-29 15:54:00
Commit & revert pair: libc/resolv: Refactor the configuration parser
libc/resolv: Refactor the configuration parser

This was previously all a single loop in res_init(), apart from option
parsing which we cleaned up in a previous commit.  Break it out into
separate functions for reading the configuration line by line, setting
the default domain, setting the search list, and adding a nameserver
to the nameserver list.  Sprinkle bounds checks and code comments all
around.

The sortlist code, which has been disabled for the past 20 years, will
be dealt with in a separate commit.

MFC after:      1 week
9fd22951233219b5e9985575c1b3aaf3532961fd Dag-Erling Smørgrav 2026-06-25 15:27:02

Revert "libc/resolv: Refactor the configuration parser"

This reverts commit 9fd22951233219b5e9985575c1b3aaf3532961fd.
d9b907be0048558c512ebd0d872542df7548ec0c Dag-Erling Smørgrav 2026-06-29 15:53:59
Commit & revert pair: libc/resolv: Reimplement the sortlist parser
libc/resolv: Reimplement the sortlist parser

When we switched from the BIND4 resolver to the BIND9 resolver, the
sortlist parser was inadvertently disabled, and nobody noticed.  The
sorting code remained enabled in the resolver, but there was no way to
set a sort order.

Reimplement the sortlist parser, but correctly, and update the
documentation accordingly.  The new parser accepts IPv4 and IPv6
addresses with or without a prefix length.

Fixes:          https://cgit.freebsd.org/src/commit/?id=5342d17f09a8 ("Update the resolver in libc to BIND9's one.")
Relnotes:       yes
507ab02d751b4aaa7f35f30882299e9908448e53 Dag-Erling Smørgrav 2026-06-27 18:31:36

Revert "libc/resolv: Reimplement the sortlist parser"

This reverts commit 507ab02d751b4aaa7f35f30882299e9908448e53.
8538c69d84ff2ee4462d09ac21a69e8c907116f1 Dag-Erling Smørgrav 2026-06-29 15:53:59
Commit & revert pair: libc/resolv: Add no-debug and no-rotate options
libc/resolv: Add no-debug and no-rotate options

These are simply the reverse of the debug and rotate options.
61697e9cd5cccc367a38f9851efebad4d7c2bb65 Dag-Erling Smørgrav 2026-06-27 19:00:52

Revert "libc/resolv: Add no-debug and no-rotate options"

This reverts commit 61697e9cd5cccc367a38f9851efebad4d7c2bb65.
955963148a99cc2c45756db76811ef61c75fb5a8 Dag-Erling Smørgrav 2026-06-29 15:53:58
Commit & revert pair: resolv.h: Remove unused parts
resolv.h: Remove unused parts
95978326cb326c69592c75323914bdc52ada0346 Dag-Erling Smørgrav 2026-06-27 22:58:41

Revert "resolv.h: Remove unused parts"

This reverts commit 95978326cb326c69592c75323914bdc52ada0346.
55227ef42de5fbcd2d765b150689e4a5c0d5e352 Dag-Erling Smørgrav 2026-06-29 15:53:57
Commit & revert pair: libc/resolv: Dead code and style cleanup
libc/resolv: Dead code and style cleanup
5028a8489f54fcf0a96399059c14e28c6a69d159 Dag-Erling Smørgrav 2026-06-27 22:58:53

Revert "libc/resolv: Dead code and style cleanup"

This reverts commit 5028a8489f54fcf0a96399059c14e28c6a69d159.
4fd9dffb2514b1d62ce9618c87a9700606f12db3 Dag-Erling Smørgrav 2026-06-29 15:53:57
Commit & revert pair: libfetch: Overhaul socket read / write
libfetch: Overhaul socket read / write

* Make fetch_ssl_read() and fetch_ssl_write() behave more like read(2)
  and write(2), and drop fetch_socket_read() in favor of read(2).

* Don't request POLLERR, it's implied.

* Don't needlessly set errno, it's relatively costly.

* Always check for EAGAIN from writev(2), otherwise we will abort on a
  short write instead of proceeding to poll(2).

* Always check for EAGAIN from poll(2) even though it can't happen on
  FreeBSD; POSIX says it can, and it might in the future.

* Rewrite fetch_read() and fetch_writev() to be more similar to each
  other.  The main difference is that a partial read is treated as
  success while a partial write is treated as failure.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296316
MFC after:      1 week
298f37a71ae6d9f2cb0c2abd4ff2887e81e0942c Dag-Erling Smørgrav 2026-06-27 12:16:31

Revert "libfetch: Overhaul socket read / write"

This reverts commit 298f37a71ae6d9f2cb0c2abd4ff2887e81e0942c.
da4d1ced75f3be17f8b089a364f642a04eb0d466 Dag-Erling Smørgrav 2026-06-29 15:53:56
Commit & revert pair: libfetch: Add read buffering
libfetch: Add read buffering

Previously, we would read FTP control connection messages and HTTP
reponse headers one character at a time.  Now, we read as much as will
fit in our buffer and look for a newline.  If there is data left over,
it will be reused by the next fetch_getln() call.  This also requires
the addition of a fetch_bufread() which takes the buffer into account,
otherwise the start of the HTTP response body will be stuck in the
buffer after we read the last line of the header.

This should noticeably improve HTTP performance, especially for small
transfers.

MFC after:      1 week
afb60498e0c9836a6e3a7efda8a51710e208a608 Dag-Erling Smørgrav 2026-06-27 14:11:38

Revert "libfetch: Add read buffering"

This reverts commit afb60498e0c9836a6e3a7efda8a51710e208a608.
fde60e3a4e922e7931c39f10105e3fbe33f54534 Dag-Erling Smørgrav 2026-06-29 15:53:55
Commit & revert pair: libfetch: Apply timeout to connection attempts
libfetch: Apply timeout to connection attempts

Mark the socket non-blocking before connecting and poll for completion,
applying fetchTimeout if set.

MFC after:      1 week
d53af4112273f7b234a1cdd6694b3a7ca0aae0eb Dag-Erling Smørgrav 2026-06-27 15:34:53

Revert "libfetch: Apply timeout to connection attempts"

This reverts commit d53af4112273f7b234a1cdd6694b3a7ca0aae0eb.
667ef98c29f94c34d06f5ff1d5d32c99a04f6082 Dag-Erling Smørgrav 2026-06-29 15:53:54
Commit & revert pair: libfetch: Document fetchTimeout
libfetch: Document fetchTimeout

Document the global fetchTimeout variable, now that it works reliably.

MFC after:      1 week
c83e9ee0ef3e6af982e6fd35afe420d460fa84b3 Dag-Erling Smørgrav 2026-06-27 15:37:23

Revert "libfetch: Document fetchTimeout"

This reverts commit c83e9ee0ef3e6af982e6fd35afe420d460fa84b3.
15ee1fc07457b5fb7e1b027d18afc4ffc9aa56b2 Dag-Erling Smørgrav 2026-06-29 15:53:54
Commit & revert pair: fetch: Stop setting an alarm
fetch: Stop setting an alarm

Now that fetchTimeout works reliably, setting an alarm is not only no
longer necessary but counterproductive, as it will trigger even if the
connection is not actually stalled but merely slow.

While here, improve the wording of the manual page's description of the
various options for setting a timeout.

MFC after:      1 week
23380f3e6ac9334e85489f92f7f20b700ede3368 Dag-Erling Smørgrav 2026-06-27 15:41:22

Revert "fetch: Stop setting an alarm"

This reverts commit 23380f3e6ac9334e85489f92f7f20b700ede3368.
1b5f832e268f1f1092d0ebfc3bab4a7228aae20b Dag-Erling Smørgrav 2026-06-29 15:53:53
Commit & revert pair: libfetch: Make fetch_ref an inline
libfetch: Make fetch_ref an inline

Make fetch_ref() an inline and provide a fetch_deref().

MFC after:      1 week
672cb7320a2754788bddf5cd026721b6f70a0d30 Dag-Erling Smørgrav 2026-06-29 13:29:10

Revert "libfetch: Make fetch_ref an inline"

This reverts commit 672cb7320a2754788bddf5cd026721b6f70a0d30.
d40b35f8eb1dbab430d595193ddb1c950766bcac Dag-Erling Smørgrav 2026-06-29 15:53:53
Commit & revert pair: libc/resolv: Export __res_conf_name
libc/resolv: Export __res_conf_name

Add a new global variable, __res_conf_name, which is initialized to
_PATH_RESCONF and used in its place by res_init().  This allows test
programs (and applications) to select a different configuration file
to read instead of /etc/resolv.conf.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220610
702c24ccc0c208e9bc697e775abe47ff723e3012 Dag-Erling Smørgrav 2026-06-28 09:37:40

Revert "libc/resolv: Export __res_conf_name"

This reverts commit 702c24ccc0c208e9bc697e775abe47ff723e3012.
f52803e475d50f6d1996aa97c14be043e288185c Dag-Erling Smørgrav 2026-06-29 15:53:52
Commit & revert pair: pkgbasify: Add new utility
pkgbasify: Add new utility

The pkgbasify utility converts a system installed from distribution sets
to packaged base by registering, without actually installing, a set of
packages that corresponds to what is already installed.

MFC after:      1 week
e6467516f584505ac29fd370966abd530a7b5454 Dag-Erling Smørgrav 2026-06-29 00:41:11

Revert "pkgbasify: Add new utility"

This reverts commit e6467516f584505ac29fd370966abd530a7b5454.
b3a970fc9202cc7c9e80e1bcb83d7d860a3475c5 Dag-Erling Smørgrav 2026-06-29 15:53:52
Commit & revert pair: Retire dialog
Retire dialog

This is the last remaining piece of GPL software in the base system.
The installer transitioned to bsddialog four years ago, and the last
remaining dialog consumer, dpv, was turned off more than two years ago.
Retire dpv, libdpv, libfigpar (used only by dpv), and dialog itself.

(cherry picked from commit 73bb4a92985d747462d866248c1e7623f7ff1a7f)
5b2bdadeb6c25c10dac9722fd66a668e14d3b384 Dag-Erling Smørgrav 2026-02-17 13:21:23

Revert "Retire dialog"

This reverts commit 5b2bdadeb6c25c10dac9722fd66a668e14d3b384.
2b9f38236151f1bb0f26ec14a72e553b8420da8b Dag-Erling Smørgrav 2026-06-29 15:53:51
Commit & revert pair: Retire the GNU subtree
Retire the GNU subtree

With GNU diff and cdialog gone, this is now an empty shell.

(cherry picked from commit 151dd62e005119dda24b8ff9b14aa5beaaa681ac)
9cc87ca23d9ccae814bea514aa4bdc791f2d6e46 Dag-Erling Smørgrav 2026-02-18 09:02:08

Revert "Retire the GNU subtree"

This reverts commit 9cc87ca23d9ccae814bea514aa4bdc791f2d6e46.
7aa0fb6181b8f520c0dde548eb7f0e03cdf3ae13 Dag-Erling Smørgrav 2026-06-29 15:53:48
Revert "ping/tests: expect bell chars from stderr after initial status"
This reverts commit 5b8c28adb829b50fb8ac065637fa99f717858bab.

The commit message was wrong.

Reported by:    des
7ac9995a062ff9f78b634fe403e6a313f5637945 Siva Mahadevan 2026-06-30 13:00:30

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.20 at 2026-07-06 18:01:18+00:00.

This work is supported by Tarsnap Backup Inc.

Alternate version: 2026-04-01 (debug) (contains info about the classification)