FreeBSD git weekly: 2026-10-01 to 2026-12-31

Introduction

This is a display of mostly-automatically-classified git commits from 2026-10-01 to 2026-12-31.

This report is still in progress.

DEBUG: This version of the report is primarily for checking the classifiers, and therefore contains extra information (in this colour).

Table of contents and commits per category:

(7) Highlighted commits (these are copies, not in stats)
30 2.0% Userland programs
94 6.4% Documentation
508 34.7% Hardware support
134 9.1% Networking
136 9.3% System administration
76 5.2% Libraries
24 1.6% Filesystems
234 16.0% Kernel
51 3.5% Build system
17 1.2% Internal organizational stuff
43 2.9% Testing
22 1.5% Style, typos, and comments
57 3.9% Contrib code
39 2.7% Reverted commits
0 0.0% Unclassified commits
1465 100% total
Technical notes about this page

debug: info about the automatic classification

num % num changed stage
40 2.7% 0 00-reverts
23 1.6% 0 01-style
131 8.9% 0 02-filenames_wildcards
42 2.9% 0 02b-filenames_wildcards2
822 56.1% 0 03-filenames_plain1
356 24.3% 0 04-filenames_plain2
20 1.4% 0 05-summary-prefix
31 2.1% 0 Manually-classified commits
0 0.0% 0 Unclassified commits

debug: more stats

num % stage
0 0.0% Misclassified commits
1434 97.9% Classified commits, no corrections

debug: groups

36 2.5% num in revert
12 0.8% num in fixes
362 24.7% num in consecutive
410 28.0% Commits in groups

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.

release: No distribution sets by default
Remove the "NODISTSETS" option and add a "DISTSETS" option.  This
option will remain, disabled by default, for the duration of the
16.x branch but will be removed in 17.0.

With hat:       re
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D60945
7b67aa67a71b02afe46d77199dac90d08ea5be41 Colin Percival 2026-10-18 17:46:40

debug: classified in 02-filenames_wildcards by '.*Makefile'

pkg: Enable FreeBSD-base by default
Enable the FreeBSD-base repository in all of the /etc/pkg/FreeBSD.conf
variants, and remove code from various install paths which enabled the
repository via /usr/local/etc/pkg/repos/FreeBSD.conf.

Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D60946
b66922687718be12f8953c6de17f46de3e54a74d Colin Percival 2026-10-18 18:18:59

debug: Commit manually moved from "unknown" to "build".

__FreeBSD_version: Bump for USB 3.1 and 3.2 changes
Bump new USB changes. Also, update RELNOTE and UPDATING.

Sponsored by:   The FreeBSD Foundation
5cc08734add2c758b225a190a562101ac1878437 ShengYi Hung 2026-11-02 03:52:04

debug: Commit manually moved from "unknown" to "build".

periodic: Fix empty output check
The empty_output variable is normalized to YES or NO, but we were
comparing it to TRUE, so the comparison always failed no matter what it
was set to.  Compare it to YES instead.

This feature has been disabled since 2007, so flip the default to NO to
preserve the current behavior.  Adjust the documentation accordingly.

Relnotes:       yes
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300676
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=68c35072f914 ("Add an option to make periodic(8) quiet when no output was generated.")
Reviewed by:    ivy, emaste
Differential Revision:  https://reviews.freebsd.org/D61435
004bba2b6b0ea5313480be65bc9506c5628e5a78 Dag-Erling Smørgrav 2026-11-11 18:07:57

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

gre(4): Add full support for gre key
Allow multiple gre tunnels between the same source and destination
addresses, distinguished by their incoming gre key.
Add greikey and greokey to ifconfig(8) to set the incoming and
outgoing keys separately and grekey now sets both.
Add a net.link.gre.key_fallback sysctl for backward compatibility
and set it to true by default.
Also write multikey tests for both IPv4 and IPv6 families.

Relnotes:       yes
Reviewed by:    adrian
Discussed with: zlei
Differential Revision:  https://reviews.freebsd.org/D59849
1555dff3bf5619278c80ba843555ac2c84d671c3 Pouria Mousavizadeh Tehrani 2026-11-12 19:33:41

debug: Commit manually moved from "unknown" to "network".

loader.efi: Measure boot policy and loaded contents with a TPM
Use the EFI TCG2 protocol, or the legacy TCG protocol on TPM 1.2
firmware, to extend the loader PCRs and record EV_IPL events in the
firmware event log.

Extend PCR 8 with the final kernel environment and the type, name, and
arguments of each loaded boot input.  Prefix both record types with
versioned, NUL-terminated domain strings.  These make the records
self-identifying and define an explicit measured policy encoding.  Store
the complete measured pre-images in the event data so attestation and
diagnostic tools can audit the values without an out of band copy.

Extend PCR 9 with the initialized contents of kernels, modules, and raw
boot inputs, but record only descriptive labels rather than copying file
contents into the event log.

The Lua module table has no defined traversal order.  Retain content
ranges as loader-private metadata, then sort the final file list before
extending either PCR.  This produces repeatable values and excludes
failed or subsequently unloaded files.

Measure initialized loaded memory rather than source files.  This covers
zero initialized ELF data while excluding undefined gaps and debugging
information.  Do not measure entropy, timing data, or GELI key files.
Exclude loader passwords and the GELI passphrase from the kernel
environment measurement so low entropy secrets do not acquire a public
event-log digest or appear in the event data.

Measurement remains best effort.  Warn and stop measuring after the
first firmware or allocation error rather than preventing the system
from booting.

Validated with the EFI TCG protocol on a ThinkPad T430 TPM 1.2 using
coreboot with a measured EDK2 payload.  Replaying the loader events
reproduced PCRs 8 and 9, and both PCRs repeated across clean boots.  TPM
2.0 testing on a commercial AMI EFI firmware likewise produced stable
PCRs across clean boots.  A raw firmware-log dump decoded by
tpm2_eventlog using tpm(4) changes that will come later confirmed the
versioned PCR 8 pre-images and the descriptive PCR 9 event data.

Reviewed by:    imp
MFC after:      2 weeks
Relnotes:       yes
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59141
f429c4a6ee50c99fbff672a3eaa7e5cdaa198a16 Kevin Bowling 2026-11-14 00:33:19

debug: Commit manually moved from "unknown" to "hardware".

UPDATING: note login-name validation in pw(8)/pwd_mkdb(8)
An existing master.passwd with a login name containing a now-disallowed
charater will make pwd_mkdb(8) fail until the name is fixed, which blocks
passwd(1), chpass(1) and pw(8).  Warn users to audit their accounts
befroe updating.

Reviewed by:    bcr
Differential Revision:  https://reviews.freebsd.org/D61507
079f82d129b8d551d07fc39f8343ebb8115375c6 Muhammad Moinur Rahman 2026-11-13 13:03:31

debug: classified in 03-filenames_plain1 by 'UPDATING'

Userland programs

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

mountpoint(1): new utility, implemented as a stat(1) hardlink
Add mountpoint(1), a simple utility to tell whether the file pointed
to by the argument is a mount point.  It prints whether it is, unless
-q is given, and exits 0 if it is, 1 if it is not, and 2 on error.

The answer comes from the kernel with a single stat(2): the root vnode
of a mounted file system is reported with SFBSD_MNTPOINT in
st_bsdflags.  Unlike comparing realpath(3) of the argument with that
of statfs(2)'s f_mntonname, this works for arbitrarily deep
hierarchies, and after chroot(2) or inside a jail.  A chroot or jail
root is reported as a mount point only if it is one.

The argument does not have to be a directory: file systems such as
nullfs(5) can be mounted over regular files and sockets, and stat(2)
reports those mount points as well.

Since all that is needed is one stat(2) call, make mountpoint a
hardlink to stat(1), the same way readlink(1) is, and document it in
stat.1.

Add ATF tests, including chroot(8) and jail(8) roots that are and are
not mount points, nullfs roots, file systems mounted inside the root,
both from the host and from within the jail, and a nullfs mount of a
file over a file.

Suggested by:   kib
Differential revision:  https://reviews.freebsd.org/D59906
Sponsored by:   Sippy Software, Inc.
MFC after:      2 weeks
43b0384bc7e87df5bd164ce833617e68824f4828 Maxim Sobolev 2026-10-01 21:25:37

debug: classified in 04-filenames_plain2 by 'usr.bin/'

mkimg: Check for realloc failure
If realloc fails, clean up and return ENOMEM; don't just copy data
into NULL.

Reviewed by:    emaste
Reported by:    Claude Opus 5.5
MFC after:      2 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60147
1a0523197c5c16ce7bcb79d16c6bf8945258b428 Colin Percival 2026-09-25 23:46:07

debug: classified in 04-filenames_plain2 by 'usr.bin/'

mkimg: Avoid leaking a page of mmap
The image_file_map function adjusts the provided file offset to be
page-aligned, with a resulting increase in the size of the mapped
region; the increased size needs to be used when unmapping as well.

Reported by:    Claude Opus 5.5
Fixes:  https://cgit.freebsd.org/src/commit/?id=baf4abfc39b2 ("Allow building mkimg as cross-tool")
MFC after:      2 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60148
434819b4fec5e508bdfe72f91e73402e9c2fca22 Colin Percival 2026-09-26 00:42:40

debug: classified in 04-filenames_plain2 by 'usr.bin/'

mkimg: Add image_buffer_region
This is like image_copyout_region, but copies into a buffer rather than
writing out to a file; it will be used by future support for compressed
images (and potentially other circumstances where image data must be
manipulated before being written out to disk).

Reviewed by:    jrm
No objection from:      Christos Komis (author)
MFC after:      2 weeks
Sponsored by:   Google LLC (GSoC 2025)
Differential Revision:  https://reviews.freebsd.org/D60149
84a3e29c72030dab16b4dc82d601d0af5da6a18c ChrisKom04 2025-07-13 15:46:46

debug: classified in 04-filenames_plain2 by 'usr.bin/'

mkimg: Make vmdk's desc_fmt slightly more generic
This will allow it to be reused in upcoming work.

Suggested by:   Claude Opus 5.5
MFC after:      2 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60150
498276b487c838afa2b3e4df322c43141788ba20 Colin Percival 2026-09-26 16:32:15

debug: classified in 04-filenames_plain2 by 'usr.bin/'

mkimg: Add support for stream-optimized VMDK
FreeBSD VM/cloud images tend to be highly compressible: The generic VM
images compress roughly 3.5:1, and cloud images typically even more
since they have significant unused space in their virtual disks.  This
generally doesn't matter for users who can download compressed release
images and extract them locally, but for EC2 in particular relying on
uncompressed image formats is painful: We now upload over 500 GB/week
to AWS.

This commit adds the "stream-optimized" version of the VMDK format,
which compresses each 64 kB "grain" individually (and omits grains
which are all zeroes).  Compared to uncompressed formats, this can
produce much smaller images; experiments indicate that using this
format for EC2 image uploads will reduce the weekly traffic to under
100 GB/week.

Co-authored-by: Claude Opus 5.5
MFC after:      2 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60151
9a0b9a23e0bb691034a019edea756377509d0a98 Colin Percival 2026-09-29 19:29:22

debug: classified in 04-filenames_plain2 by 'usr.bin/'

whereis: Fix list size calculation.
Use nitems() to calculate the number of elements in sourcepaths.

Reviewed by:            fernape@, ngie@
Approved by:            ngie@
Fixes:                  https://cgit.freebsd.org/src/commit/?id=3963483523a4
Sponsored by:           Intel Corporation
Assisted-by:            Github Copilot (GPT-5.6 Terra)
Differential Revision:  https://reviews.freebsd.org/D60368
e7b019fbf1a0f02386a8d02eac4a691f112cc242 Krzysztof Galazka 2026-10-07 15:24:05

debug: classified in 04-filenames_plain2 by 'usr.bin/'

termcap: add missing capabilities to the xterm-ghostty entry
The entry was imported from the termcap source that Ghostty generates
with infotocap during its build.  To fit within 1023 bytes, the
conversion dropped a number of capabilities, most notably all color
support, so termcap consumers such as ls -G and ncurses applications
treated Ghostty as a monochrome terminal.

Split the entry into xterm-ghostty and a ghostty+common fragment, and
restore the following from Ghostty's terminfo definition:

 - colors: Co, pa, AF, AB, op, oc, ut, AX
 - keys: End, keypad Enter, F10-F12, back tab, mouse prefix
 - attributes: italics (ZH/ZR), invisible (mk), acsc map (ac)
 - misc: cb, ch, cv, SA/RA, r1, bs, NP, 5i

AF and AB use the plain 256-color form, like xterm-256color, because
termcap cannot express the conditional used by the terminfo entry.

Fixes:          https://cgit.freebsd.org/src/commit/?id=804f961c5cdd ("share/termcap: add xterm-ghostty entry")
MFC after:      1 week
3ceb5f150bc121f5e6a3e0cc8b289279338405a1 Xin LI 2026-10-12 07:51:43

debug: Commit manually moved from "unknown" to "userland".

ncal(1): handle Sweden's transitional calendar (1700-1712)
Sweden used a unique intermediate calendar during 1700-1712.  In 1700,
Sweden omitted the Julian leap day (Feb 29, 1700) to begin a gradual
transition to the Gregorian calendar.  The transition was abandoned
mid-way due to the Great Northern War; to revert to the Julian calendar,
an extra day "Feb 30, 1712" was added.  Sweden finally adopted the
Gregorian calendar in 1753 (already handled correctly by ncal).

ncal previously displayed Feb 1700 as a 29-day month and Feb 1712 as a
29-day month, both incorrect for the Swedish (-s SE) calendar mode.

Add flag_sweden, which is set when the SE country code is selected (via
-s SE or the locale) and cleared by -J, since -J selects the plain
Julian calendar.  When active, sndaysr() and sdater() apply the one-day
offset that characterised the Swedish transitional calendar:

  - Feb 1700: displayed with 28 days (no leap day)
  - 1700-03-01 to 1712-02-30: dates run one day ahead of Julian, so
    weekdays are correctly anchored to the actual solar day
  - Feb 1712: displayed with 30 days (the unique "Feb 30" day)
  - 1712-03-01 onward: back to Julian until the 1753 Gregorian switch

Add ATF tests covering the 3-month and Julian-day views around both
boundaries and the -J override.

Reported-by:    John Costello <https://joxn.org>
Signed-off-by:  Juan Michelini <juan@juan.com.uy>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Reviewed by:    asomers, js
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2353
1ca7f6618536febba5b500c050cddaf06bd2342a Juan Michelini 2026-10-09 14:28:25

debug: classified in 04-filenames_plain2 by 'usr.bin/'

diff: support -qq to output absolutely nothing
This is similar to `cmp -s`, but can be combined with:
-B --ignore-blank-lines
-b --ignore-space-change
-w --ignore-all-space

To only report a difference if it doesn't involve whitespace

Reviewed by:    des, bapt, markj (previous version), ziaee (man page)
MFC after:      1 week
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D46717
c30a321a61ce7e1c03d4c314b2127b37f75564c6 Allan Jude 2024-09-20 15:30:58

debug: classified in 04-filenames_plain2 by 'usr.bin/'

diff: diff regular files when `-q` is specified again
c30a321a61ce accidentally modified the code paths when diffing regular
files to not diff them if `-q` was specified. Call `diffreg(..)` again,
regardless of whether or not `-q` was specified to restore the
functionality pre-c30a321a61ce, while only printing out the result to
the console if `-q` is not specified.

This change unbreaks diff so 2 files which differ are reported again via
the exit code when with `-q` is specified.

MFC after:      3 days
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299643
Reviewed by:    des
Differential Revision: https://reviews.freebsd.org/D60910
Fixes: https://cgit.freebsd.org/src/commit/?id=c30a321a61ce ("diff: support -qq to output absolutely nothing")
ec1754a677a0bebb735d752583ad625150114eee Enji Cooper 2026-10-20 17:37:12

debug: classified in 04-filenames_plain2 by 'usr.bin/'

ssh: use defaultkey sentinel for ML-DSA-44 default host key
servconf_add_hostkey() compares its file argument to defaultkey by
pointer to skip an unreadable default key; the ML-DSA-44 entry passed
the "[default]" literal, so the skip (and the "No host key files found"
fallback) never applied to it.

MFC after:      1 week
Reviewed by:    emaste
Fixes: https://cgit.freebsd.org/src/commit/?id=bb5c77e9d281 ("OpenSSH: Update to 10.4p1")
Differential Revision:  https://reviews.freebsd.org/D60922
2d6f961164e4ab7e823972336dc9cfaae6a88ed8 Osvaldo Janeri Filho 2026-10-20 19:11:32

debug: Commit manually moved from "unknown" to "userland".

Commit group #0: mkimg
mkimg: Use reallocf

Reviewed by:    ngie
Suggested by:   ngie
Improves:       1a0523197c5c ("mkimg: Check for realloc failure")
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60419
38407c46ded957a2ecb7fe2a0dca6c4ac8e802f3 Colin Percival 2026-10-06 20:01:39

debug: classified in 04-filenames_plain2 by 'usr.bin/'


mkimg: Don't ignore invalid partition offsets

When handling PART_KIND_FILE, the "error" variable is set to reflect
any errors in parsing the specified offset; but that value is then
overwritten by the return value of image_copyin.

Error out immediately instead.  Note that it is not necessary to change
the code in PART_KIND_SIZE which parses the size, since in that case we
do not overwrite the value in "error".

Fixes:          https://cgit.freebsd.org/src/commit/?id=8f3c71c85e5f ("mkimg: Add support for offset if the source is an image")
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60422
e7f84fe6cfac2de3471e4912b1ac82023976ccfa Colin Percival 2026-10-06 21:22:07

debug: classified in 04-filenames_plain2 by 'usr.bin/'


mkimg: Add per-partition alignment

This adds a "%align" field to partition specifications, resulting in
the start of a partition being shifted to the next aligned position.
When both :offset and %align are used, a relative offset is treated as
a minimum value, while an unaligned absolute offset is an error.

Reviewed by:    imp (earlier version)
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60450
729883c93e7fd89a4b88e8b9a7ef42938a431efa Colin Percival 2026-10-07 21:51:26

debug: classified in 04-filenames_plain2 by 'usr.bin/'

mkimg: Remove duplicate variable assignment
Fixes:        https://cgit.freebsd.org/src/commit/?id=459a61fd2d0a ("Add the ability to specify absolute and relative offsets to size partitions.")
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60452
1485ee74f81039cfdccd294440813a1a2badfc0b Colin Percival 2026-10-08 00:09:09

debug: classified in 04-filenames_plain2 by 'usr.bin/'

mkimg: Ignore redundant %align values
Partitions are trivially aligned to sector boundaries, so asking e.g.
for a partition to be aligned to a 64-byte boundary is pointless but
harmless.  Treat it as such, with a warning (in case the request was
a mistake, e.g. requesting 1-byte instead of 1M-byte alignment) rather
than as an error.

Reviewed by:    markj
Suggested by:   markj
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60819
da04cf02c96b97c587580b336fa527392467f689 Colin Percival 2026-10-17 19:14:16

debug: classified in 04-filenames_plain2 by 'usr.bin/'

logger: Close syslog channel on exit
MFC after:    1 week
Sponsored by:   Klara, Inc.
Sponsored by:   Qualys, Inc.
Reviewed by:    oshogbo
Differential Revision:  https://reviews.freebsd.org/D60170
aa00f4c4f69f7cd7c3ccb7e4371a44bd338cc812 Dag-Erling Smørgrav 2026-11-04 15:32:24

debug: classified in 04-filenames_plain2 by 'usr.bin/'

Commit group #1: sdiotool
sdiotool: Fix writes being issued as reads

sdio_write_1() passed 0 as the write flag to sdio_rw_direct(), so every write was performed as a read and the value was never sent to the card.  Pass 1 so that the data is actually written.

Reviewed by:    oh
Differential Revision:  https://reviews.freebsd.org/D61026
d61de53d18df34e60660baebe92ea8a1d204d1e9 Emmanuel Vadot 2026-10-22 16:39:03

debug: classified in 04-filenames_plain2 by 'usr.bin/'


sdiotool: Use the system bool type

linux_compat.h redefined bool as int8_t, overriding the _Bool definition provided by sys/types.h.  This changes the size and semantics of bool and conflicts with headers that include stdbool.h, such as cam/cam.h.  Rely on the system definition instead.

Reviewed by:    oh
Differential Revision:  https://reviews.freebsd.org/D61027
be1bdeb36c017c5d5d0311458fcde59a36a64aa5 Emmanuel Vadot 2026-10-22 16:39:03

debug: classified in 04-filenames_plain2 by 'usr.bin/'


sdiotool: Remove the unused -f option

The -f option was parsed but never used.  Its argument handling was also broken: getopt(3) binds the argument to the last option letter, so "fu:" made -f take no argument at all.  Remove it.

Reviewed by:    oh
Differential Revision:  https://reviews.freebsd.org/D61028
c67a07eb2cf8efb6ea626225ca2883f8c5aad910 Emmanuel Vadot 2026-10-22 16:39:07

debug: classified in 04-filenames_plain2 by 'usr.bin/'


sdiotool: Use (void) for functions taking no arguments

Use (void) instead of an empty parameter list, as required by style(9), and let the compiler diagnose calls with unexpected arguments.

Reviewed by:    oh
Differential Revision:  https://reviews.freebsd.org/D61029
e5b68a6a00e609a5a39777aa7060c4cd1288c45f Emmanuel Vadot 2026-10-22 16:39:11

debug: classified in 04-filenames_plain2 by 'usr.bin/'


sdiotool: Do not treat an unknown chip ID as fatal

The tool is useful for probing any SDIO card, not only the BCM4330.  Print the chip ID, report a failed backplane read, and only note when the ID is not the expected REPLY_MAGIC instead of exiting.

Differential Revision:  https://reviews.freebsd.org/D61030
c502df9eb19391c911e6fe930422aff8df926d9f Emmanuel Vadot 2026-10-22 16:39:16

debug: classified in 04-filenames_plain2 by 'usr.bin/'

top: allow filtering by command name
top(1) already supports interactive command filtering using
the '/' key. Support it also with a command line
argument '-g' / '--grep'.

Reviewed by:    kib
Obtained from:  OpenBSD
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D61160
d668d96259d568877fa863095fc28bd6c323dd01 Roman Bogorodskiy 2026-11-03 16:54:38

debug: classified in 04-filenames_plain2 by 'usr.bin/'

su, login: fix heap over-read in environment export filter
ok_to_export() (su.c) and export() (login.c) read s[n] before
strncmp(s, *pp, n) confirms s is at least n bytes long, where n is
the length of the blocked variable name. A PAM environment entry
shorter than that name over-reads past its heap allocation.

Check strncmp() first; it stops at s's NUL terminator and never
reads past the boundary that guarded the s[n] access.

MFC after:      1 week
Sponsored by:   Advanced Micro Devices, Inc.
Signed-off-by:  Osvaldo Janeri Filho <ojanerif@amd.com>
Reviewed by:    des, markj
Differential Revision:  https://reviews.freebsd.org/D61420
e1b5e1f9ddac43ed669a44cfdbba1b394d144c6b Osvaldo Janeri Filho 2026-11-12 14:23:56

debug: classified in 04-filenames_plain2 by 'usr.bin/'

top: implement pid highlighting
Implement PID highlighting. This can be activated by pressing
'L' and entering a PID to highlight. Highlighting can be cleared
by entering '+' as a PID to highlight. This feature is inspired by
the OpenBSD top, which uses 'P' key for that. We have to use 'L'
because 'P' is already used for toggling per-CPU statistics.

Reviewed by:    kib
Obtained from:  OpenBSD (partially)
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D61090
3dcd4a2fd6b84fe962897f3c07e684ce166798a4 Roman Bogorodskiy 2026-11-01 07:28:37

debug: classified in 04-filenames_plain2 by 'usr.bin/'

top: fix off-by-one in screenbuf
There is a heap overflow for screenbuf originating from
the top import to the tree. The i_process()/u_process() functions
write a terminating NUL one byte past each screenbuf line slot
when the line fills the slot, which is a 1-byte heap overflow on the last slot.

The display_resize() function allocates screen_width bytes per line.
i_process() and u_process() cut lines to screen_width characters and
then stpcpy() them into the slot, which writes screen_width + 1 bytes.
line_update() can do the same with *old = ch. For inner slots,
the NUL lands in byte 0 of the next slot. This can corrupt the saved
contents used when updating the next line. For the last slot, it writes
one byte past the end of screenbuf.

Fix by allocating (screen_width + 1) bytes per line and updating the
line offsets to fit the terminating NUL.

Reviewed by:    kib
Reported by:    llm-postcr
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D61593
5233aaccdce59abfb80312cdbe94495516fd211f Roman Bogorodskiy 2026-11-15 09:19:44

debug: classified in 04-filenames_plain2 by 'usr.bin/'

proccontrol: support la52 on powerpc64
powerpc64 is getting the same PROC_LA_CTL interface as amd64, but calls
the full address space la52 instead of la57. Take the mode name and the
constants from whichever one machine/procctl.h defines.

Reviewed by:    kib
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D61331
a637aa182bb1c1dc1e545fc5af2bceff4013affc Piotr Kubaj 2026-11-15 20:57:11

debug: classified in 04-filenames_plain2 by 'usr.bin/'

elfctl: add la52 for powerpc64
The 0x40 feature bit is la57 on amd64 and la52 on powerpc64. Tag each
feature with the machine it belongs to and only accept and show the
names that match the file's e_machine, so la57 is only known for amd64
files and la52 only for powerpc64 ones.

Reviewed by:    kib
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D61331
46ce9acd6d157d3a63ca351a522d45a35ae83499 Piotr Kubaj 2026-11-15 20:57:46

debug: classified in 04-filenames_plain2 by 'usr.bin/'

pax: Use copy_file_range
Use copy_file_range(2) instead of our own inefficient and unreliable
attempt at detecting holes.  If copy_file_range(2) is not available,
which in theory should be never, we fall back to a simple read(2) /
write(2) loop which makes no attempt to copy holes.  This should
speed up pax copy mode and cpio passthrough mode significantly.

This includes refactoring much of the existing I/O code to use the
size_t and ssize_t instead of int where appropriate.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    obiwac
Differential Revision:  https://reviews.freebsd.org/D58470
471d0cb24c6d1252f33dd1cdb6c907dd3b6b5ea4 Dag-Erling Smørgrav 2026-11-16 14:44:24

debug: classified in 03-filenames_plain1 by 'bin/'

Documentation

Man pages, release notes, etc.

tcpdrop.8: spell newreno
MFC after:    1 week
cdb4538d7f6ba891ad54dd7d3d1b25632410e40f Maxim Konovalov 2026-10-01 16:19:31

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

tcpdrop.8: Xr mod_cc(4)
MFC after:    1 week
9279dd3c15fbbf82e5727bc7bdfbc8e8b5a53552 Maxim Konovalov 2026-10-01 16:22:50

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

bhyve.8: add details on using TPM with UEFI
Add a note that UEFI VMs using TPM devices should be configured
to use a varfile. Some UEFI boot loaders, such as shim, update
persistent boot variables and then reset the system when a TPM is
present. Without a writable varfile, the VM may be reset repeatedly.

Add a TPM device example to the examples list.

While here, add a missing "\" to the "uefivm" example, and add ".Pp"
before the vCPU pinning examples for consistency with other examples.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287326
Reviewed by:    michaelo, ziaee
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D60181
ff2efe65a89a943beec4dd4cc956f5e075a921be Roman Bogorodskiy 2026-09-30 17:56:18

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

mkimg.1: Document new vmdks format
Reviewed by:  ziaee
Co-authored-by: Claude Opus 5.5
MFC after:      2 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60152
88017d32745ef24d662db826fe475d8a20d290a6 Colin Percival 2026-09-29 19:44:01

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

inotify.2: Add some entries to the BUGS section
MFC after:    1 week
Sponsored by:   The FreeBSD Foundation
fa6fe034a73c8b17320d1e68767ad2aa99eaa8bf Mark Johnston 2026-10-07 14:36:46

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

dhclient-script(8): s/URI/URL
Reported by:  glebius@
6c305c3c3129c4b90d22fdea5092788549bf7992 Baptiste Daroussin 2026-10-07 20:04:42

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

ports.7: Document how to use mdo(1) for SU_CMD
Reviewed by:  olce
MFC after:      1 week
Sponsored by:   fme AG
Differential Revision:  https://reviews.freebsd.org/D60443
8eb863097f264794eccd8ef7cdaf95aa80260353 Mateusz Piotrowski 2026-10-07 14:11:22

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

ulimit(3): Improve UL_{GET,SET}FSIZE wording
Reword the UL_GETFSIZE and UL_SETFSIZE descriptions to say 512-byte
blocks and make the setter's argument clearer.

While here, improve mdoc markup and pull in other small improvements.

Reviewed by:    des
MFC after:      3 days
Obtained from:  https://github.com/apple-oss-distributions/libc
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D60467
d39b1d6932dcc16b7c8a399d196fd81d038ca261 Aymeric Wibo 2026-10-08 14:17:22

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

acl(9): expound on NFSv4 constants' meanings
This change adds missing documentation for various NFSv4 constants
supported by acl(9).

Bump `.Dd` for the change.

MFC after:      1 week
Reviewed by:    rmacklem
Differential Revision:  https://reviews.freebsd.org/D58736
7a48c3fd3e6ea097a8fa8f3ce3e25fe7c2d37d9e Enji Cooper 2026-10-10 07:27:35

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

dict: Add "macho"
Macho is a perfectly cromulent word, in both Merriam-Webster and OED.

Reviewed by:    imp
Differential Revision: https://reviews.freebsd.org/D60713
4a65e12dfbaba7193e37fcd2e14fbc20776a78b9 Ed Maste 2022-06-17 15:55:23

debug: Commit manually moved from "unknown" to "doc".

tcpsso.8: fix a cosmetic nit and make mandoc -Tlint happy
bfb7ee5ef00f847d27f535c80936fd845db7104d Maxim Konovalov 2026-10-16 21:33:41

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

pmc.perf.3: Mark only for amd64 architecture
Manual pages have an optional architecture specifier after the section
number in the document title macro. I highly recommend using it when
expedient, the extra information is available programmatically and it
uses no extra lines in the rendered page.

MFC after:              No, pmc.perf.3 is not MFCing
Reviewed by:            Anderson Nascimento <anascime@amd.com>
Differential Revision:  https://reviews.freebsd.org/D60714
daca1e12bb99e795bf96b6ef4d069fd35c85ddac Alexander Ziaee 2026-10-19 19:15:57

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

networking.7: Scope netif to wlan0
I recently learned that you can restart just wlan0 instead of the entire
netif, which will save you when doing on-device networking like bhyve,
or activting wlan0 when it is booted parked via rc.conf's NOAUTO.

MFC after:              3 days
Reviewed by:            bz, bcr
Discussed with:         emaste
Differential Revision:  https://reviews.freebsd.org/D59586
d2df0d4eb5c0e9915abf8c96c22adb051d33cbe2 Alexander Ziaee 2026-10-19 19:16:17

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

armv8crypto: Canonicalize document description
MFC after:            3 days
Reported by:            fuz
Reviewed by:            fuz
Differential Revision:  https://reviews.freebsd.org/D59730
36804775d3541266d721d2549d05e74fc160a8cf Alexander Ziaee 2026-10-19 19:17:52

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

ossl.4: Canonicalize HARDWARE and add powerpc64
This driver now supports powerpc64, so add that to the list of supported
hardware. Further, rewrite that list into the canonical HARDWARE section
for inclusion in the FreeBSD 16.0 Hardware Release Note.

markj notes that it would be useful to list the CPU features required
for this driver to be usable on these platforms. ngie notes that this
would be good as a table.

Fixes:  https://cgit.freebsd.org/src/commit/?id=5daf8ed625af ("Add GCM support on powerpc64/powerpc64le")
MFC after:              the above was scheduled to but has not mfc yet
Reviewed by:            ngie
Differential Revision:  https://reviews.freebsd.org/D59770
067c6da5ce046e24024f27fa2be7270929865ed3 Alexander Ziaee 2026-10-19 19:17:57

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

termios.4: clarify the behavior on the last close of controlling terminal
Reviewed by:  kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60701
44961edac85505ddd7d6670b8e0bfba9cbb7c70b Vladimir Grebenshchikov 2026-10-13 23:04:27

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

mkimg.1: Document new %align mechanism
Reviewed by:  imp (earlier version)
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60451
b063ea64c72e075f593d0429739881df304ccd56 Colin Percival 2026-10-07 21:55:47

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

find.1: rewrite the -s flag section for clarity
Restructure the description of -s flag:
1. what the option does
2. why it is useful (deterministic order, streaming output)
3. how its results can differ from `find | sort'

Reviewed by: ziaee
MFC after: 3 days
ad0f86694157c998fec500e9a553550976cbc100 Wolfram Schneider 2026-10-22 08:50:56

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

pdfork.2: improve markup
Sponsored by: The FreeBSD Foundation
MFC after:      3 days
cf63e3f3cd8e37a84bb80c9944e5a8e004a58286 Konstantin Belousov 2026-10-23 18:16:45

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

locate.1: clarify bytes vs. characters
The database stores bytes, not characters. Remove the historical
note about 7-bit storage. Also document that -i ignores case only
for ASCII letters.

Reviewed by: ziaee
MFC after: 3 days
a03b051f238eb78cfccbe834b0cc206e66d566e5 Wolfram Schneider 2026-10-24 10:12:05

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

df.1: Fix unusual Xr order
51a531151a111f31d37aaf69302d4e3ebfb11c5d Wolfram Schneider 2026-10-25 11:32:12

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

ps.1: Fix unusual Xr order
14680d205c4c6967c89b49af79478b3756965ec2 Wolfram Schneider 2026-10-25 11:36:15

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

Commit group #2: manpages
manpages: Fix unusual Xr order
741197267eb5038351079e8e125c04d3401ebb16 Wolfram Schneider 2026-10-25 11:51:42

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'


manpages: Fix unusual Xr order
3f4743d657785dcc5b06ada4aefde225d6350b39 Wolfram Schneider 2026-10-25 11:57:18

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'


manpages: Fix unusual Xr order
44a5cf137230ea9c0fcb33fb2a03700be4efd365 Wolfram Schneider 2026-10-25 12:02:00

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'


manpages: Fix unusual Xr order
f7114dc7b7b6c2b1ae72a742fcd344e3ae39f876 Wolfram Schneider 2026-10-25 12:06:08

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'


manpages: Fix unusual Xr order
4560b19ff4bb1c26ac65fb7473b1b6f8af52c1b3 Wolfram Schneider 2026-10-26 10:27:43

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'


manpages: Fix unusual Xr order
afe20e82f9dbfa9016baa2c3d51d2b9f8ae21f0a Wolfram Schneider 2026-10-26 10:29:10

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'


manpages: Fix unusual Xr order
3208a17f96ef01872ad77e2ab70d182c6f3e39bb Wolfram Schneider 2026-10-26 10:32:42

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'


manpages: Fix unusual Xr order
f5b6c8f5c25261033fb9e6d0e9f682e3aa97efb5 Wolfram Schneider 2026-10-26 10:35:42

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'


manpages: Fix unusual Xr order
2ba2623414a60fb812fd5cfb075178c852b0db8b Wolfram Schneider 2026-10-26 10:41:28

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'


manpages: Fix unusual Xr order
fb4f233466d3b662f0dd8220b409a681ea6dacc3 Wolfram Schneider 2026-10-26 10:44:08

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'


manpages: Fix unusual Xr order
029466808f100ba04fa99efebb40b4209cf79e82 Wolfram Schneider 2026-10-26 10:46:28

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'


manpages: Fix unusual Xr order
13d222bd83ac15fec4b142b2a97cf0cb7ad981f7 Wolfram Schneider 2026-10-26 10:53:02

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

libc: Add a man page caveat about the `w` modifier
In-tree Clang is unaware of the N2680 fixed-width modifier `w` and emits
a warning when used.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299631
Reviewed by:    imp
Differential Revision: https://reviews.freebsd.org/D60939
7ea9ac99e171bb2b6e425e4b4af728f4783ab07c Ed Maste 2026-10-21 15:22:19

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

usr.bin/man: allow man(1) to search translated manpages in pure $man_lang subdirectory (+)
Currently our man(1) utility search manages only in $lang_country.$charset, $lang.$charset and,
as failover, in en.$charset which is historical behavior.
But nowadays most of ported software uses only $lang subdirectories for translated manpages
instead of use full locale notation, for example, share/ja/man1, share/de/man1, share/ru/man1.
In such cases, our man(1) utility cannot find any translated manpages and silently fallback to english version.

Add $man_lang in search path allows man(1) search and use translated manpages under historical and modern path traditions

MFC after:              1 day
MFC to:                 stable/15 stable/14
Reviewed by:            ziaee, fernape
Approved by:            fernape
Differential Revision:  https://reviews.freebsd.org/D55805
5250c98908482babae8379b4dede10c64e8639ae Dima Panov 2026-10-26 20:07:56

debug: classified in 03-filenames_plain1 by 'usr.bin/man/'

memset.3: Fix .Fn usage and too many commas
Fix wrong usage of .Fn macro in paragraph for `memset_explicit' that
caused too many commas improperly emitted into rendered manual page.

Approved by:    des
MFC after:      1 week
3479ee8e003b948ee3011d1a88d656add3d1284f Juraj Lutter 2026-10-29 13:51:09

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

Change invalid reference LE_Set_Scan_Parameters to LE_Set_Scan_Param
hccontrol(8) lists "LE_Set_Scan_Parameters" as a subcommand, but it does
not work on recent releases. Use the LE_Set_Scan_Param instead as that
seems to be the new name according to the source file. Update the man
page accordingly.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300178
Event:  Oslo Hackathon 2026
4347ad3b3943aa51f5d20930d1c524efeaac194f Sarder Kamal 2026-10-29 17:53:48

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

intro.7: Add editline(7) and tag SPDX
The command interpreter has lots of keyboard bindings documented in
editline(7), the line editing interface. This is kind of arcane lore,
but adding it to this listing of section 7 pages will help it get seen.

MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D60854
1ba207b672c2d0a79f6d6d8201524f474ea6dc86 Alexander Ziaee 2026-10-29 22:54:39

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

ure.4: Remove non-USB devices from HARDWARE
The RTL8168, RTL8169 and RTL8110 are PCI/PCIe Ethernet controllers
supported by re(4), and the RTL8211 is a standalone gigabit PHY.  None
of these are supported by ure(4).

The list appears to come from rgephy(4), which drives the internal PHY
on some ure-supported devices.

Fixes: https://cgit.freebsd.org/src/commit/?id=76ed6f2db316 ("ure.4: add a HARDWARE section + add RTL8156BG as a compatible controller")
Reviewed by:    Kenneth Raplee <kenrap@kennethraplee.com>
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61061
53dd6b7760d5afbf4da5d9d8ada059a199660abc Ed Maste 2026-10-30 20:01:33

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

hyperv manpages: Fix unusual Xr order
d82081e86f051de54f6ded7f64508af54f27257e Wolfram Schneider 2026-10-31 08:43:25

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

pflogd.8: hyperv manpages: Fix unusual Xr order
15bf2c9b8b7faa7c69841b6923d46133fc857d61 Wolfram Schneider 2026-10-31 08:48:11

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

elftoolchain manpages: Fix unusual Xr order
c7d3801bd9d2a34746aa361da9a5c9d5c06ec8f5 Wolfram Schneider 2026-10-31 08:53:29

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

bsnmp manpages: Fix unusual Xr order
f461e7b8842a4099fe1f549099f5d3eac145a4bb Wolfram Schneider 2026-10-31 08:59:51

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

truss.1: fix trailing dot in .Xr macro call
aabeaf60c4d7ff1eff7f85ee612ad13258e2c3b7 Wolfram Schneider 2026-10-31 10:06:37

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

apm.4: fix trailing dot in .Xr macro call
48dd6f4f6704a82f005357bf838111351066b859 Wolfram Schneider 2026-10-31 10:10:27

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

route: remove reference to long-gone netiso protocol in route(8).
8df518457e84a5d61d2c116a5628669895608ca4 Peter Wemm 2026-11-01 08:14:28

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

chroot.2: document EPERM for shared pwd
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60963
aff8d265fa1c4b6d5c7a5220e328bcb7b62585f2 Konstantin Belousov 2026-10-24 13:22:58

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

cap_enter.2: document new behavior, in particular EBUSY
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60963
82bbfe16ae1eaa9eca970cb50abe8ac9162fe9cb Konstantin Belousov 2026-10-21 23:18:36

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

tunefs.8/newfs.8: Specify unit of the avgfilesize parameter
The avgfilesize description does not say what the unit is (sectors,
blocks, bytes). Extend the description to mention that this parameter is
in bytes.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298705
Event:                  Oslo Hackathon 2026
Differential Revision:  https://reviews.freebsd.org/D61047
b56d312cd5f707ae652da0efc9b33aa23d9cf617 Benedict Reuschling 2026-10-30 14:40:51

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

RELNOTES: Fix the name of the loader tunable kern.sched.name
Reviewed by:  olce
Differential Revision:  https://reviews.freebsd.org/D61179
ba855bc358b9a173f14b640ba81db5cb30b30819 Zhenlei Huang 2026-11-04 19:28:31

debug: classified in 03-filenames_plain1 by 'RELNOTES'

mrsas(4): Add missing Xr to mrsasutil(8)
5ed9f98d7536bc020e52b7da16d7685b470541ac Poul-Henning Kamp 2026-11-05 15:21:29

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

uname.1: Document which flags are non-POSIX
MFC after:            3 days
Reviewed by:            ziaee
Differential Revision:  https://reviews.freebsd.org/D58476
d0666b1f24aeab887d3c9d54e9b4318627208faa Artem Bunichev 2026-11-06 19:54:18

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

ports.7: Add the DEVELOPER make variable
make.conf(5) says make variables that are for the ports tree should
be documented in ports(7). Add this from the porters handbook.

MFC after:              3 days
Reviewed by:            alven
Event:                  FreeBSD 2026 Vendor Summit
Differential Revision:  https://reviews.freebsd.org/D61272
b556d9c9ce94a6c9b6e28e8ecef7cc252531e91c Alexander Ziaee 2026-11-06 21:53:19

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

symlink.7: fix ref to chown(8)
27a015af943af143a7051778e9268dde8ae7bcff Wolfram Schneider 2026-11-08 09:54:07

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

manpages: fix reference to errno(2)
On FreeBSD, the errno man page is in section 2, not section 3.
fa67270fe217a6ec70c525fea72003816ca5bacf Wolfram Schneider 2026-11-08 10:04:29

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

gvirstor.8: fix reference to zfs(8)
cf99bdba352f26aabf5ea4e39db3b03e9a4db5f0 Wolfram Schneider 2026-11-08 10:09:23

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

snmp_hostres.3: fix reference to bsnmpd(1)
fef05f83df5ad6721a017f11a9be3d73dfc22a4e Wolfram Schneider 2026-11-08 10:22:49

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

mountd.8: fix link to syslogd(8)
27b116ca0714a6d6563185b703a8aa7351015929 Wolfram Schneider 2026-11-08 10:26:31

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

quot.8: fix ffs xrefs after move to section 4
b6c96b9c9f2ee2441b4d536d03ea40995f231032 Wolfram Schneider 2026-11-08 11:12:31

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

libc/gen/err.3: reword to refer to exterror.9
Requested by: wosch
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
5d622079272308ba7e9dd815ed9380ee53c14c03 Konstantin Belousov 2026-11-08 12:15:22

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

fegetenv.3: no cross reference to self
81d09d420905ca9b812b8a9004f6241cd264881a Wolfram Schneider 2026-11-08 11:55:05

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

manpages: missing comma before name
186f14e17350cc3bcd55693cc1211c3a90fe203b Wolfram Schneider 2026-11-08 17:27:30

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

manpages: missing comma before name
fddd0bc3f875c1c46c1146f16686211980f3e7aa Wolfram Schneider 2026-11-08 17:32:41

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

setaudit.8: remove empty macro Xr
989ff10fb21f3988f7075a50f4cbb11102f49136 Wolfram Schneider 2026-11-08 17:35:29

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

manpages: Fix unusual Xr order
22b4975d5a71c58ed98b267caf992410df400f5e Wolfram Schneider 2026-11-08 17:46:50

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

manpages: missing section argument for .Xr macro
ebd89b9595b0e4935791b868fec7212c8677156c Wolfram Schneider 2026-11-08 18:04:20

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

manpages: normalizing date format
11a64dfa100d9b2290283de03a822322cb892125 Wolfram Schneider 2026-11-08 18:30:37

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

manpages: normalizing date format
9b6bfb5605e9f0d96feaf018a0dfc94a8c525209 Wolfram Schneider 2026-11-08 18:31:39

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

mountd.8: fix link to syslog(3)
Reported by: des (prev. commit)
ba64f15bf7466f0fa307924d9f801e4fd866f0ff Wolfram Schneider 2026-11-08 18:42:24

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

poll.2: document that poll is not restarted after signals
Signed-off-by: _ov4 <ov4@ov4.org>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2526
72a80a4733b2e2cf7a3e004e961f0fbba9aaa31f _ov4 2026-11-06 06:16:28

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

Commit group #3: libsys/poll.2: bump .Dd for the prior change
libsys/poll.2: bump .Dd for the prior change

MFC after:      1 week
MFC with:       72a80a4733b2
89d6ddee20281270934c73b41d07f04e9bfc86bc Enji Cooper 2026-11-09 05:37:49

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'


libsys/ppoll.2: fix .Dd modification to manpage

Reported by:    gcc 14
Fixes:  https://cgit.freebsd.org/src/commit/?id=89d6ddee2028 ("libsys/poll.2: bump .Dd for the prior change")
b4a0f17b35fd862feef3e1284926da48a6aad694 Enji Cooper 2026-11-10 05:22:22

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

arch.7: Mechanical fixes
+ Increase portability by never starting content lines with symbols
+ Improve search results by adding tunables to the variable database
+ Improve search result consistency by correcting description style

MFC after:      3 days
5e91181884fc8f9281f1532605e3efcdc30a5d3a Alexander Ziaee 2026-11-09 08:51:47

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

fmtcheck.3: No crossreferences in titles
Crossreferences in titles are strongly discouraged and incompatible
with our own tooling. This is a wontfix by most of manpages ecosystem
because it is bad editorial style in the first place.

MFC after:      3 days
115f0a2fbf6421549fe3f810fef6dc82c91b9642 Alexander Ziaee 2026-11-09 09:19:16

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

freelocale.3: No crossreferences in titles
Crossreferences in titles are strongly discouraged and incompatible
with our own tooling. This is a wontfix by most of manpages ecosystem
because it is bad editorial style in the first place.

MFC after:      3 days
1794dd612c99849361416daa7c20714615d5ad78 Alexander Ziaee 2026-11-09 09:23:35

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

adduser.conf.5: No crossreferences in titles
Crossreferences in titles are strongly discouraged and incompatible
with our own tooling. This is a wontfix by most of manpages ecosystem
because it is bad editorial style in the first place.

MFC after:      3 days
4cbfaea533eb1b39b845ca52c54672198484156b Alexander Ziaee 2026-11-09 09:38:18

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

flowctl.8: Describe better
Align description with EuroBSD netgraph document descriptions rewrite.

MFC after:      3 days
4cb5268b67ea0722494aa6364d45628cbd2d743c Alexander Ziaee 2026-11-09 09:48:28

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

snmp_hostres.3: fix .Fx macro in the middle of a line
Reported by: bjk
71979d8d10c187f195dfd1fbb438d578f1aa1ac8 Wolfram Schneider 2026-11-09 21:32:13

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

_umtx_op.2: correct the description of the valid _clockid for _umtx_time
And remove the duplicated list from the description of the condition
variable.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
701ac0b230503db65b53c7ee8a211b146fcc82c9 Konstantin Belousov 2026-11-05 21:28:13

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

pthread_cond_timedwait.3: list pthread_cond_clockwait as .Nm
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
29495576ed399b2fce2c12f62356a29dbaaa86f4 Konstantin Belousov 2026-11-05 21:46:16

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

pthread_*_timed*lock.3: switch to .Fo/Fc
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
a9b82d6ba374b022926fcb77a96f8f40df862a3a Konstantin Belousov 2026-11-05 18:23:28

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

pthread_cond_timedwait.3: split STANDARDS and HISTORY
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
b3a205cd689d5c6c20aad37a1407031363c16020 Konstantin Belousov 2026-11-05 23:31:57

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

libc: Refer to xlocale(3) in strto*/wcsto* manpages
Mention the extended locale (_l) versions of strtol(3), strtoul(3),
strtod(3), wcstol(3), and wcstod(3) and point to xlocale(3).

While here, add missing serial commas in function lists and widen the
strtol(3) RETURN VALUES table columns to fit INTMAX_MIN/INTMAX_MAX.

Obtained from:  https://github.com/apple-oss-distributions/libc (partially)
Sponsored by:   Klara, Inc.
7b5a98c202238b7c2dcbc720d064e28d13702527 Aymeric Wibo 2026-11-11 14:35:56

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

strto{u,}l.3: Fix base for which 0b prefix is accepted
Fixes:        https://cgit.freebsd.org/src/commit/?id=76edfabbecde ("libc: Document support for binary integers.")
Sponsored by:   Klara, Inc.
df0fc3a43c48bce41be8305ed13671d2fbe04ab9 Aymeric Wibo 2026-11-11 15:08:40

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

aio_mlock.2: Expand document description
+ The old one renders broken because Xr is not correct/portable in Nd
+ Take this opportunity to explain it better using mlock description

MFC after:              3 days
Reviewed by:            glebius
Differential Revision:  https://reviews.freebsd.org/D61334
553bb2a95121745a27b7f6caf3f1e1c43a0ed40b Alexander Ziaee 2026-11-13 04:10:04

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

blocklist: blacklist: Chase recent upstream changes
MFC after:    3 days
e00339214db27eccf3d1574516960ba4b8869369 Jose Luis Duran 2026-11-13 13:47:43

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

syncache.4: Canonicalize SYNOPSIS
Oraganize SYNOPSIS into sysctls and tunables, and remove read-only MIB
count.

MFC after:      3 days
1bff0b21b8e302d561f59156e7c3f160abb65adf Alexander Ziaee 2026-11-13 06:45:02

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

syncache.4: Align lists
Normally I am against tabbing them over so far to align the list, but
in these lists actually the page is 862 lines rendered aligned or using
indent, so aligning it improves readability without scolling regression.

MFC after:      3 days
58a4328def768c3a7da2f2a163afbbac9feff232 Alexander Ziaee 2026-11-13 06:51:29

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

blackhole.4: Canonicalize SYNOPSIS
MFC after:    3 days
0c89a55a5d63a1764ee6a69d63df60bb0a812822 Alexander Ziaee 2026-11-13 22:22:08

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

UPDATING: note login-name validation in pw(8)/pwd_mkdb(8)
An existing master.passwd with a login name containing a now-disallowed
charater will make pwd_mkdb(8) fail until the name is fixed, which blocks
passwd(1), chpass(1) and pw(8).  Warn users to audit their accounts
befroe updating.

Reviewed by:    bcr
Differential Revision:  https://reviews.freebsd.org/D61507
079f82d129b8d551d07fc39f8343ebb8115375c6 Muhammad Moinur Rahman 2026-11-13 13:03:31

debug: classified in 03-filenames_plain1 by 'UPDATING'

ip.4: Fix ip_mreqn imr_address field name
This manual used imr_interface when describing the second field of
struct ip_mreqn, but sys/netinet/in.h names that field imr_address.
Note that ip_mreq below does have imr_interface which is unchanged.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300680
MFC after:      3 days
Reviewed by:    ziaee
Closes:         https://github.com/freebsd/freebsd-src/pull/2553
22a4f5dd0c1be42fdbde9ddb96335bfcf31e53d7 Anshuman Dutta 2026-11-14 14:36:09

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

asmc.4: fix the unterminated SYNOPSIS and FILES blocks
The SYNOPSIS .Bd and the FILES .Bl were both left open, producing two
mandoc block-nesting errors. Reduce SYNOPSIS to the .Cd line man4
style calls for, and close the FILES list.

MFC after:      3 days

Reviewed by:    ziaee, ngie

Differential Revision:  https://reviews.freebsd.org/D61486
5e421b3b23df9c93f3ec87415ec4ba4fc077df75 Abdelkader Boudih 2026-11-15 21:12:50

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

pmc.soft(3): fixup table formatting
The default indent did not serve well. No content change.

MFC after:      3 days
002594ccc0e25cc7f64e7effb525c47a148b87fb Mitchell Horne 2026-11-16 19:51:04

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

Hardware support

Hardware drivers and architecture-specific code.

ifuncs: Have DEFINE_*IFUNC() macros expand the passed name
While here, make each <machine/ifunc.h> header include <sys/types.h> so
that it can be included standalone.

Reviewed by:    kib
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60167
ab9fcc5a553a25804b9535190e914e3ba0e746cf Olivier Certner 2026-09-30 08:44:16

debug: classified in 03-filenames_plain1 by '['sys/arm/', 'sys/arm64/', 'sys/powerpc/', 'sys/riscv/', 'sys/x86/']'

cxgbe(4): Use alternate credit compute mechanism in T7 LB modes
MFC after:    2 weeks
Sponsored by:   Chelsio Communications
9deffad27457adf505c53589c4f5d6eb1560c288 Navdeep Parhar 2026-09-30 18:07:21

debug: classified in 03-filenames_plain1 by 'sys/dev/'

random: Remove unused include of ifuncs
No functional change (intended).

Reviewed by:    markj, emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=3a12982962ce ("random: add RDSEED as a provably unique entropy source")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60193
18ce3f50f630f64d5e9e898a3c06e9ed6e5a63a5 Olivier Certner 2026-09-30 15:04:24

debug: classified in 03-filenames_plain1 by 'sys/dev/'

cxgbev(4): verify the vendor id before claiming a device
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299002
Reviewed by:    jhb
MFC after:      1 week
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D60203
5f275e547814db5944ff1ca746c31447a0896e1e Navdeep Parhar 2026-10-01 16:16:10

debug: classified in 03-filenames_plain1 by 'sys/dev/'

vt: Fix timer race between vtterm_splash() and vt_flush()
Current code leads to console text being drawn over the splash image.

vt_flush() draws while holding the vtbuf lock. Have it check VDF_SPLASH
under it too, and make vtterm_splash() take the vtbuf lock when setting
it, before drawing the splash.

Sponsored by:   Defenso
Signed-off-by:  Quentin Thébault <quentin.thebault@defenso.fr>
Reviewed by:    vexeduxr
Differential Revision:  https://reviews.freebsd.org/D59928
f958aa7e754d88f3955f3c30a13f0e492822e3c3 Quentin Thébault 2026-09-30 01:42:33

debug: classified in 03-filenames_plain1 by 'sys/dev/'

hwpmc: count each AMD PMC interrupt once
amd_intr() and amd_intr_v2() call pmc_ibs_intr() and then update
kern.hwpmc.stats.intr_processed or intr_ignored.  pmc_ibs_intr() also
updated them.  So each core PMC NMI was also counted as ignored, and
each IBS NMI was counted as processed two times.

Update the statistics only in the caller.

Similarly, drop duplicate PMCDBG messages.

Reviewed by:    mhorne, Ali Mashtizadeh <ali@mashtizadeh.com>
Fixes:          https://cgit.freebsd.org/src/commit/?id=e51ef8ae490f ("hwpmc: Initial support for AMD IBS")
Sponsored by:   AMD
Differential Revision:  https://reviews.freebsd.org/D60185
c97cea955f90ceea1024716d335a39215688f324 Andre Silva 2026-10-02 13:54:04

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #4: hwpmc_amd: add PerfMonV2 global-control path
hwpmc: fix stopping process PMCs on exit with PerfMonV2

Since 9d3064010590, pmc_process_exit() calls pmc_process_csw_stop_all()
first. That clears pps_cpustate for every virtual PMC on the CPU, so the
exit loop then skips the stop and the final read.

On AMD PerfMonV2 this has two effects:
- The count from the last time slice is lost. A process that never
  switches out before exit reports 0 with pmcstat -p.
- The EVSEL enable bit stays set. After kldunload, the next kldload
  sees it and says "PMCs maybe in use by firmware!".

It is not required that pmc_process_csw_stop_all() should touch the
ppc_cpustate field at all; remove this to fix the issues.

Reviewed by:    mhorne
Fixes:          https://cgit.freebsd.org/src/commit/?id=9d3064010590 ("hwpmc_amd: add PerfMonV2 global-control path")
Sponsored by:   AMD
Differential Revision:  https://reviews.freebsd.org/D60141
4b267d4e4f6a6cd7bd08b9c4854fcb26fab8c18c Andre Silva 2026-10-02 13:55:26

debug: classified in 03-filenames_plain1 by 'sys/dev/'

vt_fb: Do not perform VT switch in vd_init hook
After 40c20fc29cad it is done by vt_core as soon as vt lock is dropped
after vd_init() has been executed to avoid sleeping with non-sleepable
lock held.

Reviewed by:    quentin.thebault_defenso.fr, vexeduxr
Differential Revision:  https://reviews.freebsd.org/D59632
2300c23d8ae876674358eec5283c6684921dfeae Vladimir Kondratyev 2026-10-03 11:26:14

debug: classified in 03-filenames_plain1 by 'sys/dev/'

virtio_console: Negotiate VIRTIO_CONSOLE_F_SIZE
The driver reads cols/rows and sets the tty window size but
never offered the feature, so that code has been dead since
the very beginning; also read size under the configuration
generation count.

Reviewed by:    markj
Approved by:    fuz (mentor)
Differential Revision:  https://reviews.freebsd.org/D60089
9c8dcc2f2fbc9dcf4132b97de3d223f3e9f000a1 Faraz Vahedi 2026-10-03 12:38:27

debug: classified in 03-filenames_plain1 by 'sys/dev/'

virtio: Validate host-supplied used lengths
virtio_console used the host-supplied used lengths without
validation, so a host could report a length larger than
the buffer, causing the receive and control paths to read
past the end of it.  Clamp to the buffer size.

vtnet already rejected used lengths larger than the buffer,
but performed the check after converting the length to an
int, so a length larger than INT_MAX would become negative
and bypass the check.  Reject such frames early before the
conversion, and count them in ierrors and rx_frame_too_large.

Reviewed by:    markj
Approved by:    fuz (mentor)
Differential Revision:  https://reviews.freebsd.org/D60092
15198bfd7437a616e66342be3c672da0b523e710 Faraz Vahedi 2026-10-03 12:39:36

debug: classified in 03-filenames_plain1 by 'sys/dev/'

virtio_console: Handle VIRTIO_CONSOLE_RESIZE
Multiport devices report console size per port by control event,
which was ignored and hence their ttys could never have a window
size.

Reviewed by:    markj
Approved by:    fuz (mentor)
Differential Revision:  https://reviews.freebsd.org/D60094
765615997a3a3ab649505d58087b7375736fdff7 Faraz Vahedi 2026-10-03 12:40:45

debug: classified in 03-filenames_plain1 by 'sys/dev/'

igc: make the hardware RSS hash agree with the stack's configuration
rss_gethashconfig() is available without options RSS since d9c55b2e8cd6.
Use it to program MRQC, as ixl(4), ice(4) and iavf(4) do, instead of a
fixed field set that included UDP 4-tuple, which the configuration
excludes unless net.inet.rss.udp_4tuple is set.  UDP is now hashed on
addresses only by default.

Also report the UDP hash types on receive; they were passed up as
M_HASHTYPE_NONE.

Reviewed by:            kbowling
Fixes:                  https://cgit.freebsd.org/src/commit/?id=517904de5cca ("igc(4): Introduce new driver for the Intel I225 Ethernet controller.")
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60284
66ff9289b041720f29205f179337f81b5dd0c365 R. Christian McDonald 2026-10-04 12:00:51

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #5: nvme
nvme: delete the I/O queues in the system shutdown path

A normal shutdown deletes all I/O submission and completion queues
before setting CC.SHN, as the suspend path already does.  The
device_shutdown path went straight to the shutdown notification with
the queues live, which some drives take slowly or record as an
unclean stop. Skipped the deletion for failed, removed, or
never-initialized controllers.

Reviewed by:    imp, adrian
Differential Revision:  https://reviews.freebsd.org/D59633
22f50379ab93024354e98333250d453a6d0eaff5 Abdelkader Boudih 2026-10-04 17:40:29

debug: classified in 03-filenames_plain1 by 'sys/dev/'


nvme: do not complete a command when its Abort is not performed

An Abort completion with cdw0 bit 0 set means the controller did not
abort the command; the command can still complete later. The driver
treated this as aborted anyway: it completed the command itself and
freed the CID. When the controller completed the command later,
the CID may already belong to a new command, so the new command
finished with the old command's status, or the unknown-cid assertion
fired on INVARIANTS kernels. The watchdog also kept sending a new
Abort for the same command every half second while the first one was
still pending.

Reviewed by:    imp, adrian
Differential Revision:  https://reviews.freebsd.org/D59634
0a0490ed551d8c89aca16b6b2f1a3b3681b60972 Abdelkader Boudih 2026-10-04 17:40:52

debug: classified in 03-filenames_plain1 by 'sys/dev/'


nvme: set the controller Timestamp feature

Controllers that report ONCS.TIMESTAMP keep a millisecond clock that the
host is expected to seed

Reviewed by:    imp, adrian
Differential Revision:  https://reviews.freebsd.org/D59997
e8a7efd92181720e9d7a7ef50fe3a00294911027 Abdelkader Boudih 2026-10-04 17:41:17

debug: classified in 03-filenames_plain1 by 'sys/dev/'


nvme: add a timeout for Format NVM commands

Format commands need a longer timeout.

Reviewed by:            seuros, chuck
Differential Revision:  https://reviews.freebsd.org/D59827
5258b44e845a7ccdc3e07a9244e77dc100feedca Warner Losh 2026-10-19 04:38:14

debug: classified in 03-filenames_plain1 by 'sys/dev/'


nvme: support per-request timeouts

Allow different timeouts per command.

Reviewed by:            seuros, chuck
Differential Revision:  https://reviews.freebsd.org/D59828
1c31ef40e185a09c030d53640f6ebc71bb0c830f Warner Losh 2026-10-19 04:38:45

debug: classified in 03-filenames_plain1 by 'sys/dev/'


nvme: honor Linux passthrough command timeouts

Now that we have per-command timeouts, allow linux-compat ioctls to have
a passed-in timeout.

Reviewed by:            seuros, chuck
Differential Revision:  https://reviews.freebsd.org/D59829
15cd8528b1964e646ed8d2282c42f5fe00b72ed2 Warner Losh 2026-10-19 04:39:16

debug: classified in 03-filenames_plain1 by 'sys/dev/'


nvme: Refactor namespace notifications for additions

When we add a namespace, we have the code inline to do the
notifications. Refactor ahead or reuse.

Reviewed by:            seuros
Differential Revision:  https://reviews.freebsd.org/D59831
66c24c94323ae36f2132c60bc2788ab70b60f224 Warner Losh 2026-10-19 04:40:45

debug: classified in 03-filenames_plain1 by 'sys/dev/'


nvme: Notify namespaces on reset sometimes

When we're resetting after a controller failure, and we fix the failure,
and we've not resetting as part of initialization, notify the all the
children devices of new namespaces. When we failed the controller
before, we removed all the namespaces.

Reviewed by:            seuros
Differential Revision:  https://reviews.freebsd.org/D59832
e65ccec8c0e359f584b2948c100ee3012e43c6e7 Warner Losh 2026-10-19 04:41:00

debug: classified in 03-filenames_plain1 by 'sys/dev/'


nvme: Byte-swap the nsid in the Get/Set Features command builders

nvme_admin_get_feature_cmd() and nvme_admin_set_feature_cmd() stored
the namespace ID in the command without converting it to little
endian, unlike the other command building functions.  Any caller
passing a non-zero namespace ID would send the wrong namespace ID on
big endian machines.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=7a9e4375316b
MFC after:      1 week
Sponsored by:   Spectra Logic
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
3a6dbe77c39d3a88b6092cfcaa820fc727d1e61d Kenneth D. Merry 2026-11-09 18:46:57

debug: classified in 03-filenames_plain1 by 'sys/dev/'


nvme: Mask the fields in the Format NVM command builder

nvme_admin_format_cmd() did not mask any of the fields it composes
into cdw10, so an out of range value in one field would corrupt
neighboring fields.  In particular, an LBA format index greater
than 15 would bleed into the metadata settings and protection
information fields.  It also had no support for LBA format indexes
above 15, which NVMe 2.0 encodes via the separate LBAFU field.

Mask all of the fields, and encode bits 5:4 of the LBA format index
in the LBAFU field (cdw10 bits 13:12).

Also reject out of range LBA format indexes in camcontrol's
nvformat global (-G) mode, which has no namespace data to validate
against.  The per-namespace mode already validates the index
against NLBAF.

sys/dev/nvme/nvme.h:
        Mask the SES, PIL, PI, MSET and LBAF fields in
        nvme_admin_format_cmd() and encode the upper two bits of
        the LBA format index in LBAFU.

sbin/camcontrol/nvformat.c:
        Reject LBA format indexes greater than 63 in -G mode.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=7a9e4375316b
Fixes:          https://cgit.freebsd.org/src/commit/?id=80f090111ae4
MFC after:      1 week
Sponsored by:   Spectra Logic
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
3892a6453fc60e00b0d6cd5c5d7e2606b4b51e7c Kenneth D. Merry 2026-11-09 18:46:57

debug: Commit manually moved from "unknown" to "hardware".


nvme: Fix the data length in the Reservation Report command builder

nvme_ns_resv_report_cmd() put its length argument, which callers
supply in bytes, directly into cdw10.  The NUMD field is a 0's
based count of dwords, so the command asked the controller to
transfer nearly four times the size of the supplied data buffer.
In practice controllers limit the transfer to the length described
by the PRP entries, which is why this worked in testing, but the
command was incorrect.

Convert the byte count to a 0's based dword count in the builder.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=7a9e4375316b
MFC after:      1 week
Sponsored by:   Spectra Logic
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
86b9d629c68f6dc63543b9c0a6da6c96c857f3bc Kenneth D. Merry 2026-11-09 18:46:58

debug: classified in 03-filenames_plain1 by 'sys/dev/'


nvme: Restore the host memory buffer size calculation

When the nvme_ctrlr_cmd_set_feature() call in
nvme_ctrlr_hmb_enable() was rewritten for the widened Set Features
API, the HSIZE calculation reverted to dividing by a hard coded
4096 instead of the controller page size, undoing commit
3740a8db13ba.  The Host Memory Buffer Size field is in units of
the current memory page size (CC.MPS), so the wrong size would be
programmed on controllers configured with a page size other than
4KB.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=7a9e4375316b
MFC after:      1 week
Sponsored by:   Spectra Logic
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
f262bdcf24f1f946edcd01f5eb5dfa2910da9e7b Kenneth D. Merry 2026-11-09 18:46:59

debug: classified in 03-filenames_plain1 by 'sys/dev/'

powerpc: keep FP, VMX and VSX ownership changes atomic with preemption
trap() and set_mcontext() change the FP/VMX/VSX ownership state in
several steps with preemption enabled.  A context switch in between
leaves the thread computing with another thread's register contents:

- enable_fpu()/enable_vec() set PCB_FPU/PCB_VEC before loading the
  registers, so a switch mid-load saves a half-loaded unit over the PCB.
- set_mcontext() clears the frame's MSR bits and then the PCB flags;
  a switch in between re-enables the unit, and the thread returns to
  user space with it enabled but not owned, so it is neither saved nor
  restored until the next signal.

Both paths run after every sigreturn(2), setcontext(2) and
swapcontext(3).  A POWER9 test that keeps f14-f31 live across a signal,
with other threads using the FPU on the same CPU, saw 283 corrupted
round trips out of 882000; none after this change.

Hold a critical section around both, as amd64 and arm64 do.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60054
1f1043d550ea2b8282e692019f17a88896212a76 Piotr Kubaj 2026-09-21 12:48:06

debug: classified in 03-filenames_plain1 by 'sys/powerpc/'

igc: Fix the flow control sysctl
dev.igc.N.fc read and wrote a function-static variable shared by every
igc device, so a read returned the last value written to any of them (3
until the first write), not the state of the device.  The softc value
started as 0, which is also the value of "no flow control", while the
hardware was set up for full flow control.  As a result:

- Writing 0 was taken for no change and did nothing, unless another
  value had been written to that device before.
- igc_reset() took a softc value of 0 for "not set", so a device set to
  0 went back to full flow control on the next init.
- With more than one receive queue the driver enabled per-queue drop
  (SRRCTL.DROP_EN), which is meant for a MAC that does not send pause
  frames, although the MAC was told to send them.
- Values out of range were accepted and ignored.

A write only forced the MAC's flow control bits.  The pause bits
advertised to the link partner, the pause thresholds and DROP_EN stayed
as the last init had set them, and the next link event resolved flow
control from the stale advertisement again: a port set to 0 came back
honoring pause frames, for example.

Start the softc value as full, report it, use it as it is in
igc_reset(), reject invalid values, and apply a change by
reinitializing the interface, as the dmac and eee_control sysctls do.

Two things behave differently now.  Changing the mode of a running
interface takes the link down to renegotiate.  And with the default
mode and more than one receive queue DROP_EN is no longer set: a full
receive ring makes the MAC send pause frames, and holds up the other
queues, where it used to drop that queue's packets.  Setting fc to 0 or
1 selects per-queue drop.

Tested on I226-V ports with four receive queues: for each mode, the
flow control bits in CTRL, the pause thresholds and DROP_EN were read
back, and the mode the link partner resolved, also after a down/up.

Reviewed by:            gallatin
Fixes:                  https://cgit.freebsd.org/src/commit/?id=517904de5cca ("igc(4): Introduce new driver for the Intel I225 Ethernet controller.")
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60363
68386f6b551e64c956c9623b9973be9e462ce1de R. Christian McDonald 2026-10-05 14:01:54

debug: classified in 03-filenames_plain1 by 'sys/dev/'

arm64/gicv5: Use ArmMpidr to find the correct CPU
The GICv5 ACPI code uses CpuInterfaceNumber to as the CPU ID. This a
GICv5 CPU ID and may not be the same as the appropriate FreeBSD value.

It is also possible the target CPU is disabled, e.g. when the hw.ncpu
tunable is uses to limit CPUs. If this is the case we don't want to
enable the CPU in the cpu set as it is offline so cannot handle
interrupts.

Switch to use ArmMpidr to find which pcpu to use when finding which
CPUs the IRS is attached to.

Fixes:  https://cgit.freebsd.org/src/commit/?id=9556306213e1 ("arm64: Add ACPI support to GICv5 driver")
Differential Revision:  https://reviews.freebsd.org/D59993
Sponsored by:   Arm Ltd
412c3a0370491c6745e056266f54ce9aa67017e1 Andrew Turner 2026-10-05 13:31:02

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

arm64: Elide coherent busdma maps
Avoid allocating per-transfer maps for coherent tags that cannot
bounce. Retain maps for cache synchronization, CCA realms, and KMSAN.
These un-used maps carry with them memory and cache miss overheads.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D60098
Sponsored by: Netflix
16c787fbabb8077df1af3bd3baaddf3b4c0dd8e8 Andrew Gallatin 2026-10-05 14:56:10

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

acpi: Tasks: Remove unnecessary includes
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
2165accd3748c0acb6e82756d71a46509b220fd8 Olivier Certner 2026-10-02 17:11:58

debug: classified in 03-filenames_plain1 by 'sys/dev/'

acpi: Tasks: Document why 'acpi_task_count' is accessed unsynchronized
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
e89c3ac5df58a9eae9d01f325ffc9b34258c4b29 Olivier Certner 2026-10-02 17:14:16

debug: classified in 03-filenames_plain1 by 'sys/dev/'

e1000: Fix the flow control sysctl
dev.em.N.fc and dev.igb.N.fc read and wrote a function-static variable
shared by every em(4) and igb(4) device, so a read returned the last
value written to any of them (3 until the first write), not the state of
the device.  The softc value started as 0, which is also the value of
"no flow control", while the hardware was set up for full flow control.
As a result:

- Writing 0 was taken for no change and did nothing, unless another
  value had been written to that device before.
- em_reset() took a softc value of 0 for "not set", so a device set to 0
  went back to full flow control on the next init.
- On igb(4) with more than one receive queue the driver enabled
  per-queue drop (SRRCTL.DROP_EN), which is meant for a MAC that does
  not send pause frames, although the MAC was told to send them.
- Values out of range were accepted and ignored.

A write only forced the MAC's flow control bits.  The pause bits
advertised to the link partner, the pause thresholds and DROP_EN stayed
as the last init had set them, and the next link event resolved flow
control from the stale advertisement again.  On 82577 and 82578 (pchlan)
a write could also turn on transmit flow control, which em_reset() keeps
off there as a workaround.

Start the softc value as full, report it, use it as it is in em_reset(),
reject invalid values, and apply a change by reinitializing the
interface, as the dmac and eee_control sysctls do.  This is the same fix
as 68386f6b551e ("igc: Fix the flow control sysctl"); igc(4) inherited
the handler from this driver.  On pchlan, remove transmit pause from the
requested mode instead of replacing the mode with receive pause, so that
the workaround stays and 0 still turns flow control off.

Reviewed by:            kbowling
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60376
481447ad9be2e60e0bb3744ab199ce121baadf84 R. Christian McDonald 2026-10-05 20:21:47

debug: classified in 03-filenames_plain1 by 'sys/dev/'

hwpmc: handle delayed IBS NMIs on Zen 6
On Zen 6, an extra IBS NMI can arrive after later samples. Keep the
credit until the empty NMI arrives, and handle fetch and op samples when
both are ready.

Reviewed by:    mhorne
Fixes:  https://cgit.freebsd.org/src/commit/?id=34b00ed041a4 ("hwpmc: fix IBS fetch and op NMI handling")
Fixes:  https://cgit.freebsd.org/src/commit/?id=e51ef8ae490f ("hwpmc: Initial support for AMD IBS")
Sponsored by:   AMD
Differential Revision:  https://reviews.freebsd.org/D60367
572cd669d6997b759084191007f3744a3610b529 Andre Silva 2026-10-06 18:42:35

debug: classified in 03-filenames_plain1 by 'sys/dev/'

riscv: support the new "riscv,isa-extensions" string-array.
Support the new "riscv,isa-extensions" property on RISC-V hart nodes
in FDT.

The "riscv,isa" property is deprecated, but cannot be removed because
doing so would break compatibility with existing DTBs. The new properties
replace it: "riscv,isa-base" describes the base ISA and
"riscv,isa-extensions" is a string array containing the supported ISA
extensions.

The "riscv,isa-extensions" property can be relatively large; on the
Spacemit K3 SoC it is approximately 300 bytes.

The FreeBSD OFW interface does not provide access to the underlying FDT
property data without copying it, and memory allocation is not possible
this early. So allocate a static buffer for the property instead.

Reuse the existing parse_riscv_isa() implementation to parse both the new
extension property and the legacy "riscv,isa" property.

Reviewed by:    bnovkov, mhorne
Sponsored by:   EPSRC ("UKRI3001: CHERI Research Centre")
Differential Revision:  https://reviews.freebsd.org/D60209
3e01ebda68291db307a5e6c23d4995c638be9228 Ruslan Bukin 2026-10-06 18:55:39

debug: classified in 03-filenames_plain1 by 'sys/riscv/'

pcm.4: Remove DIAGNOSTICS section
These diagnostics do not exist anymore.

MFC after:      1 week
25faf861089ca119528ea4da39fe594b1c5ca55a Christos Margiolis 2026-10-07 07:03:31

debug: classified in 03-filenames_plain1 by 'sys/dev/'

gve: fix kernel panic on attach failure
When device initialization fails during attach (for instance, if device
resource configuration or firmware negotiation fails), the driver aborts
and unrolls partial state via its detach routine. However, the teardown
path assumes transmit and receive queues have already been created. If
attach aborts before queue allocation, tearing down the uninitialized
queues triggers a NULL pointer dereference and panics the kernel during
boot.

Guard queue teardown against uninitialized queue state so that early
attach failures unwind safely, allowing the driver to report the failure
gracefully without crashing the operating system.

Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>

Reviewed by:    adrian, markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60385
d45b063c06d46d0f43489708e226821cddbad53b Jasper Tran O'Leary 2026-10-07 13:29:28

debug: classified in 03-filenames_plain1 by 'sys/dev/'

gve: fix double free on ring allocation failure
When gve_alloc_rings fails (such as when failing to acquire MSI-X
vectors or during partial ring allocation), ring cleanup can be
executed multiple times across nested error paths (e.g. within
gve_alloc_rings abort and gve_attach abort).

Because gve_free_counters invoked counter_u64_free without nullifying
the pointer in the stats array, repeated invocation caused a double-free
panic when freeing the same counter references.

Check for non-NULL before freeing and nullify each counter pointer
upon release in gve_free_counters.

Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>

Reviewed by:    adrian, markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60386
67f85bf4b3f1156f2300fb6414f6bb0ca446c436 Jasper Tran O'Leary 2026-10-07 13:29:31

debug: classified in 03-filenames_plain1 by 'sys/dev/'

arm64: a local TLB invalidation suffices when enabling write access
When a PTE logically supports write access, as indicated by its DBM
field, but write access is nonetheless blocked by the PTE's protection
field, pmap_fault() can enable write access with only a local TLB
invalidation.

Reviewed by:    andrew, kib, markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60417
7dd9a8125f70f1fc40fd9907bdaae0d23c8586c9 Alan Cox 2026-10-06 04:53:00

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

ipmi(4): improve debugging for ioctl(IPMICTL_SEND_COMMAND)
Add a knob to debug ioctl(IPMICTL_SEND_COMMAND). Log the IPMI NetFn and
Cmd fields, followed by a hexdump of the request data. Upon completion,
log the hexdump of the response data.

Reviewed by:    adrian, imp, ngie
Sponsored by:   Vdura
Differential Revision:  https://reviews.freebsd.org/D59514
bf97446e34abfe096d91d8c2bd49ea9a50d2227d Ravi Pokala 2026-10-08 04:01:12

debug: classified in 03-filenames_plain1 by 'sys/dev/'

iwx: update if_iwx.c to OpenBSD v1.184 and if_iwxreg.h to OpenBSD v1.53
This updates iwx to the given OpenBSD versions upstream.

This is a squashed commit of the given differential revisions
and openbsd upstream commits.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59757
Differential Revision:  https://reviews.freebsd.org/D59758
Differential Revision:  https://reviews.freebsd.org/D59759
Differential Revision:  https://reviews.freebsd.org/D59760
Differential Revision:  https://reviews.freebsd.org/D59761
Differential Revision:  https://reviews.freebsd.org/D59762
Differential Revision:  https://reviews.freebsd.org/D59763
Differential Revision:  https://reviews.freebsd.org/D59764
Differential Revision:  https://reviews.freebsd.org/D59765
Differential Revision:  https://reviews.freebsd.org/D59766

Obtained from: OpenBSD, dd37084bb9bbc1cb63137a98072e149306cc2e2a
Obtained from: OpenBSD, 521eb4f37a87f4d1ba6b3aa685721d015525efb4
Obtained from: OpenBSD, 177f96ae5464c4393971d72a9703f84ba84ad60c
Obtained from: OpenBSD, be47d0a5f00c62ce8dd784cf7f90f635203434ae
Obtained from: OpenBSD, 1fe292d1a480241213e618a905fef43d03ac65ca
Obtained from: OpenBSD, 41713280ddbe6fa1b12833163070617fa75d6e43
Obtained from: OpenBSD, 844e213d50c754e415ff22924cb86e86d4d63002
Obtained from: OpenBSD, 9fb1f10bfcbfc611a885a088a1658b52427addcb
Obtained from: OpenBSD, 3b9d585e0ce86bc6eed0b4493f3c73d741778f91
Obtained from: OpenBSD, 22f856c70e6211679c512ca0726f3c6f6a152dde
6f5803e375fe2214f1fb8f1e1378ab006b196adc Idwer Vollering 2026-10-08 04:13:29

debug: classified in 03-filenames_plain1 by 'sys/dev/'

virtio_gpu: use an X8R8G8B8 resource on big-endian guests
The virtio-gpu resource formats are defined by byte order in memory,
while vt(4) and the X server (through vt_fb and the fb mmap) write
native 32-bit 0x00RRGGBB pixels into the shadow framebuffer.  On a
big-endian guest such as powerpc64 those pixels land in memory as
00 RR GG BB, which the host interprets under B8G8R8X8 with red and
blue swapped and the padding byte taken as blue: white renders yellow
and blue renders black.

Request X8R8G8B8 on big-endian guests instead, which is also what the
Linux driver does (DRM_FORMAT_HOST_XRGB8888).  Reproduced with a colour
test pattern on a powerpc64 QEMU pseries guest using the identically
coded out-of-tree fork of this driver (graphics/virtio-gpu-qemu-kmod);
little-endian guests are unchanged.

Differential Revision:  https://reviews.freebsd.org/D60085
Approved by:    jhibbits
MFC after:      1 week
7cf02164a517824c07faed91c009be90f2f17ec0 Piotr Kubaj 2026-09-28 08:43:35

debug: classified in 03-filenames_plain1 by 'sys/dev/'

sound: Remove obsolete comment from sound.h
MFC after:    1 week
Sponsored by:   The FreeBSD Foundation
20381bce4b63975494a2f4bc84257f6932e6d379 Christos Margiolis 2026-10-08 13:11:21

debug: classified in 03-filenames_plain1 by 'sys/dev/'

libpmc: fix the family check for the AMD DF event encoding
The check compares cpu_family with decimal 19 instead of 0x19, so
Families 17h and 19h get the Family 1Ah DF encoding.

Signed-off-by:  Osvaldo Janeri Filho <ojanerif@amd.com>
Reviewed by:    mhorne
Fixes:          https://cgit.freebsd.org/src/commit/?id=00c0a1f0bf6c ("hwpmc: Fix PMC flags for AMD Zen cores")
MFC after:      3 days
Sponsored by:   AMD
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2461
ca9c5718017fc34d34f2dfe90020644aad3588d3 Osvaldo Janeri Filho 2026-10-08 09:43:59

debug: classified in 03-filenames_plain1 by 'lib/libpmc/'

hwpmc: return errors from PMC_OP_PMCGETMSR
pcd_get_msr() returns a positive errno, but only a negative value was
treated as a failure, so errors were reported as success.

Signed-off-by:  Osvaldo Janeri Filho <ojanerif@amd.com>
Reviewed by:    mhorne
MFC after:      3 days
Sponsored by:   AMD
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2461
911fcebfc7f1e5a5dd184137c0b9d62b4b066f17 Osvaldo Janeri Filho 2026-10-08 09:44:00

debug: classified in 03-filenames_plain1 by 'sys/dev/'

nvmf: Limit namespace character device I/O size
Set si_iosize_max for namespace character devices matching the fix
from commit 125ec0e30785bb0cbca7aa6c0b1a34b75e53078d.

Sponsored by:   Chelsio Communications
3b0eacaed3cf9157baf04ab11243aedf816ac976 John Baldwin 2026-10-08 15:24:45

debug: classified in 03-filenames_plain1 by 'sys/dev/'

usbdevs: Add ublox LARA-L6
The device has multiple PIDs as it supports different USB profiles.

Approved by:            adrian
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D60482
95432767ddc36fd1f6b0054e4eb1a849c73e7da6 Joel Bodenmann 2026-10-08 15:36:15

debug: classified in 03-filenames_plain1 by 'sys/dev/'

arm64: avoid full icache flushes on PIPT icaches
On many arm64 processors, the kernel plays a part in maintaining
instruction cache (icache) coherence as the contents of the underlying
physical pages change.  Previously, the only mechanism for maintaining
icache coherence implemented by the machine-dependent layer was a full
icache flush.  However, on machines with physically indexed and
physically tagged (PIPT) icaches, where aliasing cannot occur, we can
instead selectively invalidate just the affected cache lines.

Reviewed by:    andrew
Tested by:      markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60271
a66236edbf7182fcb1407590a8021f1e40adc05d Alan Cox 2026-09-29 15:37:35

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

Commit group #6: if_bnxt
if_bnxt: consolidate readl_fbsd/writel_fbsd and fix BAR mapping

There are multiple duplicates of readl_fbsd and writel_fbsd spread
accross bnxt_en and bnxt_re drivers. Move a single definition into bnxt.h as static
inline, shared by bnxt_en and bnxt_re, using the correctly sized
bus_space_read_4()/bus_space_write_4() accessors, and drop the other
two copies along with their declarations.

Also, Fix the BAR selection while at it: bar_idx 0 addresses BAR0 (the
HWRM bar) and bar_idx 2 addresses BAR2 (the doorbell bar), matching
every call site (e.g. BNXT_FW_HEALTH_REG_TYPE_BAR0/BAR1 in
if_bnxt.c) and bnxt_pci_mapping()'s own bnxt_map_bar() calls, but
both old copies and bnxt.h's own inline had the two bars swapped.

Add BNXT_HWRM_BAR_IDX/BNXT_DOORBELL_BAR_IDX macros for the two valid
bar_idx values and use them at every readl_fbsd()/writel_fbsd() call
site plus bnxt_pci_mapping(), instead of bare 0/2 literals. Any other
bar_idx is a programming error, so readl_fbsd()/writel_fbsd() panic
on it rather than silently guessing a BAR.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58995
9ff4cca75c727a5b65f279fe4bc66e71abb305a1 Sumit Saxena 2026-08-18 16:49:36

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add RX timestamping support

Add PHC register mapping, RTC initialization, refclk read with
FW-reset serialization, and sbinuptime-based calibration to convert
the raw hardware timestamp carried in RX completions into an mbuf
timestamp. Advertise IFCAP_HWRXTSTMP, configure the RX timestamp
filter in bnxt_init(), and drain the calibration callout on stop.
Check HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED in
bnxt_hwrm_func_qcaps() so the capability bit PTP is gated on actually
gets set, without which PTP never armed on real hardware.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58596
f2c300112ea491d69799c5a1085b57c48acef713 Sumit Saxena 2026-08-18 21:00:11

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add CAGR interrupt coalescing tick-resolution support

Add the P7 CAGR (Completion AGgregation Ring) NQ-aggregation timer
tick-resolution knob, programmed via a direct GRC-window register
write, with a new dev.bnxt.<unit>.cagr_tick_res read-only tunable.
This is independent of the existing per-ring AGGINT_PARAMS coalescing.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58598
2f3a1ebba81266b5f21640f88d73e03415cf13be Sumit Saxena 2026-07-29 08:36:18

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add HW-based TX completion coalescing

When firmware advertises BNXT_FLAG_TX_COAL_CMPL, request coalesced
completions via cmpl_coal_cnt on TX ring alloc and decode the
resulting tx_cmpl_coal_t records using a free-running SQ consumer
index per ring, instead of one completion per BD. Add the
tx_hw_coal_cnt sysctl to tune the firmware coalescing count code.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58599
9e69060da5eaa4a596be96a4a84b6484661466aa Sumit Saxena 2026-08-03 09:06:21

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add host-based TX completion coalescing

Suppress per-BD completions (TX_BD_LONG_FLAGS_NO_CMPL/_COAL_NOW) and
accumulate a running_bds count per ring, forcing a real completion
when iflib requests one or when the count nears overflowing the
opaque bd-count field. Replaces the previous raw (bd_count << 24 |
idx) TX completion opaque encoding, which only had 8 bits for the
count and would overflow well within these coalescing thresholds,
with a tx_bd_opaque bitfield (16-bit idx + 15-bit bds + 1-bit
ktls_replay for later use). Add tx_host_coal_bds/tx_host_coal_enable
sysctls to tune and toggle it.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58600
3c995919dc4a7f5de35534b3220f972bf0153fb9 Sumit Saxena 2026-08-03 09:07:36

debug: classified in 03-filenames_plain1 by 'sys/dev/'

if_bnxt: Support backing store v2 for Thor if FW supports it
The driver currently only supports BS v1 for Thor even though the
firmware supports v2, capping max_mr at ~192K when firmware can
support up to ~256K. Enable Backing Store v2 support for the Thor controller.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58601
4c293e01fd2a8a3adb3fbac12e7ce40db84ed734 Sreekanth Reddy 2026-07-21 06:55:15

debug: classified in 03-filenames_plain1 by 'sys/dev/'

if_bnxt: Fix interrupt storm on Thor2
An interrupt storm was observed on Thor2 because the Rx CQ consumer
index was always one less than it should be. Correct the Rx CQ
consumer index to fix the storm.

Reported by:    gallatin
Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58602
8c69a5dc60b3630a4c5bca0bda714f791324afad Sreekanth Reddy 2026-07-29 11:28:35

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #7: if_bnxt
if_bnxt: add MPC (Mid-Path Channel) ring infrastructure

Add MPC ring support: a pair of extra, driver-private
TX/completion/notification rings the firmware uses as a side-channel
for offload commands. The only current consumer is kTLS TX crypto
command submission; RCE/CFA channel types are not yet implemented by
any consumer.

Adds MPC ring allocation/teardown, HWRM ring alloc/free, a private
interrupt path for the MPC NQ ring, and the TX submit/completion
path. The RoCE-only IRQ table builder is split into a generic,
exported bnxt_populate_irq(softc, irq_count) that both MPC and RoCE
use, plus an incremental bnxt_populate_irq_roce() that grows the
table on top of whatever is already there, so IRQ rids stay
consistent regardless of attach order.

This patch does not link standalone: bnxt_mpc_cmp() calls into
kTLS's completion handler, added by a later patch.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58603
088a42c0ff7620463a870bc789f940fdf112802f Sumit Saxena 2026-07-29 09:12:26

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add bnxt_compat.h version-compat shim

Add bnxt_compat.h, a small __FreeBSD_version-gated compatibility
shim: if_getmtu()/if_name()/if_getsoftc()/if_getflags() fallbacks for
pre-1500000, and a config-task vs. config-gtask abstraction over the
iflib API split at 1403000. On this branch's FreeBSD version it also
unconditionally enables KTLS_IFLIB_SUPPORT/KTLS_REC_SEQ_NUMBER, which
the upcoming kTLS patch depends on.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58604
42988358a9210ccf7ff500895785b49fe5615567 Sumit Saxena 2026-07-29 12:13:39

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add bitmap search/test-and-set helpers

Add bitmap search/test-and-set helpers the kTLS
key-context ID allocator needs; bitstring.h has no equivalent
primitives.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58605
aef2db6fac2329bfd553f8db9c87b34dccdb33ac Sumit Saxena 2026-07-29 12:14:27

debug: classified in 03-filenames_plain1 by 'sys/dev/'

f_bnxt: add kTLS (kernel TLS) TX offload
Add kTLS TX crypto offload, layered on MPC (crypto add/delete
commands submitted over its TCE channel) and TX completion coalescing
(shared tx_bd_opaque encoding).

Adds kTLS session lifecycle management, a key-context ID allocator,
HWRM key-context alloc/free with partition-mode support, and the TX
submit path: in-order packets go out on the normal iflib path with
CSUM_SND_TAG set, while out-of-order or retransmitted TLS records get
a presync command plus a replayed copy of the record built from the
driver's own replay ring. Also adds kTLS/MPC completion-time counter
sysctls and the max_ktls_entries tunable.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58606
70d389bede66da585508c1813c10a873d42612e7 Sumit Saxena 2026-07-29 12:16:07

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #8: if_bnxt
if_bnxt: Fix HWRM mailbox/DMA teardown race on detach

iflib's generic device-deregister path never drains the admin task
before calling IFDI_DETACH, so bnxt_update_admin_status() (scheduled
once/sec) could still run concurrently with bnxt_detach(), racing on
softc->hwrm_lock and the shared HWRM request/response DMA buffer that
bnxt_detach() destroys. That race could leave the firmware-side HWRM
mailbox inconsistent, surfacing as "Timeout sending HWRM_VER_GET" on
the next module load.

Add a softc->detached guard: set it as the first statement in
bnxt_detach(), and bail out of bnxt_update_admin_status() immediately
when it's set.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58607
9330b2f73c04f06e39da5cf2279682a607185601 Sumit Saxena 2026-07-31 15:43:59

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: honor firmware min wait before VER_GET on reset

The firmware advertises a minimum wait time it needs before it is
ready. The driver was not honoring it and sent VER_GET too early
during firmware error-recovery, which could return an incomplete
VER_GET buffer. Enforce that minimum wait, measured from when the
RESET_NOTIFY async event arrived, before sending VER_GET.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58608
e009e1fd80839a4a570a73dae9011a04ed4579ca Sumit Saxena 2026-07-31 15:46:25

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: Pass HWRM cmd response to apps even if FW fails it

The driver was not passing the HWRM command response to management
apps when the firmware failed the command, which is not what apps
expect. Copy the response out whenever firmware populated one
(resp_len != 0), regardless of the command's overall return code, and
stop bailing out of the mgmt ioctl path early on a failed passthrough
so DMA'd indirect data and the response still get copied to
userspace.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58609
53b576bd81a4fb5c38b952e74ff2f806569bc8ac Sumit Saxena 2026-07-31 15:48:07

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: Collect hw stats every 250 milliseconds

bnxt_if_timer() only scheduled bnxt_update_admin_status(), which
polls HW stats, once per second. Drop the interval to 250ms so stats
collection is timely.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58610
492bd0db44bace9475e15dfebdc17076b536533f Sumit Saxena 2026-07-31 15:49:32

debug: classified in 03-filenames_plain1 by 'sys/dev/'

bnxt_re: Fix witness reported calltrace while unloading driver
bnxt_unregister_dev() called synchronize_rcu() while holding
bp->en_ops_lock, which witness flags as a sleeping-while-locked
violation on driver unload. Drop the lock around the RCU grace period
and reacquire it afterward.

Also gate the RoCE extended-stats hex dump in
bnxt_qplib_qext_stat() behind bootverbose instead of printing it
unconditionally.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58611
0aa3e15900d31a08680e2307cbc550715d727191 Sumit Saxena 2026-07-31 15:51:01

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #9: if_bnxt
if_bnxt: ktls: Reject new kTLS sessions once driver is detaching

bnxt_tls_snd_tag_alloc() only gated on BNXT_STATE_OPEN, which is set
once by bnxt_open()/bnxt_attach_pre() but never cleared again, so it
could not reject new sessions once bnxt_detach() started tearing
things down. The snd_tag_alloc_ref-based wait in bnxt_detach(), which
waits for in-flight allocators to exit, was already in place, but
without this gate new sessions could keep being created for the
entire duration of that wait, extending it indefinitely instead of
just draining existing ones.

Reject new sessions once softc->detached is set, and reset it back to
false in bnxt_attach_pre() so it doesn't wrongly persist across a
detach/reattach cycle.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58612
a48a50919da5549b2a5a2141042087a25879435e Sumit Saxena 2026-07-31 15:53:02

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: Restore Rx CQ doorbell skip-when-idle optimization on P5

The unconditional-doorbell fix for Whp/older NICs (always ring the Rx
CQ doorbell after processing Rx interrupts) had also been applied to
P5+ chips, discarding process_nq()'s work-done signal entirely and
losing the doorbell-skip optimization on P5+ when process_nq() finds
no CQ notification to act on.

Make process_nq() return whether it saw a CQ notification, and only
skip the Rx CQ doorbell on P5+ when it didn't; non-P5+ chips continue
to always ring it, since process_nq() isn't used on that path.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58613
a8622eac118a31187be02f4dd1a53f58fc6ec35a Sumit Saxena 2026-07-31 15:55:56

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add support for HW generic stats

HW generic stats provide information about PCIe transactions and
out-of-order doorbell writes, useful for debug. Allocate a DMA buffer
for them (disabling BNXT_FW_CAP_GENERIC_STATS if the allocation
fails), fetch them via HWRM_STAT_GENERIC_QSTATS once per admin-status
tick on P5+ chips, and expose them to userspace under
dev.bnxt.<unit>.hwstats.generic_stats.* via sysctl.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58614
d1619865da1cd4c5b557158b4bbf666e0f7f040b Sumit Saxena 2026-07-31 16:00:58

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: avoid FTQM/STQM pg_info alias on reset

Copying the STQM backing-store context to seed FTQM's also copied
STQM's pg_info pointer verbatim. On cold load STQM's pg_info is still
NULL so this is harmless, but on a firmware reset STQM's pg_info is
already non-NULL, making FTQM alias STQM's backing-store pages. The
allocator then skips FTQM since it looks already allocated, and FTQM
is later indexed as its own array, reading out of bounds into STQM's
buffer and dereferencing a bogus DMA address.

Clear ctxm->pg_info after the memcpy so FTQM always gets its own
backing store.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58615
f2ce672ade231a1e19f1238922a2c3b6fe696e22 Sumit Saxena 2026-07-31 16:02:18

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: Never ARM Tx CQ as they are not interrupt-driven

Tx completion rings are not interrupt-driven, so there is no need to
ring the doorbell with CQ_ARMALL and toggle bits set for them. Stop
arming the Tx CQ doorbell on P5+, which makes tx_cp_rings[]->toggle
dead, so drop the now-unnecessary toggle bookkeeping for it in
process_nq() too.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58616
7781529f31b62a3071995b9f0446b8ded4ec8cf9 Sumit Saxena 2026-07-31 16:04:34

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: fix HWRM failures/timeouts after repeated FW resets

Consecutive firmware-initiated reset cycles produced HWRM
failures/timeouts and traffic didn't come back. Fix the FW-reset
recovery path:

- bnxt_fw_reset_close() called bnxt_stop() and
  bnxt_hwrm_func_drv_unrgtr(), sending HWRM ring/VNIC/filter free
  commands to a firmware that's already mid-reset and unresponsive,
  producing the observed timeouts. Both are unnecessary since
  firmware comes back with fresh state anyway; drop them along with
  the now-redundant iflib_request_reset().
- bnxt_func_reset() now skips bnxt_hwrm_resource_free() entirely
  while BNXT_STATE_IN_FW_RESET is set, for the same reason.
- bnxt_open() (used to reopen after a firmware reset) now issues
  bnxt_hwrm_func_reset() up front and drives reinit through iflib's
  own reset machinery (iflib_request_reset() plus a new
  bnxt_iflib_reset_sync() that waits for
  IFF_DRV_RUNNING/OACTIVE to flip 1->0->1) instead of calling
  bnxt_init()/bnxt_intr_enable() directly.
- Route repeated PORT_QSTATS/PORT_QSTATS_EXT HWRM timeouts through
  bnxt_log_live() instead of device_printf(), so a stats poll timing
  out during a reset doesn't spam dmesg on every tick.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58617
dbde459751448ab9e98662660049513db783600c Sumit Saxena 2026-07-31 16:13:44

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: support more Tx rings than Rx rings on P5+

Add an unsupported-config guard rejecting nrxqsets > ntxqsets, and
teach the P5+ NQ datapath to handle the opposite asymmetric case:
extra Tx rings beyond the Rx ring count. softc->nq_rings[i].type now
tags each NQ as SHARED_NQ (paired with an Rx CQ) or BNXT_TX_ONLY_NQ
(dedicated to an extra Tx CQ with no backing Rx ring); bnxt_init()
and bnxt_hwrm_resource_free() gate all Rx ring group/ring/stat-ctx
alloc and free on IS_SHARED_NQ() so the extra Tx-only NQs don't touch
nonexistent Rx ring state. Gate the new type-tagging and IS_SHARED_NQ
checks on BNXT_CHIP_P5_PLUS(), since non-P5+ chips never allocate
softc->nq_rings and would otherwise access a nonexistent array.

BNXT_TX_ONLY_NQ is a distinct value from the existing MPC-private
TX_CP_NQ; the two are unrelated and kept apart to avoid confusion.

Suggested by:   gallatin
Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58618
644880d7b9b86fa16797fa45e7a876ac503227f9 Sumit Saxena 2026-08-01 08:52:51

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: drop redundant PCI disable in bnxt_fw_reset_close()

bnxt_fw_reset_close() unconditionally called pci_disable_device()
after freeing the Rx IRQs, on every firmware reset, not just the
BNXT_STATE_FW_FATAL_COND path which already disables the device via
bnxt_fw_fatal_close(). BNXT_FW_RESET_STATE_ENABLE_DEV in
bnxt_fw_reset_task() already re-enables the device unconditionally,
so this wasn't leaving the device disabled, just adding an
unnecessary PCI disable/re-enable cycle around every non-fatal reset.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58619
4fbb63f289ed6a06e715c6882e8fff3201381743 Sumit Saxena 2026-08-01 09:07:47

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: drop epoch_arr[] to detect EPOCH bit toggle

The EPOCH array size is 4096 but the driver does not enforce any limit
on ring size, so setting ring size >4096 corrupts adjacent memory
and leads to undefined behavior.

Toggle epoch_bit directly at every ring-producer wrap point (TX/RX
encap and refill, MPC crypto commands, kTLS presync/replay) instead of
looking it up per-index in the doorbell path, dropping the now-unused
epoch_arr[] snapshot array.

Reported by:    gallatin
Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58620
Change-Id: I4673d64670ee0e8ea256b8a8932724bbd73f710d
ed1f24d3e1a1c0f85bf3eda0337cfbf76bc34cf6 Sumit Saxena 2026-08-03 05:03:22

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: rework interrupt coalescing onto the AGGINT_QCAPS scheme

Query firmware-advertised coalescing capabilities and program
per-direction rx/tx coalescing settings against them, replacing the
old hardcoded scheme. Add sysctls for the coalescing mode, budget,
and stats-timer knobs the new scheme exposes.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58621
22f37c46b4841fec22612fd4bc485f0515f27a28 Sumit Saxena 2026-08-03 08:52:00

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: log: fix missing lock coverage in bnxt_log_live()

bnxt_log_live() walked the loggers TAILQ without holding log_lock,
unlike every other bnxt_log.c function, racing against concurrent
bnxt_register_logger()/bnxt_unregister_logger() calls. Take log_lock
around the traversal, and bail out early (with the lock dropped) if
live_msgs_len has already reached max_live_buff_size, which would
otherwise underflow the length passed to bnxt_log_info().

bnxt_start_logging_driver_coredump() now drops log_lock before
invoking logger->log_live_op() (which calls back into
bnxt_log_live()) and re-acquires it afterward, resetting live_msgs
to NULL so a later bnxt_log_live() call (e.g. from a VF async event
handler) can't write into a coredump buffer the caller has already
freed.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59086
fc4cd2c477e6d4a2cb241c0bbac0fb91520cddcf Sumit Saxena 2026-08-05 04:07:40

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: sysctl: remove unused linux/delay.h include and dead mutex

<linux/delay.h> and the DEFINE_MUTEX(tmp_mutex) it enabled are both
unused in bnxt_sysctl.c: no msleep/udelay/mdelay call remains, and
tmp_mutex itself was never referenced anywhere.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59087
4786d44fef555fe5d4e82f0b716bb2cb0c0c1ecd Sumit Saxena 2026-08-05 04:07:55

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: sriov: replace Linux kPIs with FreeBSD native APIs

Convert bnxt_sriov.c and related SRIOV files from Linux to FreeBSD
native equivalents:

- Replace cpu_to_le16/32/64/le16_to_cpu with htole16/32/64/le16toh.
- Replace Linux is_valid_ether_addr, ether_addr_equal, ether_addr_copy
  with local bnxt_eth_addr_valid/bnxt_eth_addr_equal/bnxt_eth_addr_copy
  helpers built on ETHER_IS_MULTICAST/ETHER_IS_ZERO.
- Replace kcalloc/kzalloc/kfree with malloc/free (M_DEVBUF,
  M_WAITOK|M_ZERO).
- Replace dma_alloc_coherent/dma_free_coherent with iflib_dma_alloc/
  iflib_dma_free; add struct iflib_dma_info hwrm_cmd_req_mem[4] to
  bnxt_pf_info to hold the DMA handles.
- Replace the Linux unsigned long *vf_event_bmap with FreeBSD
  bitstr_t *, allocated via bit_alloc(); bit_ffs_at()/bit_clear()/
  bit_set() replace find_next_bit()/clear_bit()/set_bit() on it
  (if_bnxt.c's vf-event producer side included).
- Replace DIV_ROUND_UP with howmany; rcu_assign_pointer with a plain
  store.
- Harden bnxt_alloc_vf_resources() error paths to free
  partially-allocated DMA pages and the VF array before returning
  ENOMEM.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59088
e9a6920e3218bb3b092a4babee129e70d57135b2 Sumit Saxena 2026-08-05 04:10:12

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: port workqueue, task-queue, and synchronization kPIs to FreeBSD natives

- Replace Linux workqueue (struct workqueue_struct, bnxt_pf_wq) with a
  FreeBSD taskqueue (bnxt_taskq) shared by every attached PF. bnxt_taskq
  is created once at module load and destroyed once at module unload
  (SYSINIT/SYSUNINIT on SI_SUB_KLD), matching the module-owned-taskqueue
  idiom used elsewhere in the tree (e.g. sys/dev/cxgbe/t4_main.c's
  reset_tq). This replaces an earlier lazy, per-attach/detach
  create-or-reuse scheme guarded by a mutex and a "ready" flag, which
  had a real race: bnxt_queue_sp_work()/bnxt_queue_fw_reset_work() and
  bnxt_attach_pre() re-read the bnxt_taskq/bnxt_taskq_ready globals
  outside the mutex right after the lazy-init call returned, so a
  concurrent bnxt_detach() on another PF freeing the shared queue once
  bnxt_num_pfs hit 0 could race a still-attached PF into enqueuing onto
  a freed taskqueue. Tying the taskqueue's lifetime to the module
  instead of to any one PF's attach/detach removes that race outright,
  since the module can't unload while a PF is still attached.

- Replace struct work_struct sp_task with struct task sp_task;
  replace struct delayed_work fw_reset_task with
  struct timeout_task fw_reset_tmo.

- Replace INIT_WORK/INIT_DELAYED_WORK with TASK_INIT/TIMEOUT_TASK_INIT;
  queue_work/schedule_work with taskqueue_enqueue;
  queue_delayed_work/schedule_delayed_work with taskqueue_enqueue_timeout;
  cancel_work_sync/cancel_delayed_work_sync with
  taskqueue_drain/taskqueue_drain_timeout.

- Rename bnxt_fw_reset_task(struct work_struct *) to
  bnxt_fw_reset_timeout_task(void *ctx, int pending) to match FreeBSD
  timeout_task callback signature.

- Add inline helpers in bnxt.h to wrap all Linux test_bit/set_bit/
  clear_bit/test_and_clear_bit calls on softc->state and
  softc->sp_event: bnxt_drv_state_test/set/clear/test_and_clear,
  bnxt_sp_event_set/test_and_clear (implemented via bit_test() from
  <sys/bitstring.h> and atomic_testandset_long()/
  atomic_testandclear_long(), all bit-index based like the Linux
  bitops they replace).

- Replace struct mutex lock in bnxt_fw_health with struct mtx;
  mutex_init to mtx_init.

- Replace kzalloc/kfree with malloc/free (M_DEVBUF).

- Replace DIV_ROUND_UP with howmany; hweight32 with bitcount32.

- Replace jiffies/HZ with ticks/hz; msleep with pause_sbt(). Since
  `ticks` (unlike LinuxKPI's `unsigned long jiffies`) is a 32-bit
  `volatile int` that wraps every ~24 days at hz=1000, BNXT_TIME_AFTER
  and bnxt_sleep_until_min_elapsed() compute the ticks delta as `int`
  (matching the in-tree wraparound-safe idiom used elsewhere, e.g.
  sys/dev/axgbe/xgbe-mdio.c) rather than widening it to `long`/
  `unsigned long`, so the comparison stays correct across a wrap.

- Replace IS_ERR_OR_NULL/ERR_PTR with plain NULL checks.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59089
22dcbd7739a174433845da800ad47fa182f37430 Sumit Saxena 2026-08-05 04:12:53

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: port endian, memory-barrier, and bitops kAPIs to FreeBSD natives

There are few more Linux kernel APIs left in the code. So,
replaced them with corresponding FreeBSD native APIs.

- Replace cpu_to_le16/32/64/le16_to_cpu/le32_to_cpu/le64_to_cpu with
  htole16/32/64/le16toh/le32toh/le64toh throughout bnxt_hwrm.c and
  the vf-event producer path in if_bnxt.c.
- Replace rmb()/wmb() interprocessor-ordering uses in bnxt_ulp.c
  (publishing/consuming ulp->async_events_bmap and max_async_event_id
  across CPUs) with atomic_thread_fence_acq()/atomic_thread_fence_rel();
  keep wmb() for the HWRM doorbell/DMA ordering barrier in
  _hwrm_send_message() (bnxt_hwrm.c), since atomic_thread_fence_rel()
  compiles to a bare compiler barrier on amd64/i386 and does not order
  the request-buffer store against the doorbell MMIO write.
- Replace hweight32 with bitcount32, ARRAY_SIZE with nitems, and
  DECLARE_BITMAP with a plain unsigned long array (sized via
  howmany()) in bnxt_hwrm_func_drv_rgtr(); replace the __set_bit/
  test_bit calls there with bit_set()/bit_test() from
  <sys/bitstring.h>, which correctly index the multi-word bitmap
  (event IDs up to 0x45 span more than one 64-bit word).
- Replace the remaining DIV_ROUND_UP/HZ with howmany/hz in
  bnxt_handle_async_event()'s error-recovery timer setup.
- Replace bnxt_sriov.h's <linux/pci.h> include with the native
  <dev/pci/pcireg.h> + generated "pci_if.h", now that nothing in
  that header needs Linux's struct pci_dev.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59090
fd540c61a1bb31536ff19e14bf456f71f0e4e737 Sumit Saxena 2026-08-05 04:13:27

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: don't reserve RoCE MSI-x on chips that don't support RoCE

RoCE is only supported on Thor and onwards chips.
bnxt_init_sctx_variants() unconditionally set isc_admin_intrcnt to
BNXT_ROCE_IRQ_COUNT for every PF device, stealing 9 MSI-x vectors from
older, non-RoCE-capable chips that will never use them.

Gate the reservation on the device ID: RoCE-capable chips keep
BNXT_ROCE_IRQ_COUNT, other chips fall back to 1, the baseline
isc_admin_intrcnt value used before RoCE support (commit 050d28e13cde)
repurposed it for RoCE MSI-x on every device.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59091
15187b27c895e82d153dd1de5324076692023e70 Sumit Saxena 2026-08-21 11:33:48

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: add support for SIOCGI2CPB page/bank i2c requests

Advertise IFLIB_I2C_PAGE_BANK and forward the requested page/bank to
firmware, so CMIS optics can be read correctly instead of falling
back to bogus legacy SFF-8472 decoding. Also fix bnxt_i2c_req() to
return positive errno values.

Signed-off-by:  gallatin
Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59573
fdab50f6f8107c9d825a7e6d92d7a6b89c417bbb Sumit Saxena 2026-09-01 07:55:35

debug: classified in 03-filenames_plain1 by 'sys/dev/'


if_bnxt: dcb: serialize HWRM sends and avoid freeing DMA bufs on timeout

Every _hwrm_send_message() call in bnxt_dcb.c ran without BNXT_HWRM_LOCK,
unlike the rest of the driver, letting concurrent HWRM commands race on
the shared MMIO doorbell and response buffer. Route single-shot sends
through the already-locked hwrm_send_message() wrapper, and wrap the
remaining send+response-read sequences in explicit BNXT_HWRM_LOCK/UNLOCK.

Also stop freeing the transient DMA buffers used for structured-data
get/set on ETIMEDOUT: a host-side timeout doesn't guarantee firmware
actually gave up, so a late completion could still DMA into memory
that's since been freed and reused. Leak the buffer instead in that case.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D60179
4f20e02ed0582bd8a3e2b59853690c1d46e08fa8 Sumit Saxena 2026-09-29 12:15:06

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #10: arm64
arm64: Add a header for system instructions

Like armreg.h for system registers add a header to hold macros for
system instructions.

Reviewed by:    jhb
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D59147
3864fe9317325e6abddf7b7126873918533231f8 Andrew Turner 2026-10-09 11:54:56

debug: classified in 03-filenames_plain1 by 'sys/arm64/'


arm64: Use sysinsn.h to generate tlbi instructions

Some toolchains may not understand the .arch_extension.

Reviewed by:    jhb
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D59148
e8997a4e44c7729e6013745cb6590d2ec3691175 Andrew Turner 2026-10-09 11:55:06

debug: classified in 03-filenames_plain1 by 'sys/arm64/'


arm64: Fix the MPIDR_EL1 field names

Use the field names from the Arm Documentation for the MPIDR_EL1
register. These will later be generated from a BSD Licensed JSON file
so to reduce the diff for that rename now.

Reviewed by:    kajetan.puchalski_arm.com
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D59176
6bf6fe1d70e780786a07e759d75eeb256f247fcd Andrew Turner 2026-10-09 11:55:14

debug: classified in 03-filenames_plain1 by 'sys/arm64/'


bhyve: Use the new spelling of MPIDR_Aff*

Fixes:  https://cgit.freebsd.org/src/commit/?id=6bf6fe1d70e7 ("arm64: Fix the MPIDR_EL1 field names")
 Sponsored by:  Arm Ltd
406a74f780ab110137011d304ac9212a31bf6364 Andrew Turner 2026-10-09 14:53:25

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

debug: moved to hardware because 'Need to be grouped with 6bf6fe1d70e780786a07e759d75eeb256f247fcd'

arm64/vmm: vgic_v3: Set EOI for level-triggered interrupts
ICH_LR_EL2 bit 41 (EOI) determines whether a maintenance interrupt will
be asserted if the interrupt identified by the LR's vINTID is
deactivated. For level-triggered interrupts, that maintenance interrupt
is necessary for the host to resample the current level once the
interrupt is deactivated.

Set the EOI bit when flushing level-triggered interrupts into LRs.

Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2437
7081201eb07367be73e43c5f878dfec51e8fe0d7 Kajetan Puchalski 2026-09-17 14:19:27

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

arm64/vmm: vgic_v3: Fix missing free of vgic_cpu->private_irqs
vgic_cpu->private_irqs is allocated but never freed, as a result leaking
memory whenever the vmm module is unloaded. Add the missing free.

Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2439
aa4086951b4a26386bcdcd0693520e7d35be425e Kajetan Puchalski 2026-09-18 15:34:18

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

Commit group #11: x86: Add external retpoline thunk
x86: Add external retpoline thunk

This allows use of -mindirect-branch=thunk-extern, and is only a few
bytes of dead code if not used.

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60524
74d971fe156113cc63add2e6701e369c93c4f52b Ed Maste 2018-03-14 14:53:34

debug: classified in 03-filenames_plain1 by '['sys/amd64/', 'sys/i386/']'


x86: Fix retpoline capitalization

Fixes: https://cgit.freebsd.org/src/commit/?id=74d971fe1561 ("x86: Add external retpoline thunk")
ac9093170de19a54e9b37d6ff39e23be4af8a554 Ed Maste 2026-10-09 14:51:28

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

thunderbolt: Router suspend routine
Suspend routine for USB4 v1.0 NHIs. This will work on v2.0 NHIs too for
now, but there's ideally a different method we should be using for those
in fine.

Reviewed by:    imp, ngie, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D49453
02880ddf9ed01a4b3444239309f522309ef11043 Aymeric Wibo 2025-04-29 20:42:56

debug: classified in 03-filenames_plain1 by 'sys/dev/'

bnxt_en: dcb: stop zeroing ETS and PFC config in bnxt_dcb_init()
bnxt_dcb_init() currently pushes all-zero ETS and PFC settings to
the firmware at every attach. This reserves bandwidth allocation
for RoCE traffic, which prevents L2 traffic from reaching line rate.

These settings should only be updated with valid values when the
RoCE driver is loaded. Therefore, we should stop programming them
during bnxt_dcb_init().

Signed-off-by:  Andy Gospodarek <gospo@broadcom.com>
Reviewed by:    chandrakanth.patil_broadcom.com, gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D60516
31cbd8f27d687ce9b10a22c858296532be400bb4 Sumit Saxena 2026-10-09 10:41:09

debug: classified in 03-filenames_plain1 by 'sys/dev/'

mgb: Correct TX interrupt bit
The TX interrupt handler checked MGB_INTR_STS_RX(qidx) instead of
MGB_INTR_STS_TX(qidx) -- presumably a copy-paste issue.

Because the driver does not use TX interrupts so there was no actual
issue in practice.

Reviewed by:    adrian
Sponsored by:   The FreeBSD Foundation
Fixes: https://cgit.freebsd.org/src/commit/?id=8890ab7758b8 ("Introduce if_mgb driver for Microchip LAN743x PCIe NIC")
Differential Revision: https://reviews.freebsd.org/D60550
6c3f2b8be268de075d60387158f2889140851725 Ed Maste 2026-10-09 19:10:18

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amdgpio: Suspend routine
Mask all interrupts when suspending and warn when there are unserviced
interrupts which might block entry to S0i3.

In the future we won't want to mask wake interrupts.

Once we can actually make use of GPIO interrupts on x86, we'll also want
to unmask relevant pins when resuming.

Reviewed by:    aokblast, avg
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D51589
16d92e92ca12c9772d921346c34f1ef87998c662 Aymeric Wibo 2026-02-25 09:28:20

debug: classified in 03-filenames_plain1 by 'sys/dev/'

hyperv: Fix single page invalidation path
A single page invalidation sets addr2 == 0. In the original code, it
falsely flush the whole address in non global pmap. However, the
kernel pmap are all PG_G, which means a single page flush will always be
staled and thus become invalid. As a result, we set parameter based on
their op in a new helper function instead of relying on args. This
affects only on AMD platform as Intel has their PTI implementation.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291577
Tested by:      franco@opnsense.org
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60380
5b1f1fd624352840cd9666447ff9cdebeaf910d4 ShengYi Hung 2026-10-05 19:58:06

debug: classified in 03-filenames_plain1 by 'sys/dev/'

riscv/pmap.c: Don't pass hartid map to 'smp_rendezvous_cpus'
The pm_active bitmask is indexed by hart IDs which can differ from
CPU IDs. `pmap_invalidate_range_svinval` assumes that the map is
indexed by CPU IDs, which is wrong and causes remote TLB invalidations
on unrelated CPUs.

Fix this by adding a routine that converts a hart-indexed bitmask
to a CPU ID-indexed bitmask. While we're here, fix a similar issue
in `pmap_active_cpus`.

Fixes:  https://cgit.freebsd.org/src/commit/?id=99360212c739 ("riscv/pmap.c: Add an Svinval-aware variant of pmap_invalidate_range")
Reported by:    markj
Reviewed by:    markj, mhorne
Differential Revision:  https://reviews.freebsd.org/D60072
f627ff51b76c728b8c6c4a7e5490ce3803c562ad Bojan Novković 2026-09-27 18:25:22

debug: classified in 03-filenames_plain1 by 'sys/riscv/'

Commit group #12: iwm
iwm: add lock assertion checks

Add lock/unlock assertions to use in current and future code.

Differential Revision:  https://reviews.freebsd.org/D60400
b3ef4013a4fa75063930d0221a0bc50f95af0527 Adrian Chadd 2026-10-12 02:40:54

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: placeholders for HT rates, update some FW flags to openbsd

* update a flag to openbsd iwm
* lay down placeholder ht rate / MIMO config routines based on
  openbsd's updated init path

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60073
1f07bcd91de1d02d1adb8a1215945cd02f469489 Adrian Chadd 2026-10-12 02:41:12

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: bring over placeholder calibration information

Like openbsd at this commit, it's not being used anywhere yet.

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60074
b00a90df99f72c30bdeec17bb0fb0cd28342415d Adrian Chadd 2026-10-12 02:41:20

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: bring in the command table version code from openbsd

Parse the command table; same way as OpenBSD (ie, memcpy()
and not anything endianness happy.)

Nothing is using it yet.

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60075
65373e8d02391054eb867edaeb92348c6f2d4ff4 Adrian Chadd 2026-10-12 02:41:24

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: Intel 9000 series bits from OpenBSD

* Add basic SOC conf firmware command
* Configured with the same xtal latency as used by openbsd

Currently untested; will need to find a device.

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60076
b15ec53784f3be913d6b4711f8eb166584a7d791 Adrian Chadd 2026-10-12 02:50:40

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: add thermal cutoff to firmware command support

This is based on firmware capabilities.

Locally tested:

* Intel 7260, STA mode

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60077
e6ca3d05b93b5f36dde2873076d7bc29dbcd46d1 Adrian Chadd 2026-10-12 02:50:45

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: clear persistence bit on 9000 series NICs

From what I've gathered, this is to make sure that the firmware
clears state and is reloaded through hardware bring-up and
suspend/resume.

It may fix instability issues with the 9000 series NICs.
I'll need to test it out first.

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60078
7ce67909fa683b22546b2ec8d635db1582b56bca Adrian Chadd 2026-10-12 02:50:50

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: add MSI-X support

This brings over the MSI-X support from OpenBSD.
It's mostly untested at this point.

Locally tested:

* Intel 7260, STA mode (but I don't know yet if it used msi-x)

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60079
8f93ad70078a88710d34b371a4076191cfebc4f6 Adrian Chadd 2026-10-12 02:50:57

debug: classified in 03-filenames_plain1 by 'sys/dev/'

u3g: Add ublox LARA-L6 modem
MFC after:            3 days
Approved by:            adrian
Reviewed by:            kevans, adrian
Differential Revision:  https://reviews.freebsd.org/D60652
a32c8dc6e8fd96e0d56e5add09638120e62d8418 Joel Bodenmann 2026-10-12 16:54:41

debug: classified in 03-filenames_plain1 by 'sys/dev/'

arm64: Fix and rename midr_check_var_part_range()
At the lowest and highest variants in the specified range,
midr_check_var_part_range() was comparing the part number, rather than
the revision, against the bounds.  In other words, the "Y" in "rXpY"
should be compared to CPU_REV() instead of CPU_PART().  Apply this
correction, and rename the function to midr_check_var_rev_range() to
better reflect the field that we are checking.

Reported by:    Claude Code (Opus 5.5)
Reviewed by:    andrew
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60624
39d6e2226484ca434c7d980eda4aa19ed0d62c9e Alan Cox 2026-10-11 18:13:25

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

hwpmc: Add support for AMD-only IRPERF in hwpmc PERF class
The IRPERF MSR counter (0xc00000e9) exposes an instructions-retired count
when read. Its support is advertised through CPUID leaf 0x80000008 EBX bit 1.
If this bit is set, the CPU supports the IRPERF MSR. For it to be used
by the system, bit 30 of the HWCR MSR (0xC0010015) needs to be enabled.

This patch checks for availability of the feature and enables the bit. If
the feature is available, the hwpmc PERF class detects its presence and
registers a third PERF MSR counter that allows hwpmc users to measure
instructions retired using IRPERF. This is AMD-only, as Intel does not
support IRPERF.

Due to erratum #1054 affecting AMD Zen 1 before model 30h, IRPERF is only
enabled for AMD Zen 1 model 30h onwards and later microarchitectures. This
commit also implements a validation step to make sure the IRPERF counter
is actually incrementing; otherwise, the feature is not enabled. This
guarantees it is working as expected before being made available to the
system and users.

To support this, the perf_pmcdesc[] structure changed from being
statically initialized with 2 entries (MPERF/APERF) to being populated
dynamically. If both MPERF/APERF and IRPERF are supported, the structure
will contain three entries: MPERF, APERF, and IRPERF. Each entry now also
carries its own MSR address and PMC event, so perf_read_pmc() reads the
MSR to use from the matching perf_pmcdesc[] entry at runtime instead of
switching over a fixed set of row indices.

Definitions for the features available on the HWCR MSR did not previously
exist. This commit adds macros for those features, including
HWCR_IRPERFEN. The MSR definition for MSR_IRPERF was also missing and has
now been added.

This commit also updates the manual page accordingly.

Signed-off-by:  Anderson Nascimento <anascime@amd.com>
Reviewed by:    mhorne, adrian
Sponsored by:   AMD
Differential Revision:  https://reviews.freebsd.org/D59554
2272fac218a88a6f25e696ec54ece2eedec39a38 Anderson Nascimento 2026-10-13 13:10:28

debug: classified in 03-filenames_plain1 by '['lib/libpmc/', 'sys/amd64/', 'sys/dev/', 'sys/x86/']'

if_bnxt: fix powerpc build of the MPC ring code
powerpc has no 16-bit acquire/release atomics, so the
atomic_load_acq_16() and atomic_store_rel_16() calls on the MPC TX
ring indices fail to build there. Make the producer and consumer
indices 32 bits wide and use the 32-bit primitives.

Reviewed by:    gallatin, chandrakanth.patil_broadcom.com
Sponsored by:   Broadcom Inc
MFC after:      1 week
Fixes: https://cgit.freebsd.org/src/commit/?id=088a42c0ff76 ("if_bnxt: add MPC (Mid-Path Channel) ring infrastructure")
Differential Revision: https://reviews.freebsd.org/D60698
b43c4d84c8d172858fc4bbf59e07888bfb8ac472 Sumit Saxena 2026-10-13 08:28:03

debug: classified in 03-filenames_plain1 by 'sys/dev/'

arm64/vmm: Treat Rt=31 as xzr in reg & instr emul
For certain instructions like msr, mrs, ldr & str, Rt=31 means the
operand is the Zero register (XZR) as opposed to the SP, even though the
two share the encoding of 31 on AArch64.

This is currently ignored in register and instruction emulation, so
emulated guest operations like "msr <reg>, xzr" will set the value of
<reg> to the current value of the SP instead of to 0.

Skip set and get operations when Rt=31 to correct the behaviour.

Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2454
167d3567c4b93650c8bcca86ff294226e6e1a9ce Kajetan Puchalski 2026-09-29 17:02:19

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

arm64: Relax memory barriers around DMA operations
Before and after DMA operations we need memory barriers to ensure
stores on the CPU are observed by the device, and stores by the device
are observed by the CPU.

Previously we used a "dsb sy" instruction, however this is too strong
and can lead to slower performance.

Drew Gallatin found and tested the issue with cache-coherent devices,
reducing the barriers to dmb instructions in the outer-shareable
domain. After discussing the issue with the Arm Linux DMA maintainer I
concluded it was safe for non-coherent devices as the only dsb
instructions we need are after cache operations and these already exist.

Replace the dsb before DMA with a "dmb oshst" when cache-coherent, or
the existing dsb after invalidating the cache when not coherent. This
ensures earlier stores have completed before we signal the device.

Replace the dsb after DMA with "dmb oshld" in both cases. This ensures
later loads or stores are ordered after earlier device register loads.

Co-Authored-By: Andrew Gallatin <gallatin@FreeBSD.org>
Sponsored by:   Arm Ltd
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D60407
ac64294143ffea63c7dedf9a1859f88342bd998a Andrew Turner 2026-10-13 15:36:16

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

mgb: support multi-segment packets in the DMA descriptor rings.
Reviewed by:  emaste
Sponsored by:   EPSRC ("UKRI3001: CHERI Research Centre")
Differential Revision:  https://reviews.freebsd.org/D60705
ec68ff15bfa6aece12383ba408e9eec95f4b79cd Ruslan Bukin 2026-10-13 16:26:10

debug: classified in 03-filenames_plain1 by 'sys/dev/'

if_rge: add debugnet/netdump support
Implement the debugnet KPI in rge(4) by mirroring the re(4) pattern.
Tested with a RTL8125 2.5GbE NIC.

Approved by:    adrian
Differential Revision:  https://reviews.freebsd.org/D60135
686323c1820cc4b2ef5434c0b6fa0ac38466fe5e Olivier Cochard 2026-10-13 16:22:19

debug: classified in 03-filenames_plain1 by 'sys/dev/'

mgb: support for PCI11414.
Add support for Microchip PCI11414 Gigabit Ethernet Controller.

The PCI11414 is used on the CHERI VITA 57.1 PCIe Extension Board.

- Add PCI11414 device ID
- Add support for SGMII mode. Read the programmed strap configuration
  and enable SGMII operation when configured. Bypass the MII interface
  in SGMII mode.
- Increase the DMA descriptor ring size.

Reviewed by:    emaste
Sponsored by:   EPSRC ("UKRI3001: CHERI Research Centre")
Differential Revision:  https://reviews.freebsd.org/D60539
da8a529bc01f5fdfdd5308ff6fd9a2bc52359069 Ruslan Bukin 2026-10-13 17:39:24

debug: classified in 03-filenames_plain1 by 'sys/dev/'

mgb: increase timeout
Increase wait timeout as needed for slower systems.

It takes ~120ms on the Codasip Prime for the MGB_PHY_READY bit
to set after phy reset command issued.

Reviewed by:    emaste
Sponsored by:   EPSRC ("UKRI3001: CHERI Research Centre")
Differential Revision:  https://reviews.freebsd.org/D60706
3943973aaeba035bf36b34dfb9354d8d1c4684b9 Ruslan Bukin 2026-10-13 18:34:40

debug: classified in 03-filenames_plain1 by 'sys/dev/'

acpi_lid: add an in-kernel lid state eventhandler
Lid state changes are only published to userland, via devd and evdev.
Drivers that need to react to the lid in the kernel have no hook, so
they end up installing a second ACPI_DEVICE_NOTIFY handler on the same
lid object and reimplementing the _LID evaluation.

Add acpi_lid_event, invoked from acpi_lid_status_update() alongside the
existing devd notification, carrying the new state (1 open, 0 closed).

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D60704
030e556ff8a9dfa6fd7b5328e410eb806f4d07ed Abdelkader Boudih 2026-10-13 18:43:56

debug: classified in 03-filenames_plain1 by 'sys/dev/'

powerpc: Avoid deadlock when CPUs exchange threads
The PowerPC context switch waited for the incoming thread to leave
blocked_lock before releasing the outgoing thread.  If two CPUs selected
each other's running threads concurrently, both CPUs waited for the
other to perform the release and neither could progress.  This appeared
as intermittent boot hangs under QEMU MTTCG when taskqueue threads were
bound to opposite CPUs.

8df2e5421468 ("powerpc: put the isync inside the TD_LOCK()...")
attempted to fix the same hang by moving isync into the polling loop.
That did not address the circular wait: isync cannot cause either CPU to
execute the release store after the loop.  It only added context
synchronization to failed iterations and changed timing. Move isync back
to the successful exit, which preserves acquire ordering for subsequent
context loads.

Match the ordering used by other architectures: publish the outgoing
thread's new lock before waiting for the incoming thread.  Apply the
correction to both 32-bit and 64-bit switch paths.

The 2015 change moved the release after the stack switch because the old
implementation continued through pmap_activate() and optional state
restoration on the outgoing thread's stack after making that thread
runnable.  The switch path has since changed: after the release it only
polls wired td_lock state using registers, then immediately loads the
incoming PCB_SP before updating per-CPU state or making any calls.
cpu_switch() also runs with external and decrementer interrupts disabled
by spinlock_enter().  Thus this does not restore the post-release call
window that the 2015 change corrected.

Reviewed by:    jhb, jhibbits
Approved by:    jhb (mentor)
Fixes: https://cgit.freebsd.org/src/commit/?id=53607fe3cc8d ("Fix an extremely subtle concurrency bug...")
Fixes: https://cgit.freebsd.org/src/commit/?id=7a49d964d3f9 ("Merge r278429 from ppc64:")
Fixes: https://cgit.freebsd.org/src/commit/?id=8df2e5421468 ("powerpc: put the isync inside the TD_LOCK()...")
MFC after:      2 weeks
Sponsored by:   FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59742
0571d8a0cc606be9a216439b3cfea685b709d6ea Minsoo Choo 2026-09-16 19:37:01

debug: classified in 03-filenames_plain1 by 'sys/powerpc/'

amdsmu: Print how long system spent in S0i3
It's practical to have this printed out proactively, at least while this
is still very experimental.

Sponsored by:   The FreeBSD Foundation
cd96657b6708e42caa55531f8118bff6dcb38769 Aymeric Wibo 2026-10-13 21:20:23

debug: classified in 03-filenames_plain1 by 'sys/dev/'

snd_hda: use the pin ELD to select DisplayPort audio framing
hdaa_audio_setup() reads the converter widget's ELD when choosing
between HDMI and DisplayPort audio infoframes. ELD is stored on the
output pin, so the converter has no ELD and the driver selects HDMI
framing even when the connected display uses DisplayPort.

Read the ELD from the output pin to select the correct audio framing.

The equivalent change was tested on DragonFly BSD with an Intel Kaby
Lake display-audio codec and an LG HDR 4K monitor connected over
DisplayPort. Before the change, converter node 2 had no ELD, while
output pin 5 had an 83-byte ELD identifying DisplayPort. Captured driver
commands programmed HDMI audio infoframe bytes (84 01 0a 70 01 00 00
00). After applying the change and rebooting, the commands used the
existing DisplayPort form (84 1b 44 01 00 00 00), and console tones and
desktop audio were audible.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299094
Signed-off-by:  David Bidner <david@crap.solutions>
Reviewed by:    christos
MFC after:      2 weeks
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2463
29449b3e468cb1673814dc6452e82035b3c2a628 David Bidner 2026-10-03 14:04:32

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amd64/vmm: Don't advertise support for performance counters
vmm doesn't implement them, and after commit 2272fac218a8
("hwpmc: Add support for AMD-only IRPERF in hwpmc PERF class"), FreeBSD
guests fail to boot since they access the unimplemented IRPERF MSR.

MFC after:      1 week
c83e075d72f62c91cb27dd644a62d6a6f5bd56ba Mark Johnston 2026-10-14 15:55:51

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

sound: Check for errors from sndbuf_resize()
Most implementations of CHANNEL_SETBLOCKSIZE and CHANNEL_SETFRAGMENTS
were not checking this.  This is probably not a big problem: it's
unlikely for sndbuf_resize() to fail due to the refcount check in this
case since it's operating on the hardware buffer, which doesn't get
mmaped.  But, I will add more reasons for it to fail in the next patch,
so let's be more careful.

This change modifies various CHANNEL_SETBLOCKSIZE implementations to
check for errors.  In some cases I reordered things to avoid updating
driver state until after sndbuf_resize() succeeds.

Return 0 from CHANNEL_SETBLOCKSIZE to indicate an error, as it otherwise
returns the new block size.  We could change the interface to return
both an error number and a block size, but that would break at least one
out-of-tree driver and I wish to avoid that here.  Make sure that errors
from CHANNEL_SETFRAGMENTS and CHANNEL_SETBLOCKSIZE are returned to
userspace.

Approved by:    so
Security:       FreeBSD-SA-26:71.sound
Reviewed by:    christos
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60553
3545fc68f416ee6d3379e0a44ed9eb22fefee2ef Mark Johnston 2026-10-13 15:53:39

debug: classified in 03-filenames_plain1 by '['sys/arm/', 'sys/dev/']'

sound: Revalidate after reacquiring locks when resizing buffers
sndbuf_resize() and sndbuf_remalloc() drop the channel lock in order to
allocate the new buffer(s) with M_WAITOK.  Before doing that they verify
that the buffer is not mapped, but this could change while the lock is
dropped, as there is no higher-level synchronization which prevents
buffer resize (e.g., via the SNDCTL_DSP_SETBLKSIZE ioctl) from happening
concurrently with mmap.  Thus, these checks are insufficient.

Modify sndbuf_resize() and sndbuf_remalloc() to revalidate after
reacquiring the lock.  Extend them to check for a couple of channel
flags, mirroring the check in chn_resizebuf().  Modify chn_resizebuf()
to revalidate state after reacquiring the channel lock.

We could also allocate new buffers with M_NOWAIT and so avoid dropping
the lock.  Then, I think we could go even further and invoke
CHANNEL_SETBLOCKSIZE and CHANNEL_SETFRAGMENTS with the channel lock
held.  But really it would be better to ensure that dsp operations are
serialized; there is no reason for mmap and chn_resizebuf() to be able
to run in parallel, we should not be relying on the channel lock for
this.  So, let's keep a more minimal approach here.

Add a simple regression test.

Approved by:    so
Security:       FreeBSD-SA-26:71.sound
Security:       CVE-2026-101308
Reviewed by:    christos
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60554
47d2d509c6b32b3c2245748f755fbf2344351d94 Mark Johnston 2026-10-13 15:54:07

debug: classified in 03-filenames_plain1 by 'sys/dev/'

machine/ieeefp.h: include <sys/cdefs.h>
The <machine/ieeefp.h> headers wrap their deprecated FPU control
prototypes in __BEGIN_DECLS/__END_DECLS but rely on the includer to
have pulled in <sys/cdefs.h>.  Including <floatingpoint.h> first on
arm, arm64, powerpc and riscv (or amd64 <machine/ieeefp.h> with
__IEEEFP_NOINLINES__) fails with "unknown type name '__BEGIN_DECLS'".
This breaks e.g. devel/py-pyinstaller.

Suggested by:   jhb
Reviewed by:    jhb
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59659
9d50245a0f1333e10cc1c4dda16878cd79a7c42b Piotr Kubaj 2026-10-14 16:04:02

debug: classified in 03-filenames_plain1 by '['sys/amd64/', 'sys/arm/', 'sys/arm64/', 'sys/powerpc/', 'sys/riscv/']'

Commit group #13: iwm
iwm: add DQA (dynamic queue assignment)

This is the minimum set of DQA bits from iwm at the given openbsd
commit place.

* add a method to map ac to queue / ring
* use the DQA command queue if needed
* glue to wire it up

Locally tested:

* Intel 7260, STA mode
* Intel 9260, STA mode
* Intel 8260, STA mode
* Intel 3160, STA mode

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60080
8d53176ef83dad3a0962cdffdae98871c0379c35 Adrian Chadd 2026-10-15 01:48:49

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: bring IWM_CSR_HW_IF_CONFIG_REG programming in line with openbsd

bring the iwm_nic_config() / IWM_CSR_HW_IF_CONFIG_REG programming
in line with openbsd.

Locally tested:

* 3160 STA mode
* 7260 STA mode
* 8260 STA mode
* 9260 STA mode

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60081
ed92055cb8e72d0a2055dc3e2f8fa96853c71d50 Adrian Chadd 2026-10-15 01:49:16

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: update phy context routines; add HT channel width parameter

Update the phy context routines to match what the openbsd snapshot
is doing.  This involves some HT channel width stuff which although
I am not doing HT right now, it was juts easier to sync these
entirely versus just a partial sync.

* Update the phy context routines to match what openbsd is doing
* Although the openbsd driver has an iwm_phy_ctxt_update() routine
  instead of add and modify, I'm leaving it as-is for now.
  A bunch of refactoring is going to need to be done to properly
  use an iwm_phy_ctxt_update() call and I didn't want to tackle
  that in here.
* Add a UHB firmware capability phy context call; I can't test it
  but it's mostly copy/paste.
* Add in a util to turn ieee80211_channel into the 'sco' variable
  (the HT low/hi parameter) since it's done in openbsd in a
  slightly different way.

Locally tested:

* 3160, STA mode
* 7260, STA mode
* 8260, STA mode
* 9260, STA mode

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60082
103a4f05c77feacacd4e8191b4bfc92a71d1673d Adrian Chadd 2026-10-15 01:49:33

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: add return status to set/clear prph bits

This brings these functions inline with OpenBSD

Locally tested:

* 3160, STA mode
* 7260, STA mode
* 8260, STA mode
* 9260, STA mode

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D60211
c27ed49a46f8cc4228ed7d420b703b4872ee46d7 Adrian Chadd 2026-10-15 01:50:15

debug: classified in 03-filenames_plain1 by 'sys/dev/'

acpi_apple: Apple platform ACPI driver,
handles wake-on-LAN arming and lid state on the PCH
PMC/GMUX platform instance, and panel backlight
control on the PNLF instance, registering with
backlight(9).

Reviewed by:    ziaee, adrian
Differential Revision:  https://reviews.freebsd.org/D58867
d7d237ce731f0897107ca0f9301b4cef1846a182 Abdelkader Boudih 2026-10-15 13:03:22

debug: Commit manually moved from "unknown" to "hardware".

powerpc64: give each CPU its own KDB trap stack
Kernel mode program, trace, breakpoint and machine check exceptions go
through dbtrap, which saves the registers on trapstk and, if KDB doesn't
want the trap, restores them from there and continues with the normal
trap handler. There was just one trapstk for all CPUs, so when two of
them trapped at the same time they overwrote each other's frame and one
of them carried on with the other's registers. DTrace fbt probes are
these traps, so a probe on a function that runs on several CPUs at once
took the kernel down within seconds.

Keep the stack in the pcpu instead. The boot CPU gets a static one,
since it's set up before malloc works, the others allocate theirs in
cpu_pcpu_init() like the Book-E critical interrupt stack.

Approved by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60362
eaaf838e33042ed3f282a5cdf8e1260e78d4989b Piotr Kubaj 2026-10-15 14:27:59

debug: classified in 03-filenames_plain1 by 'sys/powerpc/'

Commit group #14: iwm
iwm: add qenablemsk to track enabled TXQs

This isn't yet used by anything; it's a precursor to TX queue
tracking needed for dynamically assigned TX aggregate queues.

Tested:

* 3160, 7260, 8260, 9260, STA mode

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60286
05635ccc575bcd395e3f2bf23dee7f91778f1c73 Adrian Chadd 2026-10-16 03:52:57

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: add phy/mac context tasks; clean up task stop; add net80211 MAC methods

* Add phy/mac tasks, the phy task is currently a placeholder
* Add in the MAC methods from net80211 that are called whenever
  the VAP mode needs updating
* Mark the hardware as STOPPED during shutdown so scheduled tasks
  don't run

The fun side of this work:

* detaching net80211 causes the parent method to be called which leads
  to iwm_stop() being called, and at least one of the entry paths
  into iwm_stop() has IWM_LOCK held, and we can't do a taskqueue_drain()
  or taskqueue_drain_all() call with any lock held as it will sleep.

* the net80211 detach path is calling at least one of the MAC methods
  during detach, and since the taskqueue is being deleted /before/
  the net80211 detach path, we have to make sure nothing is actually
  going to do taskqueue work after that!

* STOPPED in FreeBSD is MOSTLY doing the same as SHUTDOWN in OpenBSD.
  It should be fine enough for this.

Locally tested:

* 3160/7260/8260/9260 STA mode - create, ctrl-C wpa_supplicant;  create,
  destroy; create, unload; create, destroy, unload.  The create+unload paths
  generate interesting net80211 tear down states which were causing
  issues here.

Differential Revision:  https://reviews.freebsd.org/D60607
401434a46c1067dd5fea8ba5e4886efb66c47908 Adrian Chadd 2026-10-16 03:53:19

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: add iwm_enable_ac_txq(); use it for command queue setup

Port iwm_enable_ac_txq() from OpenBSD.  It's effictively the
command FIFO path in the existing iwm_enable_txq().

The OpenBSD driver does a bunch of TX aggregation queue setup in
iwm_enable_txq() which isn't relevant here just quite yet and
it doesn't currently hurt to leave the existing one here
whilst I figure out the next steps.

Locally tested:

* 3160, 7260, 8260, 9260 - STA mode

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60696
0a12ff65b9647a6e31471e5d27a8692b4adb6803 Adrian Chadd 2026-10-16 03:53:55

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: rename iwm_stop_session_protection() -> iwm_unprotect_session()

This matches OpenBSD's driver naming.

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Reviewed by:    mizhka
Differential Revision:  https://reviews.freebsd.org/D60287
a7195567fdadb929cfddd190a9666a75ed7652d4 Adrian Chadd 2026-10-16 04:16:32

debug: classified in 03-filenames_plain1 by 'sys/dev/'

pty: preserve O_NONBLOCK when opening /dev/ptmx
ptmx_fdopen() masks the supplied file flags to FREAD | FWRITE before
passing them to pts_alloc(). This discards FNONBLOCK even when the
caller explicitly requests O_NONBLOCK.

As a result, open("/dev/ptmx", O_RDWR | O_NOCTTY | O_NONBLOCK) succeeds,
but the returned file is blocking. F_GETFL reports O_NONBLOCK cleared,
and a subsequent read can block instead of returning EAGAIN when no
data is available.

This causes Linux xfce4-terminal/VTE running under Linuxulator to
freeze. VTE opens the PTY master with O_NONBLOCK and relies on
nonblocking reads while draining terminal output. Once the available
data has been consumed, the main UI thread blocks in ptsdev_read(),
leaving the window unresponsive even though the child shell has
started successfully.

Include FNONBLOCK in the flags passed to pts_alloc(). Blocking opens
retain their existing behavior. No change to posix_openpt(2) flag
validation is required.

The flag loss also reproduces with a native FreeBSD program, so the
problem is in the shared /dev/ptmx implementation rather than Linux
syscall flag translation.

Validation:
- Before the fix, a native FreeBSD reproducer observes O_NONBLOCK
  cleared after opening /dev/ptmx with that flag.
- Explicitly setting O_NONBLOCK with F_SETFL works, confirming that
  nonblocking PTY operation itself is supported.
- After the fix, F_GETFL preserves O_NONBLOCK when requested and
  leaves it cleared for a blocking open.
- xfce4-terminal in the Linux jail displays the shell prompt and
  accepts input.

Reviewed by:    kib
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60700
495bc1924edfd474c479df61ec35bdf6a83a8d17 Vladimir Grebenshchikov 2026-10-12 18:31:30

debug: classified in 03-filenames_plain1 by 'sys/dev/'

machine/floatingpoing.h: harmonize all arches
Reported by:  fluffy
Reviewed by:    jhibbits (previous version)
Discussed with: imp
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60255
43c79c64af480dad96ba8cf73fb010239dd088d2 Konstantin Belousov 2026-10-02 19:42:07

debug: classified in 03-filenames_plain1 by '['sys/amd64/', 'sys/arm/', 'sys/arm64/', 'sys/i386/', 'sys/powerpc/', 'sys/riscv/']'

acpi_apple: rename source files to match the driver name
The driver, module, kernel option and manual page are all named
acpi_apple, but the sources lived in sys/dev/apple_acpi/ with an
apple_ prefix. Every other vendor ACPI driver in the tree uses the
acpi_<vendor> form for both the directory and the file names.

No functional change.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D60792
44ceda0a53bfe0c9b343f1e94a4f6ce67f427be6 Abdelkader Boudih 2026-10-17 19:48:49

debug: classified in 03-filenames_plain1 by 'sys/dev/'

acpi_apple: make the device mode a typed enum
The two mode values were spelled as bit flags, but a device is exactly
one of the two and the dispatch compared the field for equality.

Turned them into an enum, type the softc field with it, and dispatch with
a switch that lists every value

No functional change.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D60793
4a059dac78157e6163d6e8ed6e7be5ec65a78a5f Abdelkader Boudih 2026-10-17 19:49:19

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #15: iwm
iwm: fix incorrect mutex / crash use during error detach path

My previous commit (b3ef4013a4) added a couple of lock assertions.
However, the detach assertion is wrong - if the driver hasn't
attached then detach needs to be a no-op and this includes
not touching a deinit'ed mutex.

So, move the mutex check and use until after the attached check.

This fixes the driver crash I saw when another bit of in-flight
work caused attach to fail, and thus iwm_detach() -> iwm_detach_local()
ended up trying to use a deinit'ed mutex, leading to a crash.

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

Differential Revision:  https://reviews.freebsd.org/D60821
37337c4994745b8143f240fd1b9f64c4255b58fc Adrian Chadd 2026-10-17 21:31:45

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: ensure NIC is alive during txq enable

I broke this in a previous commit.  OpenBSD already has the NIC
nailed alive but FreeBSD's codebase currently does not.

Locally tested:

* 7260, 9260, STA mode

Fixes: https://cgit.freebsd.org/src/commit/?id=0a12ff65b9647a6e31471e5d27a8692b4adb6803

Differential Revision:  https://reviews.freebsd.org/D60823
176fd23c88e8f7e3736389547c4a2990736911e7 Adrian Chadd 2026-10-17 21:32:01

debug: classified in 03-filenames_plain1 by 'sys/dev/'


iwm: mask closed_rb_num to the RX ring size

iwm_notif_intr() reads hw = le16toh(sc->rxq.stat->closed_rb_num) & 0xfff and
loops while (sc->rxq.cur != hw) without masking hw to the ring size (512 entries
for 9000-series MQ RX, 256 for legacy). If the hardware reports a value at or
above the ring size, cur never equals hw: the loop walks stale ring entries
indefinitely and the write-pointer update uses a bogus index. Linux iwlwifi
masks the value (5eae443eb5e2) and OpenBSD has done the same since 9000-series
support was added (3287dca4fa10).

This was found while debugging an iwm crash on another BSD using the same
driver lineage (DragonFly, upstream bug 3449)

Locally tested:

* 7260, 9260, STA mode

PR: kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299427
Submitted by: David Bidner <david@crap.solutions>

Differential Revision:  https://reviews.freebsd.org/D60824
461da47e45e7f8ef8754875f4820d3855e7f4097 Adrian Chadd 2026-10-17 21:32:51

debug: classified in 03-filenames_plain1 by 'sys/dev/'

null.c: fix signature mismatch for null_read
Reviewed by:    jhb
Differential Revision: https://reviews.freebsd.org/D49168
7af3fd0993a49cce7a749dfb62e9b17ca3a6be1f ShengYi Hung 2025-02-28 14:56:45

debug: classified in 03-filenames_plain1 by 'sys/dev/'

powerpc: keep the VSX halves of the FPRs across back-to-back signals
grab_mcontext() only put the second halves of vs0-31 into the context
while the thread owned the VSX unit, but sigreturn(2) gives ownership
up so that the next use reloads the registers lazily. A signal that
arrives right after a sigreturn, like one the handler's mask was
holding back, got a context without them and its own sigreturn then
zeroed them in the PCB.

The halves saved in the PCB are current whenever the FP state is, since
VSX instructions can't run without PCB_VSX and save_fpu() stores them
in that case, so export them together with the FP registers.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60754
64b2fea9a2f90c2cc6097ed2d69acbfeeb13058d Piotr Kubaj 2026-10-15 19:18:16

debug: classified in 03-filenames_plain1 by 'sys/powerpc/'

iwn: fix TX QoS AC -> TID mapping for A-MPDU selection
Map the packet QoS value to a TID before looking it up in the
per node + TID AMPDU state array.

The TX A-MPDU state used to be per-AC, but I changed it to be
per-TID because it /is/ negotiated per-TID.  However this is
not aligned correctly and A-MPDU on eg the voice queue would
cause a mismatch and thus packets to get dropped.

(TIDs 8..15 are special and session based, not traffic QoS based.)

I noticed this because "ssh host" failed after a while, but
"telnet host 22" succeeded.  It turned out that frames weren't
making it to the driver transmit path and I traced it
back to being dropped here.  Traffic worked for a while until
A-MPDU TX was negotiated, and then all traffic on a TID
would fail until the 802.11 association was re-established.

Locally tested:

* iwn 6205, STA mode - forced traffic into VO AC/TID

MFC after: 1 week

Differential Revision:  https://reviews.freebsd.org/D60848
c78d70298edef4c599b503536d193caeb8204784 Adrian Chadd 2026-10-19 00:34:46

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Add loongarch64 as an optional boot-test.sh arch
D59889 brings up a FreeBSD/loongarch64 EFI loader, none of it in
this tree yet. Add a disabled config entry (excluded from -A, usable
via -a once the port lands) using the confirmed QEMU virt/la464
recipe; hw/loongarch/virt.c defaults to virtio-blk/net, so the
existing generic EFI+GPT builder needs no arch-specific QEMU code.

loongarch64 has never had a FreeBSD release, so
install_minimal_userland's ISO extraction can never find one. Split
it into ISO and installworld-cross-build paths, selected by a new
no_release capability, so archs without a release can still get a
minimal userland.

Differential Revision:  https://reviews.freebsd.org/D59923
041802b362aab8786419618ead6e50c389eb875a Warner Losh 2026-10-19 07:03:19

debug: Commit manually moved from "unknown" to "hardware".

sound examples: trigger dsp devices via syncgroup
Triggering is only needed if device is in mmap mode, and in mmap example
the device is triggered as part of syncgroup. For non-mmap mode,
triggering is not needed at all. Triggering mmap'ed device too early
would start the IPTR/OPTR counters and that would cause those pointers
to be out of sync, so let syncgroup do the triggering once the device is
fully configured and ready for capture and playback.

MFC after:      1 week
Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D60839
d3aa926bffd20e4ef0e12e3ee9af1707ad234cda Goran Mekić 2026-10-19 08:59:36

debug: classified in 05-summary-prefix by 'sound examples:'

uart: support Meteor Lake-P LPSS UART 0
Recognize Intel 8086:7e25 using 32-bit MMIO with a four-byte register
stride. Deassert the LPSS functional resets and program the 100 MHz
reference clock divider for a 44.2368 MHz UART clock before the UART
core claims the register window, and reprogram both on resume.

Reviewed by:    imp, adrian
Differential Revision:  https://reviews.freebsd.org/D60858
b37e8ffbd9d4c46c4dc36842a9721fa766e0e61e Abdelkader Boudih 2026-10-19 15:14:58

debug: classified in 03-filenames_plain1 by 'sys/dev/'

intel: add a shared header for the LPSS private registers
The Intel Low Power Subsystem wraps its I2C, SPI and UART functions in a
block of private registers that control the functional clock and the
function and DMA resets.

Refactored to use a single header

Reviewed by:    imp, adrian
Differential Revision:  https://reviews.freebsd.org/D60859
6690cbdc649e7d0b23d96e1490b72068fc791a95 Abdelkader Boudih 2026-10-19 15:15:09

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amd64: Don't probe MSR_IRPERF when running under bhyve
vmm doesn't implement it, and bhyve simply aborts.  I fixed this in
commit c83e075d72f6, but it'll still be impossible to boot newer FreeBSD
guests on older hosts without this workaround.

Reviewed by:    adrian
Fixes:          https://cgit.freebsd.org/src/commit/?id=2272fac218a8 ("hwpmc: Add support for AMD-only IRPERF in hwpmc PERF class")
Differential Revision:  https://reviews.freebsd.org/D60730
32f7bddb443ad7ddc72fa65ab0eb3a3658703cc7 Mark Johnston 2026-10-19 13:59:41

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

rk_spi: Do not change the clock with the driver lock held
The clock framework can sleep, it takes the clock topology sx lock.  Calling
clk_set_freq() and clk_get_freq() from rk_spi_hw_setup() with the driver
mutex held triggers a witness warning about a sleepable lock acquired after
a non-sleepable one, on the first transfer that raises the clock.

Set the clock in a new function that is called before taking the lock, and
only keep the register setup under the lock.
6aa2c651df0b0d9e0f8693dbab09d11ecea8e1f8 Emmanuel Vadot 2026-10-20 11:35:59

debug: classified in 03-filenames_plain1 by 'sys/dev/'

wg: fix the LINT-NOIP build
We don't have anything to tunnel without INET or INET6, so just smack
it with the same config(5) hammer that ovpn uses and exclude it from
such builds.

Reported by:    mjg
Reviewed by:    emaste, markj
Differential Revision:  https://reviews.freebsd.org/D60896
8430de47aa7c004e1330b8f6a3018c360425606e Kyle Evans 2026-10-20 14:34:03

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amd64/vmm: Port vlapic interface changes from illumos (duplicate)
This is a port of the bits related to vlapic-enablement of the following
bhyve improvement from illumos:

  14598 bhyve vlapic should handle APICBASE changes
  https://www.illumos.org/issues/14598

A LAPIC can be enabled/disabled in two ways:
  - by the global-enable bit in the APICBASE MSR
  - by the software-enable bit in the APIC's SVR register

This change allows distinguishing between both forms of enablement where
that matters. The more involved changes to allow guests to modify the
APICBASE MSR are not included at this time.

Reviewed by:    corvink, markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56347
a11b901f5a46de33d53899200744252424a37efe Hans Rosenfeld 2026-10-20 15:11:52

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

hv_kvp: Fix some bugs and nits
- Use pending_mutex to synchronize several state flags.  In particular,
  ensure that two threads can't race to open the device file at the same
  time.[1]
- Fix an off-by-one in hv_kvp_dev_daemon_read() that would result in a
  one-byte OOB read if the caller supplied a large enough read buffer.[2]
- Change the device permissions to 0600: hv_kvp_dev_daemon_read()
  returns an error until the owning process registers itself with a
  write, so there's no sense in providing read-only access.
- Use bool instead of boolean_t.
- Don't return negative error numbers to userspace.
- Call seldrain() when closing the device.

Reported by:    pixelpop [1][2]
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60387
ebf1041fc854c531a27efd9f979e28d57306777d Mark Johnston 2026-10-20 15:30:38

debug: classified in 03-filenames_plain1 by 'sys/dev/'

x86: ipi_bitmap_handler(): Preempt last, reduce critical section
Preemption should happen last so that other IPIs have a chance to be
executed in due course, in particular hardclockintr().  So, move
handling of IPI_PREEMPT at the end.

Reduce the critical section to be in force only around hardclockintr(),
which needs it to execute entirely without preemption (because of code
it calls that can enter a critical section; interrupts are already
disabled in this handler, as usual).

The critical_exit() following hardclockintr() may cause preemption if
due.  If that happens, there is no need to preempt again on IPI_PREEMPT,
so make sure sched_preempt() is not called in this case.

This fixes inadvertent removal of the optimization that sched_preempt()
should be called outside of a critical section to perform an immediate
context switch in the case of IPI_HARDCLOCK and IPI_PREEMPT being
handled at the same time.

While here, move IPI_AST handling just before IPI_PREEMPT.  We currently
do not need to do anything for it, but if we were to, it is likely that
would have to happen after other IPIs but IPI_PREEMPT.

Reviewed by:    kib
Fixes:          https://cgit.freebsd.org/src/commit/?id=ff326a187907 ("x86: Restore the critical section around ...")
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60861
b83bd6fec075f4acf614283cd66a691111847881 Olivier Certner 2026-10-13 14:32:15

debug: classified in 03-filenames_plain1 by 'sys/x86/'

Commit group #16: x86: ipi_bitmap_handler(): Account for IPIs correctly on COUNT_IPIS
x86: ipi_bitmap_handler(): Account for IPIs correctly on COUNT_IPIS

A preemption could occur before the updates to the initial CPU's IPI
counters, leading to a potential non-atomic updates of these counters
from another CPU.

Reviewed by:    kib
Fixes:          https://cgit.freebsd.org/src/commit/?id=ff326a187907 ("x86: Restore the critical section (...)")
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60862
3a0e2ca3eecd3176fa7dd139e59913a67c858ac9 Olivier Certner 2026-10-13 14:46:26

debug: classified in 03-filenames_plain1 by 'sys/x86/'


x86/mp_x86.c: unbreak COUNT_IPIS

Fixes:  https://cgit.freebsd.org/src/commit/?id=3a0e2ca3eecd ("x86: ipi_bitmap_handler(): Account for IPIs correctly on COUNT_IPIS")
40582412d3fc6c68bb5c90fa7878998ba7f799e3 Konstantin Belousov 2026-10-20 20:42:00

debug: classified in 03-filenames_plain1 by 'sys/x86/'

powerpc: powerpc_ipi_handler(): Stop first, preempt last
Preemption should happen last so that other IPIs have a chance to be
executed in due course, in particular hardclockintr().  So, move
handling of IPI_PREEMPT at the end.

An IPI_STOP/IPI_STOP_HARD request should be processed immediately to
avoid risks that further processing changes the system state on panic,
or worse itself causes another panic on corrupted kernel state.

While here, move IPI_AST handling just before IPI_PREEMPT.  We currently
do not need to do anything for it, but if we were to, it is likely that
would have to happen after other IPIs but IPI_PREEMPT.

Reviewed by:    jhibbits
Fixes:          https://cgit.freebsd.org/src/commit/?id=9d5a22b928c2 ("MFp4: SMP support")
Fixes:          https://cgit.freebsd.org/src/commit/?id=12640815f815 ("MFp4: SMP support")
Fixes:          https://cgit.freebsd.org/src/commit/?id=7ed09a6778d3 ("powerpc: Rework IPI message processing")
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60863
07ab87b60d08c665eab0b187e81a239145f9961d Olivier Certner 2026-10-17 17:38:59

debug: classified in 03-filenames_plain1 by 'sys/powerpc/'

arm64: Fix EFI runtime mappings with 16K pages
Map complete EFI descriptor ranges at the kernel page granularity
and merge compatible entries when 4K EFI regions share a kernel page.
Preserve execution when any sharing region requires it and reject
conflicting mapping attributes without panicing.

This gets my small N1 booting with 16K pages.

Reviewed by: chs, imp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D60749
ef7d7011ce2fa48ab072c5e802ac00ccb25c4c48 Andrew Gallatin 2026-10-20 18:54:01

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

nvme: Fix default is_storage_device kobj method
makeobjops.awk only accepts an uppercase DEFAULT before a default kobj
method. This commit fixes a typo introduced in 949804c81909 so non-PCI
drivers actually use nvme_is_storage_device_default instead of
kobj_error_method. Note that even though kobj_error_method returns
ENXIO (6), it does not get implicitly cast to a bool due to the function
pointer casting in the nvme_if.h generated by makeobjops. Instead the
codegen for the NVME_IS_STORAGE_DEVICE callsite shows that only the
lowest bit is being checked as if it were always a bool. Without this
any nvme driver that doesn't implement is_storage_device is not treated
as a storage device.

Reviewed by:    imp, kevans
Differential Revision:  https://reviews.freebsd.org/D60112
775e421dc38f18fa6b7fdc7b214a013cca44b58b Ayrton Munoz 2026-10-22 16:40:50

debug: classified in 03-filenames_plain1 by 'sys/dev/'

fdt: Support SCMI shared memory under reserved-memory nodes
Add a simplebus-based pseudo-bus that matches the "reserved-memory"
node in the device tree.  Update the SCMI shared memory driver so that
it can attach either as a child of mmio_sram or directly under
simplebus (via the new reserved-memory bus). Make the mmio_sram memory
resource shareable so both attachment methods can coexist when required.

MFC after:      1 week
Reviewed by:    manu
ffcd78861eda41d5ff00a39120f46dbbe8f814b5 Michal Meloun 2025-12-06 16:50:36

debug: classified in 03-filenames_plain1 by 'sys/dev/'

ixl(4): Fix NVM update API
Driver provides an interface for tools operating on adapters'
Non-Volatile Memory using SIOC(G|S)DRVSPEC ioctls. It allows
tools to issue Admin Queue commands to the firmware, which
may return an error code encoded as a negative integer.
The driver passed this negative integer as the return value
of the ioctl handler. This was causing issues because the FreeBSD
kernel reserves negative error codes in system calls for special
purposes such as restarting the handler or detecting incorrect
behavior in VFS operations. Simple remapping of negative values
to positive integers caused currently available tools to misbehave
and could break the NVM update process. Introduce a new API version,
which allows new versions of tools to detect the fixed driver.
Temporarily keep the old API, but issue a warning that tools need
to be updated.

Also refactor the code to use centralized cleanup and move the
debug message from the firmware earlier to make sure it is not masked
by an error from copyout.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Tested by:      Mateusz Moga <mateusz.moga@intel.com>
MFC after:      2 weeks
Assisted by:    Copilot GPT 5.4
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D57942
8e55febde6b54685fe24c8b48ed6720bae97c491 Krzysztof Galazka 2026-10-05 09:22:10

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #17: smsc
smsc: Remove phy address check in smsc_miibus_writereg

The driver only allowed writes to the expected phy (i.e., sc->sc_phyno),
and reads were never filtered.  sc_phyno is already passed to
mii_attach() as phyloc, so nothing tries to issue MDIO writes to other
addresses and the check is not required.

Remove the check in advance of supporting external PHYs at arbitrary
addresses.

Tested on Microchip's EVB-LAN9500A-LC LAN9500A evaluation board.

Sponsored by:   The FreeBSD Foundation
Sponsored by:   Microchip (Hardware)
Differential Revision: https://reviews.freebsd.org/D60743
13011cbf7d80cd1554d87296225ceccb3f7524b4 Ed Maste 2026-10-15 13:31:41

debug: classified in 03-filenames_plain1 by 'sys/dev/'


smsc: Support external PHY

SMSC_HW_CFG_PSEL indicates that an external PHY is present. Skip the
internal PHY initialization when set and store the ID of the detected
PHY.

Reviewed by:    br
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60744
dc4c75c9a3c3611af451da13990e49e267551475 Ed Maste 2026-10-14 01:04:24

debug: classified in 03-filenames_plain1 by 'sys/dev/'


smsc: Use read-modify-write to configure LEDs

After reset the driver enables three LED outputs by writing 1s to
the appropriate GPIO/LED configuration bits in the LED & GPIO
configuration register LED_GPIO_CFG.

The LED Select (LED_SEL) bit in LED_GPIO_CFG chooses between two LED
modes:

0: Speed, Link+Activity, Full Duplex
1: Speed, Link, Activity

If an EEPROM is present LED_SEL is initialized from bit 1 in the
EEPROM's configuration flags value.  If no EEPROM is present this bit
defaults to zero.

Previously we wrote to all bits in the register, clearing LED_SEL.  A
device with LED_SEL set by the EEPROM would thus not have correct LEDs.

Now we read the current value of LED_GPIO_CFG and just set the three
LED configuration bits, as Linux does in commit 52a2f0608366 ("net: usb:
smsc95xx: fix changing LED_SEL bit value updated from EEPROM").

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60828
10ceddaa94d5b234dde897a3eb90ca57700636d8 Ed Maste 2026-10-16 17:52:04

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amdsmu: Don't rely on s0i3_last_entry_status metric
This metric seems unreliable and I have observed it occasionally report
1 (successful entry to S0i3) when the time_last_in_s0i3 metric was 0 on
Phoenix, which does not make sense.

So just rely on time_last_in_s0i3 instead.

Sponsored by:   The FreeBSD Foundation
cb77c4e846d420af4d7d43f6616da213689a734b Aymeric Wibo 2026-10-23 23:56:58

debug: classified in 03-filenames_plain1 by 'sys/dev/'

arm64 linux: Allow FUTEX_REQUEUE on arm64 by setting the brand flag
Better change is to provide the dedicated musl brandinfo, as it is done
on amd64/i386, which should be done later.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299836
MFC after:      1 week

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

smsc: Allow 10BASE-T1L/-T1S media
These are Single-Pair Ethernet types (SPE) from 802.3cg. smsc sets the
link flag only if mii_media_active is one of a known set of media types.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60745
81f86c9a9417d7ad7445d46739e19a26ab916e6b Ed Maste 2026-10-14 17:12:34

debug: classified in 03-filenames_plain1 by 'sys/dev/'

x86: make machine/sysarch.h usable from assembler
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
dc1514eda55c5a2439cb5b8fa5c08e78468b7d3b Konstantin Belousov 2026-10-25 01:49:59

debug: classified in 03-filenames_plain1 by 'sys/x86/'

snd_hda: Identify AMD Audio Coprocessor
This makes the driver attach, but the device is still not usable.

Reported by:    Lukasz Wencki <lukasz@smail.net.pl>
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
8dac0bdb4df0815e14db219e9a7fb5d0be5737b8 Christos Margiolis 2026-10-25 10:21:20

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amdsmu: Print detailed stats for KRACKAN_POINT
Testing on a Dell AMD Ryzen AI 5 PRO 435 laptop shows that the same
diagnostic information is valid.

Reviewed by:    obiwac
Sponsored by:   The FreeBSD Foundation
ce9de516eef333041d66a87dfb0aa4818cc5044f Ed Maste 2026-10-23 18:41:34

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amdsmu: Update diagnostics comments for Krackan Point
Krackan Point has the same quirks as the Phoenix SMU it would seem.

Reported by:    emaste
Sponsored by:   The FreeBSD Foundation
b86f3d6ae8e2f1c64c2f230e59c582e8553a3062 Aymeric Wibo 2026-10-26 14:08:49

debug: classified in 03-filenames_plain1 by 'sys/dev/'

riscv: Map the DTB when it is outside the kernel's 1GB region
When the kernel is started directly by SBI firmware, locore.S maps only
the 1GB region that contains the kernel, and initriscv() reads the DTB
through that mapping at the physical address passed in a1.  If the
firmware put the DTB in another 1GB region, as QEMU does with more than
1GB of RAM, fake_preload_metadata() faults before the console is up and
the kernel hangs.

Also map the 1GB region that contains the DTB.

This fixes direct kernel booting without FreeBSD loader(8).

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299088
Reviewed by:    mhorne
Fixes:          https://cgit.freebsd.org/src/commit/?id=bfb857546984 ("riscv: Construct an identity map in locore.S")
MFC after:      1 week
Signed-off-by:  Rick Richard <rick@sloservers.com>
509d65fae512c24fc755d6a8b3b41bb967e6c5e1 Rick Richard 2026-10-03 16:00:00

debug: classified in 03-filenames_plain1 by 'sys/riscv/'

amdsmu: Use devclass name instead of module name
The diagnostics array contained expected modules to be loaded but the
checking logic checked for if a devclass of that name existed instead.

Have the diagnostics array contain the devclass instead as well as the
module to load for the hint string.

Furthermore, check tha the number of devices is greater than 0 so that
leftover devclasses from unloaded modules don't skip the hint.

Reported by:    emaste
Reviewed by:    emaste
Fixes:  https://cgit.freebsd.org/src/commit/?id=758578370f6b ("amdsmu: Hints on what to do if IP block blocking S0i3")
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/70
9a4bb77040f074f6e842a54f8aedf7a24c0eab42 Aymeric Wibo 2026-10-24 00:02:52

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #18: ocs_fc: Harden ioctl, XRI lookup and FCP command validation
ocs_fc: Harden ioctl, XRI lookup and FCP command validation

Fix several issues found by security review of the driver.

ioctl:
- Require PRIV_DRIVER for all ocs ioctls and create the device node
  with mode 0600, group wheel.
- Return the error from ocs_process_sli_config() to the caller.
  Previously only ENXIO was propagated, so a failed validation or a
  failed copyin() still issued the mailbox command, in the latter case
  with a descriptor pointing at freed memory.
- Reject COMMON_WRITE_OBJECT when in_bytes exceeds
  desired_write_length, and cap WRITE_OBJECT, READ_OBJECT,
  READ_OBJECT_LIST and non-embedded mailbox buffers at
  OCS_MAX_DMA_ALLOC, returning EINVAL.
- Use a 64-bit size for the non-embedded mailbox buffer to avoid
  truncation of a user supplied length.
- Refuse to copy out more than the size of the DMA buffer allocated
  for the command.
- Range check the BAR offset in the ECD helper ioctl.

HW:
- Range check the XRI in ocs_hw_io_lookup() and return NULL when it is
  out of range.  Handle a NULL return in the auto xfer ready command
  and data paths (returning the RQ buffers in the former), and in
  ocs_hw_reclaim_xri().
- Make ocs_ref_get_unless_zero() atomic.

FCP:
- additional_fcp_cdb_length is in 4-byte words, but
  ocs_validate_fcp_cmd() added it to the expected payload length as
  bytes, so the length check under-validated the received frame.
- Drop commands with a CDB longer than CAM_MAX_CDBLEN instead of
  passing a truncated CDB to CAM.

MFC after:      1 week
Sponsored by:   Broadcom
Reviewed by:    ken
26081296b244a979732f2bd09e6def256e3d7bd4 Ram Kishore Vegesna 2026-10-14 11:24:07

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ocf_fc: Fix up max() usage

max() truncates its parameters to 32-bit integers.

Reviewed by:    ram
Sponsored by:   The FreeBSD Foundation
Fixes:          https://cgit.freebsd.org/src/commit/?id=26081296b244 ("ocs_fc: Harden ioctl, XRI lookup and FCP command validation")
9b6b3a36ee295dc6edd0e00aa34adaebaed98c7d Mark Johnston 2026-10-27 16:47:19

debug: classified in 03-filenames_plain1 by 'sys/dev/'

ocs_fc: Fix config space bounds, double PRLI response and a stack overflow
Fix three unrelated problems found by security review of the driver.

ECD helper ioctl:
- OCS_ECD_HELPER_CFG_READ* and OCS_ECD_HELPER_CFG_WRITE* passed a user
  supplied offset straight to pci_read_config() and pci_write_config().
  Reject accesses that extend past PCIE_REGMAX, so that a wide access
  starting in range cannot run past the end of config space.
- Use the real access width (1, 2 or 4 bytes) of the command for both
  the BAR and the config space checks, rather than assuming 4 bytes, so
  that narrow accesses at the very end of the BAR or config space are
  not rejected while wider ones remain bounded.

PRLI:
- When a PRLI carries an FC-4 type other than the one the driver
  supports, ocs_d_send_prli_rsp() sent an LS_RJT and started node
  shutdown, but then fell through and sent a second response on the same
  IO (another LS_RJT, or a PRLI LS_ACC when the initiator is accepted),
  followed by a conflicting transition to __ocs_d_device_ready.  The two
  responses posted two WQEs for one IO and caused a double ocs_ref_put(),
  a use after free of the ELS IO.  Return after dispatching the LS_RJT so
  that exactly one response is sent.
- __ocs_d_port_logged_in calls ocs_d_send_prli_rsp() without checking
  the FC-4 type, so any port that has completed a PLOGI can trigger this
  with a single PRLI, whether or not target mode is enabled.

Management:
- The active profile id is a uint32_t that is formatted as "0x%02x"
  with sprintf() into a buffer of MAX_PROFILE_LENGTH (5) bytes, which
  overflows for any id above 0xff.  Size the buffer for the longest
  possible string ("0x" plus 8 hex digits and the terminating NUL) and
  use ocs_snprintf().
- Use ocs_snprintf() for nv_wwpn as well, as nv_wwnn already does.

MFC after:      1 week
Sponsored by:   Broadcom
Reviewed by:    ken
039a8e11f887e359af1346b04e05180b9a49920c Ram Kishore Vegesna 2026-10-19 17:29:31

debug: classified in 03-filenames_plain1 by 'sys/dev/'

sound: Let pcm_unregister() tear down a partially initialized device
Since 3107b952f534 ("sound: Merge PCM_ALIVE() with PCM_REGISTERED()"),
pcm_unregister() is gated on PCM_REGISTERED(), so it cannot run unless
pcm_register() has already succeeded, which means drivers will leak
resources if a failure happened prior to this.

Reintroduce PCM_ALIVE(), but test dev rather than the lock. pcm_init()
assigns dev before anything else, so it can tell us whether pcm_init()
has run or not. Make sure to clear it in pcm_unregister() so that a
second call to pcm_unregister() cannot double-free.

While here, publish to sndstat(4) only once pcm_register() has
succeeded.

Reported by:    jah
Fixes:          https://cgit.freebsd.org/src/commit/?id=3107b952f534 ("sound: Merge PCM_ALIVE() with PCM_REGISTERED()")
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Reviewed by:    jah, markj
Differential Revision:  https://reviews.freebsd.org/D60801
5760c22a05220cfb6b6cbf623f2cda5047b28706 Christos Margiolis 2026-10-27 11:26:29

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amd64_cpu_init_fred(): set stack level for NMI and not #NM
Fixes:        https://cgit.freebsd.org/src/commit/?id=6e93f5e4d693 ("amd64: FRED support")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
787e2e411d2a169fd28581f9bbf1e87c51757303 Konstantin Belousov 2026-10-27 08:54:43

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

trap_fred_handle_k_exc(): handle #AC in kernel
Fixes:        https://cgit.freebsd.org/src/commit/?id=c6d7235ac15d ("amd64: handle #AC in kernel mode")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
e86a612d77ab34ecd96cce5fd0732999ffdd7fc0 Konstantin Belousov 2026-10-27 08:58:44

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

Commit group #19: amd64
amd64: do not allow to set IOPL to 3 when FRED is used

SDM requires that IOPL is zero when returning to usermode with ERETU.

Do not set rflags.iopl for FreeBSD io(4) open.
This might be changed to disallow io(4) open for FRED at all with a
knob, if there is a real need.

Return ENOSYS from linux iopl(2), apparently Linux kernel can be
configured without iopl(2) support, so linux programs should be prepared
for this error.

Return EINVAL from vt(4)/syscons(4) ioctl(KDENABIO).

Fixes:  https://cgit.freebsd.org/src/commit/?id=6e93f5e4d693 ("amd64: FRED support")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
5bc997b6f5b1265ff28d11405eb980bf471c3db4 Konstantin Belousov 2026-10-27 09:10:09

debug: classified in 03-filenames_plain1 by '['sys/amd64/', 'sys/dev/']'


amd64: fixes for register handling of syscall entry for FRED

- Save %r10 into tf_rcx.  This is the location for the 4th arg.
  libsys stubs do 'movq %rcx, %r10' so the fast syscall path works
  as is.  But Go binaries directly put arg 4 into %r10.
  Also save %r11 into tf_r11 for the duration of syscall handler.
- Somewhat improve binary compatibility with IDT SYSCALL fast return,
  by copying userspace return %rip into %rcx, and %rflags into %r11,
  emulating SYSCALL IDT delivery.

Fixes:  https://cgit.freebsd.org/src/commit/?id=6e93f5e4d693 ("amd64: FRED support")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
473cd1bba9b4e80b741769ff6185ba3846b1f050 Konstantin Belousov 2026-10-27 09:21:55

debug: classified in 03-filenames_plain1 by 'sys/amd64/'


amd64: do not pass SYSENTER frame to FRED fast syscall handler

With FRED, SYSCALL is delivered as event type syscall (7) and vector 1.
SYSENTER is syscall with vector 2.  Handle SYSENTER in slow path,
otherwise 32bit code is able to execute 64bit syscalls.

Also check that SYSCALL comes from the 64bit mode. Intel already
specifies that SYSCALL causes #UD in compatibility mode, but there is no
AMD specification for SYSCALL under FRED yet, and SYSCALL is allowed
in compatibility mode on AMD with IDT event delivery.

Fixes:  https://cgit.freebsd.org/src/commit/?id=6e93f5e4d693 ("amd64: FRED support")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
8671e823b7678731cd1aaf8850ccde4a2c293527 Konstantin Belousov 2026-10-27 10:08:14

debug: classified in 03-filenames_plain1 by 'sys/amd64/'


amd64: Make the SYSENTER and INTn action same as for IDT case.

Fixes:  https://cgit.freebsd.org/src/commit/?id=6e93f5e4d693 ("amd64: FRED support")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
73b3fb41e67a11f18b9b63a5265e174e4b688661 Konstantin Belousov 2026-10-27 10:08:14

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

virtio_p9fs: Mark response buffers as initialized for KMSAN
MFC after:    1 week
Sponsored by:   The FreeBSD Foundation
eca7cba74c95c8cd64c0ea4299984484784aa836 Mark Johnston 2026-10-26 22:24:06

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amd64: strictly enforce the caller's mode for FRED 64bit syscall handler in C
For FRED SYSCALL calls, check that the LM bit is set.

Note that this handler is redundant for 64bit mode since syscalls
are handled by the asm fast path. Intel CPUs raise #UD for SYSCALL
in the compatibility mode, and for AMD we set up the MSR_CSTAR to
fast_syscall32 for IDT case, which is nop. So practically it should only
matter if AMD CPUs with FRED enabled allow SYSCALL from compatibility
mode.

Reported and reviewed by:       markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
dcc5adb27e3b00f003c2256a9e9aa2fcc20c4d32 Konstantin Belousov 2026-10-28 00:45:33

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

smb(4): Add SMB Block Process Call command
Add support for the SMBus Block Process Call (bpcall) command. This
command writes a block of data to a slave device and reads a block of
data back in a single transaction, as defined in the SMBus 2.0
specification.

Add the SMB_BPCALL ioctl to the smb(4) character device to allow
userspace to issue Block Process Call transactions.

Implement ichsmb_bpcall() for the ICH SMBus controller using the
32-byte block buffer mode.  Older ICH variants (ICH, ICH0, ICH2, ICH3)
that lack the block buffer feature will return SMB_ENOTSUPP.

The PIIX4 compatible hardware (intpm) does not support Block Process
Call at all and returns SMB_ENOTSUPP unconditionally.

This has been tested on several Beckhoff Industrial PCs using real
SMBus hardware. It has been tested on Tigerlake, Elkhart and
Amstonlake Platforms.

Signed-off-by:  YannickV <Y.Vossen@beckhoff.com>
Reviewed by:    adrian, corvink, ziaee (manpages)
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2305
ad9ab26ab52a0a88933806c81f34d2670c0f69a9 YannickV 2026-06-26 06:52:44

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amd64 FRED: handle in-kernel faults same as IDT
Pass #MC and #DF directly to corresponding handlers, avoiding EFI
pcb_onfault case.

If a fault occurs while kdb/ddb is active, handler must call
kdb_reenter() and not do the normal processing, which typically ends up
in panic() for kernel-mode faults.  But #MC and #DF should be excluded
there as well.

NMI is not an exception, it is delivered as specific event.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
efb0c54c7694798214a2c130ec8461a34444e1c4 Konstantin Belousov 2026-10-28 13:58:49

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

amd64 resumectx(): restore FRED state before loading %cr4
%cr4 has the FRED enable bit. This only matters for NMI and #MC, and the
kernel is really not ready to handle them while in resumectx(), but do
it for formal correctness.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
2fd12bf2dd9c1cf997ce2505bc2af10572ca70e2 Konstantin Belousov 2026-10-28 14:05:50

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

Commit group #20: amd64 FRED
amd64 FRED: mark trap frame as initialized for KASAN/KMSAN

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
1c25a7f1cb2986901957cc1cdf7a0c0f99748a35 Konstantin Belousov 2026-10-28 14:28:01

debug: classified in 03-filenames_plain1 by 'sys/amd64/'


amd64 FRED: clear %dr6 on #DB from kernel

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
837bb27c93a58a2df2f5203393ffa245b93caf31 Konstantin Belousov 2026-10-29 00:57:52

debug: classified in 03-filenames_plain1 by 'sys/amd64/'


amd64 FRED: no need to store fs/gsbase on user_fred_not_syscall path

The stores are only relevant for PCB_FULL_IRET return to userspace,
and setting the flag stores the bases into the pcb anyway.  Also, the
hidden issue is that FRED already did implicit SWAPGS on entry, so
stored gsbase was wrong anyway.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
6ca697360b53ce4f952d2b178c5d34f75f8c50ec Konstantin Belousov 2026-10-29 01:01:05

debug: classified in 03-filenames_plain1 by 'sys/amd64/'


amd64 FRED: add missed newline in the diagnostic

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
0cfbb34a12e59851b0eba2c6671e39cb05095e29 Konstantin Belousov 2026-10-29 01:04:23

debug: classified in 03-filenames_plain1 by 'sys/amd64/'


amd64 FRED: re-wrap the comment

Fixes:  https://cgit.freebsd.org/src/commit/?id=837bb27c93a5 ("amd64 FRED: clear %dr6 on #DB from kernel")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
0213bd5e5639e855d4039212f0f3f6ad89c6d65a Konstantin Belousov 2026-10-29 02:04:13

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

amd64 db_nextframe(): classify user_fred_syscall frame as SYSCALL
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
b2767c7b022a8d7c03af8ee1b0fcd20d855d5433 Konstantin Belousov 2026-10-29 01:07:40

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

amd64 FRED: explain why %rax is saved early
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
6105e8589b2cd7f9001df045392c30fc86900633 Konstantin Belousov 2026-10-29 01:16:49

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

amd64 FRED: normalize the user-provided 'fred' knob value
Assembler accesses 'fred' as byte, ensure that any non-zero
user-provided value works.  This is pure cosmetics.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
78962f9b66d1f84b957ddac3f528f184ba1f4739 Konstantin Belousov 2026-10-29 01:26:04

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

Commit group #21: ena
ena: Limit IO IRQ setup loop to active queues only

The loop in ena_request_io_irq() iterated over adapter->msix_vecs,
which reflects the maximum number of MSI-X vectors allocated at
init time. When the number of IO queues is reduced at runtime via
the io_queues_nb sysctl, msix_vecs is not updated, causing the
driver to bind interrupts and log CPU affinity for queues that no
longer exist.

Replace the loop bound with ENA_IO_IRQ_IDX(adapter->num_io_queues)
to iterate only over the currently active IO queues.

Also replace the loop in ena_free_io_irq() the same.

Reviewed by: cperciva
Fixes: https://cgit.freebsd.org/src/commit/?id=56d41ad5fe9c ("Add sysctl node for ENA IO queues number adjustment")
MFC after: 3 days
Sponsored by: Amazon, Inc.
32c301922dc1e6f52bdd043046661ac1e2b462d8 Gilad Ben Yakov 2026-04-29 12:10:38

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ena: Retrieve RSS table size from device

The current driver assumes a default RSS table size of 128 entries,
expecting the device's RSS table size to match this assumption.

This patch allows the driver to create RSS indirection table
with the size advertised by the device.

Reviewed by: cperciva
MFC after: 3 days
Sponsored by: Amazon, Inc.
3d1e732a43eda16f20dea3fe2671ce6fca8a03a6 Gilad Ben Yakov 2026-03-30 12:12:50

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ena: Reinit RSS table on device restore when queue count shrinks

When ena_restore_device() is called after a reset, pci_alloc_msix()
may return fewer MSI-X vectors than requested, causing num_io_queues
to shrink. When this happens, the RSS indirection table retains
entries referencing queues that no longer exist, routing packets to
non-existent queues and causing connectivity loss.

Extract ena_set_io_queue_count() to pair the queue count update with
ena_com_rss_destroy(), ensuring the RSS table is always invalidated
when the queue count changes. Use it from both ena_update_io_rings()
and ena_restore_device().

Reviewed by: cperciva
Fixes: https://cgit.freebsd.org/src/commit/?id=e2735b095b7e ("Fix assumptions about number of IO queues in the ENA")
MFC after: 3 days
Sponsored by: Amazon, Inc.
2d4d2ed3fef6acda9269f545f6703d6f32f2f0b7 Gilad Ben Yakov 2026-05-05 10:02:13

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ena: Fix RSS not working after driver reload

When reloading the driver (kldunload/kldload),
ena_rss_init_default_deferred() is called before ena_attach()
completes. At this point, devclass_get_softc() returns NULL for all
devices because the adapter structs have not been populated yet. As a
result, ena_rss_init_default() is never called and ENA_FLAG_RSS_ACTIVE
is never set. Later, in ena_up_complete(), the code checks the flag,
finds it unset, and skips ena_rss_configure() entirely. RSS is never
initialized, and all traffic is directed to queue 0.

Remove the ENA_FLAG_RSS_ACTIVE gate in ena_up_complete() and always call
ena_rss_configure(), which initialises the table when tbl_log_size is
zero. The deferred SYSINIT is now redundant, so remove it.

Reviewed by: cperciva
Fixes: https://cgit.freebsd.org/src/commit/?id=9b8d05b8ac78 ("Add support for Amazon Elastic Network Adapter (ENA) NIC")
MFC after: 3 days
Sponsored by: Amazon, Inc.
a6205766b300e83d3aa2ddc740707987f3c3c97e Gilad Ben Yakov 2026-05-19 10:18:37

debug: classified in 03-filenames_plain1 by 'sys/dev/'

ena: Fix NULL deref before NULL check in RSS sysctl
In ena_sysctl_rss_indir_table(), the code dereferenced
indir->sysctl_buf before checking whether indir itself is NULL.
Move the NULL check above the dereference so the early-return path
fires before any access through indir.

Reviewed by: cperciva
Fixes: https://cgit.freebsd.org/src/commit/?id=6d1ef2abd330 ("ena: Implement full RSS reconfiguration")
MFC after: 3 days
Sponsored by: Amazon, Inc.
462b6c50c7089e96c54cbd34378467f32fc709d4 Evgeny Ostrovsky 2026-05-26 07:01:39

debug: classified in 03-filenames_plain1 by 'sys/dev/'

ena: Reinit RSS components during queue count change flow
The io_queues_nb sysctl is writable while the interface is down, and
setting it destroys the RSS components. When the interface is not UP
nothing reinitialises them, so the indirection table is left referencing
queues that no longer exist until the next ifconfig up.

Call ena_rss_configure() after the queue count changes when the
interface is down. When it is up, this happens through ena_up().

This can configure RSS twice if the interface is brought up afterwards,
costing three redundant admin commands. That is preferred over changing
ena_up(), which the reset path also uses.

Reviewed by: cperciva
Fixes: https://cgit.freebsd.org/src/commit/?id=56d41ad5fe9c ("Add sysctl node for ENA IO queues number adjustment")
MFC after: 3 days
Sponsored by: Amazon, Inc.
2a27dd0076c55789a43415559906f795fd10c2da Gilad Ben Yakov 2026-05-31 08:28:48

debug: classified in 03-filenames_plain1 by 'sys/dev/'

ena: Update driver version to v2.8.5
New Features:
* Retrieve RSS indirection table size from device

Bug Fixes:
* Limit IO IRQ setup loop to active queues only
* Reinit RSS table on device restore when queue count shrinks
* Fix RSS not working after driver reload
* Fix NULL deref before NULL check in RSS sysctl
* Reinit RSS components during queue count change flow

Minor Changes:
* Fix ENA_MEM_FREE_COHERENT with an expression size argument

Reviewed by: cperciva
MFC after: 3 days
Sponsored by: Amazon, Inc.
5e66bf0df3104e212c1b24ff65284b6d1a694c59 Arthur Kiyanovski 2026-10-22 02:52:37

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amd64 FRED: fix handling of ATPIC IRQ range when no atpic is configured
Do not fall back to lapic_handle_intr().  Ignore the interrupt from the
range same as it is done by apic_vector.S:spuriousint.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
bf074ee97407f24c200613470b3b7a24ce5a5242 Konstantin Belousov 2026-10-29 02:05:47

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

amd64: add helpers to set up thread state on trap
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
7f49a62e3c5ff15d87afcce9ab7fe787319a3f7f Konstantin Belousov 2026-10-29 02:16:42

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

amd64 FRED: handle INT 3, INT 4, and INT 0x92 same as for IDT
Userspace INT {3, 4, 0x92} have DPL 3 gate in IDT, so enable them for
FRED as well, matching the IDT action.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
32b9c967e07c7af2b6e421969d0e7ba1cc9b9425 Konstantin Belousov 2026-10-29 02:16:42

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

Commit group #22: rk_pinctrl: Fix the drive strength of the RK3568 pins
rk_pinctrl: Fix the drive strength of the RK3568 pins

The drive strength of the RK3568 pins was never programmed.  The drive-strength
property was tested with OF_getencprop() == 0 but that function returns the
size of the property on success, so the branch was dead code and the pins kept
whatever the previous stage of the boot left in the registers.

The register layout was also wrong: each pin has an 8 bits wide drive field
and a register holds two pins, but the value was shifted by pin % 2 bits
instead of (pin % 2) * 8 and the mask only covered six bits.  An odd pin would
have overwritten part of the field of the even pin next to it.

Test the size of the property, put the field at (pin % 2) * 8 and write the
whole 8 bits, like Linux does.

Tested on a Quartz64 Model A and on a NanoPi R5S.

Reviewed by:    mmel
e8f8b17c30184687e3f6dd02a72345bcad7e92aa Emmanuel Vadot 2026-10-27 14:27:57

debug: classified in 03-filenames_plain1 by 'sys/arm64/'


rk_pinctrl: Limit the RK3568 drive strength to the 8 bits field

A drive-strength above 7 made the value wider than the 8 bits field.  On an
odd pin the extra bits set the write enable of the even pin next to it, which
was then cleared.  Limit the level to 7, where the field is full, like Linux.

Reported by:    markj
Fixes:  https://cgit.freebsd.org/src/commit/?id=e8f8b17c3018
0b7888108cc24b49386967826ecc6e6568e4aeb8 Emmanuel Vadot 2026-10-30 06:45:28

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

rk_pinctrl: Fix the drive strength of the pins on the older SoCs
rk_pinctrl_parse_drive(), used for every Rockchip SoC but the RK3568, could
never succeed and so the drive-strength of the pins was never programmed:

- OF_getencprop() returns the size of the property, but the result was
  tested against 0.  A present property made the function return an error.
- The register offset of the matching table entry was never returned, so
  the caller used whatever was left in reg (the pull register or an
  uninitialized value).  Fixing only the first problem would have written
  the drive value in the wrong register.
- The table lookup skipped an entry only if both the bank and the subbank
  differed, so an entry matching only one of them could be used.

Test the size of the property, skip an entry if either the bank or the
subbank differs and return the offset of the entry.

Tested on a Rock64 (RK3328) by clearing the drive strength of the gmac pins
in U-Boot: without this change they stay at 2mA, with it they get the 4mA
and 8mA of the DTS and the rest of the GRF is unchanged.  On a RockPro64
(RK3399) the registers are unchanged, no pin of its default DTS is in the
tables of this driver that has a drive-strength.  Not tested on RK3288.

Note that the RK3399 tables only cover GPIO0 and GPIO1.  The other banks,
which have 3 bits per pin on some groups, are still not handled.

Reviewed by:    mmel
3a2528ae7a61b9423d10a1272aebcf1ada771839 Emmanuel Vadot 2026-10-29 06:49:39

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

ufshci: fix the WLUN peripheral lookup timeout
The timeout in ufshci_sim_find_periph() is uint64_t, making the
comparison of timeout - ticks with zero always false. If the requested
peripheral does not become available, the lookup can wait indefinitely.

Use an sbintime_t deadline based on sbinuptime() and mstosbt(), and
compare the current uptime directly with the deadline. Preserve the
successful lookup path and existing timeout cleanup.

On an HP 15-fd0118ca with Intel N150 and Samsung UFS 3.1 storage, a
kernel built from stable/15 revision 84aa3cb3204d with this change
logged the missing-WLUN timeout, attached da0 and mounted root in two
boot trials.

Signed-off-by:  Denis Lemire <denis@lemire.name>
Reviewed by:    jaeyoon
Fixes:          https://cgit.freebsd.org/src/commit/?id=31407551c3d4 ("ufshci: Add a check for WLUN during driver initialization")
MFC after:      3 days
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2520
8721f68642c392afa0413eafa3cefde66d65b6eb Denis Lemire 2026-10-29 06:14:18

debug: classified in 03-filenames_plain1 by 'sys/dev/'

clk: Add a clknode method to get and set the phase
Add clknode_get_phase/clknode_set_phase (and the clk_get_phase and
clk_set_phase consumer API) so that clocks which can shift their phase,
such as the MMC sample and drive clocks of some SoCs, can expose it.

Reviewed by:    mmel
Differential Revision:  https://reviews.freebsd.org/D60883
a2ae5a27ce0898221e2fdbf7fdf2aee6a9925096 Emmanuel Vadot 2026-10-20 08:09:18

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #23: clk: rockchip: Add the MMC phase clock
clk: rockchip: Add the MMC phase clock

Add a clock node type for the Rockchip MMC sample and drive clocks.  These
clocks have a phase in degrees controlled by a delay line and a fine-grained
phase selector, and implement the new clknode phase methods.

Reviewed by:    mmel
Differential Revision:  https://reviews.freebsd.org/D60886
e32b082ba28bd3d0e026782eeb93f124ced7508f Emmanuel Vadot 2026-10-20 08:09:18

debug: classified in 03-filenames_plain1 by 'sys/dev/'


clk: add config(5) entry for `rk_clk_mmc.c`

This is needed in order to unbreak the build on armv7.

Reported by:    Jenkins
Fixes:          https://cgit.freebsd.org/src/commit/?id=e32b082ba28b ("clk: rockchip: Add the MMC phase clock")
acc54751190f1a26c31873a49d42922e0fcad483 Enji Cooper 2026-11-01 00:57:19

debug: classified in 03-filenames_plain1 by 'sys/arm/'

vtnet: honor the advertised MTU limit on attach
When VIRTIO_NET_F_MTU is negotiated, virtio_net_config.mtu specifies
the maximum MTU the driver may use. vtnet_ioctl_mtu() enforces this
limit for subsequent MTU changes, but ether_ifattach() unconditionally
initializes the interface MTU to ETHERMTU (1500).

So a device advertising a maximum below 1500 starts with an MTU above
its limit. So make sure to set the initial MTU no larger than
vtnet_max_mtu. That is, for vtnet_max_mtu less than 1500
interface MTU will be set to this value, otherwise the current behaviour
is preserved, MTU will be set to 1500.

Reviewed by:    kfv, tuexen
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60980
0974ef03b43f279f16289ad4d5be3a03923983ea Roman Bogorodskiy 2026-10-29 18:24:15

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #24: amd64 FRED
amd64 FRED: get out of NMI blocking mode unconditionally

When NMI interrupted userspace (ring 3), unconditionally unblock NMI,
not only for the pmc backtrace sampling. Return to userspace needs
to deliver ASTs and do userret(), which should not be done with NMIs
blocking.

Note that NMI from ring 3 is always delivered at stack level 0, i.e. the
thread's kernel stack.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
880d2991661de74e1f800db867dc9d0eda7b1bc9 Konstantin Belousov 2026-10-30 12:43:44

debug: classified in 03-filenames_plain1 by 'sys/amd64/'


amd64 FRED: use symbolic constant for the NMI unblocking bit for ERETS

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
614b6597e7025b5b1dd23f058e53e8c28dc28efe Konstantin Belousov 2026-10-30 12:46:52

debug: classified in 03-filenames_plain1 by 'sys/amd64/'


amd64 FRED: enable interrupts after user EXTINTs and NMIs

This is needed to run userret() with interrupts enabled.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
91d9fbb6e1537009c35ec0c1c37ca09b28c0b31d Konstantin Belousov 2026-10-30 13:01:15

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

lan867xphy: New driver for Microchip LAN8670/1/2 10BASE-T1S PHYs
10BASE-T1S is a Single Pair Ethernet (SPE) standard, intended for
automotive and industrial applications.  It supports a multidrop "mixing
segment" of at least 25m with up to 8 nodes.

This driver currently does not support per-silicon-revision config or
PHY-Level Collision Avoidance (PLCA), but is sufficient for establishing
basic connectivity.

Device details are available in the "Microchip LAN8670/1/2 10BASE-T1S
Ethernet PHY Transceiver Datasheet".

Reviewed by:    adrian
Differential Revision: https://reviews.freebsd.org/D60979
83d0eed501060a733753c57c85da3abab4c973ad Ed Maste 2026-05-04 22:45:56

debug: classified in 03-filenames_plain1 by 'sys/dev/'

smsc: Add Microchip EVB-LAN8670-USB 10BASE-T1S USB adapter
Reviewed by:  adrian
Sponsored by:   The FreeBSD Foundation
e3ba0d3eb0883c3fd524159e156d6bc119861d7c Ed Maste 2026-05-04 15:34:34

debug: classified in 03-filenames_plain1 by 'sys/dev/'

hwpmc: include PMC_CLASS_PERF in the PMC class range
PMC_CLASS_PERF (0x1a) was added after PMC_CLASS_RAPL, but
PMC_CLASS_LAST was left at PMC_CLASS_RAPL.

Signed-off-by:  Osvaldo Janeri Filho <ojanerif@amd.com>
Reviewed by:    Anderson Nascimento <anascime@amd.com>, mhorne
Fixes:          https://cgit.freebsd.org/src/commit/?id=5369f8e73eff ("hwpmc: add MPERF/APERF MSR support for AMD/Intel CPUs")
Sponsored by:   AMD
Differential Revision:  https://reviews.freebsd.org/D60546
ed8b9bf5f076609a2ba6f07dd9733ccb795f400a Osvaldo Janeri Filho 2026-10-30 14:10:39

debug: classified in 03-filenames_plain1 by 'sys/sys/pmc.h'

uether: Handle SIOCGIFXMEDIA
Commit eb7e25b22f1 ("ifmedia changes:") added SIOCGIFXMEDIA for extended
Ethernet media subtypes, but uether_ioctl() was not updated to pass it
to ifmedia_ioctl().  I believe no existing USB Ethernet devices used
extended subtypes, so this went unnoticed.

Without SIOCGIFXMEDIA ifconfig falls back to SIOCGIFMEDIA, which maps an
extended subtype to IFM_OTHER, and ifconfig reports "Ethernet Other."

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60779
91431aa03605383ecfcbf1b9b2be69ab47e56a08 Ed Maste 2026-10-16 15:17:44

debug: classified in 03-filenames_plain1 by 'sys/dev/'

e1000: Honor the common RSS hash-field policy
Use rss_gethashconfig() to select MRQC hash fields in both the em and
igb multiqueue paths, including kernels built without options RSS.

igb previously enabled UDP four-tuple hashing unconditionally, while
the stack defaults to hashing only the addresses unless
net.inet.rss.udp_4tuple is enabled.  Honor that setting and include the
configured IPv6 extension-header address hash.

Limit the 82574 mapping to its supported fields.  Its TCP/IPv6 selector
is bit 18, named IPV6_TCP_EX in the shared definitions; bit 21 and the
UDP selectors are reserved.  Its default field selection is unchanged.

MFC after:      3 days
Sponsored by:   BBOX.io
86bdf7a4aec5223b016791ffc6bffb8a51865670 Kevin Bowling 2026-10-30 18:10:06

debug: classified in 03-filenames_plain1 by 'sys/dev/'

ure: Handle SIOCGIFXMEDIA
The SIOCGIFXMEDIA ioctl is uesd to report extended Ethernet media
subtypes.

ure(4) commit d4cf41a99b40 added support for some newer devices and
added a special case to call ifmedia_ioctl() instead of uether_ioctl()
for those devices, but only for SIOCGIFMEDIA and SIOCSIFXMEDIA.

Fixes: https://cgit.freebsd.org/src/commit/?id=d4cf41a99b40 ("Add support for RTL8153B, RTL8156 and RTL8156B to if_ure(4).")
Reviewed by:    kbowling
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61049
eb0f28db1bfa5b4e6b0eda0a3dc25820bff1acba Ed Maste 2026-10-30 14:57:27

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #25: tpm
tpm: Validate TIS 1.2 IRQs and quiesce delivery before teardown

The TIS 1.2 driver uses the IRQ resource value directly as the four-bit
LPC SIRQ selector in TPM_INT_VECTOR, without validating it before
narrowing. Add the missing range check on the full resource value and use
polling for routes outside 1 through 15. This restriction reflects the
driver's current routing support: parent interrupt numbers need not equal
LPC SIRQ channels.

Attach also installs a handler when the chip's quirks select polling.
Release the IRQ resource when initialization selects polling. Retain an
interrupt cookie only after successful setup and require it for interrupt
waits.

Share verified interrupt masking across initialization, resume, and
detach. Quiesce after draining cdev methods and before removing a handler,
including polling devices whose failed resume left firmware delivery on.
Preserve an owned locality until the existing abort path discards any
pending response. Report quiesce failures while completing detach cleanup.
Diagnose a failed initialization-time disable in the attach context, even
when the cleanup retry succeeds. Lifecycle locality acquisition uses the
bounded timeout without PCATCH so signals cannot interrupt masking;
command-path acquisition remains interruptible.

Cancel timed-out or interrupted locality requests, including requests
made by the ISA probe, so a late grant cannot leave locality reserved.

A device whose global enable does not read back cleared now fails attach
instead of publishing a cdev, and fails resume instead of accepting new
commands. Initialization's existing requirement to acquire locality is
unchanged. The separate legacy Atmel transport is unaffected.

Tested by:      jrm
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59653
8d710f5383fe569635c385ca1ba62f1e4694ce8f Kevin Bowling 2026-09-13 17:27:56

debug: classified in 03-filenames_plain1 by 'sys/dev/'


tpm: Validate firmware interrupt routes and fall back cleanly

A host IRQ resource is not necessarily an LPC SIRQ selector.  Let the
frontend configure the route: ACPI uses the allocated _CRS interrupt and
_SRS when present, preserving the firmware selector, while ISA supplies a
separate, range-checked SIRQ.  Match trigger and polarity to the host route
and TPM capabilities, including opaque INTRNG resource mappings.
Pass the firmware descriptor unchanged to _SRS; apply the x86 ISA polarity
override only when computing the TPM mode.  ISA chips without rising-edge
support now poll instead of substituting a level mode for the host route.

For both FIFO drivers, require a complete GetRandom transport response and
a fresh DATA_AVAIL interrupt before selecting interrupt waits.  Perform
the test with polling before publishing the device, and repeat it after
resume.  During cold boot, defer the test and publication to an interrupt
configuration hook so the IRQ grace wait can sleep and the handler can run.
Drain the hook before teardown; failed deferred initialization remains
unpublished and can be detached safely.  Missing or failed routes release
the handler and IRQ resource;
TPM 1.2 handler-setup failure now also falls back to polling.

Use monotonic deadlines for TPM 1.2 locality, status and burst polling.
Keep lifecycle locality waits uninterruptible, propagate command signal
errors, and terminate transfers when the burst wait expires instead of
retrying a zero burst indefinitely.  Check VALID with the requested status
bits and retain bounded polling response retries.  Interrupt waits retain
their original single-timeout budget and error return.

Arm only DATA_AVAIL before GO.  Mask delivery on the first interrupt and
before relinquishing locality, preventing idle and repeated-source storms.
Bound interrupt sleeps so lost delivery can recover the current command
through polling.  Defer unexpected-source cleanup to a task that can
acquire locality, and drain it before destroying driver locks.  Preserve
an unread TPM 1.2 response when quiescing an already owned locality.

If the ithread cannot mask the TPM, yield for a tick with the host source
masked so a level storm cannot starve the command owner or cleanup worker.
Register INTR_SLEEPABLE | INTR_EXCL for both drivers, and reject firmware
shared routes before installing a handler.  Such routes now poll: FreeBSD
does not allow sleepable shared handlers.  Drain maskable events during
firmware programming without letting them validate or reject the IRQ test.

Retain the initial hardware-quiesce guarantee, including after _SRS:
initialization fails when delivery cannot be disabled, and a later unrecoverable
quiesce failure suspends command access.  Known TPM 1.2 NOINTS quirks and
the TPM 2.0 polling hint remain effective.  Frontends without an explicit
route method use polling.

Tested by:      jrm (tpm 1.2 tis)
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59657
6362e5068c23ac862d64764107979371e3ca4799 Kevin Bowling 2026-09-14 00:34:35

debug: classified in 03-filenames_plain1 by 'sys/dev/'


tpm: Tie exclusive-open cleanup to the file lifetime

Use a cdevpriv destructor to abort an unfinished TPM 1.2 transaction and
release exclusive-open ownership. Register it before setting TPM_OPEN so
a failed registration leaves the device available. The last reference to
the successful open triggers cleanup, including after dup() or fork().

Suggested by:   kevans
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59812
084f245a8514e89a506e43efd1a7ed44ffdbb5eb Kevin Bowling 2026-09-18 12:16:54

debug: classified in 03-filenames_plain1 by 'sys/dev/'


tpm: crb: Improve ACPI control and buffer addresses

The TPM2 ControlAddress identifies the control area, not necessarily a
PTP locality block.  Hyper-V exposes a start-method-7 control area at the
beginning of its ACPI memory resource, with command and response buffers
in separate reserved memory pages.  Assuming control registers are at
resource + 0x40 instead writes CANCEL as LOC_CTRL and fails attach.

Map the control area using ControlAddress and map buffers using their
reported physical addresses.  Reuse the resource mapping for contained
ranges and track ownership of independent mappings for cleanup.  Request
locality only when the resource contains the preceding 64-byte PTP header.
Keep the existing Pluton notification callbacks and locality behavior for
that layout.  Control, locality, and buffer accesses use their respective
mappings directly, without the tpm_bus accessor class.

Bound transfers by the mapped buffer sizes and TPM_BUFSIZE.  Clamp an
overstated buffer that starts within the ACPI resource to its remaining
extent, while requiring room for a complete response header.  Keep strict
control-area bounds and the shared-buffer size consistency check.

Write locality and state requests directly and wait for the corresponding
CTRL_REQ bit to clear.  The old ready wait instead tested the fatal-status
bit in CTRL_STS.  Enter ready state before reading buffer configuration,
and check fatal status again before reading a response, while locality
is still held.  Retain common error cleanup and diagnose attach-time idle
transition failures without replacing an earlier error.

These layouts and register semantics are defined by TCG ACPI 1.5 Table 7
and PC Client PTP 1.03 sections 5.5.3.1, 5.5.3.4, and 5.5.3.5.

Validation: a Windows Server 2025 Hyper-V FreeBSD guest attached and
passed manufacturer queries, 700 GetRandom/PCR_Read pairs, concurrent
clients, five detach/reattach cycles, and device suspend/resume
with entropy harvesting active.

MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59786
f0ac0f73aea71fdcd70408c046cfca88d8a34076 Kevin Bowling 2026-09-18 06:35:27

debug: classified in 03-filenames_plain1 by 'sys/dev/'


tpm: Harvest entropy from TPM 1.2 devices

The TPM 2.0 driver periodically contributes TPM-generated random bytes
to the kernel entropy pool, but the TPM 1.2 driver does not.

Issue TPM_GetRandom every ten seconds and submit successful responses
as RANDOM_PURE_TPM.  Keep each exchange under the TPM transaction lock.
Defer harvesting while the character device is open or a command is
pending so the task cannot consume a user response.  Drain the task for
suspend and detach, rearming it after resume or a failed suspend.

Document the expanded scope of RANDOM_ENABLE_TPM and update the kernel
configuration comments that described it as TPM 2.0-only.

Validated on a STMicroelectronics TPM 1.2 TIS device.  DTrace observed
periodic entropy submissions; a raw GetRandom response remained intact
while the device was held open across a harvest interval; and module
unload/reload deregistered and restored the entropy source cleanly.

Tested by:      zarychtam_plan-b.pwste.edu.pl
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59239
4bcd10f7c04988056c7b28c4cbe65804d7f26d93 Kevin Bowling 2026-08-27 14:27:45

debug: classified in 03-filenames_plain1 by '['sys/arm/', 'sys/arm64/', 'sys/dev/', 'sys/riscv/']'

tpm20: Preserve all harvested random bytes
The TPM requests 16 random bytes every ten seconds, but a random
harvest event retains at most eight bytes.  random_harvest_queue()
reduces a larger input to one 32-bit Jenkins hash, so each successful
TPM request contributed only four bytes to the entropy accumulator.

Split the response into harvest event sized chunks.  This preserves all
16 random bytes without increasing the TPM command rate or changing its
high quality source classification.

MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59246
914892d374e924cae2a0a1d7a669f246a845ad35 Kevin Bowling 2026-08-28 00:32:33

debug: classified in 03-filenames_plain1 by 'sys/dev/'

mlx5en: Report SR-IOV VF status
Query each enabled eswitch vport to report its effective MAC and VLAN
configuration and administrative link-state policy.  Serialize the
query with vport enable and disable, and hold the interface state lock
so teardown joins an in-progress report.

Propagate firmware errors from MAC, administrative link-state, and
supported VLAN queries instead of returning a partially initialized
configuration.  When the hardware lacks CVLAN enforcement, report the
remaining status with no imposed access VLAN.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D58740
0c08d85c99b7b57e45816d011685d349b240a3e3 Kevin Bowling 2026-08-08 17:50:12

debug: classified in 03-filenames_plain1 by 'sys/dev/'

mlx5en: Report the configured RSS tuple selections
Derive SIOCGIFRSSHASH's TCP and UDP selections from the same boot-time
hash configuration used by mlx5e_build_tir_ctx().  The query previously
advertised all six IPv4/IPv6 hash types even when the transport-specific
TIRs selected only the IP addresses.  In particular, the default RSS
configuration disables UDP four-tuple hashing.

Continue reporting IPv4 and IPv6 two-tuple hashing unconditionally,
matching the driver's IP-only TIRs.  Do not report IPv6 extension-header
variants which the query did not previously claim.  Leave key selection,
TIR programming, and the receive datapath unchanged.  This lets consumers
such as hn(4) match the VF's hash inputs instead of enabling incompatible
UDP four-tuple hashes on their own receive path.

Fixes:          https://cgit.freebsd.org/src/commit/?id=a00718e1dfcd ("Implement SIOCGIFRSSKEY and SIOCGIFRSSHASH and mlx5en(4).")
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59807
0f111a802f6beb88f3edad9fa48d3721f8b3ec7b Kevin Bowling 2026-09-18 10:23:19

debug: classified in 03-filenames_plain1 by 'sys/dev/'

bnxt: Report SR-IOV VF status
Expose the PF-known effective per-VF MAC, allocated transmit and receive
queue counts, and policy state through the iflib VF status method.
Snapshot the state under the SR-IOV lock so concurrent trust and
anti-spoof sysctl updates cannot produce a torn report.  Mark known queue
allocations present even when their value is zero.

Cache a VF-selected MAC only after firmware accepts the forwarded
request.  Prefer that address in status.  Replay the accepted address,
trust state, and MAC anti-spoof policy after firmware recovery.

Record completion of the per-VF configuration callback separately from
firmware resource allocation.

Track successful PCI SR-IOV attachment independently of the active VF
count.  This lets a supported but unconfigured PF return an empty status
while unsupported devices and failed attachments omit it.

Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D58738
2c379efd1834dac2432a98de847b79f345f66974 Kevin Bowling 2026-08-08 17:46:27

debug: classified in 03-filenames_plain1 by 'sys/dev/'

qlnx: Report SR-IOV VF status
Retain the PF-known MAC and allocated transmit and receive queue counts
for each VF and expose them through the PF ifnet.  Sum queues across all
hardware functions rather than reporting only the first one.

Publish and snapshot the VF cache under the existing hardware lock.
Unpublish it before hardware teardown, and invalidate queue-allocation
knowledge when error recovery releases the underlying VF resources.

Initialize the cache, release it on failed initialization, and reject an
out-of-range VF index instead of continuing into the array.

Tested by:      zlei
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D58742
9b8bc7b827ef99a0488d0bed32293bad323e8cdb Kevin Bowling 2026-08-08 18:00:44

debug: classified in 03-filenames_plain1 by 'sys/dev/'

iavf: Report the programmed VF RSS configuration
Implement the iflib RSS key and hash query methods for register-based
and PF-managed RSS. Cache the programmed key and HENA selections so hn
can synchronize its synthetic RSS configuration with the VF without
reading hardware or issuing mailbox requests from the query path.

For PF-managed RSS, publish the snapshot only after successful replies
to both CONFIG_RSS_KEY and SET_RSS_HENA. Failed sends, rejected requests,
and missing replies leave it unavailable. Protect the snapshot with
vc_mtx and invalidate it at init, stop, mailbox loss, and reset
notification. Gate queries with the existing running, reset, and mailbox
state.

Report the first 40 key bytes used by standard IPv4/IPv6 tuples, or the
shorter key length supplied by the PF. Preserve register byte order and
report the merged HENA on the direct-programming path. Translate the six
representable IPv4/IPv6 TCP/UDP selections without treating fragment
PCTYPEs as IPv6 extension-header selections. The single-queue register
path reports RSS_FUNC_NONE.

Leave RSS policy and queue distribution unchanged. Queries return ENXIO
until the current configuration is confirmed, without waiting for a PF
reply themselves.

MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59808
a0f2994b312e5a78ffce7dd7bc4521455edbc2cd Kevin Bowling 2026-10-31 23:27:44

debug: classified in 03-filenames_plain1 by 'sys/dev/'

ice: Roll back Tx queues after scheduler setup failures
Add Tx LAN Queues commits the PQM queue and PSM leaf before returning
success.  ice_ena_vsi_txq() can subsequently fail to create the software
scheduler node or replay its saved bandwidth configuration.  Returning
at that point leaves an allocated queue that the caller does not record.
Later queue setup can fail until a function or PF reset removes it.

Issue Disable Tx LAN Queues directly from the completed Add response
before returning a post-add error.  Keep the rollback buffer on the
stack so the allocation failure being recovered cannot also prevent
cleanup.  Remove any software node and invalidate its queue context only
after firmware accepts the disable.  Preserve the queue context and any
software node when rollback fails so active hardware state is not
hidden.

This follows the Add and Disable command lifecycle documented in the
Intel E810 Datasheet, document 613875-003, section 10.5.5.8.

MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D58907
a50d83ef83d716d5e5e7f727c366561dd1b79d00 Kevin Bowling 2026-10-31 23:55:31

debug: classified in 03-filenames_plain1 by 'sys/dev/'

cd9660: Fix dereferencing invalid RR outlen ptr
`ISO_RRIP_ANALYZE` is constructed in four places. Two of the
initializers set the `outlen` field while the other two,
`cd9660_rrip_analyze` and `cd9660_rrip_offset`, leave it uninitialized.

The uninitialized paths can dereference an invalid pointer on error
paths which causes a kernel panic.

To fix, I zero out `ISO_RRIP_ANALYZE` in all four places where it's
initialized and check that `outlen` is non-null on the error path
in `cd9660_rrip_loop`.

While testing the above, I encountered another kernel panic due to
mounting continuing after the error branch. Evidently, the ISO continued
mounting through the normal ISO 9660 path then triggered a panic down
the line due to a very broken file system from the ISO. To fix that, I
propagate the error from the RR path then fail in the mount path.

A previous iteration of this commit included the ISO from the PR. The
current iteration creates an ISO with makefs then corrupts it with a
small helper written in C that is a condensed version of the CD 9660
code. It checks the input ISO for a a Rock Ridge extension reference
then corrupts the length byte. This triggers the early failure in
cd9660_rrip_offset.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296853
Signed-off-by: Josh Megnauth <jo.sh@tutanota.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2462
1a4c2eedad5bd62c4ec3cdda276bf4579ecab6c6 Josh Megnauth 2026-10-05 19:40:15

debug: Commit manually moved from "unknown" to "hardware".

netmap: bdg: replace strncpy with safer strlcpy
Submitted by: Brian Poole <brian90013@gmail.com>
ce1dc2df8019733f320b7338f8cf736faf0ffa5d Vincenzo Maffione 2026-11-01 17:53:47

debug: classified in 03-filenames_plain1 by 'sys/dev/'

ice: Restart disabled VF Tx queues from saved configuration
DPDK iavf's per-queue stop/start operations send DISABLE_QUEUES followed
by ENABLE_QUEUES without another CONFIG_VSI_QUEUES. Disabling an ice Tx
queue removes its hardware scheduler leaf, so acknowledging ENABLE alone
cannot restart it. Clearing the configured bitmap also prevents the VF
from requesting this sequence.

Track saved configuration separately from active Tx queues. Retain ring
parameters and queue handles on disable, and recreate only the selected
inactive queues on enable. Share the existing Tx context builder between
initial VSI configuration and per-queue restart. Keep the initial
Tx-at-CONFIG behavior and the existing dense-prefix CONFIG validation.

Track cleanup progress per queue and publish valid configuration only
after both Tx and Rx configuration succeed. If an enable fails, undo its
partial setup before permitting a retry. Retain hardware ownership when
cleanup fails and reject another enable of that queue rather than
silently acknowledging it. A failed post-add rollback without a software
scheduler node requires VF reset, not a successful no-op disable.

After a verified VF reset and DMA drain, remove any remaining software
scheduler leaves and invalidate the queue contexts. Treat the initial
queue disable as best effort so a failed rollback cannot permanently
prevent reset recovery. Retain unresolved state if the reset or drain
fails.

Fixes:          https://cgit.freebsd.org/src/commit/?id=bc761988b724 ("ice: Add host SR-IOV support")
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59851
57d8db405e68fa32b98aec803693f0f5880b9b92 Kevin Bowling 2026-11-01 00:13:34

debug: classified in 03-filenames_plain1 by 'sys/dev/'

arm64 pmap: demote L3C pages in pmap_clear_modify()
When pmap_clear_modify() demotes a dirty L2 block mapping, it write
protects the L3 entry that maps "m", so that a subsequent write access
may repromote.  However, since fd6cb031f577, the L3 entries created by
pmap_demote_l2_locked() may have ATTR_CONTIGUOUS set, and
pmap_clear_modify() was write protecting one L3 entry within an L3C page
while leaving the page's other L3 entries writeable with ATTR_CONTIGUOUS
still set.  A TLB entry that a processor creates from any of those other
L3 entries may translate "m"'s virtual address and permit writes to "m"
without a fault.  To fix this issue, as in pmap_remove_write(), demote
the L3C page before write protecting the L3 entry.

Found by:       Claude Code (Opus 5.5)
Fixes:  https://cgit.freebsd.org/src/commit/?id=fd6cb031f577 "arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1]"
MFC after:      1 week
6d7960628f825f1eec0959d6000a79ca8a4ae927 Alan Cox 2026-11-01 18:25:05

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

ice: Allow VSI loopback in VEB mode
The embedded switch installs local forwarding rules with loopback enabled,
but their source VSI must also permit loopback. Without that permission,
traffic between host-attached VFs can trigger Tx data MDD events instead
of reaching the destination VSI.

Set ICE_AQ_VSI_SW_FLAG_ALLOW_LB when initializing a VSI in VEB mode, matching
the forwarding rules to the VSI permission. Keep MAC anti-spoof checking
enabled.

Validated on E810 with native iavf and DPDK VFs, together with the absolute
VF number correction. Local forwarding and queue/reset recovery passed;
spoofed source MACs were still rejected and isolated.

Fixes:          https://cgit.freebsd.org/src/commit/?id=bc761988b724 ("ice: Add host SR-IOV support")
MFC after:      2 weeks
Sponsored by:   BBOX.io
9bd865a67c22aa19c99aaee58fd98c03c5ac0bab Kevin Bowling 2026-11-01 21:09:57

debug: classified in 03-filenames_plain1 by 'sys/dev/'

ice: Use the absolute VF number when adding a VSI
The Add VSI AdminQ command requires an absolute hardware VF number, while
vsi->vf_num is relative to its PF. Add the PF's vf_base_id, as the VF Tx
queue context already does.

On an E810 PF with vf_base_id 128, relative VFs 0 and 1 were associated
with hardware VFs 0 and 1 instead of 128 and 129. Their receive queues
became blocked and both native iavf and DPDK receivers dropped traffic.
A PF whose VF base is zero hides the error.

Validated the VSI-to-function mapping and receive traffic on that PF,
including VF reset recovery and local PF/VF forwarding with VSI loopback
enabled.

Fixes:          https://cgit.freebsd.org/src/commit/?id=bc761988b724 ("ice: Add host SR-IOV support")
MFC after:      2 weeks
Sponsored by:   BBOX.io
cbaf3f1bc55524126182f63d09ed79ba8cf61cf2 Kevin Bowling 2026-11-01 21:09:57

debug: classified in 03-filenames_plain1 by 'sys/dev/'

iavf: Handle queue disable during reset recovery
Some PFs reject a redundant DISABLE_QUEUES request after queues have
already stopped. The historical driver retried the request but
continued. The mailbox recovery change instead treated this NACK as a
transport failure, tore down the Admin Queue without a VF reset, and
could not recover the interface during API rediscovery.

Track a PF's pre-reset warning separately from an observed reset and
from exclusive ownership of polled AdminQ replies. RESET_IMPENDING
leaves asynchronous AdminQ processing available so a concurrent stop
can consume its DISABLE_QUEUES reply. VC_POLLING protects VERSION and
GET_VF_RESOURCES rediscovery without blocking that reply. Record
completed resets so subsequent stop/init operations do not issue a
redundant queue-disable request.

If queue disable is not confirmed, wait for an observed reset or request
a VF reset and wait for completion. Give queue shutdown a separate
60-second monotonic deadline to accommodate slow PF reset recovery.
Propagate reset submission failures and restore the previous RSTAT
value when no request was submitted. Clear the attach-time recovery
marker before the first runtime stop/init cycle, and suppress RSS
status reporting during reset recovery.

This implements the native recovery portion of D58904, with PCI
containment and permanent failure handling deferred. If native shutdown
cannot be confirmed, report the failure and leave recovery pending.
Shutdown remains best effort because IFDI_STOP cannot return an error
to prevent iflib from releasing queue resources.

Matched hardware testing against the parent on E810 with two four-queue
VFs covers 18 TCP smoke runs, 40 down/up cycles, three PF resets, and
three CORE resets per kernel. The change eliminates all 12 observed
"PF mailbox rediscovery failed: 60" messages and reduces the longest
UDP delivery gap per CORE reset from 3.43-3.57 seconds to 2.62-2.67
seconds.

MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D58904
845f9747380a0db4d8a174794a5e199e80de81c0 Kevin Bowling 2026-11-02 00:39:27

debug: classified in 03-filenames_plain1 by 'sys/dev/'

usb: Add SSP and SSPx2 speed and move USB_*_MAX into enum
Add the USB 3.1 and 3.2 speeds and revisions.  The speeds are in USB
3.2 rank order, so they can be compared directly.

Also, move USB_*_MAX into the enums.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57194
6e575d08a5f5030562593bba5b47cc176d0b9bb7 ShengYi Hung 2026-05-22 15:32:25

debug: classified in 03-filenames_plain1 by 'sys/dev/'

usbdump: Support SSP and SSPx2 speed display
Add the SuperSpeedPlus speed names.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57197
65346af4961e248b59385a871ae36a223a1171d4 ShengYi Hung 2026-05-22 15:41:31

debug: classified in 03-filenames_plain1 by 'usr.sbin/usbdump/'

Commit group #26: usb
usb: support SSP/SSPx2 devices in all-speed consumers

Handle the new speeds wherever USB_SPEED_SUPER was checked.  Most
consumers treat them as SS.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57198
85c3bd4595ba3d213ef570a51b517d82cd481d0a ShengYi Hung 2026-05-22 15:48:49

debug: classified in 03-filenames_plain1 by 'sys/dev/'


usb: Add usbd_bos_foreach helper

Iterate the capabilities of a BOS descriptor.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57199
ab18352d8f9dd26d94da1165259460ead44a9e4c ShengYi Hung 2026-05-22 16:18:57

debug: classified in 03-filenames_plain1 by 'sys/dev/'


usb: Add extended port status struct

Extended Port Status reports the speed and lane count of SS and SSP
links.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57200
1fe552b036a52e13cb26c32265c418f355300360 ShengYi Hung 2026-05-22 16:31:20

debug: classified in 03-filenames_plain1 by 'sys/dev/'


usb: Add get_ext_port_status helper function

usbd_req_get_ext_port_status() wraps the Get Extended Port Status
request.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57201
1928debe1a47e3a7411a1c09e46ea910f73950d2 ShengYi Hung 2026-05-22 16:23:07

debug: classified in 03-filenames_plain1 by 'sys/dev/'


usb: Implement usbd_req_get_bos_descriptor helper

Get the header or the complete BOS descriptor of SS+ devices.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57202
2f79adc28976870f4f5ad3a2ce61f2f8da0eb131 ShengYi Hung 2026-05-22 16:21:06

debug: classified in 03-filenames_plain1 by 'sys/dev/'


usb: Add SSPlus device capability descriptor

Add the SuperSpeedPlus USB Device Capability descriptor and its field
macros.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57203
23ef0bdb48f3f9065769404c77c17f10b9a14576 ShengYi Hung 2026-05-22 16:29:40

debug: classified in 03-filenames_plain1 by 'sys/dev/'


usb: Add support for SSP and SSPx2 hubs

An SSP hub reports its sublink speeds in the BOS descriptor, and
Extended Port Status tells which one each port uses.  Read it based on
bcdUSB, since the ports of a hub can be faster than its upstream link.
Without it, the ports are treated as SuperSpeed.

Read the speed again in usbd_req_re_enumerate(), since a link can come
back at another speed.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57204
fb470e8f1c58f4fcdeb163d118fb1d6526da325d ShengYi Hung 2026-05-23 07:00:45

debug: classified in 03-filenames_plain1 by 'sys/dev/'


usb: support SSP and SSPx2 xHCI

Only the default PSI IDs are supported, other controllers fall back to
USB 3.0.  Record the speed IDs the controller has: the root hub BOS
lists those, and a link without one uses the closest lower ID.

Per xHCI 6.2.2, take the parent hub slot ID and port number of SS and
SSP devices from the closest higher-rank hub.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52347
20b19982545eb96160a20d0224f4b074f5fcb9af ShengYi Hung 2025-09-01 14:54:11

debug: classified in 03-filenames_plain1 by 'sys/dev/'

ice(4): Do not leave device non-functional if Tx scheduler config fails
The ice_cfg_tx_topo function attempts to apply Tx scheduler topology
configuration based on NVM parameters, selecting either a 5 or 9 layer
topology. As part of this flow, the driver acquires the "Global Configuration Lock",
which is a hardware resource associated with programming the DDP package
to the device. This "lock" is implemented by firmware as a way to
guarantee that only one PF can program the DDP for a device. Unlike a
traditional lock, once a PF has acquired this lock, no other PF will be
able to acquire it again (including that PF) until a CORER of the device.
However, if configuration of the Tx topology fails, (i.e.
ice_get_set_tx_topo returns an error code), the driver exits
ice_cfg_tx_topo() immediately, and fails to trigger CORER.
While the global configuration lock is held, the firmware rejects most
AdminQ commands, as it is waiting for the DDP package download (or Tx
scheduler topology programming) to occur.
Refactor ice_cfg_tx_topo() to always trigger a CORER after acquiring the
global lock, regardless of success or failure of the topology
configuration.
We need to re-initialize the HW structure when we trigger the CORER.
Previously, this was the responsibility of the core driver to cleanup after
the CORER. Instead, make it the responsibility of this function. This
avoids needless re-initialization for the cases where no reset occurred.

Authored-by:    Jacob Keller <jacob.e.keller@intel.com>
Co-Authored-by: Pawel Sobczyk <pawel.sobczyk@intel.com>
Signed-off-by: Sobczyk, Pawel <pawel.sobczyk@intel.com>

Reviewed by:    kbowling
Tested by:      Mateusz Moga <mateusz.moga@intel.com>
MFC after:      3 days
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D60168
013f1779f63413173535ab770abb70715e92bee6 Sobczyk, Pawel 2026-11-02 07:31:05

debug: classified in 03-filenames_plain1 by 'sys/dev/'

if_bnxt: size MRAV from the AV split entry for backing store V2
On RoCE-capable Thor2, attach fails with
HWRM_FUNC_BACKING_STORE_CFG_V2 returning INVALID_PARAMS, as MRAV is
sized the pre-V2 way and the firmware's AV split value is sent as is.

Size MRAV from the AV split entry, and move the legacy entry-count
packing into bnxt_hwrm_func_backing_store_cfg().

Fixes: https://cgit.freebsd.org/src/commit/?id=d5ce906da7c5 ("bnxt_en: Add backing store V2 support")
Reviewed by:    gallatin
Sponsored by:   Broadcom Inc
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D60976
aca2e5fae3d9c3350b47ee3e7d00937a73dba9a9 Sumit Saxena 2026-10-22 10:48:42

debug: classified in 03-filenames_plain1 by 'sys/dev/'

if_bnxt: skip HW kTLS on old firmware and add a tunable to disable it
Older Thor2 firmware serves key context allocation requests very
slowly, about a second each. The driver allocates key contexts in
batches of 128, so setting up 500k sessions takes roughly 3900
requests and driver load appears to hang.

Enable hardware kTLS only when the firmware's HWRM interface version
is 1.10.3.99 or newer. Keep the full four-part version in
hwrm_spec_code_ext for the comparison.

Also add a disable_hw_ktls loader tunable that turns hardware kTLS off
for a device without unloading kTLS support, which helps isolate kTLS
problems in the field.

Reviewed by:    gallatin
Sponsored by:   Broadcom Inc
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D60977
cfbf11308b586d559f7d4ce39edefe1a0c3b3742 Sumit Saxena 2026-10-24 07:22:55

debug: classified in 03-filenames_plain1 by 'sys/dev/'

sdhci_pci: Add Intel Sunrise Point-LP SDXC controller
Co-authored-by:       Michael Osipov <michaelo@FreeBSD.org>
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300175
Reviewed by:    imp
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D60973
584f44221f45c5c26ec2a2888a3815c6f34bfad0 Anna Fireshevsky 2026-10-28 22:58:24

debug: classified in 03-filenames_plain1 by 'sys/dev/'

ix(4): Support Total Port Shutdown on E610
Firmware controls the physical link state on E610 adapters, similarly to
X700 and E800 adapters. As a result, running "ifconfig down" does not
disable the physical link unless Total Port Shutdown is enabled.

Read the Link Default Override TLV from NVM to detect when Total
Port Shutdown was enabled for given port in system setup. In that
case, force the link down when the interface is stopped and restore
it during link configuration. Leave link state management unchanged
when the TLV is unavailable or the feature is not enabled.

Co-authored-by: Miłosz Linkiewicz <milosz.linkiewicz@intel.com>
Co-authored-by: Tomasz Lichwala <tomasz.lichwala@intel.com>
Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Tested by:      Mateusz Moga <mateusz.moga@intel.com>
MFC after:      1 week
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D60643
7868958f5c79eb986d067e02ca8239aa7491dfac Krzysztof Galazka 2026-11-02 11:17:08

debug: classified in 03-filenames_plain1 by 'sys/dev/'

riscv intc: convert to a bus.
Convert the RISC-V Interrupt Controller (INTC) device to a bus;
try to find and attach Incoming Message Signalling Interrupt Controller
(IMSIC) device.

This allows to establish parent-child relationships between two and
to propagate PIC_INIT_SECONDARY call from the INTC (parent) to the
IMSIC (child).

Reviewed by:    mhorne, mmel
Sponsored by:   EPSRC ("UKRI3001: CHERI Research Centre")
Differential Revision:  https://reviews.freebsd.org/D59813
24558f289dd3b0a2a2372123186455e449d60abf Ruslan Bukin 2026-11-02 11:31:38

debug: classified in 03-filenames_plain1 by 'sys/riscv/'

riscv: Incoming MSI Controller support.
Support for Incoming Message Signalling Interrupt Controller (IMSIC)
defined by the RISC-V Advanced Interrupt Architecture (AIA) specification.

This is based on early work of Himanshu Chauhan on IMSIC support for
IPI delivery. This change, however, does not include IPI delivery support,
instead it provides MSI support for peripheral devices.

IMSIC is a core-local interrupt controller with non-global interrupts,
which means that interrupt identity is effectively (hart, interrupt ID).

When IMSIC present on hart, APLIC does not trap the CPU directly,
instead it delivers the interrupt to the IMSIC instance associated with
the target hart. Upon reception of interrupt, IMSIC on hart invokes APLIC
for handling. Note that PCIe devices deliver interrupt directly to IMSIC.

Apart from IMSIC support, this includes APLIC changes:
- Obtain the interrupt trigger type from FDT and configure the interrupt
  accordingly (e.g. level or edge-triggered);
- Per the AIA requirement, level-triggered MSI interrupts must be
  retriggered manually after being handled. See the comment in
  aplic_post_ithread();
- Reorganize APLIC register definitions to have some structure.

Reviewed by:    mhorne
Sponsored by:   EPSRC ("UKRI3001: CHERI Research Centre")
Differential Revision:  https://reviews.freebsd.org/D59695
48ac4113c88fddcea619d0bf252b87c62132f214 Ruslan Bukin 2026-11-02 11:43:07

debug: classified in 03-filenames_plain1 by 'sys/riscv/'

snd_hdspe: Serialize rate and latency updates
Protect running-state checks and register updates with the softc lock.

Drop the lock around sndbuf_resize(), which may sleep, and recheck the
running state after reacquiring it.  Keep the resize ahead of the latency
register update so that a failed resize leaves the hardware unchanged.

Reviewed by:    br
MFC after:      3 days
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D58371
d1dcb2b117a3c128c8e8eda047f93739f06d6099 Kevin Bowling 2026-07-21 03:33:08

debug: classified in 03-filenames_plain1 by 'sys/dev/'

snd_hdsp: Serialize rate and latency updates
Protect running-state checks and register updates with the softc lock.
Keep the pointer reset and the HDSP 9632 frequency rewrite in the same
critical section as the latency update.

Drop the lock around sndbuf_resize(), which may sleep, and recheck the
running state after reacquiring it.  Preserve resize error handling so
that a failed resize leaves the hardware unchanged.

This mirrors the locking in snd_hdspe.

MFC after:      3 days
Sponsored by:   BBOX.io
a25ad366d51d52ef30b8bc4e2a7dd377255a409b Kevin Bowling 2026-11-02 15:54:35

debug: classified in 03-filenames_plain1 by 'sys/dev/'

snd_hdspe: Use busdma for DMA buffers
Program DMA pages from busdma segments and synchronize buffer ownership.
Unwind partially allocated resources on failure.

Reviewed by:    br
MFC after:      3 days
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D58372
46b338381400cb8106d6d2af945e7950553c16f4 Kevin Bowling 2026-07-21 03:36:02

debug: classified in 03-filenames_plain1 by 'sys/dev/'

snd_hdsp: Use busdma for DMA buffers
Program DMA buffer registers with the bus addresses returned by busdma.
Require one full-size contiguous DMA segment per direction and validate
its alignment and 32-bit address range.

Synchronize buffer ownership around playback, capture, clearing, and
teardown.  Disable channels before clearing their DMA buffers, and unwind
partially allocated resources on failure.

This mirrors snd_hdspe's DMA handling, adapted to HDSP's single base
address per direction.

MFC after:      3 days
Sponsored by:   BBOX.io
5355c97e129a004f013570be0b7a99c8610e1757 Kevin Bowling 2026-11-02 16:09:33

debug: classified in 03-filenames_plain1 by 'sys/dev/'

snd_hdspe: Use saved resource IDs on detach
Release resources with the IDs used to allocate them.
Rename irqid to rid to reflect that it stores a resource ID.

Reviewed by:    br
MFC after:      3 days
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D58373
d33ab9dae2f5f5421e4cb5a141751924e35eeb2d Kevin Bowling 2026-07-21 03:36:41

debug: classified in 03-filenames_plain1 by 'sys/dev/'

snd_hdsp: Use saved resource IDs on detach
Release resources with the IDs used to allocate them.
Rename irqid to rid to reflect that it stores a resource ID.

This mirrors the corresponding snd_hdspe change.

MFC after:      3 days
Sponsored by:   BBOX.io
96e2a9a40a05716a444dc217629374c387efd159 Kevin Bowling 2026-11-02 16:17:00

debug: classified in 03-filenames_plain1 by 'sys/dev/'

vmm: Add a bulk TMR reset hook for Intel APICv
vioapic_update_tmr() resets all 256 vectors before rebuilding the
level-triggered vector set. With Intel virtual interrupt delivery,
each per-vector reset loads the VMCS, reads and writes an EOI-exit
bitmap, and clears the VMCS.

Add an optional bulk-reset hook so VMX can clear the four EOI-exit
bitmaps with one VMCS load/clear pair. Clear the software TMR banks
directly when using the hook, and retain the per-vector fallback
for backends without it.

Reviewed by:    markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60692
ee9205f068c7675cf4d23e51cc98238d95ba1950 Hayzam Sherif 2026-11-02 16:21:18

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

vmm: Skip TMR rebuilds for edge-to-edge IOAPIC writes
IOAPIC redirection-table writes rendezvous all active vCPUs to
rebuild their vlapic trigger-mode registers when fields other than
mask or polarity change. Retargeting an edge-triggered pin incurs
this cost even though it does not contribute to the TMR.

vioapic_update_tmr() rebuilds the TMR from level-triggered entries
only. Skip the rendezvous when the modified entry is edge-triggered
both before and after the write. Check the old and new trigger modes
so that edge-to-level and level-to-edge transitions still rebuild
the TMR. Retain the existing all-vCPU rebuild path, mask/polarity
exclusions and remote-IRR handling.

Reported by:    Wanpeng Qian <wanpengqian@gmail.com>
Reviewed by:    Wanpeng Qian <wanpengqian@gmail.com>, markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60721
0340fb03288166091a8cdf694f5fed20e4c4f9ac Hayzam Sherif 2026-11-02 16:21:36

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

igc: Count packets dropped for want of a receive descriptor
When a receive ring is full the hardware drops the packet and counts it
in RQDPC, a per-queue register the driver never read. Such drops were
invisible: MPC counts packet buffer overflows, not descriptor
exhaustion, so an overloaded queue lost packets with nothing to show for
it. With several receive queues this is the common overload signature,
since RSS loads the queues unevenly and one saturated queue drops while
the others idle.

Read RQDPC for each queue with the other statistics and account the
drops per queue as dev.igc.N.queue_rx_M.rx_drops and in total as the
interface's input queue drop counter (netstat -d, Idrop), as ixgbe does
with QPRDC. Write the register back to zero after reading; the I210
documents it as read/write rather than read-to-clear.

Reviewed by:            kbowling
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61004
5d9f99143690dcd18e326937769f03514eee2652 R. Christian McDonald 2026-11-02 17:10:17

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Revert "ena: Reinit RSS components during queue count change flow"
This reverts commit 2a27dd0076c5.

Changing the IO queue count destroys the RSS table, and if this is done
while the device is down a new table is not rebuilt until the next
ena_up(). That leaves 2 problems in the meantime:
1. A stale copy of the destroyed table is still returned via sysctl.
2. Reading the destroyed key, or writing the table, panics.

That commit addressed 1 by creating a new RSS table, so that sysctl
returns a fresh default table with the new number of queues. It did not
set out to fix 2, but the rebuild hid it by accident.

The rebuilt table is the default round-robin one, wired to no queues and
unusable: a write still fails, because programming the device needs the
IO queues that only exist after ena_up(). ena_up() builds that same
table anyway.

Rebuilding also programs the device while no IO queues exist. When the
queue count grows this fails with EINVAL; when it shrinks it succeeds
and points the device at completion queues that ena_down() destroyed.

The following commit addresses both issues properly.

Reviewed by: cperciva
MFC after: 3 days
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D61056
ccceb1729a6bd82b8b293bc5ea61b863179a268e Arthur Kiyanovski 2026-10-30 01:38:44

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #27: ena
ena: Fix RSS sysctl panic when the RSS table is destroyed

ena_set_io_queue_count() destroys the ena-com RSS state but left
ENA_FLAG_RSS_ACTIVE set. The RSS sysctl handlers gate on that flag, so
they ran against state that was gone.

This causes 2 types of issues:
1. Kernel panic when reading dev.ena.0.rss.key or writing to
   dev.ena.0.rss.indir_table
2. Returning a stale cached RSS table when reading
   dev.ena.0.rss.indir_table, or a bogus 1 when reading
   dev.ena.0.rss.indir_table_size

ena_set_io_queue_count() is called in 2 cases:
1. The io_queues_nb sysctl.
2. Device restore when the device comes back with fewer MSI-X vectors
   than before.

Clear ENA_FLAG_RSS_ACTIVE when the RSS table is destroyed. The handlers
then fail with ENOTSUP until the next ena_up() rebuilds RSS.
This both fixes the panics, and stops returning cached and bogus values.

Note: A plain ifconfig down does not destroy the table, so the sysctls
keep working across a down/up cycle.

Reviewed by: cperciva
Fixes: https://cgit.freebsd.org/src/commit/?id=56d41ad5fe9c ("Add sysctl node for ENA IO queues number adjustment")
Fixes: https://cgit.freebsd.org/src/commit/?id=2d4d2ed3fef6 ("ena: Reinit RSS table on device restore when queue count shrinks")
MFC after: 3 days
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D61057
eb65bcbf6cb5b8ace59504ea721ff1802e912296 Arthur Kiyanovski 2026-10-30 01:38:44

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ena: Set ENA_FLAG_RSS_ACTIVE only when RSS is really configured

If the device does not report support for the RSS indirection table,
ena_rss_init_default() destroys the RSS state and returns EOPNOTSUPP.
ena_rss_configure() treats EOPNOTSUPP as success and returns 0, and
ena_up_complete() sets ENA_FLAG_RSS_ACTIVE on any 0 return.
Reading dev.ena.N.rss.key at this point causes kernel panic.

Every current device reports the indirection table, so reaching this
needs a device that is broken or misreporting.

The SYSINIT removed by a6205766b300 called ena_rss_init_default()
directly, saw the EOPNOTSUPP and cleared the flag. Routing the decision
through ena_rss_configure(), which hides EOPNOTSUPP, lost that.

Move the flag set into ena_rss_configure(), which can see whether a
table exists, and clear it when tbl_log_size is 0.

Reviewed by: cperciva
Fixes: https://cgit.freebsd.org/src/commit/?id=a6205766b300 ("ena: Fix RSS not working after driver reload")
MFC after: 3 days
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D61058
8aea6556529159d133aba66f25a2ec26aa47dc4c Arthur Kiyanovski 2026-10-30 01:38:44

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ena: Update driver version to v2.8.6

Bug Fixes:
* Revert "Reinit RSS components during queue count change flow"
* Fix RSS sysctl panic when the RSS table is destroyed
* Set ENA_FLAG_RSS_ACTIVE only when RSS is really configured

Reviewed by: cperciva
MFC after: 3 days
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D61059
6c177745c58e526bcf7451ad2765df6c63f35f97 Arthur Kiyanovski 2026-10-30 08:23:00

debug: classified in 03-filenames_plain1 by 'sys/dev/'

iavf: Reconcile VLAN filters with acknowledged requests
Track desired and acknowledged VLAN membership separately.  Retain
pending deletions and uncertain state after failed requests instead of
losing the work when a message is submitted.  Make repeated registration
idempotent.

Adapt DPDK's synchronous, single-VID virtchnl request shape and the
bounded desired-state reconciliation used by igbv and ixv.  Serialize
VLAN requests under the existing virtchnl mutex, with filter-list
changes under the iflib context lock.  Preserve an unresolved
transaction so a late reply cannot be mistaken for a newer operation,
including after the desired state changes.

Reconcile live membership changes without restarting healthy queues.
Limit each pass to 32 requests and a one-second reply deadline,
continuing live batches from the admin task.  Down or recovering VFs
apply desired state at initialization; initialization batches continue
through the existing retry callout without rediscovering the mailbox or
losing acknowledged progress. Completed PF rejections retain pending
work without resetting unrelated traffic.  An unresolved request invokes
mailbox recovery when running and prevents queue enable during
initialization.

Delete nonzero VLAN filters before additions so released capacity is
reused in the same reconciliation pass. Add VID 0 first and delete it
last, retaining untagged admission if a nonzero deletion is rejected.
After a confirmed VF reset, replay desired membership.  After
AdminQ-only rediscovery, retain deletion tombstones and reconcile
uncertain state because the PF may still hold the old filters.

MFC after:      2 weeks
Sponsored by:   BBOX.io
c13dfbcf43b4c7a5ba0204ad0a0c3bf34eb54be3 Kevin Bowling 2026-11-02 00:39:54

debug: classified in 03-filenames_plain1 by 'sys/dev/'

iavf: Honor negotiated VLAN offload capabilities
The driver advertised VLAN offload unconditionally, even when the PF
did not grant it, as observed with an E835 VF under Hyper-V.  This
tells the stack to rely on hardware tag insertion and sends the PF
unsupported VLAN filter requests.

Advertise hardware VLAN tagging and filtering only when GET_VF_RESOURCES
grants the legacy VLAN capability.  Do not allocate filter shadow entries
or send ADD_VLAN/DEL_VLAN requests without that capability.  Retain VLAN
MTU and checksum/TSO support for software-tagged packets.

Keep advertised capabilities stable across resets, since existing VLAN
interfaces may already rely on them.  If resource rediscovery removes
previously advertised VLAN offload, leave the VF stopped and require
reattachment rather than resume with a stale offload contract.  A newly
granted capability is not exposed until reattach.

MFC after:      2 weeks
Sponsored by:   BBOX.io
933c4f6e06c276548783247242b75814027159eb Kevin Bowling 2026-11-02 00:40:25

debug: classified in 03-filenames_plain1 by 'sys/dev/'

mii: fix the LINT-NOVIMAGE build for LAN867X
`sys/kernel.h` must be included for all kernel drivers, per driver(9).

`sys/kernel.h` provides defines for `SI_*`, which
`EARLY_DRIVER_MODULE(..)` in `sys/bus.h` relies on and the latter header
is not "self-standing".

Found when running `make tinderbox`.

Fixes:  https://cgit.freebsd.org/src/commit/?id=83d0eed50106 ("lan867xphy: New driver for Microchip ...")
3ddf7666a0c4d970102be1e6d392a8029c009297 Enji Cooper 2026-11-03 04:19:19

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #28: ufshci
ufshci: detect completions with the completion notification register

The single doorbell completion scan took a cleared doorbell bit as a
completion. A bit that was never set reads the same, so a slot whose
doorbell was not rung yet, or one that a reset wiped, looked complete
and was finished with a stale descriptor.

UFSHCI 3.0 added UTRLCNR, which the controller sets when it completes
a request and the driver already clears afterwards. Use it to find
completed slots on a 3.0 or later controller. Older controllers keep
the doorbell check, and the task management list has no such register.

Reviewed by:            imp
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D61111
5603ddb8299d0fe3b8e81a5bee5cd1fa24a1806c Jaeyoon Choi 2026-11-03 04:11:14

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ufshci: add debug aids for driving the recovery path

The reset and recovery paths only run when the hardware fails, so they
never ran on an emulated controller. The failure path also took the
controller offline without logging anything.

Add the force_reset, drop_next_ios and drop_next_admins sysctls to
drive these paths, and log when the controller fails. The aborts the
watchdog sends must go out, so the task management queue is never
dropped.

Reviewed by:            imp
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D61112
b83a22eb9d3c3e621d2096b0f5988c1e09f6ddc5 Jaeyoon Choi 2026-11-03 04:15:35

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ufshci: claim a slot before completing it

A request is completed with the queue lock dropped, because the
completion callback may submit the next request and take that lock
again. The completion scan checked a slot under the lock, dropped the
lock, and only then completed the request, with the slot still marked
scheduled. The failure path and the abort completion look for such
slots under the same lock, so one of them could pick the same slot in
that window. The request was then completed twice, freed twice, and
its CCB went back to CAM twice. After a reset every in-flight slot
reads as done at once, so the window was easy to hit.

No existing state could mark that window. FREE would hand the slot to
a new request while the old completion still reads it, RESERVED means
a submit in progress, and NEED_ERROR_HANDLING is about to mean a
request that a reset has claimed but nobody has completed yet.

Add a completing state. Every path that completes a slot sets it
under the lock before dropping the lock, and every path skips a slot
in that state. The abort completion now takes only a slot that is
still scheduled, where it used to take anything that was not free.

Reviewed by:            imp
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D61113
088c6fc1f9bf938fcad465fe7899d64cf4453b69 Jaeyoon Choi 2026-11-03 04:16:36

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ufshci: keep a slot for admin requests

The slot reserve step handed any free slot to whoever asked first, so
I/O could fill the queue and leave no slot for the driver's own admin
commands, which a reset sends through the same queue. A full queue was
also reported to CAM as busy, and CAM used up its retries on that
within microseconds.

Keep the last slot for admin requests and give CAM one opening fewer,
since letting CAM fill every I/O slot cut the throughput sharply. On a
full queue, freeze the device queue and requeue the request. Remove the
unused reserve_admin_slot hook.

Reviewed by:            imp
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D61114
c41be266147fd5313d4f4ccd417f95738443645a Jaeyoon Choi 2026-11-03 04:17:49

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ufshci: tear down the controller in a safe order

Detach freed the request queues while the interrupt, the watchdog or a
running reset could still use them. It also left the controller
running, so a pending interrupt could hit the next attach before its
queues existed.

Tear down the interrupt, stop the watchdogs, free the task queue,
disable the controller, and only then destroy the queues. A stopped
watchdog stays stopped, so a reset still running cannot arm it again.
A reset requested after the task queue is freed is ignored.

Reviewed by:            imp
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D61115
e2b46f35f78321d2faa94a2cf3e71d7fc72f4ba4 Jaeyoon Choi 2026-11-03 04:18:50

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ufshci: reclaim in-flight requests across a reset in SDB mode

A reset wipes the controller's request list, so a request that was in
flight never completes. Its slot stayed scheduled, the watchdog timed
it out again, and the next reset went round the same way. CAM never
got the request back.

Claim in-flight requests when the queue is disabled and return them as
aborted once it is back. If the reset fails first, the failure path
completes them instead.

Reviewed by:            imp
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D61116
3dbdcf937cf4689144666791c4113143b6dbc931 Jaeyoon Choi 2026-11-03 04:20:33

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ufshci: requeue requests that a reset aborted

A request taken back by a reset was reported to CAM as an error, which
used up a retry. A few resets in a row failed the I/O even though the
device never saw it.

Pass the overall command status to the completion callback and requeue
aborted requests. The polled completion carries it too, so the
passthrough ioctl reports it instead of a placeholder zero. The abort
path now reports an invalid status instead of aborted, so a command
that never finishes still uses up its retries.

Reviewed by:            imp
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D61117
5a53e2a6ba951ed90c05986efdd2bf995f7163e5 Jaeyoon Choi 2026-11-03 04:22:20

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ufshci: hold back I/O during a reset

The disable path only claims what is in flight at that moment. An I/O
submitted after a reset was requested rang a doorbell that the reset
then wiped, so it was lost. An I/O sent as soon as the queue was back
reached the device before the bring-up had initialized it, and the
device answered NOT READY.

Keep such an I/O on a list instead, without a slot, from the moment a
reset is requested until the bring-up has finished, and send the list
in order then. A request that a reset returned to CAM comes back while
the list is still held, so it waits there too. A completion sends the
next one when the slots have run out. If the controller fails first,
the failure path completes the list with an error. Admin and task
management requests still go out, because the reset task waits on its
own commands and the watchdog sends the aborts. This is how nvme(4)
holds requests while a queue is in recovery.

Reviewed by:            imp
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D61118
6e6f63c3807dd5557bb8f4621b262ad81241c1b2 Jaeyoon Choi 2026-11-03 04:23:35

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ufshci: fail the controller when a polled command never completes

The reset task waits on its own polled bring-up commands. If one was
lost, nothing could complete it, and the poll panicked after ten
seconds.

Fail the controller instead. The failure path completes every
outstanding request, including the polled one, so the poll returns an
error to its caller. A polled command is only sent while the controller
is being brought up or by the passthrough ioctl, and a lost one means
the controller is not usable anyway.

Reviewed by:    imp
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D61119
30fd39861f8d4f24bbe5c3931e8c5adce21d2f1d Jaeyoon Choi 2026-11-03 04:24:22

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ufshci: tell CAM when the controller is gone for good

When the controller failed for good, CAM was not told, so its disks
stayed and every command to them failed.

Post AC_LOST_DEVICE from the failure path so CAM removes them.

Reviewed by:            imp
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D61120
1066d5e15f086df9849bab7a95edb69fcbad3310 Jaeyoon Choi 2026-11-03 04:25:06

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ufshci: try the link startup more than once

A device that is still powering on may not answer the first
DME_LINKSTARTUP, and the driver gave up after one try.

Try up to three times. Both attach and reset use this path.

Reviewed by:            imp
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D61121
4861ef4e82451bfb1e5fd58d02a38f6baf20eb24 Jaeyoon Choi 2026-11-03 04:26:00

debug: classified in 03-filenames_plain1 by 'sys/dev/'


ufshci: report the SCSI status and sense to CAM

A CHECK CONDITION was reported to CAM as a transport error without
valid sense, so CAM retried blindly. After a reset the device answers
NOT READY, and those retries ran out and detached the disk.

Report the SCSI status and sense with CAM_AUTOSNS_VALID, and freeze the
device queue on a SCSI status error. A GOOD status with a failed
response is still an error. Stop logging every CHECK CONDITION.

Reviewed by:            imp
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D61122
7d5d54dec54fc377b422d94e8c578c10281f28ff Jaeyoon Choi 2026-11-03 04:26:56

debug: classified in 03-filenames_plain1 by 'sys/dev/'

uchcom: validate baud rate in uchcom_pre_param
Check the requested baud rate in uchcom_pre_param() instead of working
around it in uchcom_calc_baudrate(), where a rate of 0 caused a
divide-by-zero.  The pre_param callback is the proper place for this check.

Reviewed by:    aokblast
Differential Revision:  https://reviews.freebsd.org/D61127
418b14ae076f310cab21ee6aabe2a7389c80dbb0 Kevin Lo 2026-11-03 08:04:21

debug: classified in 03-filenames_plain1 by 'sys/dev/'

FDT, clk_fixed: add gated-fixed-clock support and deferred initialization
- Add CLK_TYPE_GATED_FIXED with GPIO-based gate control.
- Support optional vdd-supply regulator.
- Delay clknode registration until parent clock and other dependencies
  are present (via new_pass).

While I'm in, switch license header to the new SPDX format.

MFC after:      2 weeks
Reviewed by:    manu
Differential Revision:  https://reviews.freebsd.org/D58103
e495998e7c6d39a6f818813bb06729c49eaf58fb Michal Meloun 2026-11-03 09:25:27

debug: classified in 03-filenames_plain1 by 'sys/dev/'

hwpmc/amd: prime UMC perfmon block before programming counter registers
UMC counter register writes do not take effect while no counter in the
channel is enabled. Reserve the last counter slot of each UMC channel
and keep it enabled with EventSelect=0 so writes to the remaining slots
take effect. Reserved slots are not exposed to MI code.

UMC perfmon MSRs are package-scoped. A per-socket reference count arms
the reserved slots on the first amd_pcpu_init() for a socket and
disarms them on the last amd_pcpu_fini().

Reviewed by:    mhorne
Sponsored by:   AMD
Signed-off-by:  Osvaldo Janeri Filho <ojanerif@amd.com>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2422
662deb47077d5b9c9c71d419dc0c2ec462b07542 Osvaldo Janeri Filho 2026-09-10 16:20:31

debug: classified in 03-filenames_plain1 by 'sys/dev/'

bnxt: add 400GBase-FR4 support
Support 400GBase-FR4 optics, allowing the driver to report
"Ethernet autoselect (400GBase-FR4 <full-duplex>)"  for FR4
media.

Differential Revision: https://reviews.freebsd.org/D61135
Reviewed by: sumit.saxena_broadcom.com
Sponsored by: Netflix
9ed1713e2818aed7d785fcc94a675a421a51e7e1 Andrew Gallatin 2026-11-03 15:26:34

debug: classified in 03-filenames_plain1 by 'sys/dev/'

iichid: keep a fixed sampling cadence in polled mode
Touchpads using sampling mode have a sampling task which is run at
a certain polling rate. When the system is under load this task may
not complete quickly which might stretch the time taken beyond what
the polling rate should be, leading to dropped touchpad motion.
On my laptop this causes the touchpad to be barely useable when
the system is under heavy load, and it is really difficult to move
the cursor since so many events are dropped.

This change adjusts the sampling loop to schedule the next polling
event to take place at a specific time in the future, based on the
polling period. If servicing the poll takes longer due to load then
the next sample will still be scheduled at its original time.

Approved by:    wulf, khng (mentor)
Differential Revision:  https://reviews.freebsd.org/D0914
e58325fb988c1704637656b197af65e67657d6fd Austin Shafer 2026-09-30 19:05:49

debug: classified in 03-filenames_plain1 by 'sys/dev/'

bnxt: correct more mappings for 400G optics and 100G LR
- Support 400G-DR4 optics
- Support 400G-CR8 and -SR8 with their types, rather than generic 400G-AUI8
- Use the generic 400G-AUI8 for 400G-SR4, rather than mislabeling it -DR4
(We probably should add a 400G-SR media type, but I don't have any to test ATM)
- Add missing legacy PAM4 100G LR entry and matching media-selection cases.

Reviewed by: sumit.saxena_broadcom.com
Differential Revision: https://reviews.freebsd.org/D61162
Sponsored by: Netflix
28d8abeaa5741768cbf01be1aa3f34c6cd6db9a2 Andrew Gallatin 2026-11-03 17:40:18

debug: classified in 03-filenames_plain1 by 'sys/dev/'

bnxt_en: update the driver version to 239.1.153.0
bnxt_en driver version has not been updated for
a while, updating the version now so it better
reflects the current state of the driver.

Sponsored by:   Broadcom Inc
9145e8a2ebe57b260e8e929043ed2052188eddae Sumit Saxena 2026-11-04 09:56:10

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amdsmu(4): Fix 32-bit compile
For what is worth, since i386 is going away soon and still does not
compile.

Fixes:          https://cgit.freebsd.org/src/commit/?id=cd96657b6708 ("amdsmu: Print how long system spent in S0i3")
Sponsored by:   The FreeBSD Foundation
208d30a8f594e5683992a71dd01747179a1f923d Olivier Certner 2026-11-04 10:45:26

debug: classified in 03-filenames_plain1 by 'sys/dev/'

sdiob: copy vendor/device IDs from card common CIS
Copy both the vendor and device IDs from the card common CIS if they are
absent in a function.

These are optional according to the spec. [1]

[1] Part E1 SDIO Simplified Specification §16.6

MFC after:      3 days

Reviewed by:    kibab, imp, adrian
Differential Revision:  https://reviews.freebsd.org/D60988
c91dfb47e0bcdf682f7f152624e03747787c6ea3 Ahmad Khalifa 2026-11-04 15:37:54

debug: classified in 03-filenames_plain1 by 'sys/dev/'

arm64: pte.h: Correct S2 MEMATTR definitions
Fix the definition of ATTR_S2_MEMATTR_NC to 0x5, instead of the current
0xf which is the encoding for ATTR_S2_MEMATTR_WB.
While at it, add remaining device memory attributes and define missing
bitshifts for easier value extraction.

Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2476
c90253b58cbbb3346696e6eb49e6021c4d022125 Kajetan Puchalski 2026-10-15 16:30:07

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

arm64/vmm: Remove PMXEVCNTR_EL0 from the switcher
PMXEVCNTR_EL0 writes PMEVCNTR<n>_EL0, selected by PMSELR_EL0.SEL.
All the counter registers are saved and restored in their own block, so
at best saving and restoring this register is pointless.
Given that it comes right after writing PMSELR_EL0 with no barrier, at
worst it could break things.
Remove the register from the switcher code.

Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2481
7f2e6600acc4f6ec6a2049c7816b8a849c9b6773 Kajetan Puchalski 2026-10-21 14:15:28

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

arm64/vmm: Disable fine grained trapping of range-based TLBI instructions
vmm passes the FEAT_TLBIRANGE field of ID_AA64ISAR0_EL1 to the guest, but also
enables fine-grained traps in the range-based TLBI instructions. This didn't
cause a problem until commit 5549785
("arm64 pmap: use range-based TLBI instructions"); following this commit, the VM
will exit with VM_EXITCODE_REG_EMUL during boot if the host supports FEAT_FGT and
FEAT_TLBIRANGE.

This commit disables fine-grained trapping of these instructions.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Pull Request:   https://reviews.freebsd.org/D60196
38ead08e27addad96223f7cc5b13f2863de2a6f6 Sarah Walker 2026-10-01 10:19:53

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

ixgbe: Guard E610 Link Default Override access
Reading Link Default Override uses the E610 Admin Command Interface,
whose mutex is initialized only on E610.  Calling it on other adapters
can hang attach, as observed on X520.

Skip the read on non-E610 devices, leaving the cached policy invalid so
that the existing link-state guard also skips force-link commands.

Reviewed by:    kgalazka
Fixes:          https://cgit.freebsd.org/src/commit/?id=7868958f5c79 ("ix(4): Support Total Port Shutdown on E610")
MFC after:      1 week
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D61144
2c6b01416f80462b393bbe70a38cea017325dea8 Kevin Bowling 2026-11-04 16:55:44

debug: classified in 03-filenames_plain1 by 'sys/dev/'

bnxt: avoid unintialized use of media_type in bnxt_add_media_types()
When 5e6e4f752833 landed, it inadvertently allowed unsupported / unknown
phys with  a valid link_info->sig_mode to use  media_type uninitialized.
Fix this by returning from those cases that do not assign a media_type
so as to avoid using it uninitialized.

Reported by: imp (forwarding an llm's post-commit review of previous
                  changes to this file)
Fixes: https://cgit.freebsd.org/src/commit/?id=5e6e4f752833
Reviewed by: imp, kbowling,  sumit.saxena_broadcom.com
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D61164
36cd9f2ff3316e113eb2ed0c69b70695c0d9b9c8 Andrew Gallatin 2026-11-04 17:01:50

debug: classified in 03-filenames_plain1 by 'sys/dev/'

vt_vga: repost only a vgapci(4) video device
When vt(4) falls back to vt_vga, vga_init() passes vd_video_dev to
vga_pci_repost(), which expects a vgapci(4) device. The framebuffer
driver that set it need not provide one: drm-kmod's linux_fb passes the
parent of the DRM parent device, which is vgapci for LinuxKPI PCI
drivers but the PCI bus for virtio-gpu, whose DRM parent is the virtio
PCI transport. On x86, vga_pci_repost() then calls pci_get_class() on
the bus, which fails the accessor's KASSERT under INVARIANTS; without
INVARIANTS the class reads as 0 and the repost is skipped. Repost only
a vgapci device.

Signed-off-by:  Denis Borovikov <denis.borovikov@gmail.com>
Reviewed by:    wulf
Differential Revision:  https://reviews.freebsd.org/D60880
2edd355e33d28e02f7c7ab3809729f5420c5edaf Denis Borovikov 2026-11-04 17:13:50

debug: classified in 03-filenames_plain1 by 'sys/dev/'

uart: Set the bus space tag before parsing hw.uart.console
uart_cpu_getdev() lets hw.uart.console override the FDT, but
uart_getenv() maps an "mm:" address with uart_bus_space_mem, which is
only assigned after the FDT probe.  On riscv and arm it is still NULL
at that point, so bus_space_map() faults before there is a console.
On riscv this happens on any EFI boot where the firmware provides an
SPCR table, since the loader turns it into hw.uart.console.

Initialize uart_bus_space_mem to fdtbus_bs_tag, as uart_cpu_arm64.c
does with &memmap_bus (See also 0624eddcffefe).

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299089
Reviewed by:    mhorne
MFC after:      1 week
Signed-off-by:  Rick Richard <rick@sloservers.com>
9db8ae83e62e9a1391674a14b0b7d76de2e3c3f7 Rick Richard 2026-10-03 16:00:00

debug: classified in 03-filenames_plain1 by 'sys/dev/'

acpi: Implement debug.acpi.suspend_bounce for suspend-to-idle
Reviewed by:  olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61134
fcaea1200aad79d7c0f7c70e56aae76a34d0abab Aymeric Wibo 2026-11-02 14:47:20

debug: classified in 03-filenames_plain1 by 'sys/dev/'

hwpmc: use the PerfMonV2 DF encoding on Family 19h
Family 19h processors with PerfMonV2 use the Family 1Ah DF encoding.
Selecting it by family alone drops the upper unit mask bits, and most
DF events count zero.

Reviewed by:    Ali Mashtizadeh <ali@mashtizadeh.com>
Sponsored by:   AMD
MFC after:      1 week
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>
Differential Revision:  https://reviews.freebsd.org/D60769
869bb2bbb7809e79cd672a6adc46bdc79a38f382 Osvaldo Janeri Filho 2026-11-04 17:43:15

debug: classified in 03-filenames_plain1 by '['lib/libpmc/', 'sys/dev/']'

libpmc: Map AMD Family 1Ah models 00h-0Fh to amdzen5
178d0b5b8da7 adapted the Zen 5 pattern matching from Linux perf.
However, Linux prints CPU models with a single digit when under 0xF
(allowing |[[:xdigit:]] to match 0h-Fh), whereas hwpmc/libpmc formats
model numbers with two leading hex digits (00h-0Fh).

Fix the pattern to explicitly cover two-digit hex models in the 00h-0Fh
range, and add a test case verifying table selection across Zen 5 and Zen 6
cpuid strings.

Reviewed by:    Ali Mashtizadeh <ali@mashtizadeh.com>
Signed-off-by:  Osvaldo Janeri Filho <ojanerif@amd.com>
Fixes:          https://cgit.freebsd.org/src/commit/?id=178d0b5b8da7 ("libpmc: Import AMD Zen 6 PMU events.")
Sponsored by:   Advanced Micro Devices, Inc.
Differential Revision:  https://reviews.freebsd.org/D60625
a01ea5156198fd6ae284a0d84b957b978fa017eb Osvaldo Janeri Filho 2026-11-04 17:51:45

debug: classified in 03-filenames_plain1 by 'lib/libpmc/'

cp2112: Check status errors and bound I2C waits
A USB error during an I2C transfer can leave `cp2112(4)` blocked indefinitely,
preventing USB detach and even reboot from completing.

`cp2112iic_check_req_status()` uses the status response without checking whether
the exchange succeeded. A failed exchange can therefore reuse a stale busy
response and retry indefinitely. The output callback also records an error
without marking the transfer done, causing its waiter to sleep again.

Check the exchange result before using the response, and mark failed output
transfers complete. Use absolute deadlines based on `USB_DEFAULT_TIMEOUT`
(five seconds) for output and input condition-variable waits, and stop
repeated busy status responses after the status loop's own deadline.
Clear pending input state when the paired output request fails.
These are per-wait and status-loop bounds; they do not impose a
single five-second limit on the entire I2C operation.

Add `HQ_HID_IGNORE` entries for both VID/PID pairs matched by
`cp2112`, so `usbhid` does not claim the interface ahead of the
bridge driver. Define `LUMANATE` in `usbdevs` and use
`USB_VENDOR_LUMANATE` for the existing `0x1009` entry in both device tables.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300017

Related hardware testing: https://reviews.freebsd.org/D60989,
the RNG90 I2C slave driver. This controller fix applies independently of
that driver.

Reviewed by:    wulf, adrian
Differential Revision:  https://reviews.freebsd.org/D61065
Event: NetApp/Vendor Summit Hackathon 202611
e9e4115a0bb41416bf5e1277627fc6c565073972 Patrick Tudor 2026-11-04 18:41:37

debug: classified in 03-filenames_plain1 by 'sys/dev/'

e1000: Separate DH89xxCC memory errors
DH89xxCC shares the 82580 MAC type but reserves several of its memory
error control and status registers.  Accessing the full 82580 register
set breaks normal RX/TX operation on affected adapters.

Give DH89xxCC separate configuration, accounting, and recovery paths.
Use its transmit packet-buffer ECC counter and DMA/LAN parity status
with device-specific masks, avoiding the reserved receive-buffer ECC
and PCIe error registers.  Retain the port-reset sequence for fatal
memory-error recovery without waiting for the absent STATUS.RST_DONE.

Tested by:      chuck2k (https://github.com/opnsense/src/issues/329)
Fixes:          https://cgit.freebsd.org/src/commit/?id=915c628c4f49 ("igb: Report 82580 memory ECC errors")
MFC after:      1 day
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D61138
0857b57787cb2bdd2bb123b12638ea5e4c10eabd Kevin Bowling 2026-11-04 19:32:50

debug: classified in 03-filenames_plain1 by 'sys/dev/'

tpm: crb: Correct the Pluton mailbox handshake
Pluton's REPLY register indicates readiness for a new notification, not
completion of the notification just sent.  Wait for REPLY=1 before
ringing the mailbox, then wait for START=0 when a synchronous state
change needs acknowledgement.

Use a separate command notification callback that waits for mailbox
readiness but leaves command completion to the existing CRB_CTRL_START
polling.  Bound readiness waits by TPM_TIMEOUT_C, including asynchronous
idle notifications, while retaining the command's execution timeout.

This resolves reported command timeouts on a Framework AMD laptop.

Tested by:      olivier, tuexen
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D61128
4995fd4bf2c61e30363e588c5b90d7fc9145bf5e Kevin Bowling 2026-11-04 19:43:28

debug: classified in 03-filenames_plain1 by 'sys/dev/'

tpm: crb: Dump register state on command failures
Include the command code in notification failures and the command code
and execution timeout in completion failures.  Capture CRB control
registers on completion timeouts and Pluton mailbox readiness or
acknowledgement timeouts, before cancellation or cleanup changes them.

Include locality registers when present and mailbox registers for the
Pluton start method.  The dump contains transport state without command
payloads or response data.

Tested by:      olivier, tuexen
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D61128
915eb355d8fe8555f7a74c6db95bc3c02610a939 Kevin Bowling 2026-11-04 19:43:54

debug: classified in 03-filenames_plain1 by 'sys/dev/'

virtio_random: avoid using vtrnd_detach in the failure path
On the off chance that we discover more than one virtio-random device,
the second one will deregister the global instance or trip an invariant
when it fails to attach and calls vtrnd_detach().

We don't have that many resources to free, so just inline those.  This
is purely a hygiene thing, we haven't seen an instance of this in the
wild (to my knowledge).

Reviewed by:    bnovkov, kfv
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D61050
26ba71f73e8914ecd9e5b1e7bb864fee41158d04 Kyle Evans 2026-11-04 21:31:31

debug: classified in 03-filenames_plain1 by 'sys/dev/'

virtio_random: stop on detach, don't poll
If the device is hung, then polling will block the detach and hang us.
Stop it and drain the queue instead.  This fixes a hang on detach in
some circumstances without the upcoming virtio_pci_modern fix.

Reviewed by:    bnovkov, kfv
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D61051
cce522853aae3da45b131c2522dd2510edf083e7 Kyle Evans 2026-11-04 21:31:31

debug: classified in 03-filenames_plain1 by 'sys/dev/'

virtio_pci_modern: enable virtqueues before completing attach
Most of our drivers setup interrupt(s) and virtqueues are enabled at
that time, but nothing will currently enable them for devices that we're
only going to poll.  This most notably affects virtio-random, and the
problem can be observed with qemu's q35 emulation and a random device
attached.  The q35 implementation ignores the ring unless it's enabled,
so vtrnd_harvest() will consistently EAGAIN rather than contribute
anything of value, but with this patch it becomes functional.

This can be reproduced with a qemu invocation like so:

qemu-system-x86_64 -machine q35,accel=tcg -cpu max -smp 2 -m 2G \
  -drive file=FreeBSD-16.0-CURRENT-amd64-ufs.qcow2,if=virtio \
  -device pcie-root-port,id=rp1,bus=pcie.0,chassis=1 \
  -object rng-random,id=rng0,filename=/dev/urandom \
  -device virtio-rng-pci,rng=rng0,bus=rp1 \
  -display curses

Reviewed by:    bnovkov, kfv
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D61052
c67e695b8f7eff84f7daa9e30eba7eb5ec552436 Kyle Evans 2026-11-04 21:31:31

debug: classified in 03-filenames_plain1 by 'sys/dev/'

gve: Fix AdminQ buffer DMA sync directions
In gve_verify_driver_compatibility(), the driver populates the
gve_driver_info buffer for the device to read. Sync this buffer with
BUS_DMASYNC_PREWRITE instead of BUS_DMASYNC_PREREAD before issuing
the command.

In gve_adminq_describe_device(), the device populates the
gve_device_descriptor buffer for the driver to read. Sync this buffer
with BUS_DMASYNC_PREREAD instead of BUS_DMASYNC_PREWRITE before
issuing the command.

In gve_adminq_get_ptype_map_dqo(), the device populates the
gve_ptype_map buffer for the driver to read. Add the missing
BUS_DMASYNC_PREREAD and BUS_DMASYNC_POSTREAD syncs around the
command.

In normal GCP environments this did not cause a functional failure
because the underlying platforms are DMA cache-coherent and
bus_dmamap_sync() inside gve_adminq_issue_cmd() still provided a
memory barrier before ringing the AdminQ doorbell. However, if bounce
buffers are used, the wrong or missing sync directions would cause the
OS to skip copying between the driver buffer and the bounce buffer in
the expected direction.

Signed-off-by: Tim Hostetler <thostet@google.com>

Reviewed by:    markj, Jasper Tran O'Leary <jtranoleary@google.com>
Fixes:          https://cgit.freebsd.org/src/commit/?id=54dfc97b0bd9 ("Add gve, the driver for Google Virtual NIC (gVNIC)")
Fixes:          https://cgit.freebsd.org/src/commit/?id=d438b4ef0cfc ("gve: Add DQO RDA support")
Differential Revision:  https://reviews.freebsd.org/D61172
64ea2b980884adcc774b04b2c0d206ced711bd76 Tim Hostetler 2026-11-04 23:24:59

debug: classified in 03-filenames_plain1 by 'sys/dev/'

gve: Page-align DQO descriptor and completion rings
Currently, gve_rx_alloc_ring_dqo() and gve_tx_alloc_ring_dqo() request
CACHE_LINE_SIZE alignment when allocating DMA memory for the DQO TX/RX
descriptor and completion rings. The device requires stronger alignment
than cache line alignment, which was incidentally being met due to how
the kernel allocates memory. Explicitly meet this requirement by
requesting page aligned memory.

Signed-off-by: Tim Hostetler <thostet@google.com>

Reviewed by:    markj, Jasper Tran O'Leary <jtranoleary@google.com>
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D61211
9d48e88e023634e12530bf9db4a2e85d022b93db Tim Hostetler 2026-11-04 23:25:00

debug: classified in 03-filenames_plain1 by 'sys/dev/'

snd_envy24ht: Fix out-of-bounds DMA buffer indexing
378e0c5c8967 reduced the number of playback channels from 5 to 1. This
introduced a regression, because the global DMA buffer indexing was not
adapted accordingly, which now results in kernel panics because of
out-of-bounds reads into the buffer. Additionally, because of wrong
indexing, recording channels ended up being serviced by the playback
part of envy24ht_intr().

Register 1 recording channel instead of 2 + sc->adcn, as the recording
DMA buffer only has room for 1 stereo stream. With 1 channel per
direction, give each channel the first index of its direction
(ENVY24HT_CHAN_PLAY_DAC1 and ENVY24HT_CHAN_REC_ADC1).

While here, fix the buffer wrap in envy24ht_r16sl(). It has to be
ch->size / ch->unit, but was copied verbatim from the 32-bit equivalent,
whose samples are twice as large, so 16-bit recording wrapped halfway
through the DMA buffer and never read the second half.

Fixes:          https://cgit.freebsd.org/src/commit/?id=378e0c5c8967
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299952
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D61155
dbf51f8ed0a5bda749dd20aedca67ddcdfe70980 Christos Margiolis 2026-11-03 10:28:58

debug: classified in 03-filenames_plain1 by 'sys/dev/'

snd_hda: wake display audio and restore amplifier settings
An Intel display-audio codec was observed to remain in D3 after monitor
sleep on DragonFly BSD. Starting a new stream then produced no sound,
and waking the codec alone left the output pin amplifier muted and other
function configuration unrestored.

Read the audio function power state at stream start. If its requested or
actual state is not D0, use the existing power-up routine before
configuring and starting the stream, then restore the function to a
known state:

Restore selectors, pins, EAPD, GPIO/GPO and direct codec patches, then
replay the cached gain and mute values once the pins are configured.
Split widget configuration out of hdaa_audio_commit() into
hdaa_audio_widget_commit() so the wake path can reuse it without
reinitializing the cached amplifier values. Preserve the existing
volume, mute and forced-mute values.

Re-enable unsolicited responses, refresh ELD, and run jack presence
handling for playback pins. Skip the full presence handler for recording
pins only: its recording path can drop the driver lock to update the
recording source, which is not safe while starting a stream with the
channel lock held. The playback path does not drop the driver lock, so
it is safe to run here, and it is what matters for display audio, whose
pins belong to playback associations.

GET_POWER_STATE reports the actual state in ACT (bits 7:4) and the
requested state in SET (bits 3:0). They can differ during a transition.
Checking both avoids skipping the D0 request when the function is still
actually in D0 but has been requested to power down, or when D0 has been
requested but the actual state has not reached D0 yet. The observed
post-sleep response on DragonFly was 0x233, with both fields reporting
D3.

Despite their names, HDAA_AMP_MUTE_DEFAULT (0xffffffff) and
HDAA_AMP_VOL_DEFAULT (-1) are sentinels meaning "keep the cached
setting" in hdaa_audio_ctl_amp_set(). Passing them leaves ctl->muted,
ctl->left and ctl->right unchanged, then writes the cached values to the
hardware while respecting ctl->forcemute. It does not select factory
defaults or unconditionally unmute the output.

Preserve the existing behavior when the power-state query returns
HDA_INVALID or both fields already report D0, and leave the D0 fast path
and invalid power-state query handling unchanged.

The observed wake-only silence and amplifier recovery were seen on
DragonFly BSD. This FreeBSD adaptation has not been validated on FreeBSD
hardware.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299139
MFC after:      2 weeks
Reviewed by:    christos
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2464
43bbd71ac785fcc4ee39a8c0ef29d59fcb8c2a3c David Bidner 2026-11-05 12:28:15

debug: classified in 03-filenames_plain1 by 'sys/dev/'

hwpmc: use the UMC enable bit with PerfMonV2
The PerfMonV2 start and stop methods set the core enable bit on UMC
counters too, so UMC events never count.  Use the UMC enable bit, as
the legacy methods do.

Reviewed by:    mhorne, Ali Mashtizadeh <ali@mashtizadeh.com>
Fixes:  https://cgit.freebsd.org/src/commit/?id=9d3064010590 ("hwpmc_amd: add PerfMonV2 global-control path")
Sponsored by:   AMD
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>
Differential Revision:  https://reviews.freebsd.org/D60770
abd7dfa09a0ed1c06924226da0285d0731273f66 Osvaldo Janeri Filho 2026-11-05 13:32:29

debug: classified in 03-filenames_plain1 by 'sys/dev/'

sdhci: Add generic HS200 tuning and clock fixes
Allow HS200 tuning only above 100MHz timings, let the host driver keep a
fixed maximum clock, and stop clearing max_clk in the generic FDT attach so
that a controller driver can set it before attach.

Differential Revision:  https://reviews.freebsd.org/D60885
052c745c3bb2fe80c384c40d0b2abea23810f92e Emmanuel Vadot 2026-10-20 08:09:18

debug: classified in 03-filenames_plain1 by 'sys/dev/'

clk: rockchip: rk3328: Add the MMC sample and drive clocks
Describe the SDMMC, SDIO, EMMC and their sample/drive phase clocks so that
host drivers can tune them.

Reviewed by:    mmel
Differential Revision:  https://reviews.freebsd.org/D60887
6e4c139d301913769f3a1f4e34cb426afa1e276a Emmanuel Vadot 2026-10-20 08:09:19

debug: classified in 03-filenames_plain1 by 'sys/dev/'

dwmmc: Add HS200 support
Add the tuning procedure (CMD21 with the standard JEDEC tuning block
patterns), the 1.2V/1.8V/3.3V signaling voltage switch using voltage
bands, a watchdog for stuck requests, controller recovery and DMA fixes
needed to run HS200 reliably.

For the Rockchip glue, implement the tuning hook by sweeping the sample
clock phase over 360 degrees, picking the middle of the widest good window
and restoring the previous phase on failure.  The drive phase is set to
180 degrees.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D60888
49a3cbc47f8e721a787eb15c3e03b781e03f0f03 Emmanuel Vadot 2026-10-20 10:24:21

debug: classified in 03-filenames_plain1 by 'sys/dev/'

sdhci: rockchip: Enable HS200 on the RK3399
Pin the xin clock to 200MHz, use the generic UHS timing and tuning
methods, parse the eMMC properties and the vqmmc supply from the device
tree, and set the I/O voltage through the regulator framework instead of
the S18 bit.  Limit the RockPro64 to 100MHz.

Reviewed by:    mmel
Differential Revision:  https://reviews.freebsd.org/D60889
689a2df26341820a450853437a15b8b2b7708bae Emmanuel Vadot 2026-10-20 10:24:21

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #29: clk
clk: rockchip: Add a mux flag to select the closest parent

Add RK_CLK_MUX_ROUND_PARENT for muxes whose parents are fixed rate clocks
that can be shared with other consumers.  When a rate is requested, pick
the parent with the rate that best fits the rounding flags and never change
the rate of a parent.  Without it the request is passed up to the shared
parents, which refuse to change.

Reviewed by:    mmel
Differential Revision:  https://reviews.freebsd.org/D60890
9c85482ca5ddbc1b9f6ae7f69d7dd1bdc07429a5 Emmanuel Vadot 2026-10-20 11:04:15

debug: classified in 03-filenames_plain1 by 'sys/dev/'


clk: rockchip: rk3568: Select the sdmmc source clocks by rate

The sdmmc clocks are muxes without a divider, whose parents provide the
750kHz clock for card identification and the 50MHz and 100MHz clocks for
the bus.  Use RK_CLK_MUX_ROUND_PARENT so that the host driver can change the
card clock, which used to fail with EBUSY and left the SD cards at half
speed.

Differential Revision:  https://reviews.freebsd.org/D60891
090ffc7f016df7eb0ec11e2b1966c3b5ee7ea9e0 Emmanuel Vadot 2026-10-20 11:04:15

debug: classified in 03-filenames_plain1 by 'sys/dev/'


clk: rockchip: rk3568: Select the eMMC core clock by rate

The eMMC core clock is a mux without a divider, whose parents provide the
375kHz clock for card identification and the 24MHz to 200MHz clocks for the
other modes.  Use RK_CLK_MUX_ROUND_PARENT so that the host driver can change
the card clock, which could not be done before.

Reviewed by:    mmel
Differential Revision:  https://reviews.freebsd.org/D60892
6925f2caedca8b0f62d15235f8b1fcc3ed11631e Emmanuel Vadot 2026-10-20 11:04:16

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #30: sdhci
sdhci: rockchip: rk3568: Fix the eMMC card clock

The divider of the controller is not functional on Rockchip, the card clock
is the rate of the core clock.  Request the core clock rounded down so that
the closest available rate is selected and report a failure, which was
ignored before.  The eMMC was identified at the wrong clock and was never
detected.

Reviewed by:    mmel
Differential Revision:  https://reviews.freebsd.org/D60893
40363144e85b08bbe581248066054c77ca0281b4 Emmanuel Vadot 2026-10-20 11:04:16

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sdhci: Do not reprogram an unchanged clock

sdhci_set_clock() compared the requested clock with slot->clock, which holds
the rate that the host driver actually applied.  Some drivers do not apply
the requested rate: the RK3568 one maps the 400kHz identification frequency
to 375kHz.  The two values then never match and every update_ios call goes
through SDHCI_SET_CLOCK() again, even when the clock did not change.

That ends in clk_set_freq(), which takes a sleepable lock, from the done
context of the mmc probe with the CAM locks held.  With another thread
holding the clock topology lock this panics with "sleeping thread holds CAM
device lock".

Remember the last requested clock in a new field and compare against it.
Clear it wherever slot->clock is cleared so that a reset still forces an
update.

Tested on a Quartz64 Model A with an NVMe drive on the PCIe slot, where the
panic was seen: 5 cold boots out of 5 attached everything.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D61012
3e9ff26d2ac7979ab840b9efcf3fdebec1a289db Emmanuel Vadot 2026-10-27 06:41:57

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sdhci: Defer XPT_SET_TRAN_SETTINGS to the slot taskqueue

Only XPT_MMC_SET_TRAN_SETTINGS was handed to the slot taskqueue.
XPT_SET_TRAN_SETTINGS, which mmc_xpt.c issues too, still called
sdhci_cam_settran_settings() directly from the CAM done thread with the
CAM device lock held.  Changing the bus clock can sleep (clk_set_freq()
takes the clock topology sx lock), which panics with "sleeping thread
holds CAM device lock".

Handle both opcodes the same way and complete the request from the
taskqueue.

Differential Revision:  https://reviews.freebsd.org/D61013
bbb90912eb3260260ad5cb3fc2f4c5ad4c144d7e Emmanuel Vadot 2026-10-27 18:12:53

debug: classified in 03-filenames_plain1 by 'sys/dev/'

mmc: Fix clock handling in mmc-pwrseq-simple set_power()
set_power() enabled the ext_clock on power-on and called clk_stop() on
power-off.  This was wrong in three ways:

- clk_stop() is not the counterpart of clk_enable() (it KASSERTs
  enable_cnt == 0), so it panics once the clock has been enabled.
- set_power() is driven by the MMC power_mode IOS and is called
  repeatedly for the same state during probing and tuning, so the
  enable/disable refcount over- or underflows and panics.
- The ext_clock may be a shared PMIC output (e.g. rk808-clkout2 on the
  RockPro64, also feeding the companion Bluetooth controller), so gating
  it here disturbs the other consumers.

The external clock is a free-running low-power oscillator the device
needs for its whole lifetime, so enable it once at attach and leave it
running.  Only act on real power-mode transitions in set_power() and
limit it to driving the reset line, which is what actually sequences the
device.

Tested on a RockPro64 (Broadcom BCM4359 SDIO Wi-Fi): the SDIO function
now enumerates and the module is reachable from userspace.

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D61023
604e2b5c2adb6a3961c68f3061840e7eafea67d4 Emmanuel Vadot 2026-10-22 06:33:55

debug: classified in 03-filenames_plain1 by 'sys/dev/'

e6000sw: Write the value, not the register, in Clause 45 writes
e6000sw_write_xmdio() loaded the Clause 45 register address into the
SMI PHY data register a second time, where the value to write belongs,
so every Clause 45 write stored the register address.

Its only caller, e6000sw_serdes_power(), runs at attach for ports 9 and
10 of the 88E6190 and 88E6190X to power one SERDES interface up and the
other down.  It wrote 0x2000 to the SGMII control register and 0x1000
to the 10GBASE-R PCS control register instead, so neither interface was
powered down and the rest of each register was overwritten.

Fixes:          https://cgit.freebsd.org/src/commit/?id=9aba06377d26 ("Add support for the Marvell https://cgit.freebsd.org/src/commit/?id=88E6190 11 ports switch.")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
843cb77850d991c349fd384fee6402b6af5d7f74 R. Christian McDonald 2026-11-05 16:55:24

debug: classified in 03-filenames_plain1 by 'sys/dev/'

tpm_crb: wait for idle and locality release after each command
transmit only requested GO_IDLE and the locality release, so a back-to-back
command could see stale state and fail with EIO.
A post-send idle timeout no longer discards a completed response.

Reviewed by:    kbowling
Approved by:    kbowling
Differential Revision:  https://ron-dev.freebsd.org/FreeBSD/src/pulls/93
bfe4be85a9354b92135e105028f2e1b3e0307ada Olivier Cochard 2026-11-04 21:05:22

debug: classified in 03-filenames_plain1 by 'sys/dev/'

virtio_random: defer first enqueue until after DRIVER_OK
According to the virtio spec:

> The driver MUST NOT send any buffer available notifications to the
> device before setting DRIVER_OK.

DRIVER_OK isn't set until after attach completes, so defer the first
enqueue.  We haven't found any problems as a result of this to the best
of my knowledge: q35 and other devices that we *have* been used with
will apparently check when we go DRIVER_OK.

Tested with q35 virtio-random, which still works.

Reported by:    llm-postcr
Reviewed by:    kfv, markj
Fixes:  https://cgit.freebsd.org/src/commit/?id=f1c5a2e3a62505 ("virtio_random: Pipeline fetching the data")
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D61228
12f90bbd3029fedea93e9bb0b1f02c3afafe237b Kyle Evans 2026-11-05 21:53:30

debug: classified in 03-filenames_plain1 by 'sys/dev/'

nvme: program the arbitration burst from Identify RAB
The controller's Recommended Arbitration Burst was ignored; the
specification advises matching the Arbitration feature's burst to it
even under plain round robin. Some controllers report unusable
values: programming the Apple S3X with its reported RAB wedged
sustained I/O, so quirked controllers keep their default
configuration. The hw.nvme.arb_burst tunable overrides the
recommendation.

Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59155
764761d3169d37ebbf24566344e50bfca5f013b9 Abdelkader Boudih 2026-08-24 18:15:15

debug: classified in 03-filenames_plain1 by 'sys/dev/'

nvme: drop the S3X single-outstanding-I/O quirk
The quirk's 8KB transfer clamp exposed raw character-device I/O to
the oversized-mapping stall fixed earlier, and its single tracker
turned a stranded request into a complete I/O stall. Without it an
S3X controller runs 128 trackers at its MDTS-derived transfer size
with no retries, failures, or timeouts, at about seven times the
serialized throughput.

Reviewed by:    imp, adrian, ngie
Approved by:    ngie (co-mentor)
Differential Revision:  https://reviews.freebsd.org/D59156
e6fc1765bd34e4e1a2b56fddfdf4eccc218c2ff9 Abdelkader Boudih 2026-08-24 18:15:16

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amd64: make hw.splitlock_force adjustable at runtime
The setting is only read on exec(2), so it can be safely modified.
This is useful to adapt the system to newly discovered buggy programs
without reboot.

Note that that running processes keep their mode until they exec again.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
57bc1e1c2f4c01953336bdf03743e30f4ba12cdc Konstantin Belousov 2026-11-06 13:05:50

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

cpuctl, x86: claim IBS NMIs orphaned by control MSR writes
A cpuctl(4) write that stops or reprograms IBS can clear the valid bit
of a sample whose NMI is already raised.  hwpmc then declines the NMI,
no other handler claims it, and with the default machdep.panic_on_nmi
the system panics.

Have nmi_handle_intr() claim, after all handlers declined it, one NMI
per cpuctl write to an IBS control MSR.  Claiming last, rather than
from a cpuctl NMI handler, cannot take an NMI away from hwpmc.

cpuctl.ko now needs the new kernel symbols; an MFC has to update both.

Reproduced on an EPYC 9654 by toggling IBS op through /dev/cpuctlN:
about one unclaimed NMI per 2000 toggles.

Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   AMD
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>
Differential Revision:  https://reviews.freebsd.org/D60765
f5304e44ff506082e8587bdcb857a8ad4b375364 Osvaldo Janeri Filho 2026-11-06 14:40:46

debug: classified in 03-filenames_plain1 by '['sys/dev/', 'sys/x86/']'

hwpmc: release a PMC whose ID could not be copied out
If copyout of the newly allocated PMC ID fails, the caller cannot use or
release the PMC. Release it in the kernel.

Reviewed by:    mhorne
MFC after:      3 days
Sponsored by:   Advanced Micro Devices, Inc.
Differential Revision:  https://reviews.freebsd.org/D60562
e5a48c8e0dd026ba953cf401c4dec02f76078aa2 Andre Silva 2026-11-06 15:20:08

debug: classified in 03-filenames_plain1 by 'sys/dev/'

arm64/pmap: Add support for FEAT_TTL
FEAT_TTL adds a Translation Table Level field for TLB maintenance intructions,
to indicate the level holding the leaf address for the address being
invalidated. This can reduce the cost of TLB invalidation.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D60090
f0b589edc7a7604b22b7cfcfc0a5bdf9fcbe29ad Sarah Walker 2026-09-01 14:24:41

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

arm64/acpica: Fix the IORT MSI xref type
The acpi IORT code incorrectly uses a u_int as the MSI xref type, while
INTRNG expects an intptr_t. Switch to using intptr_t to help document
this value is the xref for the MSI controller.

Reviewed by:    dsl
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D60653
e82b2913b780063e004cec8b3a7cc04a47c40124 Andrew Turner 2026-11-06 15:35:38

debug: classified in 03-filenames_plain1 by '['sys/arm64/', 'sys/dev/']'

hwpmc: Decline the AMD PerfMonV2 path when GLOBAL_CTL is absent
The v2 path writes AMD_PMC_GLOBAL_CTL whenever the PerfMonV2 CPUID bit
is set. bhyve passes that bit through from the host but does not emulate
the register, so loading hwpmc in a guest on a Family 19h or later host
panics the kernel.

amd_v2_hwcheck_cpu() already probes EVSEL MSRs, so probe GLOBAL_CTL
there too, in order to reject the v2 path and fall back to the generic
CPU class.

Fixes:          https://cgit.freebsd.org/src/commit/?id=9d3064010590 ("hwpmc_amd: add PerfMonV2 global-control path")
Tested by:      Osvaldo Janeri Filho <ojanerif@amd.com>
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Reviewed by:    mhorne, afscoelho@gmail.com
Differential Revision:  https://reviews.freebsd.org/D61133
0efaebd5ab83f5977f7f5a8f76321e77dee1fdb3 Christos Margiolis 2026-11-06 08:49:16

debug: classified in 03-filenames_plain1 by 'sys/dev/'

amd64/vmm: Don't advertise AMD PerfMonV2 or performance counters
vmm does not handle CPUID leaf 0x80000022, so a FreeBSD guest on a
Family 19h or later host panics on "kldload hwpmc", which trusts the
PerfMonV2 bit and writes AMD_PMC_GLOBAL_CTL.

Tested by:      Osvaldo Janeri Filho <ojanerif@amd.com>
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Reviewed by:    markj, kib
Differential Revision:  https://reviews.freebsd.org/D61141
8fb539b081dbfe3e93e607a5d4d36184c53c8aaf Christos Margiolis 2026-11-02 17:15:33

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

irdma: improve TCP header validation
iWARP handling code deals with TCP header processing outside of the normal TCP stack.
Add validation checks to verify the internal integrity of the TCP headers.

Reviewed By: tuexen, O11 Intel Networking group, #transport, bartosz.sobczak_intel.com
Sponsored by: NetApp, Inc.
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D58323
e0c6b88706a9fff9e4090803ba2338dd0ce97eba Richard Scheffenegger 2026-11-06 20:42:20

debug: classified in 03-filenames_plain1 by 'sys/dev/'

nvme: Add reservation, format and features command building support
Add command (struct nvme_command) building functions for the four
NVMe reservation opcodes (Report, Register, Acquire and Release),
Format NVM, and Get Features / Set Features, along with the
enumerations and data structures that go with them.  These are
shared between the kernel and userland, and are the underpinnings
for new camcontrol(8) subcommands (nvres, nvformat, nvfeature) that
will be added separately.

The reservation type names are intentionally similar to the SCSI
names for the same reservation types.

sys/dev/nvme/nvme.h:
  Add NVMe command building functions for the four NVMe
  reservation opcodes: nvme_ns_resv_report_cmd(),
  nvme_ns_resv_register_cmd(), nvme_ns_resv_acquire_cmd() and
  nvme_ns_resv_release_cmd().

  Add enumerated types for the various NVMe reservation
  subcommand actions (acquire, register, release), reservation
  types, and Change Persist Through Power Loss State values.

  Add struct nvme_resv_acq_data and struct nvme_resv_reg_data,
  the data payloads for reservation Acquire and Register.

  Add a new NVMe Format NVM command building function,
  nvme_admin_format_cmd(), and an enumeration for the Secure
  Erase Setting parameter for format.

  Add nvme_admin_get_feature_cmd() and
  nvme_admin_set_feature_cmd() functions to fill a struct
  nvme_command for Get Features / Set Features.

  Add macros for bitfields in the ctratt and mic dwords of the
  NVMe Identify Controller data structure.

  Add a prototype for nvme_hostid_sbuf().

  Stop byte swapping the hostid fields in
  nvme_resv_status_swapbytes() and
  nvme_resv_status_ext_swapbytes(), and document the fields as
  little endian.  The hostid is an opaque 8 or 16 byte value;
  keep it in the byte order the device returns it in instead of
  interpreting it at this level.

  Widen the nvme_ctrlr_cmd_get_feature() and
  nvme_ctrlr_cmd_set_feature() prototypes as described below.

  While here, fix the entry count clamp in the reservation status
  swapbytes functions to use sizeof(*s) rather than sizeof(s); using
  the pointer size made the clamp one entry too permissive.

sys/dev/nvme/nvme_util.c:
  Add nvme_hostid_sbuf(), which formats an 8 or 16 byte hostid
  (from the Get Features hostid feature, in the little-endian
  byte order the device returns it in) into an sbuf as an
  integer value in base 16, most significant byte first.

sbin/nvmecontrol/resv.c:
  Decode the now little-endian hostid fields explicitly when
  printing, and zero pad the printed 64-bit values.  Previously
  the extended hostid printed in a different byte order on big
  and little endian machines, and without zero padding between
  the two halves.

sys/dev/nvme/nvme_ctrlr_cmd.c:
  Refactor nvme_ctrlr_cmd_get_feature() and
  nvme_ctrlr_cmd_set_feature() to use the new command building
  functions from nvme.h and accept a namespace ID parameter.

  Refactor nvme_ctrlr_cmd_set_feature() to also accept the sv
  (save) parameter to persist a feature value across reset.

sys/dev/nvme/nvme_ctrlr.c:
  Update the temperature threshold, autonomous power state
  transition and host memory buffer callers for the new
  nvme_ctrlr_cmd_get_feature() and nvme_ctrlr_cmd_set_feature()
  arguments.

Co-authored-by: Reid Linnemann <reidl@spectralogic.com>
Co-authored-by: Dave Baukus <daveb@spectralogic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed by:    imp
MFC after:      1 week
Sponsored by:   Spectra Logic
Differential Revision:  https://reviews.freebsd.org/D59531
7a9e4375316b82ca3426820e24ee69101562611a Kenneth D. Merry 2026-11-07 01:05:54

debug: Commit manually moved from "unknown" to "hardware".

powerpc64: Don't ignore lookup errors in kernel linker
If a lookup fails for a R_PPC_JMP_SLOT (PLT relocation) ignoring errors
results in an address of 0 gets written into the jump slot, leading to a
NULL pointer jump when attempting to call the function it points to.
Fix this with proper error checking so that a module will fail to load
instead of crashing later on.
934ffa4c7d8c24c4eb81dbcc0c85a2fd29b4ea17 Justin Hibbits 2026-11-07 03:20:26

debug: classified in 03-filenames_plain1 by 'sys/powerpc/'

powerpc: Define the sub-word atomic load and store directly
All currently supported powerpc CPUs handle single-copy atomicity for
any size up to the native word size, so load and store operations are
guaranteed for sub-word size that are naturally aligned.
0f908dae9d08a7146bc1d783189899852f4d8ca4 Justin Hibbits 2026-10-26 21:05:56

debug: classified in 03-filenames_plain1 by 'sys/powerpc/'

asmc: notify the SMC of shutdown and restart
Nothing tells the SMC that a power off or restart was user requested, so
the T2 keeps rebooting the machine thinking the system is wedged.

Approved-by: ngie (co-mentor)

Reviewed by:    ngie, adrian
Differential Revision:  https://reviews.freebsd.org/D61260
4ce90d56a853431668aac4493eac9cc13ab79f26 Abdelkader Boudih 2026-11-07 09:14:28

debug: classified in 03-filenames_plain1 by 'sys/dev/'

xhci: only set the slot context parent hub fields on xHCI 1.2
The Enhanced SuperSpeed meaning of the slot context parent hub slot ID
and port number fields was introduced in xHCI 1.2. Controllers built to
an earlier revision define them only for a Low- or Full-speed device
behind a High-speed hub.

A SuperSpeed device behind a USB 3.2 hub on an Intel Alpine Ridge
controller, an xHCI 1.1 part, stops responding to Address Device and
loops in uhub_reattach_port until the port is disabled.

Fixes:          https://cgit.freebsd.org/src/commit/?id=20b19982545e ("usb: support SSP and SSPx2 xHCI")

Reviewed by:    aokblast, ngie, adrian
Differential Revision:  https://reviews.freebsd.org/D61278
6d5c80aee3ae8b16a0b08b25852430fb076fed37 Abdelkader Boudih 2026-11-07 09:56:13

debug: classified in 03-filenames_plain1 by 'sys/dev/'

acpi_apple: Fix sleep with non-sleepable lock held
Apple platform attach and detach functions are serialized with ordinary
mutex and contain code that executes malloc() that leads to INVARIANTS
warnings. Fix it through replacement of mutex with sx lock.

Fixes:  https://cgit.freebsd.org/src/commit/?id=d7d237ce731f ("acpi_apple: Apple platform ACPI driver")
Reviewed by:    seuros
Differential Revision:  https://reviews.freebsd.org/D61295
04db6f654c4fb908b94265eb392db3e56cb7da8c Vladimir Kondratyev 2026-11-07 17:20:50

debug: classified in 03-filenames_plain1 by 'sys/dev/'

acpi_apple: Add PNP record
Reviewed by:  seuros
Differential Revision:  https://reviews.freebsd.org/D61298
dc57dc2176cea78a44ef2cc745d02f77973aaae2 Vladimir Kondratyev 2026-11-07 17:20:50

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #31: asmc
asmc: factor out the PIO data port byte loops

Reuse existing pattern and evict magic numbers

No functional change: the port access sequence and the per-caller retry
and error reporting behaviour are unchanged.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61283
5ac6a4154b77164bb04d892401ccbc2513f582df Abdelkader Boudih 2026-11-07 20:25:59

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: rebuild asmc_key_dump on the by-index helper

asmc_key_dump() branched on the backend, but asmc_key_dump_by_index()
already dispatches on it, so the PIO arm open-coded a transaction it could
have called. Keep one printer for both.

Output is unchanged. The PIO arm checked asmc_key_read()'s return value
instead of printing a zeroed buffer; the merged printer keeps that. Its
retry exhaustion message is gone, which asmc_dumpall() cannot observe.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61284
d8318a8ba673c691514749ee34c417f6606d5396 Abdelkader Boudih 2026-11-07 20:26:18

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: share the getinfo and getbyindex PIO transactions

asmc_key_getinfo() and asmc_key_dump_by_index() both ran the command 0x13
transaction, the latter after a command 0x12. Put each behind a helper that
assumes the caller holds sc_mtx, and fold the shared response decode into
asmc_keyinfo_decode().

The index bytes are now derived inside the helper, so they are recomputed
per retry. Same value all the time.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61285
880b166b02e1454bdb261d8947cbcb18f6580bf6 Abdelkader Boudih 2026-11-07 20:26:25

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: collapse the per-fan speed sysctl handlers

The five fan speed handlers differed only in which key they read and
whether they wrote back. Select the key from a table through arg2, the way
asmc_sensor_sysctl() already packs a type and an index, and keep one
handler. A second table drives the seven registration calls.

No functional change,

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61286
12797df3a2d1f715e48592cb5443af5437b519ce Abdelkader Boudih 2026-11-07 20:26:33

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: collapse the SMS axis and light sensor sysctl handlers

asmc_mb_sysctl_sms_{x,y,z} differed only in which SMS key they read, and
asmc_mbp_sysctl_light_{left,right} only in which light key. One handler
each, selecting from a table through arg2.

No functional change.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61287
c72040208bab453dd73efeafd41063512ddabe2e Abdelkader Boudih 2026-11-07 20:26:42

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: table-drive the system state and board identity sysctls

The dev.asmc.n.system subtree was seven copies of "probe the key, then
register", and the auto_poweron/sil pair in asmc_init two more. Drive both
from tables.

No functional change.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61288
225dbb6374ca84b7f258226b190ebdf960deb6c7 Abdelkader Boudih 2026-11-07 20:26:52

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: scan every sensor range through one helper

asmc_detect_sensors hand-rolled the temperature and light scans as copies
of asmc_scan_sensor_range(). Give the helper a match predicate and route
all five ranges through it.

No functional change.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61289
f0f940c8df9d643ad616349c71c10714c54b3c3d Abdelkader Boudih 2026-11-07 20:27:01

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: correct the copyright address in asmcmmio

Use my FreeBSD address.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61290
c9a8fb0ab813ba3712196ed609c91b02f0d71fb7 Abdelkader Boudih 2026-11-07 20:27:13

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: move the backlight control level into the softc

light_control was a file-scope static shared by resume, the light.control
sysctl and the backlight method. Per-device state belongs in the softc.

No functional change.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61291
73b1453e6d87f9af4c4761049640c238fcee3bcd Abdelkader Boudih 2026-11-07 20:27:37

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: make the raw key debug state unconditional

The ASMC_DEBUG block was in mid-struct, so struct asmc_softc had a different
layout in translation units that missed opt_asmc.h.

No functional change.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61292
1988abf023a37e42d21ea38ec04fa4684262918f Abdelkader Boudih 2026-11-07 20:27:44

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: move the sysctl registration loops next to their tables

asmc_attach() and asmc_init() had 4 description tables inline,
several hundred lines from the tables they index. Wrapped each loop in a
function defined after its table.

No functional change.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61293
ff6ff0f596a65fa05ab706a06265202bc49c10f1 Abdelkader Boudih 2026-11-07 20:27:56

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: split the debug key access into asmc_debug.c

Move the ASMC_DEBUG code out of asmc.c into a file compiled only when the
option is set, gated in files.amd64 the way acpi_debug gates the ACPICA
debugger sources. The module Makefile writes the define into opt_asmc.h so
every translation unit sees it; the old CFLAGS.asmc.c form covered one.

No functional change.

MFC After: 1 Week
Approved-by: ngie (co-mentor)

Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D61294
d412f42e5377340d27702826bb35520d31d1156f Abdelkader Boudih 2026-11-09 18:35:09

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: split the PIO backend into asmcpio.c

Moved the inline PIO transactions out of the key transport routines,
which now only dispatch on sc_is_mmio, matching asmcmmio.c. getbyindex and
getinfo stay fused: PIO needs both halves under one hold of sc_mtx.

No functional change.

MFC After: 1 Week
Approved-by: ngie (co-mentor)

Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D61296
0b545e5a9281919117786d57e02876e8031dfc94 Abdelkader Boudih 2026-11-09 18:35:21

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: split the sysctl layer into asmcsysctl.c

Moved the dev.asmc.N tree out of asmc.c

No functional change

MFC After: 1 Week
Approved-by: ngie (co-mentor)

Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D61300
c714cde179a412b95535d2377fcc8dd4e192755e Abdelkader Boudih 2026-11-09 18:35:30

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: Use c99 initializers with for-loop counters to improve scoping

declared loop indices in the for statement
Index types are unchanged.

No functional change.

MFC After: 1 Week
Approved-by: ngie (co-mentor)

Reviewed by:    ngie, imp
Differential Revision:  https://reviews.freebsd.org/D61301
a3468ea7bd7a0b33b51a1a94ac2e39c0c231bd20 Abdelkader Boudih 2026-11-09 18:35:40

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: include sys/kernel.h

This is needed for the `MODULE*` macros.

This include was accidentally removed in the linked commit.

MFC after:      1 week
Reported by:    Ian Freislich <ianfreislich@gmail.com>
Fixes:  https://cgit.freebsd.org/src/commit/?id=c714cde179a4 ("asmc: split the sysctl layer into asmcsysctl.c")
87e27bcf3c47958ea57a14baef4a9d40353e934e Enji Cooper 2026-11-13 03:10:06

debug: classified in 03-filenames_plain1 by 'sys/dev/'

iSCSI: Fast and per-session timeouts
Support per-session configurable ping (SCSI NOP) and login timeouts
similar to what is supported in the Linux iSCSI initiator configuration file.

Reduce iscsi timer granularity to 0.1 sec.
For backwards compatibility, when all timers are selected on integer numbers,
all status messages are unchanged. If the higher granularity is used, the
log messages include sub-second granularity.

The sysctl(3) interface has changed from pure int to string, in order to
support fractional seconds in a human-readable, dotted notation.

Reviewed By: #netapp, #manpages, jhb, pauamma_chezdork.com, siderop1_netapp.com
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D32540
0c248bdf1d63625c40a541397d6e601cf9a51141 Richard Scheffenegger 2026-11-07 18:06:09

debug: Commit manually moved from "unknown" to "hardware".

pci: restore resizable BAR sizes in pci_cfg_restore()
After a device reset, resizable BARs return to their default sizes.
Restore them to the sizes they had prior to reset.

Reviewed by:    imp, adrian
Differential Revision:  https://reviews.freebsd.org/D61110
Approved by:    adrian (mentor)
Signed-off-by: Nick Price <nprice@FreeBSD.org>
665afd2a9d6469ce692de4018c7c015a194c201d Nick Price 2026-11-08 01:36:01

debug: classified in 03-filenames_plain1 by 'sys/dev/'

vmm: Emulate the byte forms of OR and AND with an immediate
Opcode 0x80 (group 1: r/m8, imm8) is in the decode table and
emulate_cmp() handles 80 /7, but emulate_or() and emulate_and() only
accept 0x81 and 0x83.  An "or byte ptr [mem], imm8" or "and byte ptr
[mem], imm8" on emulated memory therefore fails with EINVAL and bhyve
stops the guest with "Failed to emulate instruction sequence
[ 80 ... ]".  Seen with macOS: VoodooHDA starts the HDA controller's
CORB with "or byte [rax+0x4c], 2" (CORBCTL |= CORBRUN), and the guest
died at the first sound.

Accept 0x80 in both, with a one byte operand as emulate_cmp() does.
The file is shared with bhyve(8), so the fix covers the in-kernel
devices (HPET, local APIC without APICv, I/O APIC) and the user space
device models alike.

Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>

Reviewed by:    markj
MFC after:      1 week
Sponsored by:   keelos.dev
Differential Revision:  https://reviews.freebsd.org/D60997
8e7f9aa97b3e886afc2c445bb51c4d781a106a1e Wanpeng Qian 2026-11-08 16:05:04

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

powerpc/idle: Set 'RL' field in PSSCR on POWER9
The POWER9 does not do automatic state transitions when idling, so the
'MTL' field (Maximum Transition Level) is ignored.  Thus, setting '0'
for the 'RL' field (Requested Level) as was done means it
doesn't transition to any power saving level.  To fix this, set both the
'MTL' and the 'RL' fields to the same level.

On a Talos II at idle this drops the reported temperatures by ~10-15%.

MFC after:      3 days
04a3a6e3a8d9c27847caa4b807e777720bb6bf99 Justin Hibbits 2026-11-08 23:17:13

debug: classified in 03-filenames_plain1 by 'sys/powerpc/'

arm64 pmap: combine L3C accessed bits in pmap_mincore()
The accessed bit may be set in only some of an L3C superpage's L3
PTEs.  However, when pmap_mincore() found an L3C mapping, it reported
the accessed state of the specified L3 PTE only, so mincore(2) could
fail to report MINCORE_REFERENCED for an L3C superpage that had been
accessed.  When the accessed bit is not set in the specified entry, use
pmap_load_l3c() to combine the accessed bits from all of the L3C
superpage's L3 PTEs.

Found by:       Claude Code (Opus 5.5)
MFC after:      1 week
3ba68f5c5dcc9a4bcd513c28efce29afdfcb76ff Alan Cox 2026-11-02 01:18:01

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

arm64: Rename the user_regs struct and array
In preparation for storing a non-user register rename the struct so and
array so they are more obviously for sanitized registers.

While here switch to a flag field and add a flag to record if the
register is for userspace or just the kernel and check for this when
reading the value for userspace.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D60742
fb1fb7df9db5c133e36c09201fbedbddb32e37c5 Andrew Turner 2026-11-09 17:03:26

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

riscv: add QEMU marchid
Globally allocated per:
https://github.com/riscv/riscv-isa-manual/blob/main/marchid.md

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
bba06f0681bb8197f1cd11160fa489c1631f399c Mitchell Horne 2026-11-09 18:01:46

debug: classified in 03-filenames_plain1 by 'sys/riscv/'

asmc: compare integer results to zero explicitly
No functional change.

MFC After: 1 Week
Approved-by: ngie (co-mentor)

Reviewed by:    ngie, adrian
Differential Revision:  https://reviews.freebsd.org/D61303
88e0df0b33e29fe593f1fc07a3847d8764f1ef1b Abdelkader Boudih 2026-11-09 18:36:05

debug: classified in 03-filenames_plain1 by 'sys/dev/'

camcontrol: Fix extended host identifier retrieval
The Get Features command for the host identifier always requested
the 64-bit form (cdw11 EXHID=0), but the decoding logic sized the
identifier from the controller's CTRATT extended host identifier
capability bit, or always treated it as 128 bits when -U was
given.  On a controller supporting the extended host identifier,
the printed value did not match what was requested from the
controller.

Fetch the controller data before issuing the command, request the
extended form when the controller supports it, and decode the form
that was requested.  Reject -U when the controller only supports
64-bit host identifiers, since an 8 byte value cannot be shown as
a UUID.

sys/cam/nvme/nvme_all.c,
sys/cam/nvme/nvme_all.h:
        Add an exhid argument to nvme_get_feature_hostid(),
        matching nvme_set_feature_hostid(), and set the EXHID bit
        in cdw11 from it.

sbin/camcontrol/nvfeature.c:
        Fetch the controller data and determine the host
        identifier size before issuing the Get Features command,
        request only as many bytes as the identifier holds, and
        decode the identifier in the form it was requested.
        Reject -U on controllers without extended host identifier
        support.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=9814633f631b
Fixes:          https://cgit.freebsd.org/src/commit/?id=6eae951cd51b
MFC after:      1 week
Sponsored by:   Spectra Logic
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2dd34affca4d1041b8f6f58bb24c45f29b720430 Kenneth D. Merry 2026-11-09 18:47:01

debug: Commit manually moved from "unknown" to "hardware".

intel/intel_pmc: Add support for Cannon Lake through Meteor Lake
Match the platform by CPU model and attach on acpi with PWRM at
0xfe000000; the PMC is not PCI-enumerable on these platforms.
SLP_S0_RES offsets and granularities follow each generation's PCH
Family Datasheet Volume 2.  A mismatch between the LPIT residency
counter address and SLP_S0_RES is reported on attach.

Reviewed by:    olce, adrian
Differential Revision:  https://reviews.freebsd.org/D59596
fdf948e3f9e879937a85386fada277f93ba61434 Abdelkader Boudih 2026-11-09 20:03:36

debug: classified in 03-filenames_plain1 by 'sys/dev/'

ixgbe: Attach the MDIO bus after iflib drops the context lock
ixgbe_mdio_attach() ran from ixgbe_if_attach_post(), which iflib calls
with the context lock held.  Attaching the MDIO bus there also probes
and attaches the devices on it, and their register accesses go through
ixgbe_mdio_readreg_c22() and ixgbe_mdio_writereg_c22(), which take the
same lock.  A driver on the bus that was in the kernel or loaded by
loader(8) therefore recursed on the non-recursive iflib sx lock as soon
as it touched a register: INVARIANTS kernels panic in _sx_xlock_hard(),
others recurse silently.

Wrap iflib_device_attach() and attach the MDIO bus once it has
returned, so the children take the context lock like any later MDIO
access does.

Reviewed by:            kbowling
Fixes:                  https://cgit.freebsd.org/src/commit/?id=cfec995c87f3 ("ixgbe: add MDIO bus support")
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61199
88b7b851210762af4827f71b2757a7d4673006a9 R. Christian McDonald 2026-11-10 12:48:01

debug: classified in 03-filenames_plain1 by 'sys/dev/'

twsi: Do not clear the interrupt flag when changing the control bits
twsi_control_set() and twsi_control_clear() read the control register,
change some bits and write it back.  On the controllers where the
interrupt flag is cleared by writing a 1 to it (iflag_w1c), this clears
it as the flag is read as set.

In the polled mode this breaks the repeated start: START is set with
the flag cleared by the write, the hardware sends the repeated start at
once, and the flag is then cleared a second time, which loses the event
and leaves the controller with the status of the previous transfer.
Transfers with a repeated start fail with IIC_ESTATUS on an Allwinner
H6 until the controller works with interrupts.

Mask the flag out of the value that is written back, unless the caller
asks for it.

Tested on: H6
5e62bf3403379c92cf42fc33bb462b6fb7e54425 Emmanuel Vadot 2026-11-10 09:09:07

debug: classified in 03-filenames_plain1 by 'sys/dev/'

aw_rsb: Accept a write in a single message
The driver only took a write as two messages, the offset and then the
data.  A write on an I2C bus is a single message that starts with the
register, which is how a driver that can be on I2C or on RSB, like
axp81x, does it.  Split such a message into the two the controller
needs.

Tested on: A64
09624daf6485be05dee9d6110b0488589da06e20 Emmanuel Vadot 2026-11-10 08:34:49

debug: classified in 03-filenames_plain1 by 'sys/arm/'

Commit group #32: axp81x
axp81x: Move the sensors, sysctls and thresholds out of attach

Add one function for each of them: axp8xx_add_sensors(),
axp8xx_add_sysctls() and axp8xx_get_thresholds().

No functional change. This is a preparation to support PMUs without a
battery, like the AXP805, with this driver.
5065335ab4df5ce0cebe850758769f92190f79fb Emmanuel Vadot 2026-11-10 07:49:59

debug: classified in 03-filenames_plain1 by 'sys/arm/'


axp81x: Move the interrupt setup out of attach

Add axp8xx_setup_intr() which enables the interrupts and installs the
handler.

No functional change.
3e9384b3c3c5f9d32777024a069e8222e0cb2600 Emmanuel Vadot 2026-11-10 07:52:32

debug: classified in 03-filenames_plain1 by 'sys/arm/'


axp81x: Fix the register accesses

The register pointer was written without IIC_M_NOSTOP, so the controller
sends a STOP before the read message. On the Allwinner H6 (twsi) this
makes the reads return garbage without any error.

Set IIC_M_NOSTOP on it, and send the register and its value in a single
write message, like the other PMIC drivers do.

Tested on: A64, H6
07448cd0c6341793406fa0d7a2f33401be01c7a3 Emmanuel Vadot 2026-11-10 07:54:22

debug: classified in 03-filenames_plain1 by 'sys/arm/'


axp81x: Serialize the register accesses

The registers were accessed with iicbus_transfer(), which does not own
the bus.  The interrupt driven transfers of the Allwinner twsi
controller drop their mutex while they sleep waiting for the interrupt,
so two accesses can overlap, and the PMU shares its bus with other
devices, an RTC for instance.  Use iicbus_transfer_excl() so that the
accesses are arbitrated.

The regulators share the enable registers and the regulator framework
only serializes the accesses to a single regulator.  Protect the
read-modify-write of these registers with a lock, so that regulators
enabled at the same time cannot lose each other's update.

No failure was seen without this, it is there for correctness.

Tested on: A64, H6
40256923a2bd1e316fbfbfac692d58947ab40262 Emmanuel Vadot 2026-11-10 08:00:54

debug: classified in 03-filenames_plain1 by 'sys/arm/'


axp81x: Check the errors of the register accesses

axp8xx_regnode_enable() wrote back a value computed from a register it
failed to read, which clears the enable bits of all the other
regulators of that register.  Return an error instead, and do the same
in the other regnode methods, which used an uninitialised value when an
access failed.

Also initialise udelay in axp8xx_regnode_init(), as
axp8xx_regnode_set_voltage() can now fail before setting it.

Tested on: A64, H6
e41207729840f817a45a1db9894c5d633f541009 Emmanuel Vadot 2026-11-10 08:25:57

debug: classified in 03-filenames_plain1 by 'sys/arm/'


axp81x: Add a function to get the regulator definition

Move the lookup of the regulator definitions out of axp8xx_attach().
This also fixes an off-by-one: the test was i <= nitems(common), so the
first regulator of the per-chip table (dc1sw or dcdc7) was never
registered and one entry past the end of the common table was read.

Tested on: A64
d0fb805c33608f8068e3e1dbfc5e762893679233 Emmanuel Vadot 2026-11-10 07:54:53

debug: classified in 03-filenames_plain1 by 'sys/arm/'


axp81x: Get the voltage of the regulators with a single range

axp8xx_regnode_get_voltage() failed when the regulator has no second
step, which is the case of the ones with a single range. Only the first
step is mandatory, as in axp8xx_regnode_set_voltage().

Tested on: A64, H6
5ca038636a54c3d7504123fde00aa78c4169440f Emmanuel Vadot 2026-11-10 07:55:06

debug: classified in 03-filenames_plain1 by 'sys/arm/'


axp81x: Do not change the voltage of a regulator in range

axp8xx_regnode_init() set every regulator described in the FDT to its
minimum voltage, even if the firmware had already set a voltage in the
range. For a regulator that is in use, like the one of the CPU, this can
make the system crash. Only set the voltage when the current one is out
of the range.

Tested on: A64, H6
7ea71c136c209e1aea05afb08f59c8917cff8325 Emmanuel Vadot 2026-11-10 08:02:41

debug: classified in 03-filenames_plain1 by 'sys/arm/'


axp81x: Skip the regulators that have no name in the FDT

A regulator that is not used is described in the FDT by a node without
regulator-name, and regulator_parse_ofw_stdparam() fails for it, which
printed two errors at every boot.  Skip these nodes, and only tell about
it when booting verbose.
4c501475359f162e80ff5eba7a5c53c06e5853a0 Emmanuel Vadot 2026-11-10 08:46:46

debug: classified in 03-filenames_plain1 by 'sys/arm/'


axp81x: Add support for the AXP805 and AXP806

The AXP805 and AXP806 are regulator only PMUs, with different registers
than the AXP803 and AXP813, and without a battery, ADC sensors or GPIO.
Add the regulators (voltage ranges from the datasheet and the Linux
driver) and the interrupts: the power key short press powers the system
off and the die temperature is sent to devd.  The battery, sensors,
thresholds, shutdown handler and GPIO bus are not set up for them.

Tested on a Pine H64 (AXP805 on the R_I2C).
79fbc233102e7cbe969a8bd21d65d843a8d2b9f6 Emmanuel Vadot 2026-11-10 07:56:16

debug: classified in 03-filenames_plain1 by 'sys/arm/'

libpmc: Strip leading zeros from the cpuid model
Upstream's mapfile.csv lists models without leading zeros, so entries
for models below 10h had to be fixed up by hand on every import.  Strip
them before matching and use the entries as imported.

Add tests to validate the functionality.

Reviewed by:    mhorne, Ali Mashtizadeh <ali@mashtizadeh.com>
Sponsored by:   Advanced Micro Devices, Inc.
MFC after:      1 week
Signed-off-by:  Osvaldo Janeri Filho <ojanerif@amd.com>
Differential Revision:  https://reviews.freebsd.org/D60790
c5400dc5421cce1be7152f401dc09725036d0963 Osvaldo Janeri Filho 2026-11-10 15:50:57

debug: classified in 03-filenames_plain1 by 'lib/libpmc/'

asmc: do not enable the sudden motion sensor on the MMIO backend
The interrupt filter reads the PIO interrupt port, but sc_ioport is NULL
under MMIO; the capability test only probed for keys, which says nothing
about the backend.

No MMIO-capable machine has a sudden motion sensor anyway. It existed to
park the heads of spinning disks.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61383
2764bc54d5d35838c2aeccbfd2632625067283a5 Abdelkader Boudih 2026-11-10 16:12:06

debug: classified in 03-filenames_plain1 by 'sys/dev/'

tpm_crb: Use locality registers only with plain CRB
The locality release wait times out on every command on a Framework 13
(Pluton start method), logging every 10 seconds.

Reported by:    emaste, tuexen
Reviewed by:    kbowling
Approved by:    kbowling
Fixes:          https://cgit.freebsd.org/src/commit/?id=bfe4be85a935 ("tpm_crb: wait for idle and locality release after each command")
1dade7024457ee10df1ccae22e3c454e80f82b76 Olivier Cochard 2026-11-10 07:25:06

debug: classified in 03-filenames_plain1 by 'sys/dev/'

axgbe: bound the sysctl parser writes in get_val()
Reject tokens and option counts that exceed the fixed parser buffers,
and fix the terminating NUL offset. Have the sysctl handlers propagate
parser errors before applying settings.

Handle SYSL_U32 options and reject failed numeric conversions instead of
using an uninitialized value. Fix the duplex case falling through to an
error, and initialize the link-setting strings for unexpected speeds.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61339
5523a8ba6f618fa5c853450dd551d8a5f06715ca Osvaldo Janeri Filho 2026-11-10 19:09:29

debug: classified in 03-filenames_plain1 by 'sys/dev/'

axgbe: return positive errno values from the sysctl handlers
Return positive errno values from the FreeBSD sysctl handlers so that
userland reports the proper error instead of "Unknown error: -22".

Convert the negative phy_config_aneg() result at the sysctl boundary,
matching axgbe_if_media_change(), and retain the PHY code's internal
error convention.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61400
c89613ded9237811d35a42788e9728fe0404e26b Osvaldo Janeri Filho 2026-11-10 19:15:02

debug: classified in 03-filenames_plain1 by 'sys/dev/'

acpi_video: fall back to _BCL when _DOD matches no output
vid_enum_outputs() only registers a child whose _ADR appears in the
graphics controller's _DOD. _DOD is filled in from the graphics driver's
ACPI opregion on some platforms, so with no such driver attached it can
describe no device at all while the panel still implements _BCL, _BCM and
_BQC. The match then fails for every child and the machine is left with
no brightness control.

Fall back to registering the first child that implements _BCL when _DOD
matched nothing, so such a machine gets a working
hw.acpi.video.lcd0.brightness and the brightness keys that ride on it.

MFC after: 1 week

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D60826
09a79e9eb4d902e31f699fe5bd634c00138586e0 Abdelkader Boudih 2026-11-10 19:22:27

debug: classified in 03-filenames_plain1 by 'sys/dev/'

acpi_video: dim the internal panel while the lid is closed
Register an acpi_lid_event consumer that saves the current _BQC level and
drives _BCM to the lowest level _BCL offers when the lid closes, putting
the saved level back when it opens.  Only an output already classified as
an internal panel is touched, and only a level this handler dimmed is
restored, so a brightness change made while the lid was shut survives.

Disabled by default; set hw.acpi.video.lid_blank=1 to enable.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D60827
6066c7907be3ee6246b0dc7f5d980e10ac181e45 Abdelkader Boudih 2026-11-10 19:22:37

debug: classified in 03-filenames_plain1 by 'sys/dev/'

mlx5: add per-flow-group hash table for FTE lookup
lookup_fte_locked() scanned every FTE in a flow group with xa_next()
and memcmp() on each one.  A new RX TLS session always misses, so the
whole group was walked under the group lock for every insertion.  With
tens of thousands of RX-offloaded sessions in the same IPv6 TCP group
this costs milliseconds per call and grows linearly with the number of
FTEs.

Keep a hash table of the FTEs in each flow group, keyed by a jhash of
the match value.  The table is sized from the group size, capped at
16K buckets.  It is updated in insert_fte() and del_sw_fte(), both of
which hold the group write lock, and read in lookup_fte_locked() under
the group read or write lock.  The xarray is kept for index
allocation.  No lockless reads are introduced.

Reported by:    NetApp
Reviewed by:    kib
Sponsored by:   NVidia networking
MFC after:      1 week
2d5a6bc2a4c5eb061f8d63b7aaff7dc04e96f1ea Slava Shwartsman 2026-10-26 19:27:56

debug: classified in 03-filenames_plain1 by 'sys/dev/'

acpi_cpu: No longer disable idle during suspend
This had been introduced in 3331373ce733 ("Disable CPU idle states
during suspend and reenable them during resume.") to work around C-state
selection logic which would skip C-states which returned immediately,
considering them "broken".

This workaround is incompatible with suspend-to-idle however, which
requires CPUs to be in their idle states, and is no longer relevant
either way since b0baaaaecf1a ("Avoid comparing negative signed to
positive unsignad values.") removed the C-state skipping logic the
previous change was working around.

Reviewed by:    olce
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/71
Differential Revision:  https://reviews.freebsd.org/D60649
427747fc16c9be5e4d4eb31a797d7854c4fd839f Aymeric Wibo 2026-02-25 09:39:05

debug: classified in 03-filenames_plain1 by 'sys/dev/'

acpi_cpu: Bring back setting BM_RLD on resume
enable_idle(), which was called on resume before 427747fc16c9
("acpi_cpu: No longer disable idle during suspend"), also set BM_RLD.

This commit brings back just setting BM_RLD on resume because some
firmware might not be doing this itself on some machines.

Reviewed by:    olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61431
ff3f704d922a7e0c8c32525fa0ebfc5a6e397160 Aymeric Wibo 2026-11-11 11:09:28

debug: classified in 03-filenames_plain1 by 'sys/dev/'

arm64/gicv3: Expose the ACPI maintenance interrupt
The ACPI entry describing the maintenance interrupt INTID is already
available as "VgicInterrupt", but it is not exposed to the GIC driver.

Check that the value is valid and consistent between CPUs, then publish
it for the GIC driver to use under rid 0 if so.

Print a warning if the maintenance interrupt is configured to be
edge-sensitive in ACPI, as the GIC spec explicitly states "maintenance
interrupts are level-sensitive".

Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2527
d4085297f4b5bcfed856ec059c6403796cc2fc9f Kajetan Puchalski 2026-11-02 16:44:10

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

arm64/vmm: vgic_v3: Register the maintenance interrupt
If one is available, register the maintenance IRQ so that vmm can
receive and process guest exits when the maintenance IRQ is asserted.

Since vmm and vgic can still operate without it, print a warning but
attach the vgic regardless if the maintenance IRQ cannot be registered.

Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2530
6b4a478057315e8b61935e062fd730298c559467 Kajetan Puchalski 2026-11-02 16:53:56

debug: classified in 03-filenames_plain1 by 'sys/arm64/'

pmap: Fix some bugs around accounting of wired mappings
The amd64 and arm64 pmaps failed to decrement the count when tearing
down a 1GB largepage mapping.  The riscv pmap failed to decrement the
count when unwiring a superpage mapping.

Reported by:    alc
Reviewed by:    bnovkov, alc, kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61414
da507ac5503d9af35f5aff4a7a773f6a92746e4a Mark Johnston 2026-11-11 14:15:35

debug: classified in 03-filenames_plain1 by '['sys/amd64/', 'sys/arm64/', 'sys/riscv/']'

nvme: honor CRTO for the controller ready timeout
CAP.TO is a 8b field and saturate at 127.5 seconds; a controller
that needs longer reports the real worst case in CRTO.CRWMT.
Waiting only CAP.TO can reset a controller that is still within its declared
recovery time after e.g. an abrupt shutdown.
Taking the larger of CRTO.CRWMT and CAP.TO when CAP.CRWMS show CRTO support.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59631
bd1bd0ba5540f773a21c6fc6c8949bd198e7ed9a Abdelkader Boudih 2026-11-11 20:54:01

debug: classified in 03-filenames_plain1 by 'sys/dev/'

ixgbe: Restore EEE exclusion for X550EM_X KR
X550EM_X KR devices do not support EEE and have no setup_eee operation.
The shared-code update restored the capability removed by d61b6a41dd30,
and the E610 EEE support subsequently added an unchecked call during
attach. Together these changes allow a NULL function pointer call when
attaching a KR device.

Remove the incorrect EEE capability and use the NULL-safe ixgbe_setup_eee()
wrapper when enabling EEE at attach.

Removing the unsupported capability also stops exposing eee_state and the
eee.tx_lpi_count and eee.rx_lpi_count sysctls on X550EM_X_KR devices.

Fixes:  https://cgit.freebsd.org/src/commit/?id=f72de14ea132 ("ixgbe: update if_ix and ixgbe api with ix-3.3.38 changes")
Fixes:  https://cgit.freebsd.org/src/commit/?id=13ee84c591f8 ("ix(4): Add EEE support for E610 adapters")
MFC after:      1 week
Sponsored by:   BBOX.io
4678f9d8dc1324da6c021dc9d376a4671e72ad97 Kevin Bowling 2026-11-12 01:44:18

debug: classified in 03-filenames_plain1 by 'sys/dev/'

regulator: Do not delay when setting the voltage failed
regnode_set_voltage_checked() called regnode_delay() with the delay
returned by the driver even when REGNODE_SET_VOLTAGE() failed.  A driver
does not have to set it on error, so the delay could be a random value
from the stack.  Only wait when the voltage was set, like
regnode_set_voltage() does.

Reported by:    llm-postcr
Tested on:      A64
010f31a79c4313344a05df768ea31429ec7a9fd6 Emmanuel Vadot 2026-11-12 08:44:24

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #33: axp81x
axp81x: Always set the delay of the regulator methods

axp8xx_regnode_set_voltage() and axp8xx_regnode_enable() only set the
delay when they succeeded, so the callers could use an uninitialized
value after an error.  Set it first like the default methods do.

Reported by:    llm-postcr
Tested on:      A64
97db601428e9118aa45a8ac3da4f904fa21b25ef Emmanuel Vadot 2026-11-12 08:48:46

debug: classified in 03-filenames_plain1 by 'sys/arm/'


axp81x: Allow the interrupt handler to sleep

The interrupt handler reads and writes the registers of the PMU, which
can sleep: the I2C controller the AXP805 is on in the H6 waits for the
end of the transfer, and taking the bus waits when it is busy.  The
handler runs in an interrupt thread, which cannot sleep unless the
interrupt is marked as sleepable, so the first interrupt would panic a
kernel with INVARIANTS.  Mark it, the interrupt is not shared.

Reported by:    llm-postcr
Tested on:      A64, H6
732778856725927a57c2054e9d513e7927b4544a Emmanuel Vadot 2026-11-12 09:00:35

debug: classified in 03-filenames_plain1 by 'sys/arm/'


axp81x: Set the maximum voltage of the AXP805 regulators

AXP805_REG() did not set voltage_max, so a regulator without
regulator-max-microvolt in the FDT got a maximum of 0 and its
initialisation failed with ERANGE.  Compute it from the minimum and the
steps of the two ranges, like the value of the AXP813 DCDC7.

Reported by:    llm-postcr
Tested on:      H6
9597338d5679ae65129e1dc58825fd74d779aecf Emmanuel Vadot 2026-11-12 09:00:42

debug: classified in 03-filenames_plain1 by 'sys/arm/'

md: Map preloaded images with pmap_mapdev_attr()
pmap_map() only works for memory the kernel already maps. A ram disk the loader
places in reserved memory may lie outside the direct map, and some platforms
have no direct map.

Reviewed by:    imp
Approved by:    imp
Sponsored by:   Netflix
Differential Revision:  https://ron-dev.freebsd.org/FreeBSD/src/pulls/101
75734a4b6d0b89820ca17a10991edcea86867102 Olivier Cochard 2026-11-08 22:25:56

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #34: aw_clk
aw_clk: Initialize best in the nmm and np find_best functions

aw_clk_nmm_find_best() and aw_clk_np_find_best() compared the first
candidate to best before it was ever assigned, so the result of the
search depended on whatever was on the stack.  Initialize it to 0 like
the nm and nkmp ones do.
3337dd483bae129ff2dabc626bee121f6299646d Emmanuel Vadot 2026-11-10 14:29:25

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_clk: Use clk_freq_diff() to find the best factors

The find_best functions of the nmm, np, m and frac clocks compared the
candidates with abs() of the difference to the requested frequency.  The
frequencies are 64 bits and abs() takes an int, so the difference was
truncated: for a PLL of 2.4GHz or more it can become negative or small
and the wrong factors were chosen.

Use clk_freq_diff() as the nm clock already does.

Tested on: H6
5559613c8e2fb82dfca1aa835dc7dfa242e3e4e1 Emmanuel Vadot 2026-11-10 14:32:19

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_clk: Take the first candidate in the nmm and np find_best functions

The search starts with a best value of 0 and only takes a candidate that
is closer to the requested frequency than the best one.  When every
candidate is more than twice the requested frequency, which happens for
a clock that has a minimum for its N factor, none of them is closer than
0 and the search returns the factors 0.  set_freq then writes them,
which gives a wrong value to the register.

Always take the first candidate, so that the result is the closest one
that the clock can do.

Tested on: H6
4b8553c3700bbc44f89882daeabed92ec33709b0 Emmanuel Vadot 2026-11-10 15:16:47

debug: classified in 03-filenames_plain1 by 'sys/dev/'

aw_ccu: h6: Set the lock enable bit of the PLLs
The PLLs have a lock enable bit, bit 29, and the lock status bit, bit
28, is only updated when it is set.  The firmware only sets it on the
PLLs that it uses, which are the CPUX, DDR0 and PERIPH0 ones, so the
other PLLs could never be seen as locked.

Set it on all the PLLs when attaching, as Linux does.

Tested on: H6
4f1a78adcd6503778b6d0722713b707382ada3a7 Emmanuel Vadot 2026-11-10 14:46:27

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #35: aw_clk: Wait for the PLL to lock when enabling it
aw_clk: Wait for the PLL to lock when enabling it

The nm, nmm, np and nkmp clocks wait for the lock bit after their rate
has been changed, but not when they are enabled.  A PLL that was off
could then be used by its children, or by the consumers of the clock,
before it had locked.

Add aw_clk_wait_for_lock() and use it when the clock is enabled, for the
clocks that have a lock bit, and in place of the copies of the loop that
waited for the lock after a rate change.  Tell when the PLL does not
lock, as the callers did not notice it.

Tested on: H6
92b59f3d010d0ed176e452a0264ab19659e9d7fd Emmanuel Vadot 2026-11-10 14:37:21

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h616: Set the lock enable bit of the PLLs

The lock status bit of a PLL is only updated when its lock enable bit,
bit 29, is set, and the firmware only sets it for the PLLs it uses.
Enabling another PLL, or changing the rate of an enabled one, then
waited for a lock that never came and ended after a second with an
error.  Set the bit on all the PLLs when attaching, like Linux does.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=92b59f3d010d ("aw_clk: Wait for the PLL to lock when enabling it")
b1a3c098f7346b848e1b90e6aabcf03e87b5eaee Emmanuel Vadot 2026-11-13 06:38:53

debug: classified in 03-filenames_plain1 by 'sys/dev/'

aw_clk: Do not wait for the lock of a disabled PLL
A PLL that is disabled cannot lock.  After a rate change the nm, nmm, np
and nkmp clocks waited a full second for the lock bit and then, with the
previous change, told that the PLL did not lock.

Wait only if the clock has no gate or if its gate is on.  The lock of a
PLL that is enabled later is waited for when it is enabled.

Tested on: H6
4aa5c63dec82ea8ee0c4cb693d8b11d15bbeb06d Emmanuel Vadot 2026-11-10 15:34:17

debug: classified in 03-filenames_plain1 by 'sys/dev/'

aw_ccu: h6: Fix the width of the N factor of the PLLs
The N factor of the PLLs is 8 bits wide, bits 15:8 of their register,
and not 7 as it was defined.  A PLL with N above 128 was read with a
wrong rate, and the factor could not be set above this value.

No PLL has such a rate today, so nothing changes for now.

Tested on: H6
4898d754d759a37576561e53194fcf4569143dca Emmanuel Vadot 2026-11-10 14:52:03

debug: classified in 03-filenames_plain1 by 'sys/dev/'

aw_clk: Add the minimum value of the N factor to nmm and np
The AW_CLK_FACTOR_MIN_VALUE flag had no effect on the nmm and np clocks
as the minimum value of their factors was never copied when registering
them, and they had no way to set it.

Copy the minimum value of the N factor and add a _nmin argument to
NMM_CLK() and NP_CLK() to set it.  The existing clocks pass 0 as they
do not use the flag, so nothing changes for them.

Tested on: H6
f0bab8a17fdae03902631569ca09f3438cbb53b9 Emmanuel Vadot 2026-11-10 15:01:55

debug: classified in 03-filenames_plain1 by 'sys/dev/'

aw_ccu: h6: Limit the N factor of the PLLs to 12 or more
The minimum value of the N factor of all the PLLs of the H6 is 12, like
the Linux driver does.  Without it the search of the factors for a
requested rate can choose a value that makes the PLL run below its
minimum frequency.

Tested on: H6
30566d1a9deedf38d128a82ab953bd1ae7494bea Emmanuel Vadot 2026-11-10 15:06:08

debug: classified in 03-filenames_plain1 by 'sys/dev/'

aw_clk: Add a flag to only search the given value of a factor
Some factors have to be read from the register, as the firmware or the
reset value can leave them set, but must not be changed when looking for
a rate.  AW_CLK_FACTOR_FIXED cannot be used as it does not read the
register.

Add AW_CLK_FACTOR_SEARCH_VALUE: the factor is decoded from the register
as usual but the search only tries its value, so the factor is set to
this value when the rate is changed.

Tested on: H6
7726c0ce98db53011d1d2066a36643aaab2a4782 Emmanuel Vadot 2026-11-10 15:55:26

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #36: aw_ccu
aw_ccu: h6: Never use the output divider of the GPU PLL

Linux found that using the output divider of the GPU PLL, bit 0 of its
register, to scale the frequency of the GPU makes the system fail, so it
clears it and does not model it.  The H6 manual does not say so and has
it in the rate of the PLL, 24MHz*N/M0/M1.  It is set at reset, the PLL
is at 432MHz with N=36, so it still has to be read to compute the rate.

Search the rate with this divider at 1.  It is read as before, and is
cleared when the rate of the PLL is changed.

Tested on: H6
c240a00b51825ffed503bde179d018e3f44cc446 Emmanuel Vadot 2026-11-10 15:55:57

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Fix the P factor of the CPUX PLL

The P factor of the CPUX PLL was defined on the bits 1:0, which are the
M factor that is only used for testing, instead of bits 17:16.  It was
also defined as one to four when it is a divider of 1, 2 or 4, as the H6
manual says.

Read it from the correct bits as a power of two.  It should only be used
for frequencies lower than 288MHz, which the minimum of N does not
allow, so always search the rate with it at 1 as Linux does.

Tested on: H6
5c25d7b78da04dd1f78e889d616abc425062320a Emmanuel Vadot 2026-11-10 16:09:59

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Do not use the output divider of the video PLLs

The bit 0 of the video PLLs is an output divider that is only used for
testing.  According to the H6 manual the rate of these PLLs is 24MHz*N/M
with M the bit 1, and it is 1188MHz at reset, when this divider is set.

It was used as a divider anyway, so the rates of the video PLLs were
half of the real ones, 594MHz at reset.  Do not use it.

Tested on: H6
e5a6d69f62bb6d8c7735caab72d1b42b51e2d66a Emmanuel Vadot 2026-11-10 16:19:52

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Add the CPUX, AXI and CPUX_APB clocks

Add the clocks of the CPU from the CPUX_AXI_CFG register: cpux, which
selects between OSC24M, the 32kHz clock, the 16MHz RC oscillator and
PLL_CPUX, and the AXI and APB clocks of the CPU, which are cpux divided
by 1 to 4.  The cpu nodes of the device tree use CLK_CPUX.

Tested on: H6
433e4c0a6ea42b92894aebbd5bf3cf4712e39b6f Emmanuel Vadot 2026-11-10 16:28:37

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Add the DMA, MSGBOX, SPINLOCK, HSTIMER and DBGSYS clocks

Add the bus gates and the resets of the DMA controller, the message box,
the spinlock, the high speed timer and the debug system.  They are on
the PSI bus.

Tested on: H6
8f5dfd3c860fb7d50b8e026e5fcb089ad06477d6 Emmanuel Vadot 2026-11-10 16:42:57

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Add the PWM, IOMMU and THS clocks

Add the bus gates and the resets of the PWM controller, the IOMMU and
the thermal sensor.  They are on the APB1 bus.

The manual has no reset for the IOMMU but the binding has one and Linux
uses the bit 16 of its register for it.  This bit cannot be written, so
this reset does nothing.

Tested on: H6
4ba979e1e6ea3178c0f3f270c6509ee6d9cffa38 Emmanuel Vadot 2026-11-10 16:48:24

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Add the AVS clock

Add the gate of the AVS clock, which is the 24MHz oscillator.

Tested on: H6
2cfa2ed6e0f7c635f78bb9ff890ed1e97be546c4 Emmanuel Vadot 2026-11-10 16:52:03

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Add the MBUS clock

Add the MBUS clock, which selects between OSC24M, PLL_PERIPH0(2X),
PLL_DDR0 and PLL_PERIPH0(4X) and has a divider from 1 to 8, with its
reset, and the gates of the MBUS clock of the DMA, VE, CE, TS, NAND, CSI
and DE interlace masters.

Tested on: H6
4bd42d103fab07136453b458417b52921589536e Emmanuel Vadot 2026-11-10 16:59:08

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Add the DRAM clock

Add the DRAM clock, which is PLL_DDR0 divided by 1 to 4, and the bus
gate and the reset of the DRAM.  The firmware sets up the DRAM, they are
not meant to be changed.

Tested on: H6
6f35f21323c1cfcfc137087af0cd5d8f4a995c46 Emmanuel Vadot 2026-11-10 17:07:12

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Add the SPI, NAND, SCR, TS and CIR-TX clocks

Add the module clocks of NAND0, NAND1, SPI0, SPI1, TS and CIR-TX,
which are all a gate, a mux, a power of two N and a M.  Also add the
bus gates and resets of NAND, SCR, SPI, TS and CIR-TX.

Tested on: H6
9d30cc3f3609dcc0ca794cb91be92ca72ca61786 Emmanuel Vadot 2026-11-10 17:13:13

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Add the DE, DI, GPU, CE, VE, EMCE and VP9 clocks

Add the module clocks, bus gates and resets of the display engine, the
deinterlacer, the GPU, the crypto engine, the video engine, the EMCE
and the VP9 decoder.

Tested on: H6
b1fdc489a0b084d9773bd80942f45f48ac39c002 Emmanuel Vadot 2026-11-10 17:17:58

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Add the HDMI, TCON and HDCP clocks

Add the module clocks, bus gates and resets of HDMI, TCON LCD0, TCON
TV0 and HDCP, and the HDMI slow clock.  The TCON LCD clock has no
divider.

The HDMI CEC clock is not added, its second parent is PLL_PERI0(2X)
divided by 36621, which needs a fixed pre-divider.

Tested on: H6
df6fa026b8f94c1545bc19a51abff1ccf0fce120 Emmanuel Vadot 2026-11-10 17:22:04

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Add the PCIe clocks

Add the 100MHz reference clock, which is PLL_PERIPH0(4X) divided by 24,
its two gates, the MAXI and AUX clocks, and the bus gate and the two
resets of PCIe.

Tested on: H6
4b958e7d8129c377983be6ec2e25593292bb4df7 Emmanuel Vadot 2026-11-10 17:26:16

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Add the CSI clocks

Add the CCI gate, the TOP and MCLK clocks, and the bus gate and reset of
the CSI.  The mux of the TOP clock has no parent for the value 1.

Tested on: H6
333b4fd2457839f019942c59e69acbf9ea4cc7e8 Emmanuel Vadot 2026-11-10 17:29:40

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Add the IR, W1, RSB and RTC clocks of the R CCU

Add the IR and 1-wire module clocks, which are a gate, a mux, a power
of two N and a M, the RSB and RTC bus gates and the RSB reset.

The manual does not document the registers of the R CCU, the offsets
and the fields are the ones used by Linux.

Tested on: H6
69919babdac77d403e0570c5fd4e6e37514d3224 Emmanuel Vadot 2026-11-10 17:34:48

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Fix the id of PLL_DE and the names of the R_APB2 gates

CLK_PLL_DE had the same id as CLK_PLL_VE, 14, so two clocks of the CCU
shared an id.  Use 15 as the Linux driver does.

The gates of the R_APB2 UART and I2C were named r_apb1-uart and
r_apb1-i2c, but their parent is r_apb2.  Name them after it.

Tested on: H6
60190341b7a1f66244fc526554e84981a2d8ff0d Emmanuel Vadot 2026-11-10 14:18:40

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Document why the UART gates are not enabled

Enabling the gates makes uart_snps get the clock rate from the CCU, it
then detects a 256 bytes FIFO and the input of the console is delayed:
a character is only seen when the next one is typed.  Explain it in the
comment instead of the old "weird behavior".

Tested on: H6
31f2b822e627d683d48951dfe75c9d9091a6be16 Emmanuel Vadot 2026-11-11 06:44:31

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Add the HDMI CEC clock

Add the HDMI CEC clock, a mux and a gate.  Its second parent is
PLL_PERIPH0(2X) divided by a fixed 36621, which gives about 32.768kHz,
so add this division as a fixed clock.

Tested on: H6
ba775ce34e2d22950eaddbe14bd13c0ee52696ea Emmanuel Vadot 2026-11-11 07:00:30

debug: classified in 03-filenames_plain1 by 'sys/dev/'

allwinner: h6: Put the PM pins in bank M
The PM0 to PM4 entries of the pad table of the R_PIO controller had port
0 and pin 0, copied from the PL ones, so no pin could be found for a
<&r_pio 1 N> specifier.  On the Pine H64 model B the reset GPIO of the
SDIO WiFi power sequence is PM3, and the kernel panicked in
mmc_pwrseq_attach() with "invalid pin" as the pin number was never set.

Use port 1 and the real pin numbers, like the PL entries do with port 0.

Tested on: H6
aa70464671cdc3f25101fb84dda264a19a5a3dd8 Emmanuel Vadot 2026-11-09 18:39:47

debug: classified in 03-filenames_plain1 by 'sys/arm/'

aw_gpio: Fail when a pin cannot be mapped
aw_gpio_map_gpios() returned success without setting the pin when no
entry of the pad table matched the bank and pin of the specifier, so
the caller went on with whatever was in its variable.  Return EINVAL.

Tested on: H6
256d6289a86b85c22e3509627e3b23078d54a947 Emmanuel Vadot 2026-11-09 18:39:47

debug: classified in 03-filenames_plain1 by 'sys/arm/'

aw_ccu: h6: Use the 1x PLL_PERIPH as parents of the MMC clocks
The MMC clocks of the H6 have the doubled outputs of the PLL_PERIPH0
and PLL_PERIPH1 as inputs of their mux, followed by a fixed post divider
of 2 that the driver does not know about.  The rate it computed was
twice the real one: on a Pine H64 the SD card requested at 50MHz and the
eMMC at 52MHz ran at half of that, and transfers at about half the speed
they should reach.  U-Boot does the same compensation, as it pretends
the parent is the 1x PLL.

Name the 1x PLLs as parents, like the H3 driver does.  The position in
the mux is the same.

Tested on: H6
c1dbf3f5135205ddcd3056e08a1477f366f28cea Emmanuel Vadot 2026-11-09 19:30:39

debug: classified in 03-filenames_plain1 by 'sys/dev/'

tpm: crb: Support the ACPI start method
Some AMD firmware TPMs report StartMethod 2 and had no driver. They never
acknowledge CTRL_REQ, so skip the idle and ready requests.

Do not harvest entropy from these TPMs on AMD: on a Ryzen 7 7735HS each
periodic TPM2_GetRandom froze every CPU, for up to 1.2 s (AMD PA-410).

Reviewed by:    kbowling
Approved by:    kbowling
Differential Revision:  https://ron-dev.freebsd.org/FreeBSD/src/pulls/103
6af18560a124b84549713a5f2b667a1df0990929 Olivier Cochard 2026-11-11 09:33:56

debug: classified in 03-filenames_plain1 by 'sys/dev/'

hwpmc: refuse MOD_UNLOAD while PMC owners exist
Unloading hwpmc while processes own PMCs frees state they still use.
Return EBUSY instead.  Use a try-lock on pmc_sx, since MOD_UNLOAD runs
with kld_sx held. MOD_SHUTDOWN still always cleans up.

Reviewed by:    mhorne
MFC after:      1 week
Sponsored by:   Advanced Micro Devices, Inc.
Differential Revision:  https://reviews.freebsd.org/D60561
c37b830554064fcc46ae383f3dc5725ea63a80c4 Andre Silva 2026-11-12 16:19:02

debug: classified in 03-filenames_plain1 by 'sys/dev/'

snd_dummy: Do not use dummy_chan_io() as mpu401's interrupt handler
dummy_chan_io() runs with sc->lock held, but mpu401 calls its handler
from a callout with no mutex associated with it, so writing to the MIDI
device node caused a panic.

Give mpu401 its own handler, and leave MIDI to mpu401's timer instead of
the PCM callout.

Fixes:          https://cgit.freebsd.org/src/commit/?id=e963472ef853 ("snd_dummy: Initial MIDI support")
Sponsored by:   The FreeBSD Foundation
c8d1c94741231d95964b91910880769019478854 Christos Margiolis 2026-11-10 13:02:13

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #37: sound/midi
sound/midi: Replace MIDIQ with a simple byte queue

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
d63b11caae6cc2615be31de5660cbc3e2320ddf5 Christos Margiolis 2026-11-10 13:36:26

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sound/midi: Remove unused and dead code

No functional change intended.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
fb357da6977c7684fccf3fb1ed3fd9a99d9fbb7c Christos Margiolis 2026-11-10 13:54:33

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sound/midi: Do not return from midi_close() with the lock held

This was already fixed in midi_open().

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
961e18b07cda24e838098127e1079372851379df Christos Margiolis 2026-11-10 14:03:53

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sound/midi: Do not duplicate MPU constants in snd_csa(4)

No functional change intended.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
543adfcf51e027d5edafe222547574c0d5120b50 Christos Margiolis 2026-11-10 14:04:53

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sound/midi: Drain the mpu401 callout

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
f960b33d35dafa85a7373f6ab68e499e8d47dc3a Christos Margiolis 2026-11-10 14:11:30

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sound/midi: Fix inverted POLLOUT test in midi_poll()

midi_queue_avail() returns the free space, so the test had it backwards.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
690b242cbbaf22a5f5c7a3203798a7d77c5e61d2 Christos Margiolis 2026-11-10 14:18:51

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sound/midi: Clean up zero assignments

No functional change intended.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
a41ab6befba220c9acf9b9ee09931f598d4862ea Christos Margiolis 2026-11-12 09:35:58

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sound/midi: Retire M_RXEN

It was always set and cleared together with M_RX and never tested on its
own, so it was redundant. The only thing that read it was midi_close()'s
check for whether the flags had changed, which can be reduced to a plain
FREAD test.

No functional change intended.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
276e696108a682579f528ece65c695a546ecc63b Christos Margiolis 2026-11-12 09:50:09

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sound/midi: Rename M_TXEN to M_TXPEND

The flag means that there is data queued to transmit, not that
transmission is enabled.

No functional change intended.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
fd2bc75de92e19adfd7cc89fd8f166974b406f22 Christos Margiolis 2026-11-12 09:59:32

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sound/midi: Always notify the provider from midi_close()

Be consistent with midi_open() which also invokes the callback
unconditionally.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
70d3fab9c40bb297c0c7cf200887c9ce8dc6c555 Christos Margiolis 2026-11-12 10:00:41

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sound/midi: Use size_t instead of int where appropriate

Also switch the affected min() calls to ulmin().

No functional change intended.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
5f00965631f8631b0beda2e194d9290c488972aa Christos Margiolis 2026-11-12 10:18:33

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sound/midi: Centralize snd_midi cleanup

midi_init()'s error path leaked both unit numbers and duplicated
existing code.

While here, drop the locking in midi_init(), because nothing can reach m
before make_dev() publishes it.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
ab9bdb417b41b853e3ec668796e42ff65ccfcedb Christos Margiolis 2026-11-12 10:28:52

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sound/midi: Pair kobj_init() with kobj_delete()

kobj_init() bumps the class refcount, so without a matching
kobj_delete() it never drops to zero.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
3fc4d02c4b02e1af0627720597352965ad87eb02 Christos Margiolis 2026-11-12 10:40:55

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sound/midi: Create the device node with make_dev_s()

make_dev(9) publishes the node before si_drv1 is assigned, so an open(2)
racing with midi_init() could dereference si_drv1 before it's set.
Triggering a UAF is not currently an issue because all cdevsw methods
check for NULL, but the fix makes it more robust in any case.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
315d50898cc2a561020059251a42068b3f983e78 Christos Margiolis 2026-11-12 10:49:46

debug: classified in 03-filenames_plain1 by 'sys/dev/'


sound/midi: Pass the queue sizes as arguments to midi_init()

There is no reason to have kobj methods for this.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
83c8ec72ac6acdad35aa0eaa053faf57ae34ea54 Christos Margiolis 2026-11-12 11:01:14

debug: classified in 03-filenames_plain1 by 'sys/dev/'

lan867xphy: Add silicon rev C2 configuration
Rev C2 requires special configuration for "optimal performance" per
Microchip AN1699: LAN8670/1/2 Configuration Application Note.

Add MMD (MDIO Manageable Device) read/write helpers and an indirect read
function for Microchip's proprietary register access mechanism, and use
them to implement the register writes documented in Microchip's
application note.

It appears rev C1 may warrant the same configuration, based on the Linux
driver, but it is not mentioned in the application note and I have not
included it here.

Reviewed by:    kbowling
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61268
f3ec447a1c0697f024dcf12929552e4ee9a420e0 Ed Maste 2026-10-14 20:12:04

debug: classified in 03-filenames_plain1 by 'sys/dev/'

vmm: Don't assert on device errors in MOVS emulation
emulate_movs() asserts that it fails only with EFAULT, but a device read
or write can fail with other errors, such as EINVAL from lapic_mmio_read()
for an access whose 4-byte-aligned offset is not 16-byte aligned, or from
lapic_mmio_write() for an unaligned or non-4-byte access.  A guest could
therefore panic a kernel with INVARIANTS using a MOVS from the local APIC.
Return the error, as the other emulation functions do.

Reviewed by:    markj
MFC after:      1 week
Sponsored by:   Alchemilla Ventures Private Limited
821f8ae42f42f8004567a2e202d031d76525bae9 Hayzam Sherif 2026-11-13 00:04:20

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

axp209: Allow the interrupt handler to sleep
The interrupt handler reads and writes the registers of the PMU with
IIC_INTRWAIT, which can sleep when the bus is busy, and the I2C
controller the AXP209 is on in the A10 and A20 waits for the end of the
transfer.  The handler runs in an interrupt thread, which cannot sleep
unless the interrupt is marked as sleepable, so an interrupt of the PMU
would panic a kernel with INVARIANTS.  Mark it, the interrupt is not
shared, like it was done for the axp81x driver.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=30068a1de9e3 ("Add support for interrupts, sensors and GPIO for AXP209 PMIC")
cffbc16cc5090c4ff31d91bacfd944d6374e1111 Emmanuel Vadot 2026-11-13 06:27:54

debug: classified in 03-filenames_plain1 by 'sys/arm/'

axp81x: Fix the number of steps of the first range of DCDC5
The voltage of DCDC5 goes from 800mV to 1120mV in 10mV steps with the
codes 0x00 to 0x20, then from 1140mV to 1840mV in 20mV steps with the
codes 0x21 to 0x44.  The first range has 32 steps and not 42, so every
code above 32 was decoded and encoded wrongly: the driver read 1160mV
for the 1.2V that the firmware sets for the DRAM, did not see it in the
range of the FDT and wrote a code that is really 1280mV.  The same
happens for the other voltages, 1.36V is set to 1.46V and 1.5V to 1.6V.
It also made the voltage reported for the regulator wrong.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=c175fd0fe8a3 ("axp81x: Add support for AXP803")
Tested on: A64
486633127e37389dc83449bbc13dfa670ea78ba5 Emmanuel Vadot 2026-11-13 06:35:25

debug: classified in 03-filenames_plain1 by 'sys/arm/'

Commit group #38: aw_ccu
aw_ccu: d1: Set the lock enable bit of the PLLs

The lock status bit of a PLL is only updated when its lock enable bit,
bit 29, is set, and the firmware only sets it for the PLLs it uses.
Enabling another PLL, or changing the rate of an enabled one, then
waited for a lock that never came and ended after a second with an
error.  Set the bit on all the PLLs when attaching, like Linux does.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=92b59f3d010d ("aw_clk: Wait for the PLL to lock when enabling it")
da4aca33d26eef787786f4ced9fab1337520de5d Emmanuel Vadot 2026-11-13 06:41:53

debug: classified in 03-filenames_plain1 by 'sys/dev/'


aw_ccu: h6: Allow the IR and W1 clocks to change their parent

The IR clock was defined without AW_CLK_REPARENT, so only the current
parent was used to find a rate.  The firmware leaves the mux on osc32k,
from which the best rate is 32768Hz, and aw_cir asks for exactly 3MHz,
which osc24M can give.  The request failed and r_ir did not attach.  Do
the same as the main CCU for the CIR-TX clock and let the clock use the
best parent, and do the same for the 1-wire clock which is the same.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=69919babdac7 ("aw_ccu: h6: Add the IR, W1, RSB and RTC clocks of the R CCU")
Tested on: H6
628d2bc313b7eed68461a65585b5161f4fefe713 Emmanuel Vadot 2026-11-13 06:43:43

debug: classified in 03-filenames_plain1 by 'sys/dev/'

aw_gpio: Return the error when an interrupt cannot be mapped
aw_gpio_pic_map_intr() returned success without setting the interrupt
source when aw_gpio_pic_map_gpio() failed, which happens for a pin that
has no interrupt function or for an unsupported mode.  The caller then
went on with an uninitialized pointer.  Return the error.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=0fe5379c6a99 ("arm: allwinner: Add GPIO Interrupt support")
50f02080ea94a786a4a9215175eb79c153be7901 Emmanuel Vadot 2026-11-13 06:48:11

debug: classified in 03-filenames_plain1 by 'sys/arm/'

Commit group #39: allwinner
allwinner: h616: Put the PI pins in bank 8

The PI0 to PI16 entries of the pad table had port 9 and interrupt bank 9
but the PI bank is the ninth one, bank 8, at offset 0x120.  Bank 9 is a
bank that does not exist, so the configuration, data, drive and pull of
these pins, and their interrupt registers, were accessed at the wrong
place and a <&pio 8 N> specifier, like the one of the card detect GPIO
of some boards, did not find its pin.

Use 8 for the port and the interrupt bank, like the other entries do
with the position of their letter.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=e506af08bb52 ("aw_gpio: Add support for H616")
770d272d871fd99e1d6c2489eab5a60cefccc9a3 Emmanuel Vadot 2026-11-13 06:50:12

debug: classified in 03-filenames_plain1 by 'sys/arm/'


allwinner: a31s: Fix the pin number of PH28

The PH28 entry of the pad table of the A31s had the pin number 27, the
one of PH27, so the pinctrl of PH28 configured PH27 and a <&pio 7 28>
specifier could not be mapped.  This was fixed for the A31 in
222947a74223 but not in the copy for the A31s.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=ccf8caad1413 ("Add the Allwinner A31 and A31s padconf support. It's currently unused, but")
0b6b389cf60f913c91825d42f1880e9a784896a9 Emmanuel Vadot 2026-11-13 06:50:13

debug: classified in 03-filenames_plain1 by 'sys/arm/'


allwinner: a33: Fix the pin number of PE17

The PE17 entry of the pad table of the A33 had the pin number 16, the
one of PE16, so the pinctrl of PE17 configured PE16 and a <&pio 4 17>
specifier could not be mapped.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=cf72965fbf02 ("Allwinner: Add A33 support")
209af0597f23b108e6d7d7ca62b7f5039ef5af68 Emmanuel Vadot 2026-11-13 06:50:13

debug: classified in 03-filenames_plain1 by 'sys/arm/'

Commit group #40: revert-pair-sound/midi
sound/midi: Drain the mpu401 callout before device teardown

midi_uninit() frees the snd_midi that mpu401_intr() reaches through
midi_in() and midi_out(), but the callout that calls it was drained
afterwards. Drain it first, and clear M_TXPEND so that a firing handler
does not re-arm itself.

Fixes:          https://cgit.freebsd.org/src/commit/?id=f960b33d35da ("sound/midi: Drain the mpu401 callout")
MFC with:       f960b33d35da
Sponsored by:   The FreeBSD Foundation
91539591d7f8dd8ca24ced875bd16c3ba3c7d201 Christos Margiolis 2026-11-13 10:59:46

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "sound/midi: Drain the mpu401 callout before device teardown"

This was committed to main by accident, but was also buggy.

This reverts commit 91539591d7f8dd8ca24ced875bd16c3ba3c7d201.
16bdecce64b491e826917b438c6b1a4af078c7e7 Christos Margiolis 2026-11-13 11:39:24

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

axp81x: Honor the enable delay of the regulators
axp8xx_regnode_enable() always reported a delay of 0, so the
regulator-enable-ramp-delay property of the FDT was ignored.  On the
Pine H64 model B the Ethernet PHY is supplied by ALDO2, which has a
delay of 100ms, and awg(4) resets the controller right after enabling
it, before the PHY is ready: the soft reset timed out and the interface
did not attach.  Return the delay when enabling a regulator, like the
fixed regulator driver does.

Fixes:          https://cgit.freebsd.org/src/commit/?id=c175fd0fe8a3 ("axp81x: Add support for AXP803")
Tested on: H6
8a131d2f16103661e5f0bea29777c0f85352f02d Emmanuel Vadot 2026-11-13 08:07:14

debug: classified in 03-filenames_plain1 by 'sys/arm/'

awg: Use the MAC address of the FDT
The firmware gives the MAC address of the controller in the FDT, in the
mac-address or local-mac-address property.  awg(4) only used the address
in the registers, which is set when the firmware used the controller,
and the one created from the SID.  On the Pine H64 the firmware does not
initialise the Ethernet and the SID driver does not support the H6, so a
random address was created and it changed at every boot.

Use fdt_ether_get_addr(), it takes the address of the FDT and keeps the
current one when there is none.

Tested on: H6
deedeb1e4160509f0074d0055340c130c72466ce Emmanuel Vadot 2026-11-13 10:46:33

debug: classified in 03-filenames_plain1 by 'sys/arm/'

aw_sid: Add support for the H6
Add the SID of the H6.  The efuse starts at 0x200 like on the other
64 bits SoCs and starts with the 16 bytes of the chip ID, which awg(4)
uses to create a MAC address when the firmware did not give it one.

The thermal sensor calibration data is not added, there is no driver
for the thermal sensors of the H6.

Tested on: H6
64abec2e5862bdc3c28f44a0b5defbcc5c6a54ae Emmanuel Vadot 2026-11-13 09:06:33

debug: classified in 03-filenames_plain1 by 'sys/arm/'

lan867xphy: Add silicon rev D0 configuration
Apply hardware revision D0 configuration from Microchip AN1699
(Revision G).  The LSCTL (0x0012) write is deferred until link state
reporting is implemented.

Sponsored by:   The FreeBSD Foundation
Sponsored by:   Microchip (Hardware)
Differential Revision: https://reviews.freebsd.org/D61269
57e8eddc52b9a5adfda6b5c907a2c84967dcc257 Ed Maste 2026-11-06 18:02:07

debug: classified in 03-filenames_plain1 by 'sys/dev/'

ure: Initialize ifm_active in ure_ifmedia_sts
Most ure(4) devices use mii; 8156 and 8156B do not and have special
cases throughout the driver.

ifmedia_ioctl() sets ifmr->ifm_active to ifm_cur->ifm_media before
calling the status callback.  The 8156 case in ure_ifmedia_sts ORs in
the subtype and duplex flags to the existing value, which may result in
garbage values.

Instead, start by setting ifm_active to just IFM_ETHER before ORing in
other bits.

Reported by:    llm-postcr
Reviewed by:    kbowling, pouria
Fixes: https://cgit.freebsd.org/src/commit/?id=d4cf41a99b40 ("Add support for RTL8153B, RTL8156 and RTL8156B to if_ure(4).")
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61158
83067a22396f5609f3e8be035eb8f316ed52b895 Ed Maste 2026-10-30 19:26:28

debug: classified in 03-filenames_plain1 by 'sys/dev/'

vmm: Route MMIO-to-MMIO MOVS by GPA
emulate_movs() uses the memread and memwrite callbacks selected from
the faulting GPA for both operands of an MMIO-to-MMIO MOVS.  A guest
can therefore make the local APIC handler write to a GPA outside the
APIC page, which trips the offset assertion in vlapic_write() on
INVARIANTS kernels.

Dispatch each MMIO read and write according to its GPA.  This allows
MOVS between in-kernel devices.  During in-kernel emulation, return
EINVAL if an MMIO operand lies outside those devices' ranges.

Reported by:    llm-postcr
Reviewed by:    markj
MFC after:      1 week
Sponsored by:   Alchemilla Ventures Private Limited
Differential Revision:  https://reviews.freebsd.org/D61495
4aa3a5ef7a1269cc34ec47c657f851162206c6e4 Hayzam Sherif 2026-11-13 16:44:16

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

Commit group #41: acpi
acpi: Tasks: Use M_WAITOK to allocate the taskqueue

Memory failure at this point normally does not happen except if the
kernel is running on a machine with a too tiny amount of memory, in
which case it is likely to panic or to be unusable anyway.  However,
letting it panic here with a NULL pointer dereference is not very
helpful.  Instead, use M_WAITOK, hoping the memory allocator itself will
indicate the low memory condition if it cannot succeed (if it does not,
it should be changed to).

Reviewed by:    obiwac
Differential revision:  https://reviews.freebsd.org/D60379
ee417f9f7f27b3dd3e97aeac0daba66cf9bf3c97 Olivier Certner 2026-10-03 20:33:37

debug: classified in 03-filenames_plain1 by 'sys/dev/'


acpi: Tasks: Ensure sane values for number of tasks and threads

Make sure that these are set to sane values even on silly tunables:
- There must be at least one thread to process the 'acpi_taskq'.
- Use the ACPI_MAX_TASKS default when a negative number of tasks was
  specified. This avoids common pilot errors causing a bogus huge memory
  allocation for acpi_tasks[].

Reviewed by:    obiwac (older version)
Differential Revision:  https://reviews.freebsd.org/D60373
067161c31fe8eed8a046ba3f820748cf9d6627c1 Olivier Certner 2026-10-01 13:57:57

debug: classified in 03-filenames_plain1 by 'sys/dev/'


acpi: Tasks: Precisely report the maximum number of slots used

To this end, store the actual number of busy slots instead of the index
of the final slot selected (off by one), and fix races when updating
'acpi_tasks_hiwater'.

The race is that it could happen that a first thread enqueued a task at
a higher index than the current maximum, followed by a second one
enqueuing at some even higher index, with the first thread updating
'acpi_tasks_hiwater' while the second was exactly after the 'if (i >
acpi_tasks_hiwater)' but just before attempting the atomic_cmpset_int()
that updates 'acpi_task_hiwater', which then would fail silently (the
return value was ignored) leading to the real maximum not being
recorded.

Fix the race by simply testing the return value of atomic_cmpset_int()
and retrying.  Use an explicit atomic_load_int() for the guard (that
compiles to a regular load, so this change is cosmetic).

Note that the atomic_cmpset_int() loop can at most be executed a number
of times equal to the reported 'acpi_tasks_hiwater', which appears to be
low in practice (~#CPUS).

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60375
fde43820f31dbcec64e41a1ffe3fe1b799e09d04 Olivier Certner 2026-10-02 08:11:31

debug: classified in 03-filenames_plain1 by 'sys/dev/'

nvme: enforce the Abort Command Limit
Each watchdog pass submitted an Abort for every timed-out command
with nothing counting them against the controller's ACL. A
controller may complete excess Aborts with Abort Command Limit
Exceeded status.

Reviewed by:    imp, adrian
Differential Revision:  https://reviews.freebsd.org/D59636
c91485376bb07990abe24ccdbbbf330820f35e7c Abdelkader Boudih 2026-11-13 18:24:11

debug: classified in 03-filenames_plain1 by 'sys/dev/'

powerpc: don't drop FPU and VMX ownership in grab_mcontext()
grab_mcontext() saved the FP and vector registers with save_fpu() and
save_vec(), which drop ownership: PCPU(fputhread) becomes NULL while
PCB_FPU stays set and the thread keeps using the unit. A later
cpu_update_pcb(), at fork(2) or thr_new(2), then skipped the save,
since save_fpu_nodrop() only saves for the thread that owns the unit,
and the child got the registers as they were at the getcontext() or
signal rather than at the fork. Use the nodrop variants.

A child forked after getcontext() saw the parent's f14 as it was at
the getcontext(); it sees the current value now.

Reviewed by:    adrian, jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60837
8a79b6398f06f31947a2dada576c5f489c69d498 Piotr Kubaj 2026-10-18 10:41:36

debug: classified in 03-filenames_plain1 by 'sys/powerpc/'

powerpc64: don't reserve the red zone on the alternate signal stack
A 64-bit signal frame is 1552 bytes; rounded up and with the 512 byte
red zone added it needs 2096 bytes, more than MINSIGSTKSZ (2048), so a
handler on a minimum size alternate stack had its frame start 48 bytes
below the stack. The red zone only exists below the interrupted code's
stack pointer, so skip it only when the frame goes on that stack.

A handler on a MINSIGSTKSZ alternate stack overwrote the 48 bytes below
it; the frame stays within the stack now.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61519
34005cb7d5caeee3f3073cbc2adc3b2841ef54d7 Piotr Kubaj 2026-10-18 10:41:37

debug: classified in 03-filenames_plain1 by 'sys/powerpc/'

loader.efi: Measure boot policy and loaded contents with a TPM
Use the EFI TCG2 protocol, or the legacy TCG protocol on TPM 1.2
firmware, to extend the loader PCRs and record EV_IPL events in the
firmware event log.

Extend PCR 8 with the final kernel environment and the type, name, and
arguments of each loaded boot input.  Prefix both record types with
versioned, NUL-terminated domain strings.  These make the records
self-identifying and define an explicit measured policy encoding.  Store
the complete measured pre-images in the event data so attestation and
diagnostic tools can audit the values without an out of band copy.

Extend PCR 9 with the initialized contents of kernels, modules, and raw
boot inputs, but record only descriptive labels rather than copying file
contents into the event log.

The Lua module table has no defined traversal order.  Retain content
ranges as loader-private metadata, then sort the final file list before
extending either PCR.  This produces repeatable values and excludes
failed or subsequently unloaded files.

Measure initialized loaded memory rather than source files.  This covers
zero initialized ELF data while excluding undefined gaps and debugging
information.  Do not measure entropy, timing data, or GELI key files.
Exclude loader passwords and the GELI passphrase from the kernel
environment measurement so low entropy secrets do not acquire a public
event-log digest or appear in the event data.

Measurement remains best effort.  Warn and stop measuring after the
first firmware or allocation error rather than preventing the system
from booting.

Validated with the EFI TCG protocol on a ThinkPad T430 TPM 1.2 using
coreboot with a measured EDK2 payload.  Replaying the loader events
reproduced PCRs 8 and 9, and both PCRs repeated across clean boots.  TPM
2.0 testing on a commercial AMI EFI firmware likewise produced stable
PCRs across clean boots.  A raw firmware-log dump decoded by
tpm2_eventlog using tpm(4) changes that will come later confirmed the
versioned PCR 8 pre-images and the descriptive PCR 9 event data.

Reviewed by:    imp
MFC after:      2 weeks
Relnotes:       yes
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59141
f429c4a6ee50c99fbff672a3eaa7e5cdaa198a16 Kevin Bowling 2026-11-14 00:33:19

debug: Commit manually moved from "unknown" to "hardware".

awg: Stop the controller and power down the PHY on shutdown
On the Pine H64 model B the PHY is supplied by a regulator of the
AXP805, which keeps its state over a reset of the SoC.  After a reboot
the PHY is still powered and U-Boot finds it, while after a power cycle
it does not.  When U-Boot finds the PHY the kernel hangs or panics at a
random place very early, before any driver is attached, most of the
time.  When it does not, the boot is fine.  The reason is not known, the
Ethernet controller of the SoC being left running by U-Boot is one
possibility.

Stop the controller and disable the PHY supply when shutting down, so
that the next boot starts like after a power cycle.  This is a
workaround, the problem should be fixed in U-Boot.

Tested on: H6
512342998935242b65352654191e6f6f3ca7c78f Emmanuel Vadot 2026-11-13 19:43:16

debug: classified in 03-filenames_plain1 by 'sys/arm/'

snd_uaudio: Do not touch mixer_lock when there is no mixer
Using the mixer lock unconditionally panics because the lock is
uninitialized on devices with no audio interfaces, for instance
MIDI-only keyboards.

Fixes:          https://cgit.freebsd.org/src/commit/?id=9a00e0b8ca56 ("snd_uaudio: Do not use snd_mixer->lock as mixer_lock")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D61506
dabd959b17597ad790327020a667ced9a05d7499 Christos Margiolis 2026-11-13 12:48:09

debug: classified in 03-filenames_plain1 by 'sys/dev/'

powerpc: fix the VSCR save and restore on little endian
VSCR was saved and restored through stvewx/lvewx at byte 12 of a
16 byte slot. Which element those instructions move at a given address
depends on the byte order, so on little-endian kernels they touched VR
bits 0-31 instead of the 96-127 where mfvscr/mtvscr keep VSCR: every
context switch and signal reset VSCR to 0, losing NJ and SAT.
Replicate the word into all four elements first so that the element
choice no longer matters.

VSCR[NJ] set with mtvscr read back as 0 after a usleep on a
little-endian kernel; it is preserved now.

Reviewed by:    adrian, jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61525
27b4bb447eababd60da777065a813d2379050850 Piotr Kubaj 2026-10-18 10:41:39

debug: classified in 03-filenames_plain1 by 'sys/powerpc/'

ixgbe: Classify missed packets only as input drops
Missed packets should be counted as drops, not as both drops
and errors.  Errors should be reserved for things like link level
crc errors.

Reviewed by: kbowling
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D61523
8a73282486223f549724bb93622a50d843ccb55b Andrew Gallatin 2026-11-14 13:52:15

debug: classified in 03-filenames_plain1 by 'sys/dev/'

netmap: Handle TX buffers larger than MCLBYTES
The generic netmap TX pool always allocates standard clusters
(zone_clust), even though the buffer size may be larger.

INVARIANTS kernels panic in nm_os_get_mbuf() on first transmit through a
non-native NIC (e.g. re or epair) using netmap with jumbo frames
configured.  Release kernels silently truncate frames in
nm_os_generic_xmit_frame().

Implement cluster zone selection based on the requested size.  Catch
oversized requests in nm_os_catch_tx() and return EINVAL.  Add a KASSERT
before the truncation fallback in xmit.  Make nm_os_get_mbuf() take a
uint32_t size, matching the type of the value passed to it.

Tested using epair, pkt-gen, and tcpdump on release (15.1) and
INVARIANTS (main) kernels at buffer sizes 2048/4096/9216/16384.

Reviewed by:    vmaffione, kevans, markj
Approved by:    kevans (mentor)
Differential Revision:  https://reviews.freebsd.org/D61281
926a8baff0e1a9d3a0fe66be188c29edf9bd8e90 Ryan Moeller 2026-11-12 04:54:24

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #42: acpi_pci_link
acpi_pci_link: Ignore tunables with negative values

IRQ values are unsigned and negative values do not make sense.  The
invalid IRQ value (255) is already ignored, so ignoring other invalid
values is consistent with that behavior.

Reported by:    cperciva
81dab94a5452f996a063bdba2103eda4aa32b3d1 John Baldwin 2026-11-14 16:02:38

debug: classified in 03-filenames_plain1 by 'sys/dev/'


acpi_pci_link: Remove a helper variable from _PRS parsing

Tested by:      cperciva
df10f7b7500c129c48a477e94039c4e0d2711b54 John Baldwin 2026-11-14 16:02:38

debug: classified in 03-filenames_plain1 by 'sys/dev/'


acpi_pci_link: Factor out some duplicated code into a single copy

Tested by:      cperciva
6c1b6f7cf81447315fc0c7a294ed1467c62832bd John Baldwin 2026-11-14 16:02:38

debug: classified in 03-filenames_plain1 by 'sys/dev/'


acpi_pci_link: Handle IRQ values > 255

Some systems use a stub PCI link device for hardwired interrupts
instead of static _PRT entries.  These link devices can use an IRQ >
255.  The current driver was designed to handle PCI link devices on
x86 used for legacy INTx IRQs which were < 255.  These changes handle
larger IRQ values while making a few tradeoffs.

- Expand most IRQ fields from 8 bits to 32-bits.  The BIOS IRQ
  (read from the PCIR_INTLINE config register which is an 8-bit register)
  remains 8 bits.

- Add a wrapper API for managing interrupt weights and avoid tracking
  weights for IRQs > 255 and instead report a constant weight of 0 for
  IRQs > 255.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300476
Reported by:    Aviv Bakal <avivb@amazon.com>
Tested by:      cperciva
931a5d8866bcd7163272f6a9a65ed87fe481763b John Baldwin 2026-11-14 16:02:38

debug: classified in 03-filenames_plain1 by 'sys/dev/'

xhci: Map stream id to occupied slot
In xhci_check_transfer, we tried to iterate through STREAM * NUM_SLOTS
and find the correct stream. However, stream is rear nowadaya both on
FreeBSD and Linux. In which means that such STREAM * NUM_SLOTS array is
sparse.

As a result, we use a bit map to map stream id to slot. For a
xhci_mask[stream_id], it contains the slot_id bitmap over which slot has
been occupied.

Differential Revision: https://reviews.freebsd.org/D61247
f8a67d6ff5e7c89ee2ffd4b05a68d2f2b29db1a1 ShengYi Hung 2026-11-05 22:37:52

debug: classified in 03-filenames_plain1 by 'sys/dev/'

xhci: Enlarge total transfer number
We enlarge the total number of queued transfer. Also, to make controller
always busy. We enqueue the xfer as much as possible to the ring in
multiple enter code.

Differential Revision: https://reviews.freebsd.org/D61246
3b795a9b0be5f8a09d290cc147a0c0407f9f36ef ShengYi Hung 2026-11-05 23:15:58

debug: classified in 03-filenames_plain1 by 'sys/dev/'

mcommphy: Set the 10/100 TX delay of the YT8511
The TX clock delay of the YT8511 is split in two registers.  The delay
used in gigabit mode is in the clock gating page and was already set
from the RGMII mode, but the one used in the 10/100 modes is in the next
page and was left at its reset value of 2ns.  With a phy-mode that does
not ask for a TX delay in the PHY, the MAC provides it and the PHY adds
another 2ns in the 10/100 modes.

Set it like the gigabit one, like Linux does.

Tested on a Quartz64 Model A, gigabit and 100Mbit links.

Reviewed by:    oh
Differential Revision:  https://reviews.freebsd.org/D61015
495c899ab02bff8f559edf5d0793487a66396fb1 Emmanuel Vadot 2026-10-27 14:28:13

debug: classified in 03-filenames_plain1 by 'sys/dev/'

pci_dw: Honor the max-link-speed property
The root port reports in LNKCAP the highest link speed the core was
synthesized for, which can be more than the PHY behind it supports.  On
the RK3568 pcie2x1 the root port advertises 8GT/s while the PHY only
does 5GT/s.  The link stays at 2.5GT/s after the directed speed change.

Read max-link-speed from the device tree and write it to the Max Link
Speed field of LNKCAP and to the Target Link Speed field of LNKCTL2
before requesting the speed change.  Nothing changes when the property
is absent.

Tested on a Quartz64 Model A with a Samsung 970 EVO Plus NVMe drive: the
link now trains at 5GT/s and the sequential throughput goes from 200MB/s
to 400MB/s.

Differential Revision:  https://reviews.freebsd.org/D61014
e23c13a0c96772efe8fb3d1a88b219fb4ef189a2 Emmanuel Vadot 2026-10-27 07:24:57

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #43: asmc
asmc: restore SMC state across suspend/resume

Reinit the SMS interrupt mask, motion thresholds, and shock window on
resume. Guard the backlight rewrite on sc_has_light. Add
device_suspend to release manual fan control before sleep and restore
it on resume.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61478
ddf06e98560237c60dab2809d2b0a9764f9fb747 Abdelkader Boudih 2026-11-15 21:12:37

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: print the last field of the SMC revision correctly

Use be16dec() at the correct offset instead of an unaligned,
off-by-two-bytes read through a cast pointer.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61479
40d0f9e02b746284a0bc4800f26e5b16f146f3b8 Abdelkader Boudih 2026-11-15 21:12:39

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: add MODULE_VERSION

Advertise the module's ABI version.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61480
92f5c74c4663c3871b9d84b4ee68d0bfe2784ada Abdelkader Boudih 2026-11-15 21:12:41

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: remove the unused sc_dev softc field

It was never assigned or read. legacy code.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61481
14a88ee6addc8e03abd7802bb05328ed67a96efc Abdelkader Boudih 2026-11-15 21:12:42

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: do not drop shutdown notification when the system node fails

asmc_attach() registered the MBSS shutdown-cause handler
(EVENTHANDLER_REGISTER(shutdown_pre_sync, asmc_shutdown, ...))
after attempting to add the dev.asmc.N.system sysctl subtree. If that
subtree registration failed, the error path took goto nosms, jumping clean
over the shutdown-handler registration. On T2 Macs this silently drops
the only thing standing between a clean shutdown and bridgeOS's
watchdog power-cycling the machine.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61482
902b401a51c8165a3af23466acabe912c9a48b34 Abdelkader Boudih 2026-11-15 21:12:44

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: clear the sensor counts in detach

The key arrays are freed but the counts were left set, leaving the
softc describing freed memory. Reachable via the attach error path,
which calls detach directly.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61483
cf3e63b842f5e13dca93d8e218ef48892b358a71 Abdelkader Boudih 2026-11-15 21:12:46

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: register the fan id sysctl with a string format

Every fan sysctl was registered with a hardcoded "I" format, but id
is CTLTYPE_STRING. Carry the format in the table instead.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61484
e029e26ca08744a4d50c29b3f7226bf0379be603 Abdelkader Boudih 2026-11-15 21:12:47

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: propagate sysctl read and write errors

Several handlers discarded the key transport's result: fan speed, SMS
and ambient light handlers published a value regardless of read
success; a rejected fan speed or keyboard backlight write reported success;
fan id returned EPERM on an unreadable key instead of ENXIO.

asmc_fan_getvalue()/asmc_fan_setvalue() now return the error and pass
the speed out by reference instead of returning -1 for failure.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61485
cd827095b744b41dd93a3f65974e85fab1a0334d Abdelkader Boudih 2026-11-15 21:12:49

debug: classified in 03-filenames_plain1 by 'sys/dev/'

Commit group #44: asmc
asmc: report temperatures in deciKelvin

The handler returned the raw key's high byte, dropping the sign and
fraction of the sp78 encoding, and published -1 on a failed read.

Read through asmc_sensor_read() instead, convert to deciKelvin, and
register the leaves as "IK". Changes the unit of dev.asmc.N.temp.*.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61487
49ba2878e6ec412565caccd2d0990e9355123290 Abdelkader Boudih 2026-11-15 21:12:52

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: wrap the lines that exceed 80 columns

Remove linter noise.
No functional change.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61488
fcc8bf08b7e9f0b5e8e280c455dbb78dde32edcd Abdelkader Boudih 2026-11-15 21:12:54

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: do not report absent sensors as a temperature

A key can exist for a sensor the model was never built with; the SMC
answers those with a fixed sentinel instead of an error. Return ENXIO
for the sentinel instead of publishing it as a reading.

MFC after:      3 days

Reviewed by:    adrian

Differential Revision:  https://reviews.freebsd.org/D61489
58d836473fb65ece9f78ce5f577b44855a98c982 Abdelkader Boudih 2026-11-15 21:12:56

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: make asmc_sysctl_add_system() void

Its only caller already discarded the return value with (void). Match
the other sysctl subtree builders.

Reviewed by:    adrian

Differential Revision:  https://reviews.freebsd.org/D61537
93451769fc6eae77ed3cfb0f6f508ca82e9eab96 Abdelkader Boudih 2026-11-15 21:12:57

debug: classified in 03-filenames_plain1 by 'sys/dev/'


asmc: rename asmcmmio.{c,h} to asmc_mmio.{c,h}

No functional change.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61538
9fe57fe3578a3d53d00ba979d13fe3f68f1470fb Abdelkader Boudih 2026-11-15 21:13:14

debug: classified in 03-filenames_plain1 by 'sys/dev/'

mps(4): add support for hostboot
If the mps/mpr(4) device has corrupted or missing firmware then
it will fail to attach.

Add an interface to use firmware(9) to load the firmware at boot.

Loosely based on https://github.com/marcan/lsirec/

Assisted-by:    Claude Code (Opus 5)
Reviewed by:    imp
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D59854
866760ff8338a307b10470ea85b5df5ad9fccf6a Allan Jude 2026-11-16 01:26:10

debug: classified in 03-filenames_plain1 by 'sys/dev/'

sound: Remove stale midi module dependencies
midi(4) stopped being a module in 45bb10e0ed5a ("sound: Stop building
midi as a module"), so snd_cmi(4) and snd_emu10k1(4) fail to load
because they still depend on it.

Fixes:          https://cgit.freebsd.org/src/commit/?id=45bb10e0ed5a ("sound: Stop building midi as a module")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 day
563c2f27e0ffec96a0ddd77b68c7ca6614d704af Christos Margiolis 2026-11-16 11:32:22

debug: classified in 03-filenames_plain1 by 'sys/dev/'

vmm: release the lock when vrtc_snapshot() fails
The error path of the SNAPSHOT_*_OR_LEAVE() macros jumped past
VRTC_UNLOCK() and returned with the vrtc lock held.

Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>

Reviewed by:    bnovkov, markj, jhb
Sponsored by:   keelos.dev
Differential Revision:  https://reviews.freebsd.org/D60232
125b88f5aa91e524acbf00411aa993677857ad2d Wanpeng Qian 2026-11-16 19:00:17

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

vmm: do not let the RTC's periodic interrupt drift
The callout of the periodic interrupt was rearmed from its handler with
a timeout of one period from the time the handler ran.  Each period was
longer than programmed by the latency of the callout, so the interrupt
came at a lower rate than the guest asked for.  A guest that counts
these interrupts to keep its time runs slow.

Give the callout absolute deadlines one period apart, as vatpit does.
If a deadline has already passed when it is computed, for instance
after the VM was paused, start again from the current time.

Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>

Reviewed by:    jhb
Sponsored by:   keelos.dev
Differential Revision:  https://reviews.freebsd.org/D60233
018bd70c4ac9c3e7b985ab775bf371cc59a22759 Wanpeng Qian 2026-11-16 19:00:17

debug: classified in 03-filenames_plain1 by 'sys/amd64/'

Networking

Network-related commands, library, and kernel.

Commit group #45: pf
pf: free the packet rate counter of a rule

pf_ioctl_addrule() allocates a counter_rate for every rule, whether it
has a max-pkt-rate or not, and pf_krule_free() never frees it.

Free it with the rest of the rule.

Reviewed by:            kp
Approved by:            kp (mentor)
Fixes:                  https://cgit.freebsd.org/src/commit/?id=ff11f1c8c76c ("pf: add a generic packet rate matching filter")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60190
2fa4ef491608aad827f8ceef3eb389d8c07451fb R. Christian McDonald 2026-10-01 10:32:32

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'


pf: remove a source limiter from the id tree if its name is taken

When pf_sourcelim_add() finds the name of the new limiter taken, it
undoes the insertion into the id tree with RB_REMOVE() on the name tree,
which the limiter is not in, and then frees the limiter.  The freed
limiter stays in the inactive id tree, and RB_REMOVE() of an element
with no links clears the root of the name tree, which loses every other
inactive limiter from it.  pf_statelim_add() gets this right.

parse.y refuses duplicate names, so pfctl does not get here, but any
netlink client can.

Reviewed by:            kp
Approved by:            kp (mentor)
Fixes:                  https://cgit.freebsd.org/src/commit/?id=461648121230 ("pf: introduce source and state limiters")
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60189
5c13a82de8be51c8472e922a667519d575dcb59e R. Christian McDonald 2026-10-01 10:34:50

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'


pf: return per-address feedback from netlink table test

The PFNL_CMD_TABLE_TEST_ADDRS reply carries only the match count, so
the per-address feedback from pfr_tst_addrs() is lost:
"pfctl -v -T test" lists nothing and "pfctl -vv -T test" reports
every address as "nomatch".

Return each address, as updated by pfr_tst_addrs(), in a nested
PF_TAS_ADDR attribute, and decode them into the caller's array in
libpfctl.  PF_TA_ADDR is not reused: it shares its value with
PF_TAS_ASTATS, which older libpfctl would decode into an
uninitialised target.  That target was also read when no reply was
parsed, so the match count could be garbage; initialise it.

Add a regression test.

Reviewed by:            kp
Approved by:            kp (mentor)
Fixes:                  https://cgit.freebsd.org/src/commit/?id=281282e9357b ("pf: convert DIOCRTSTADDRS to netlink")
See also:               https://redmine.pfsense.org/issues/17135
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60146
f05af59fba6912bdde8c911b0820871224ed16db R. Christian McDonald 2026-10-01 10:39:01

debug: classified in 05-summary-prefix by 'pf:'

tcp: use SB_AUTOSIZE flag to tell if socket buffer was set
The check against V_tcp_sendspace is not a correct one, as a buffer may
grow larger than the initial value.  The conjunction was always false up
until 587c6c121504, and only after it the bug surfaced.

If we already grow our buffer past the value stored in the hostcache,
prefer our value.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D60105
e65b7079db12afb1aa61be4f1c666b162984a95e Gleb Smirnoff 2026-10-02 02:53:31

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

pf: do not leak a source hash row lock in the netlink dump
pf_handle_get_srcnodes() returns with the lock of a source hash row
held when it cannot start the message for a source node.  Unlock the
row there, as the other error exit of the loop does.

Reviewed by:            kp
Approved by:            kp (mentor)
Fixes:                  https://cgit.freebsd.org/src/commit/?id=9c125336727b ("pf: convert DIOCGETSRCNODES to netlink")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60251
782c6ea08603a4839c2c099842df92b6159b799f R. Christian McDonald 2026-10-02 17:10:56

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

netinet6: Fix the OSIOCAIFADDR_IN6 handler
We cannot simply treat a pointer to struct oin6_aliasreq as a pointer to
struct in6_aliasreq: the latter is larger.  In particular, the store to
ifra->ifra_vhid is out of bounds.

Since OSIOCAIFADDR_IN6 does not need to copy data back out, it can
simply use a struct in6_ifaliasreq on the stack.

Reported by:    Andrew <xxx.sys@protonmail.com>
Reviewed by:    pouria
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60184
c109a681456d03fc0737ca83487995e28b759e3b Mark Johnston 2026-10-05 13:13:47

debug: classified in 03-filenames_plain1 by 'sys/netinet6/'

tcp: Preserve borrowed ICMPv6 error mbufs
The TCP-over-UDP ICMP callback receives ip6c_m as a borrowed chain owned
by icmp6_notify_error.  It used m_pulldown() to obtain a contiguous UDP
header even though that API frees the complete chain when the requested
range is unavailable.  The callback could then return without
propagating the lost ownership, leaving raw ICMP delivery to read and
free a stale head.

Validate that the complete UDP header was quoted, copy it through the
chain with m_copydata(), and temporarily advance the parser offset
instead of consuming bytes from the caller-owned packet.

A remote sender can reach the old path when TCP UDP tunneling is enabled
by quoting the configured local UDP source port in an ICMPv6 error and
including only four through seven UDP-header bytes.

Signed-off-by: Andrew Griffiths <andrew@calif.io>

Reviewed by:    pouria, tuexen, markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60143
80af0a32e48bff6ad97e768b16d2dbc01ac8d1c3 Andrew Griffiths 2026-10-05 13:14:38

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

iflib: Do not ring the transmit doorbell when nothing is pending
For a lightly used ring iflib_txd_db_check() may defer zero descriptors,
so its "pending >= limit" test is true even when nothing has been queued
since the last doorbell.  iflib_txq_drain() calls it before, inside and
after its loop, so a sender that drains its own packet wrote the tail
register three times per packet, twice with the value the hardware
already had.

The log of 81be655266fa ("iflib: ensure that tx interrupts enabled and
cleanups") calls skipping the doorbell when db_pending is zero "an
obvious missing optimization"; the comparison against a limit of zero
defeated it.  vmx(4) and mgb(4) have dropped such repeated requests in
the driver since 2019.  Return early when nothing is pending.

Reviewed by:            gallatin
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60290
4a0ec469934a5de60b9b540689703a698ac44105 R. Christian McDonald 2026-10-05 15:17:13

debug: classified in 03-filenames_plain1 by 'sys/net/'

iflib: Make the deferral test in iflib_txd_db_check() an early return
Invert the test so the doorbell write is no longer nested inside the
conditional, and wrap its comments to 80 columns.  Fix a typo in one of
them.

No functional change intended.

Reviewed by:            kbowling
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60371
ac24108dabcac04c7db351d33eb76f3ddee6073b R. Christian McDonald 2026-10-05 18:52:10

debug: classified in 03-filenames_plain1 by 'sys/net/'

netinet: Deprecate OSIOCAIFADDR and OSIOCAIFADDR_IN6
Requested by: glebius
Reviewed by:    pouria, glebius
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60247
4bb60157646df86c77cea130c66f63f119947709 Mark Johnston 2026-10-05 22:21:39

debug: classified in 03-filenames_plain1 by '['sys/netinet/', 'sys/netinet6/']'

routing: fix rtentry use-after-free in multipath route append
add_route_flags() drops the RIB lock and passes the existing entry,
rt_orig, to add_route_flags_mpath(). If a concurrent delete removes
the prefix in that window, the retry re-inserts rt_orig, which is
then freed while still linked, crashing later in rn_match().

Pass the new rt instead, return ENOENT when the prefix is gone and
RTM_F_CREATE is not set, and fix the rnd_orig NULL check.

Approved by:    pouria
Fixes:          https://cgit.freebsd.org/src/commit/?id=c24a8f19c5d5 ("routing: fix rib_add_route_px()")
Differential Revision:  https://reviews.freebsd.org/D60353
139fa2c12ddc028048efe3946f2663dcfba9b122 Olivier Cochard 2026-10-07 04:16:33

debug: classified in 03-filenames_plain1 by 'sys/net/'

epair: Make vnet_epair_uninit() run earlier
I can't see a reason for vnet_epair_init() and vnet_epair_uninit() to be
inconsistent in the sys(un)init run order.  Move vnet_epair_uninit() to
SI_SUB_PSEUDO, which is more appropriate for software ifnet drivers.

Reviewed by:    glebius
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60388
5c20c75b67e3c96d58c1bbfe82472a8371bfa161 Mark Johnston 2026-10-06 22:04:54

debug: classified in 03-filenames_plain1 by 'sys/net/'

ctld: Fix namespace IDs for exported NVMe namespaces
NVMe namespace IDs are 1-based, but CTL LUN IDs are 0-based.  The
in-kernel NVMe ctl(4) target accounts for this by adding one to the
LUN ID to compute a namespace ID.  ctld was attempting to handle this
by translating namespace IDs from config files to internal LUN IDs,
but it did this incorrectly resulting in the namespace configured for
as namespace N actually showing up as namespace N + 1.

Fixes:          https://cgit.freebsd.org/src/commit/?id=66b5296f1b29 ("ctld: Add support for NVMe over Fabrics")
Sponsored by:   Chelsio Communications
9c8be6518e2e5f396055ecdab8098ce19c4b2218 John Baldwin 2026-10-08 15:24:45

debug: classified in 03-filenames_plain1 by 'usr.sbin/ctld/'

netipsec: Fix V_spd_size updates
key_unregister_ifnet() was erroneously decrementing the size of the
global security policy database, V_sptree, but it doesn't modify that
database.  V_sptree_ifnet is for policies attached to if_ipsec
interfaces.  Note also that key_register_ifnet() was not incrementing
the counter.

Move the definition of V_spd_size up to the rest of the SPD definitions.
Its inclusion among the SPD cache definitions was confusing to me.

Reviewed by:    ae
Reported by:    Stephan de Wit and Cedrik Pischem from OPNsense
Sponsored by:   OPNsense
Sponsored by:   Klara, Inc.
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60418
6b1d5fec57f9604a447864ec5e66940126b38df4 Mark Johnston 2026-10-08 17:02:51

debug: classified in 03-filenames_plain1 by 'sys/netipsec/'

nd6: Do not allocate an ifaddr for the interface ID in in6_ifadd()
Without a suitable link-local address, in6_ifadd() obtains the
interface identifier from in6_get_ifid().  It wrote the result into a
freshly allocated struct in6_ifaddr, M_NOWAIT since the function runs
in the network epoch, so SLAAC could fail under memory pressure over a
16 byte scratch buffer.

Write the identifier into the on-stack address the rest of the function
uses instead.  Zero it first, in6_get_ifid() only fills in the low 64
bits, as the M_ZERO allocation did.  Track which path provided the
identifier with a flag instead of a pointer into the ifaddr, so each
path releases its own reference.

Reviewed by:            glebius
Fixes:                  https://cgit.freebsd.org/src/commit/?id=9e792f7ef729 ("sys/netinet6: Fix SLAAC for interfaces with no /64 LL address")
Fixes:                  https://cgit.freebsd.org/src/commit/?id=f9fc93690aef ("sys/netinet6: fix memory corruption in in6_ifadd")
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60488
ec76d3f600b528df7c29d3305e44342f08789fbf R. Christian McDonald 2026-10-08 23:08:19

debug: classified in 03-filenames_plain1 by 'sys/netinet6/'

libalias: index fully specified inbound links by remote endpoint
Inbound lookups find the (alias address, alias port, link type) group
with a splay tree and then walk grp->full, a list of every fully
specified link in that group, comparing the remote address and port.
With redirect_addr in front of a busy server, every client connection
to public:443 lands in the same group, so each inbound packet that is
not near the head of the list walks all of it.  TCP links live up to
24 hours unless libalias sees a clean close, so the list can grow to
hundreds of thousands of entries and saturate a core at a few hundred
packets per second.

Keep the fully specified links of a group in an RB tree ordered by
(dst_addr, dst_port).  Links that share an endpoint are ordered newest
first by a per-instance insertion counter, which keeps the "most recent
link wins" behaviour of the list (tested by 3_natin:2_portoverlap).

Lookups with an unknown remote address and a known port still scan the
group.  Each link grows by 16 bytes.

With ~170,000 links in one group, LibAliasIn() took 1-2 ms per packet
and one core saturated at ~720 packets/s.  With this change it takes
2-4 us per packet and the offered 1,000 packets/s are handled with the
thread nearly idle.

Sponsored by:           NLINK
Differential Revision:  https://reviews.freebsd.org/D60083
16bc669facc5eba33f7e215adce206bcf6ab2776 Paulo Fragoso 2026-09-27 19:25:07

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

if_me: Do not reuse gre(4)'s static sysctl OID number
if_me(4) registers its net.link.me node with the static OID number
IFT_TUNNEL, the same number if_gre(4) has used for net.link.gre since
2003, so the two tunnel drivers collide under net.link.  Until
d35c4cfad580 that only printed a warning and left two nodes with the
same number; since then sysctl_register_oid() panics, so loading if_me
after if_gre (or the other way round) takes the box down:

  kldload if_gre
  kldload if_me
  panic: sysctl: OID number(131) is already in use for 'me'

Use OID_AUTO like the other tunnel drivers.  Nothing addresses the node
by number.

Reviewed by:            ae
MFC after:              3 days
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60536
21f2245de21931cf388120d8cb464442aaa84c6f R. Christian McDonald 2026-10-10 13:13:22

debug: classified in 03-filenames_plain1 by 'sys/net/'

if_gre(4): Cleanup unused RSS macros
RSS hash calculations no longer depend on RSS macro.
Therefore, remove unused macros and its XOR fallback.

Reviewed by:    adrian
Fixes:  https://cgit.freebsd.org/src/commit/?id=9c55b2e8cd6b ("rss: Enable portions of RSS globally to ...")
Differential Revision:  https://reviews.freebsd.org/D60556
f877ace81633822f66c2b1300040ea15ca063b8d Pouria Mousavizadeh Tehrani 2026-10-09 21:34:27

debug: classified in 03-filenames_plain1 by 'sys/net/'

ng_ubt: ignore further MediaTek USB BT devices
Following 8b21c469dbd6 add more entries for various MT BT USB VPI
combinations given we currently do not support any of them.

Suggested by:   thierry (while testing MT7920 wireless)
MFC after:      3 days
Reviewed by:    emaste, imp
Differential Revision: https://reviews.freebsd.org/D60279
33901f0d6f7bae39d7cb2867aee3327373762df0 Bjoern A. Zeeb 2026-10-03 17:47:40

debug: classified in 03-filenames_plain1 by 'sys/netgraph/'

netgraph/ng_ksocket: Enter epoch on NG_SEND_DATA_ONLY
The work queued by ng_send_fn() is intentionally processed
outside of the epoch in ngthread().
It is ng_ksocket's responsibility to enter epoch if it decides
to send data from such work.

Reviewed by:    glebius
Fixes:  https://cgit.freebsd.org/src/commit/?id=104827151e2a ("ng_iface: don't recursively enter epoch ...")
Differential Revision:  https://reviews.freebsd.org/D60589
67be955f6bd5d5b51fdee407969d1a7cde156f65 Pouria Mousavizadeh Tehrani 2026-10-10 15:51:58

debug: classified in 03-filenames_plain1 by 'sys/netgraph/'

if_gre: Use OID_AUTO for the net.link.gre sysctl node
if_gre(4) registers net.link.gre with the static OID number IFT_TUNNEL.
That number is an interface type that several tunnel drivers share, not
one that belongs to gre(4).  if_me(4) used it too, which made loading
both modules panic until 21f2245de219.  Nothing addresses the node by
number, so use OID_AUTO as if_me(4) now does.

Suggested by:   markj
MFC after:      3 days
Sponsored by:   Rubicon Communications, LLC ("Netgate")
80bc1d0e3ef732c6b58d13d0f223453a2410d8c1 R. Christian McDonald 2026-10-11 11:49:09

debug: classified in 03-filenames_plain1 by 'sys/net/'

sctp: hold tcp lock when calling sctp_calc_rwnd()
This was done in all code paths except one. Fix this to avoid
race conditions.

Reported by:    syzbot+2e2dc35c0e24a74663a7@syzkaller.appspotmail.com
Reviewed by:    tuexen
MFC after:      1 week
MFC to:         stable/14
MFC to:         stable/15
429f2fb48b92011d07798e681d96aa628fd8e387 Lukas Book 2026-10-11 20:00:06

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

net80211: add driver registration documentation
This is a brief introduction into the top-level newbus
driver methods and net80211 driver registration.

Differential Revision:  https://reviews.freebsd.org/D60503
Reviewed by: ziaee, zi
2409e2436a5369146f4cc99463ce5314dba0b7d4 Adrian Chadd 2026-10-11 22:26:14

debug: classified in 03-filenames_plain1 by 'sys/net80211/'

net80211: add DRIVER_REGISTRATION to README.md ; fix links
* add the driver registration doc to README.md
* fix the links to resolve correctly with current doxygen
  (1.18.0) with the current file path -> sanity conversion ->
  html path rules.

Differential Revision:  https://reviews.freebsd.org/D60504
Reviewed by: ziaee
e8b58993ff5d31fa964741d8e37c0f1a3e549095 Adrian Chadd 2026-10-11 22:27:35

debug: classified in 03-filenames_plain1 by 'sys/net80211/'

netlink: Make room for the unfinished message when growing the buffer
When a message outgrows the writer's buffer, _nlmsg_refill_buffer()
allocates a larger one and moves the unfinished message there.  The new
buffer was sized for the data about to be added alone, so with enough of
the message already written the caller wrote past its end and left it
with datalen > buflen.  A 20-byte message plus an attribute of 8176
bytes got a buffer of 8192 bytes for 8200 bytes of data, and reading it
panicked an INVARIANTS kernel in nl_soreceive().

Size the new buffer for both, and add a ktest for it.

Reviewed by:            glebius
Fixes:                  https://cgit.freebsd.org/src/commit/?id=7e5bf68495cc ("netlink: add netlink support")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60541
5180fce1cf7ec7430ccf2adb88358602e5ccee1e R. Christian McDonald 2026-10-11 20:46:56

debug: classified in 03-filenames_plain1 by 'sys/netlink/'

pf: Drain the overload task before a vnet's rules are freed
pf_src_connlimit() queues an entry for pf_overload_task() when a
source exceeds max-src-conn or max-src-conn-rate and the rule has an
overload table.  The entry holds a pointer to the rule, and the task
runs from taskqueue_swi with the vnet of the queue.  Nothing drained
the task when the vnet went away: an entry queued just before could
be applied to a rule pf_unload_vnet_purge() had freed, or to a vnet
that was gone.

Drain the task at the start of pf_unload_vnet_purge(), before the
unlinked rules are freed.  No packet can queue another by then, as the
hooks are already removed.

Reviewed by:            kp
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60529
92d66a6b474fa6fe42fbe08002803d79a5af6594 R. Christian McDonald 2026-10-12 11:52:34

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

Commit group #46: pf
pf: do not free the caller's ruleset when attaching a table fails

pfr_attach_table() takes a struct pf_ruleset * from its caller and, on its
own error paths, calls pfr_destroy_ktable() on the table it just made.  That
drops the table's reference on the ruleset and calls
pf_remove_if_empty_ruleset(), which may unlink and free the anchor the
ruleset is embedded in -- and then pfr_attach_table() returns NULL to a
caller still holding the pointer.

Reached from userland with DIOCADDRULE and a PF_ADDR_DYNIFTL source, after
DIOCSETLIMIT has lowered PF_LIMIT_TABLES to one item of headroom: the first
pfr_create_ktable() takes it and the root table's fails.

Hold a table reference on the ruleset for the duration instead, so the
ruleset outlives every failure path inside pfr_attach_table() and stays the
caller's to remove.

OK sashan@

Obtained from:  OpenBSD, gnezdo <gnezdo@openbsd.org>, e0a25791f4
Sponsored by:   Rubicon Communications, LLC ("Netgate")
25f04bf42786806e2661b7a09c283b83f568380a Kristof Provost 2026-10-12 08:00:11

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'


pf: check extension header length.

pf_walk_header6() advances the packet offset for each IPv6 extension
header.  It was not checked that this does not exceed the packet
length if no next header was processed.  When used with af-to rules,
this could trigger a panic: m_copydata: null mbuf.

from Acts1631; OK henning@ sashan@

MFC after:      1 week
Obtained from:  OpenBSD, bluhm <bluhm@openbsd.org>, 6d56112588
Sponsored by:   Rubicon Communications, LLC ("Netgate")
ccb19b359aae4b7e7315ad61d33d9a35d85849d1 Kristof Provost 2026-10-12 12:25:07

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'


pf: check AH header length.

pf_walk_header() advances the packet offset for each AH extension
header.  It was not checked that this does not exceed the packet
length if no next header was processed.  Fix it like in IPv6.

OK henning@ sashan@

MFC after:      1 week
Obtained from:  OpenBSD, bluhm <bluhm@openbsd.org>, fcd4e5522e
Sponsored by:   Rubicon Communications, LLC ("Netgate")
b4d2c9835c0edfddd1d6742afa86d4873ccfad16 Kristof Provost 2026-10-12 12:28:22

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'


pf: convert DIOCXBEGIN, DIOCXROLLBACK, DIOCXCOMMIT to netlink

Sponsored by:   Rubicon Communications, LLC ("Netgate")
a7aad5bbcdf7f82b4db8557adfa1a0267d43d06a Kristof Provost 2026-10-20 07:34:39

debug: classified in 05-summary-prefix by 'pf:'


pf: have DIOCXBEGIN/DIOCXROLLBACK/DIOCXCOMMIT use the new functions

The netlink begin/rollback/commit code has separate functions for this.
Deduplicate the code and just use those functions.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
2636cc0414fdd2cf69759d8c56e1e82782aef7b0 Kristof Provost 2026-10-27 13:37:45

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'


pf: remove armv7-specific counter code

The armv7 specific counter code is less useful now that armv7 is
basically end-of-life.

This removes a lot of armv7-specific code.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
9e7d55570f6993ba4092ce7919a0a731c7f8e734 Kristof Provost 2026-10-23 11:50:35

debug: classified in 03-filenames_plain1 by '['sys/net/', 'sys/netpfil/']'


pf: fix pf_krule_item memory leak during counters:match_fail

If pf_counters_inc() did not increment the counters because the rule
failed to apply it potentially failed to free match rules (which were
not bound to a state already).

Do so.

While here explicitly hand match_rules over from the pf_test_ctx to the
state so we never list them in two places.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
2e9ac12e97939d536c02877a41807dee05717ea5 Kristof Provost 2026-10-28 10:35:57

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'


pf: fix DIOCXBEING/DIOCXROLLBACK/DIOCXCOMMIT error handling

 - ensure the anchor name is always 0-terminated
   strlcpy() won't overflow, but will walk off the end of the provided
   buffer looking for a 0.
 - don't overwrite the pf_begin()/... return value with the copyout()
   return value
 - stop on the first copyout() error

Fixes:  https://cgit.freebsd.org/src/commit/?id=2636cc0414fd (pf: have DIOCXBEGIN/DIOCXROLLBACK/DIOCXCOMMIT use the new functions, 2026-10-27)
Reported by:    markj's Post-Commit LLM Review Service
Sponsored by:   Rubicon Communications, LLC ("Netgate")
73bd8d4bf618a5d6f4a2aa7f5237af3a5d8c1ebc Kristof Provost 2026-11-02 10:19:31

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

pf: Change source limiter tables from a task
pf_source_used() puts a source in the table of its source limiter when
the source has more states than the high-water mark, and
pf_source_rele() takes it out again below the low-water mark.  Both
changed the table in place: pf_source_used() from pf_create_state(),
with the rules lock held for reading, and pf_source_rele() from
pf_remove_state(), with no rules lock at all.  A table may only be
changed with the rules lock held for writing, as packets look addresses
up in its radix tree at the same time.  With INVARIANTS the first
insertion panics ("Lock pf rulesets not exclusively locked" in
pfr_route_kentry()); without, the tree can be corrupted.

Queue the changes instead, as pf_overload_task() does for overload
tables, and make them from a task with the rules lock held for writing.
An entry names the limiter by its id and remembers its table: the
limiter, or its table, may be gone or replaced by the time the task
runs, and then the entry is dropped.  pfsr_intable changes only once
the change is queued, so a failed allocation is retried the next time
the source crosses a mark; a removal is also retried when the source is
purged.  Drain the task when a vnet goes away, after its last state.

Add a regression test.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=461648121230 ("pf: introduce source and state limiters")
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60526
6bc57500b8b700a3d9998fd417fdee653f93366d R. Christian McDonald 2026-10-12 16:47:21

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

iflib: unify prefetching
This change makes all prefetching use the iflib prefetch wrappers, rather
than using prefetch() in some places and __builtin_prefetch() in others.

Note that __builtin_prefetch() does not work in the kernel on amd64 as clang
disables it when -mnosse is specified, so we must use the asm directives there,
and builtin_prefetch() elsewhere.

This change enables prefetching on non-x86 (notably arm64), and it enables
prefetching in netmap that has been there since day one, but which has never worked.

This is a no-op on non-netmap amd64 and i386

Differential Revision: https://reviews.freebsd.org/D60602
Reviewed by: glebius, kbowling
Sponsored by: Netflix
cdd95034d6f4b5a7abe7d21b2b1a568fa5e906a0 Andrew Gallatin 2026-10-12 19:50:15

debug: classified in 03-filenames_plain1 by 'sys/net/'

pf: first-match-wins for nat rules, even in anchors
Ensure we stop evaluating nat rules if we find a match in a nat-anchor.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299320
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
b5219c068fbc133dde91d5cf48423e34ce27bd4f Kristof Provost 2026-10-13 12:40:58

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

pf: Set the reassembly flags under the rules lock
DIOCSETREASS stored V_pf_status.reass twice with no lock, first the
flags it was given and then, if reassembly was not among them, zero.
pf_normalize_ip() and pf_normalize_ip6() read the flags with the rules
lock held for reading, so a packet could see the intermediate value.
Compute the flags first and store them once, with the rules lock held
for writing, as DIOCSETDEBUG and DIOCSETHOSTID do.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=39282ef356db ("pf: backport OpenBSD syntax of "scrub" option for "match" and "pass" rules")
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60531
b951994eddd4d274514df751da06680a32139037 R. Christian McDonald 2026-10-13 13:39:30

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

pf: Parse the GETSTATES state id as 64 bits
The GETSTATES dump sends PF_ST_ID as a u64, but the request parser
reads it as a u32 and rejects an id taken from the dump with EINVAL.
Nothing in base sends PF_ST_ID.  Parse and document it as a u64.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=2cef62886dc7 ("pf: convert state retrieval to netlink")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60543
74d2a0b79ffd8d43da61eaca36b39935594d8772 R. Christian McDonald 2026-10-13 14:53:10

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

pf: Free a table entry that cannot be routed
pfr_insert_kentry() returned the error of pfr_route_kentry() and
leaked the entry it had created; pfr_insert_kentries() stopped at the
first entry it could not route and leaked it and the rest of the work
queue, which no caller frees.  Destroy an entry that cannot be routed
and go on with the next.

Reviewed by:            kp
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60532
989d72fd3d35daa6a056afdd0c6b0aba4c5d8ccf R. Christian McDonald 2026-10-13 15:53:00

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

pf: Do not corrupt neighbour advertisements when translating
When an ICMPv6 query or reply matches a translated state,
pf_test_state_icmp() copies the state's virtual id into icmp6_id.  Only
echo messages have an identifier there.  For all other types the
virtual id is 0 and those two bytes hold something else; in a neighbour
advertisement they hold the R, S and O flags.  The checksum was not
updated either, so icmp6_input() dropped the advertisement as a bad
checksum.

Unicast NUD probes to a link-local neighbour, such as the default
router, are sent from the link-local address.  With a nat rule that
matches it (e.g. "from any"), every advertisement answering a probe was
dropped: NUD failed, the neighbour cache entry was deleted, and traffic
to the neighbour stalled until it was resolved again.

Only rewrite the id of echo messages, as the ICMPv6 error path already
does, and update the checksum, as the IPv4 path does.

Add a regression test.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=f1ddd7f1dae6 ("pf: add forgotten fixup for icmp6 id's when translating")
See also:               https://redmine.pfsense.org/issues/16236
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60542
a6e1dde287eb3854873224200cea40996b0b5cbf R. Christian McDonald 2026-10-13 15:58:55

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

pf: Do not hash pool address pointers into rule hashes
pf_hash_pool() hashes the first address of a pool as a whole struct
pf_addr_wrap, including the union that holds the kernel's pfi_dynaddr
or pfr_ktable pointer.

An interface pool such as "-> ($ext_if)" gets a new pfi_dynaddr on
every load, so with "set keepcounters" the rule never matches its
predecessor and loses its counters on every reload.  The pointers also
differ between hosts: once a filter rule in the main ruleset has an
interface or table pool, pfsync peers disagree on the ruleset checksum
and bind every synced state to the default rule.

Hash the address with that union cleared.  The rest of the address,
including the prefix length of an interface address, is hashed as
before, and the hash of a rule with a plain address pool does not
change.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=c6bcf6e6fd50 ("pf: include all elements when hashing rules")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60370
e6dc001d7a387100125718322fa741444a9025fc R. Christian McDonald 2026-10-13 19:17:48

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

pf: Register the netlink family only while the vnets are set up
pf_modevent() registers the generic netlink family at MOD_LOAD, before
vnet_pf_init() has set up the state hashes and locks the handlers use,
and pf_unload() unregisters it after vnet_pf_uninit() has torn them
down.  Sending PFNL_CMD_GETSTATES while pf loads or unloads panics in
pf_handle_getstates() on a NULL or freed V_pf_idhash.

Register the family from a SYSINIT ordered after vnet_pf_init(), and
unregister it from the matching SYSUNINIT, before vnet_pf_uninit().

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=2cef62886dc7 ("pf: convert state retrieval to netlink")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60651
68831d2a2cbb34e8daf24db7e4e15b8c09451f85 R. Christian McDonald 2026-10-13 19:22:30

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

ipfw: re-arrange declarations so that they match comments
No functional change.
a20bbabe343148c1a6d4b234c05fbcc9916c840d Gleb Smirnoff 2026-10-13 19:51:53

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

netinet: garbage collect __IPPROTO_DIVERT
90c8c8e451058289660e798b242ff5d27f9e7d1e Gleb Smirnoff 2026-10-13 19:51:53

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

tcp/rack: Fix a potential overflow in rack_update_pcm_ack()
The RACK stack's path capacity measurement module maintains an array of
samples, updated when the stack receives an ACK.  The array grows as
needed, but code which handles the expansion is susceptible to remotely
triggerable overflow.  This could lead to underallocation and a ~512KB
out-of-bounds write.

Fix this by bounding the sample array size.

Approved by:    so
Security:       FreeBSD-SA-26:70.tcp
Security:       CVE-2026-101307
Reviewed by:    glebius, markj
Reported by:    Nozomi Networks Security Research
9a406a9ec399cced14ce5d204ba3fd383544b47f Michael Tuexen 2026-10-12 18:55:21

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

pfsync: use result of m_pullup()
f84cdc2584305f8b656ce3f3746868c4a58a9a82 Gleb Smirnoff 2026-10-15 04:50:41

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

pf: Remove a table entry regardless of its mark
pfr_remove_kentry() returns without removing an entry whose mark is
set.  The mark is scratch space for the operations that handle a list
of addresses: each resets it before use and leaves it set on the
entries it kept, so after "pfctl -T replace" or "pfctl -T zero" of an
address the entry stays marked.  An address a source limiter put in
its table is then never taken out again when the source falls below
the low-water mark.

Remove the entry whether it is marked or not; nothing else is in the
work queue.

Add a regression test.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=461648121230 ("pf: introduce source and state limiters")
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60530
f4fe4c3d17f9bb523981b88a01d7c0f0c0f00c36 R. Christian McDonald 2026-10-15 18:10:11

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

pf: only log that we're not creating a tag in verbose mode
While here get rid of the aesthetically unpleasing '== false' construct.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
294dc0464c3b68e8308d8c6ac93cf6b31e433a00 Kristof Provost 2026-10-13 14:31:01

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

sctp: improve locking validation
Ensure that the TCB lock is hold in sctp_calc_rwnd().

Reviewed by:    tuexen
MFC after:      1 week
MFC to:         stable/14
MFC to:         stable/15
38479a4832789c239eb1ff097ee51e93e8084315 Lukas Book 2026-10-16 07:46:16

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

loopback: set MTU to IF_MAXMTU
It was temporarily reduced in af78195e0024 in 1994 to hide some bugs with
signed short overflow.  We believe all these bugs were sorted out by
today. :)

Note that earlier ba582a82b0e36 reduced the MTU be rounded to a longword
with a reference "NFS likes it to be rounded".  We have had several
refactors of the NFS code since that.

Reviewed by:            pouria, zlei, tuexen
Differential Revision:  https://reviews.freebsd.org/D59450
a44c11974c82a01c767a33332177a39fd65616fe Gleb Smirnoff 2026-10-16 21:08:36

debug: classified in 03-filenames_plain1 by 'sys/net/'

ipfw: cleanup SYSINIT(9)s
Make them all belong to SI_SUB_PROTO_FIREWALL and explicitly specify
order.  Prefer SYSINIT() over modevent, for those subsystems that don't
have dependencies.  All subsystems just depend on the main module and they
don't depend on each other, except dummynet which also has submodules.
Thus, keep DECLARE_MODULE() only for the main module and dummynet.

Differential Revision:  https://reviews.freebsd.org/D60685
9bcc1e97dda8e926483b81874884211bbe4f36e9 Gleb Smirnoff 2026-10-16 21:09:05

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

net*: remove remnants of caddr_t
caddr_t is a typedef for a character pointer (char *) that originated in
Version 7 Unix, released by AT&T in 1979.  It became obsolete in 1989,
when ANSI C introduced void *.

What's left:

* ioctl(9) KPI still uses caddr_t, thus network related ioctl method
  still use it.
* if_clone KPI, to be done separately.
* bpf(4), to be done separately.
* SCTP, let maintainers decide.
* iflib(4), let maintainers decide.

Reviewed by:            zlei
Differential Revision:  https://reviews.freebsd.org/D60738
d7cf2e714e29a52264fa4bc67e7d727948003afb Gleb Smirnoff 2026-10-16 21:16:27

debug: classified in 03-filenames_plain1 by '['sys/net/', 'sys/netinet/', 'sys/netinet6/']'

tcp/rack: reject wma_divisor values <= 0
The net.inet.tcp.rack.measure.wma_divisor sysctl is the divisor
of the goodput weighted moving average used when the dynamic
goodput multiplier is enabled.  Setting it to 0 panics the kernel.

Make the variable and the sysctl unsigned, reject 0 and values
above INT32_MAX.

MFC after:      1 month
Found with:     Claude Code Opus 5.5
Reviewed by:    tuexen, glebius, markj (early version)
Differential Revision:  https://reviews.freebsd.org/D60759
7668705cb9837d4c3a6db9b3434b3a522220c8ea Maxim Konovalov 2026-10-16 22:15:00

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

iflib: Pass up the frames received before a descriptor error
When the driver's isc_rxd_pkt_get() fails part way through a receive
pass, iflib_rxeof() jumps straight to the reset request.  The frames it
already took off the ring and chained for if_input() are neither passed
up nor freed, so up to budget - 1 frames are lost and their mbufs and
clusters leak on every such error, and the frames queued to LRO in the
pass wait for the next one.  Leave the loop instead, pass the chain up
and flush LRO as on the normal exit, then request the reset as before,
without refilling.

The path is reachable from several drivers: igc, em, igb and ixgbe
return EBADMSG for frames received with errors, which the hardware
passes up only with store-bad-packets enabled; ixl, iavf and ice for
every descriptor flagged RXE; aq, enetc, mgb and enic for descriptors
they cannot use.

Reviewed by:            gallatin
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60805
bdaddb76ef1b9d5537f4a76cff01cdb4795804a4 R. Christian McDonald 2026-10-19 01:06:41

debug: classified in 03-filenames_plain1 by 'sys/net/'

ng_pppoe: fix m_pullup() logic
The clear intent here is to do m_pullup() if we _don't_ have two bytes.
Before the fix: a) m_pullup() was always called and did nothing; b) if a
node was ever supplied with a fragmented but otherwise correct mbuf, then
it would not handle PROT_LCP as intended.

Noticed by:             zlei
Reviewed by:            zlei, eugen_grosbein.net
Differential Revision:  https://reviews.freebsd.org/D60788
Fixes:                  https://cgit.freebsd.org/src/commit/?id=28903f396af4b151e16ea606cda66a9244fb179f
4c72b1c36dda72b9ba8de593cac2c94e15f42bcf Gleb Smirnoff 2026-10-19 17:30:43

debug: classified in 03-filenames_plain1 by 'sys/netgraph/'

net*: use inlined m_pullup()
Leverage the fact that m_pullup() in an inline function in mbuf.h and let
compiler to do all optimizations.

Mostly mechanical changes, but in few cases surrounding lines are brought
to style(9).  In netinet6, a few input functions changed to set the
input/output `struct mbuf **` pointer to NULL at a single place.

Reviewed by:            pouria, zlei, gallatin
Differential Revision:  https://reviews.freebsd.org/D60689
41356c80179c708b6a49eabf1be9cedd6bca4444 Gleb Smirnoff 2026-10-19 17:32:00

debug: classified in 03-filenames_plain1 by '['sys/net/', 'sys/net80211/', 'sys/netgraph/', 'sys/netinet/', 'sys/netinet6/', 'sys/netipsec/', 'sys/netpfil/']'

ipfw: gc disabled old hashing code
This code was disabled for 8 years already.  It used to produce very
predictable hash without a salt, and that made the dynamic state engine an
easy DoS attack vector.  No chance we will ever use it again.
bc9e66886a2537d4536e24353669ef1a21105b70 Gleb Smirnoff 2026-10-19 17:32:15

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

ipfw: keep flag(s) definition next to member that holds them
f2bba019216648c634a41ac4381fc62801905c41 Gleb Smirnoff 2026-10-19 17:32:21

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

inpcb: make ipport_randomized static
4488a4f0486c1c766f5e9498a524c379a5ad7add Gleb Smirnoff 2026-10-19 19:41:58

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

pflow: Destroy exporters on module unload
Since 83641335f96c only jail removal destroys exporters.  Unloading
pflow with one left trips the assertion in vnet_pflowdetach() or,
without INVARIANTS, leaves pf calling into the freed module the next
time it removes a state that pflow exports.

Reviewed by:    kp
Fixes:          https://cgit.freebsd.org/src/commit/?id=83641335f96c ("pf: clean up pflow sockets on jail removal")
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
c91539772b07cb78369626716a4ddf92cf6caa5f R. Christian McDonald 2026-10-19 20:18:25

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

pf: Keep every chunk of a table that a ruleset defines
libpfctl sends a table definition in chunks of 256 addresses, each as
its own PFNL_CMD_INA_DEFINE.  The kernel treated every chunk as a new
definition and replaced the shadow table, so only the last chunk
survived.

Mark the chunks after the first with PF_ID_APPEND and have the kernel
add them to the shadow table in progress.  A request without the
attribute still replaces the shadow; one with it and no definition in
progress fails with EINVAL.  Old kernels ignore the attribute, so both
halves are needed; the ioctl sends all addresses at once and is not
affected.  Mask the flags userland passes to PFR_FLAG_ALLMASK, as
PFR_FLAG_APPEND is kernel-internal.

Add a test that defines a table of 1,000 addresses, also in an anchor.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=219ce3063840 ("pf: convert DIOCRINADEFINE to netlink")
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60876
a3173175193e111f2a92c999842bc3cfbcc2d945 R. Christian McDonald 2026-10-20 12:45:35

debug: classified in 05-summary-prefix by 'pf:'

if_media: Add 100BASE-T1 and 1000BASE-T1 media types
100BASE-T1 (IEEE 802.3bw) and 1000BASE-T1 (IEEE 802.3bp) are Single-Pair
Ethernet (SPE) standards intended for use in automotive and industrial
applications.

Reviewed by:    kbowling
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60864
f69099fc0fc55262741621451a52de50f164271a Ed Maste 2026-05-11 20:27:40

debug: classified in 03-filenames_plain1 by 'sys/net/'

tcp: refactor tcp_autorcvbuf() and associated sysctls
Run the entire function under the socket buffer lock.  Make it responsible
to set the new limit or clear SB_AUTOSIZE in case of a failure.  Use
unsigned type for newsize, that matches both the sb_hiwat type and min()
argument types.  Make byte counter in the tcpcb unsigned, too.  Make the
sizing tunables unsigned, and make the switching tunable a boolean.  Don't
execute Dtrace probe in case of a failure.  Simplify the Dtrace probe to
report only relevant information, the previous probe looked more like a
leftover from a debugging session.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D60731
04cd9bca4dab67c45292c59bbf6d78ce66fc5628 Gleb Smirnoff 2026-10-22 03:27:36

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

Commit group #47: tcp: refactor tcp_autosndbuf() and associated sysctls
tcp: refactor tcp_autosndbuf() and associated sysctls

Rename tcp_sndbuf_autoscale() to tcp_autosndbuf().  This matches
complementary tcp_autorcvbuf() that was factored out as a separate
function a few months before tcp_sndbuf_autoscale() was.  Move the large
comment to the header of the function.  Use unsigned types for all sizing
sysctls and variables and use bool for the switching sysctl.  Add a
comment above net.inet.tcp.sendbuf_auto_lowat (default to off) providing a
reference to its origins.  Add DTrace probe tcp::send-autoresize,
complementary to the existing tcp::receive-autoresize.

Rack has its own function, just enable the DTrace probe there.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D60732
7146ad04f18e7f0767a4d44cff43c1c67ea98cec Gleb Smirnoff 2026-10-22 03:27:47

debug: classified in 03-filenames_plain1 by 'sys/netinet/'


tcp: fix incorrect assertion

tcp_autosndbuf() asserts that the buffer is locked, but it should assert
this about the send buffer, not the receive buffer.

Fixes:          https://cgit.freebsd.org/src/commit/?id=7146ad04f18e ("tcp: refactor tcp_autosndbuf() and associated sysctls")
Reviewed by:    tuexen
Sponsored by:   Rubicon Communications, LLC ("Netgate")
c7523e8cfbd0fa8f8a9dc6c8864bf138b7cffde8 Kristof Provost 2026-10-22 13:38:31

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

ipfw: hold sleepable "upper half lock" for periodic state expiry
The state expiration may lead to freeing rules, which requires this lock.
Since the lock is sleepable, move the expiry routine from callout context
to a taskqueue.  This also should have a positive effect of not running
expensive function as a callout.

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

Reviewed by:            pouria
Differential Revision:  https://reviews.freebsd.org/D60869
331333ba0186fe43cbd5256c305c41ffb2748692 Gleb Smirnoff 2026-10-22 03:28:57

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

icmp6: make icmp6_notify_error() more readable
Remove a level of indentation, improve line breaks, remove single use
variables.  No functional change.
abb8b02550c3313d846c15167755f699388a4731 Gleb Smirnoff 2026-10-21 20:49:17

debug: classified in 03-filenames_plain1 by 'sys/netinet6/'

udp: in_pcblookup() never returns a freed inpcb
49548ea75c91893f9a30b35abb122b2fff9274f0 Gleb Smirnoff 2026-10-21 21:32:15

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

inpcb: inp_next() never returns a freed inpcb
9c67d6ed9632e180e95bebabc5a8ceae7f22ce1a Gleb Smirnoff 2026-10-21 21:36:01

debug: classified in 03-filenames_plain1 by 'sys/netinet6/'

sctp: Allow to ignore iface type when determining address scope
Scope restriction by loopback interface was not specified in
the draft-stewart-tsvwg-sctp-ipv4 draft and having global address
on loopback interface is common.
Therefore, allow to skip loopback interface type check in sctp.

Reviewed by:    tuexen
Differential Revision:  https://reviews.freebsd.org/D60938
3200a274272d28cf6d2385a8ea46959f313866de Pouria Mousavizadeh Tehrani 2026-10-21 15:53:51

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

iflib: Do not pull up trailing IPv4 fragments to the L4 header
iflib_parse_header() pulls every IPv4 packet up to the end of the TCP or
UDP header, including fragments at a non-zero offset, which carry no L4
header at all.  A trailing fragment shorter than that header (1-7 bytes
of UDP, 1-19 bytes of TCP) makes m_pullup() fail and the frame is freed
without a trace in the interface counters.

Only parse the L4 header on the first fragment.  TSO never produces
fragments, so assert that.

With a 1500-byte MTU every UDP datagram of 1473-1479 bytes is lost
behind a forwarding host whose ingress NIC sets receive checksum flags,
or on any VLAN with hardware tagging.  SIP over UDP is a common victim.

Reported by:    Alex Roberts
Reviewed by:    gallatin
Fixes:          https://cgit.freebsd.org/src/commit/?id=c224b2ce7de0 ("iflib: don't pullup UDP payloads to the TCP header size")
See also:       https://redmine.pfsense.org/issues/17196
MFC after:      3 days
Sponsored by:   Rubicon Communications, LLC ("Netgate")
f1726686cb31ff141e507760124f44442c9f141a R. Christian McDonald 2026-10-23 18:28:29

debug: classified in 03-filenames_plain1 by 'sys/net/'

sctp: improve handling of SO_SETFIB socket option
Since SCTP keeps fibnum in the SCTP protocol control block,
the code can't just defer the processing to the IPv4 or IPv6
layer. Therefore it needs to be implemented in the the SCTP
layer and it needs to call the socket layer function.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300091
Reviewed by:    tuexen
Fixes:          https://cgit.freebsd.org/src/commit/?id=caccbaef8e26 ("socket: Move SO_SETFIB handling to protocol layers")
MFC after:      3 days
MFC to:         stable/14
MFC to:         stable/15
7b8151b0cd1b4f077b382b6be2c02c936d1988fa Albin Hellqvist 2026-10-26 19:07:03

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

ipfw: declare the ipfw_nat module
The module declaration is necessary for 'kldstat -m' to see it,
and the rc(8) uses that to detect presence of ipfw_nat.

NB: the module(9) KPI lacks a way to declare a module without
providing an empty handler and no SYSINITs.

Reported by:    ambrisko
Fixes:          https://cgit.freebsd.org/src/commit/?id=9bcc1e97dda8e926483b81874884211bbe4f36e9
f2d4370fbbe6a24b663a4151e3a462e8e2c306c6 Gleb Smirnoff 2026-10-27 20:53:26

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

ipfw: fix off-by-one error in bdel()
After deleting an item from a sorted array, bdel() moves the tail
following it, but the size of the data to move was calculated with
an off-by-one error, causing memmove() to read one element past the
end of the array. This can happen when the table is full for ifidx
or numarray algorithms.

Obtained from:  Yandex LLC
MFC after:      1 week
Sponsored by:   Yandex LLC
c6b08de0e4c797929f4609d86395d494ac695c68 Andrey V. Elsukov 2026-10-28 11:13:53

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

pf: Clear only the part of the packet descriptor that is read first
pf_init_pdesc() cleared the whole structure, 336 bytes on amd64, for
every packet and twice for a forwarded one.  kif, m, pf_mtag, act and
the SCTP job list are set before they are read, so move them to the end
and clear only the 240 bytes before them.  On amd64 that also stays
below the 256 bytes from which memset() switches to rep stosb.

Reviewed by:            kp
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60948
11080181491144b9cad726bb6e84d87fa05a681e R. Christian McDonald 2026-10-28 16:00:03

debug: classified in 03-filenames_plain1 by '['sys/net/', 'sys/netpfil/']'

pf: Store the rounded source node hash size
hashalloc(9) rounds the requested size down to a power of two and writes
the result back, but pf_initialize() stored it into the mask, which the
next line overwrites from the unrounded size.  With a
net.pf.source_nodes_hashsize that is not a power of two the mask is
larger than the table: pf_hashsrc() returns rows past its end, the row
walkers in pf_purge_expired_src_nodes() and the ioctl handlers run past
it, and pf_cleanup() frees it with the wrong size.  The key and UDP
endpoint hashes already take the rounded size.

Reviewed by:            glebius, kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=cd5ff4e841fb ("pf: use hashalloc(9) for key, id, src-node and udp-endpoint hashes")
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60949
06f98c554fbe1fa9a678aacbcf1bc25bda0aef91 R. Christian McDonald 2026-10-28 16:10:17

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

ipfw: declare the ipfw_nat64 module
The module declaration is necessary for 'kldstat -m' to see it,
and the rc(8) uses that to detect presence of ipfw_nat.

Submitted by:   markj's Post-Commit LLM Review Service
Fixes:          https://cgit.freebsd.org/src/commit/?id=9bcc1e97dda8e926483b81874884211bbe4f36e9
930be41aa75705673659ea92faaf24f75c629a33 Gleb Smirnoff 2026-10-28 16:55:01

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

pf: Free the stack key when attaching it collides
pf_state_key_attach() attaches the wire key first and then the stack
key, setting sks to NULL before the second pass.  When the stack key
collides with an existing state, the error path removes the wire key
again but then frees sks, which is NULL by then: the stack key leaks.

pfsync hits this.  A peer that gets a plain state in a bulk update
before a redirected state whose stack key is the plain state's key
fails to import the redirected state, leaks its stack key, and leaks
another one with every later update of that state.

Free sk, the key of the pass that collided (skw on the wire pass), and
add a test.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=371bd29d4b22 ("pf: fix potential state key leak")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60951
389ae8e4fabeaf1c655f8116b1a1402e597fa515 R. Christian McDonald 2026-10-28 16:55:07

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

netlink_snl: make snl_free() safe to call twice
snl_init() calls snl_free() on its own failure paths but leaves the
state marked initialised and the buffer pointers set, so a caller that
also frees the state on failure, as libpfctl's pfctl_open() does, closes
the descriptor twice and, on the lb_init() failure path, frees the
buffer twice. Reset what snl_free() releases so a second call is a
no-op.

Signed-off-by:  Avinash Duduskar <avinash.duduskar@gmail.com>
Reviewed by:    kp
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2508
489ded6d5231f44e02988e8c47969a9e6a1e07b7 Avinash Duduskar 2026-10-28 10:22:14

debug: classified in 03-filenames_plain1 by 'sys/netlink/'

netlink_snl: add snl_init_fd() to adopt an already open socket
snl_init() always creates its own socket. Split out snl_init_fd(), which
initialises the state on a descriptor the caller already holds, and make
snl_init() open the socket and hand it over. The state owns the
descriptor either way, including when initialisation fails, and
snl_free() closes it; snl_clone() remains the way to borrow one.

pfctl(8) needs this to run on a socket inherited from authpf(8).

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291981
Signed-off-by:  Avinash Duduskar <avinash.duduskar@gmail.com>
Reviewed by:    kp
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2508
e4c78de63e584617663a965fad2a4ce55f3d715a Avinash Duduskar 2026-10-26 14:38:10

debug: classified in 03-filenames_plain1 by 'sys/netlink/'

Commit group #48: pfsync: avoid underflow on different timeouts
pfsync: avoid underflow on different timeouts

If two pfsync hosts have different timeout values set it's possible for
an underflow to occor when importing a state. If the destination host
has a shorter timeout set than the exporting host it's possible for the
state to be older than the importing host's timeout value, which results
in an underflow and a state with an unreasonable expiry time.

Check for this, and avoid the underflow. While here also account for the
timeout being longer than our uptime.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60950
78b620b781b0cdc85378e439ad2974e6aae771ff Kristof Provost 2026-10-21 15:18:59

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'


pfsync: improve underflow check

We checked the state's expiry time to make sure it was large enough to
not underflow if we subtracted the already expired time from the remote
end, but we failed to account for the state's expiry time being in
miliseconds and the pfsync time delta being in seconds.

Take that multiplication by 1000 into account.

Fixes:  https://cgit.freebsd.org/src/commit/?id=78b620b781b0 (pfsync: avoid underflow on different timeouts, 2026-10-21)
Reported by:    markj's Post-Commit LLM Review Service
Sponsored by:   Rubicon Communications, LLC ("Netgate")
d8b2c298a117416a57cad176718b87eb504bfb49 Kristof Provost 2026-11-02 09:50:30

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

Commit group #49: pfsync: improve handling of large packets
pfsync: improve handling of large packets

On setups with pfsync over large MTUs (> 2K) we could fail to parse
packets because m_pulldown() fails on packets larger than MCLBYTES.
Instead use m_copydata() to copy out the individual chunks we're
interested in.

This should also fix the flaky pfsync:bulk test case. Depending on the
hash seed states would or would not end up synced.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297307
Sponsored by:   Rubicon Communications, LLC ("Netgate")
c6a520af95b206d6e6a603e95314398d31f57def Kristof Provost 2026-10-30 09:48:26

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'


if_pfsync: add missing unlock

Fixes:  https://cgit.freebsd.org/src/commit/?id=c6a520af95b2 (pfsync: improve handling of large packets, 2026-10-30)
Reported by:    markj's Post-Commit LLM Review Service
Sponsored by:   Rubicon Communications, LLC ("Netgate")
04b6d3e0be8cf1ef6e105c2c33992f891152e95b Kristof Provost 2026-11-02 10:07:56

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'


if_pfsync: fix mbuf leaks on errors

Some of the pfsync input handlers freed the mbuf on errors, others did
not. Unify this by having the caller free the mbuf on error.

Fixes:  https://cgit.freebsd.org/src/commit/?id=c6a520af95b2 (pfsync: improve handling of large packets, 2026-10-30)
Reported by:    markj's Post-Commit LLM Review Service
Sponsored by:   Rubicon Communications, LLC ("Netgate")
240a76704b49b6c67104c5027ddf4d4cf18abfe5 Kristof Provost 2026-11-02 10:09:13

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

netinet6: Set PFIL_FWD in ip6_tryforward()
ip6_forward() has run the outbound hooks with pfil_mbuf_fwd() since
b52b61c0b6b1, and ip_tryforward() since 1f4c3887e3fa, but
ip6_tryforward() still calls pfil_mbuf_out().  pf therefore handles a
packet on the IPv6 fast path as locally generated: it skips the
packet-too-big error it sends with the untranslated addresses, and
pf_refragment6() sends reassembled packets out through ip6_output()
instead of ip6_forward(), so their fragments leave with the hop limit
not decremented.

Use pfil_mbuf_fwd() in ip6_tryforward() as well.  The new
fragmentation_pass:v6_refrag_hlim test sends a packet that pf
reassembles and refragments through the fast path, and checks that its
fragments leave with the hop limit decremented once; before this change
they leave with it unchanged.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=b52b61c0 ("pf: distinguish forwarding and output cases for ...")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61033
8c73c0f1230dde0a65474b1ae9a94f27f6568bda R. Christian McDonald 2026-10-30 17:31:37

debug: classified in 03-filenames_plain1 by 'sys/netinet6/'

netinet6: Check the hop limit after pfil in ip6_tryforward()
ip6_tryforward() sends time exceeded for an expiring packet before the
inbound pfil hooks have seen it, whereas ip_tryforward() and
ip6_forward(), which ip6_input() calls after the hooks, check it
afterwards.  On the fast path the router therefore answers packets the
firewall blocks inbound, and pf never handles the expiry itself: a
nat64 (af-to) packet with hop limit 1 gets a time exceeded error from
the router, which a "block" ruleset then drops on the way out, instead
of the one pf_translate_af() sends with the untranslated addresses.

Check the hop limit after the inbound hooks.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=5a1842a2 ("Add ip6_tryforward() - a run to completion ...")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61034
cb007621bc729c346e59b3e5e7e4234f5578d3a0 R. Christian McDonald 2026-10-30 17:32:37

debug: classified in 03-filenames_plain1 by 'sys/netinet6/'

pkt-gen: fix UDP checksum when IPv6 address ranges are used
update_ip6() left the UDP checksum stale for most packets. Unlike
update_ip(), it computed the incremental checksum delta only after the
source-address wrap, so every earlier "break" (port increment, address
increment, and both random paths) returned with udp_sum still 0 and no
correction applied. The trailing delta block also re-read oaddr/naddr
after they had been reassigned, so the source and destination deltas
could not both be accounted for.

Fold each delta in with new_udp_sum() before the corresponding break,
mirroring the structure update_ip() already uses, and drop the stale
trailing block. IPv4 was not affected.

Verified by driving update_addresses() directly and recomputing every
checksum from scratch over the real pseudo-header: 128 packets across
six range configurations, 12 mismatches before, 0 after. IPv4 passes
both before and after.

Submitted by:   Olivier Cochard-Labbé <olivier@cochard.me>
0a12444b2989c38a5d2e358e0f9ef01c665cc268 Vincenzo Maffione 2026-11-01 18:06:13

debug: Commit manually moved from "unknown" to "network".

pf: don't leak transaction elements on error
If nlmsg_reply() or nlmsg_end() in pf_handle_trans() failed we did not
call pf_trans_free(), leaking the pf_trans_e elements in it.

Reported by:    markj's Post-Commit LLM Review Service
Sponsored by:   Rubicon Communications, LLC ("Netgate")
af531324973021c5dc2cec47d0ef346666a4a551 Kristof Provost 2026-11-02 09:42:04

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

lacp: fix lacp for interfaces with unknown media
Fall back to if_baudrate if ifmedia_baudrate() returns 0 in
lacp_aggregator_bandwidth().

When lacp_aggregator_bandwidth() returns 0, lacp will
never come up, due to aggregator selection starting with a 0.
This is why its important for interfaces with unknown media
(meaning  ifmedia_baudrate() returns 0) to fall back to
using if_baudrate in order to avoid this state.

Differential Revision: https://reviews.freebsd.org/D61084
Reviewed by: kbowling
Sponsored by: Netflix
0b420c655f816a31165c457b9462183b25eaecf2 Andrew Gallatin 2026-11-02 15:53:34

debug: classified in 03-filenames_plain1 by 'sys/net/'

if_media: Add 400G FR4 media types
400GBase-FR4 is yet another 400G optical standard

Differential Revision: https://reviews.freebsd.org/D61135
Reviewed by: kbowling
Sponsored by: Netflix
0e44056f19ab339fe7e37c03e49cf50b33bf1d6b Andrew Gallatin 2026-11-02 16:34:30

debug: classified in 03-filenames_plain1 by 'sys/net/'

netinet6: Use memcpy/memset/memcmp for consistency
Convert the remaining bzero()/bcopy()/bcmp() calls in the neighbor
discovery handlers to memset()/memcpy()/memcmp().

No functional change intended.

Reviewed by:    glebius, pouria
Sponsored by:   VersatusHPC
Differential Revision:  https://reviews.freebsd.org/D58177
ede77280787a10462cb9e26b4b4e38fd0825ef53 Vinícius Ferrão 2026-11-02 20:27:54

debug: classified in 03-filenames_plain1 by 'sys/netinet6/'

udp6: make udp6_ctlinput() same as IPv4 version
Processing an incoming ICMPv6 we need to find just the matching inpcb and
call udp_notify() on it.

The call to in6_pcbnotify() at the first glance seems like a notifying
sweep across the entire database, but it is not. It finds just the
matching inpcb, but does that in the most inefficient way!  The added test
case proves that ICMPv6 processing stays the same before and after the
change.  This weird use of in6_pcbnotify() can be tracked down all the way
to the initial KAME code.

Reviewed by:            tuexen, gallatin
Differential Revision:  https://reviews.freebsd.org/D60967
a08dc822f4943f2cea509cd0ba1f11a89ec9e82d Gleb Smirnoff 2026-11-02 21:42:15

debug: classified in 03-filenames_plain1 by 'sys/netinet6/'

net/ieee_oui.h: clarify how `OUI_FREEBSD_BASE` is managed
Note that the FreeBSD Foundation manages the current value
associated with `OUI_FREEBSD_BASE`.

Trim trailing whitespace in comments in the change while here.

MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/82
529e9a00ddd3a207f3841c6581c9f1a23532972e Enji Cooper 2026-08-09 05:25:03

debug: classified in 03-filenames_plain1 by 'sys/net/'

Broadcom tester's were able to trigger a KASSERT in rack due to an accounting issue.
The recently added code to rack to help minimize reordering issues had a KASSERT for protection of its counting field. This
was consistently. Triggered in broadcom's testing lab. They came up with a partial solution.. but one of their fixes was
also incorrect causing the counter to increase incorrectly as well. I worked with them to give them an updated patch (the one
attached in this review). They have tested that in their same repro environment and confirm this fixes the issue.

Reviewed by:tuexen, nickbanks_netflix.com
Differential Revision:  <https://reviews.freebsd.org/D61136>
dc5a7d98ff1c21d5d77f7d4d7a433b59d57c6d6c Randall Stewart 2026-11-03 15:14:04

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

iflib: prefer simple_tx over mp_ring
In preparation for removing mp_ring, enable simple_tx by default.
Users encountering bugs are still able to set the tunable:
        net.iflib.prefer_mpring="1"
at boot, but are encouraged to report any regressions so they
can be fixed.

My plan is to remove mp_ring assuming no major bugs are found in
simple_tx after a month or two.

Reviewed by: kbowling, netchild, rcm
Sponsored by: Netflix
Differential Revision:  https://reviews.freebsd.org/D61166
d1695bbd48ccef6cd922be5fc089345954e87e42 Andrew Gallatin 2026-11-04 16:56:04

debug: classified in 03-filenames_plain1 by 'sys/net/'

netlink: Pre-register the missing devctl event systems
devctl_notify() can be called with a mutex held. If the event system is
not listed in devctl_systems[], sysevent_get_group() calls
sysevent_new_group(), which calls strdup() with M_WAITOK, and we may end
up sleeping while holding a non-sleepable mutex.

Add the missing systems.

While here, remove the nonexistent KERNEL system.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299272
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61161
66d078c17294ca2ea225e4926a8cd9697dda57ed Christos Margiolis 2026-11-03 16:51:08

debug: classified in 03-filenames_plain1 by 'sys/netlink/'

TCP RACK: fix RSM computation for TCP fast open
When spitting an RSM containing the SYN and data, honor the
sequence number used by the SYN flag when computing the offset
in the socket buffer.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297006
Reviewed by:            rrs, Peter Lei
MFC after:              3 days
MFC to:                 stable/15
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61149
ff066579fd7719a6361e7ce8cc9ade47517d242d Michael Tuexen 2026-11-07 13:33:45

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

Mark Johnsons Claude code found a duplicate call to rack_check_reorder_ack() in rack.c
Mark's Claude code properly points out an interesting bug case where if a new block is
created from a sack aka

        rsm |--------|
    sackblk    |--------->
Then when the new block is created rack_check_reorder_ack() is called and then called again when
the block is actually ack'ed. Proper thing is to *not* in this case call the function and only call
it at the processing to ACK. You leave the hookery side however since that is just transfering
the existing block pointers.

Differential Revision:https://reviews.freebsd.org/D61159
96691152d13be08926aa48e2cbdae1dfa36dd76c Randall Stewart 2026-11-08 12:27:06

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

tcp: address PR295870
Fix accounting in the sequence space for a FIN bit potentially
piggy bagged during SACK loss recovery triggered transmissions.

Reviewed By: #transport, tuexen
Sponsored by: NetApp, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D61312
0aa6428f463699c5f5e03715ea4ebe2309a23a2d Richard Scheffenegger 2026-11-08 15:36:13

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

netipsec: Do not leak the SAH when an SA is cloned
key_updateaddresses() gives the clone of an SA a new SAH reference when
the SA index comes from key_newsah() or key_getsah(), but nothing
releases the reference of the old SA: key_delsav() leaves the SAH alone,
because key_unlinksav() normally releases it, and an SA that is replaced
never goes through that.  The SAH then stays allocated for good, after
its SAs are flushed and after the vnet is destroyed, as an SADB_UPDATE
with a new address does each time an IKE daemon moves an SA.

The old SA cannot release the reference when it is replaced, since a
sender that still holds it reads its SAH.  Release it in key_delsav()
instead.  When only the NAT-T config changes, the clone used to take over
the reference of the old SA; take a new one in that case as well, so that
every SA holds its own.

Reviewed by:            kib, markj
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61101
488bf44737722c27f2e93b5347648e76e86540df R. Christian McDonald 2026-11-09 15:30:12

debug: classified in 03-filenames_plain1 by 'sys/netipsec/'

Commit group #50: ipfilter: Only recalculate the UDP header when we have one
ipfilter: Only recalculate the UDP header when we have one

When ipf_nat_out processes NAT_DIVERTOUT (ipnat rdr statements)
it also fixes the checksum in the UDP header. Test for a UDP header
before adjusting its length.

While we are here, the length in the UDP header must be converted
from network byte order to host byte order. Add the missing ntohs().

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296944
MFC after:      3 days
72cc9e3766f4222fa7fc462bc669dcf668e8b334 Cy Schubert 2026-08-26 05:27:28

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'


ipfilter: Remove erroneous ntohs()

The original commit was wrong.  ipf_nat_builddivertmp() builds the UDP
template with the length in host byte order

M_DUP() copies that value unchanged. The old code was therefore correct.
It added fin_plen in host order and then did a single htons().

The original patch was discussed with Co-Pilot, which pointed out the
original bug. claude-opus-5-5 discovered the ntohs() error that
co-pilot suggested.

Interestingly this code had been running here for a couple of months.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=72cc9e3766f4
86861520613f99c85b5fbdf92b5c955a13ed6624 Cy Schubert 2026-11-09 23:13:21

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

netipsec: Release the SA inside the vnet context in AH and IPComp callbacks
The error paths of ah_input_cb(), ah_output_cb(), ipcomp_input_cb() and
ipcomp_output_cb() called CURVNET_RESTORE() before key_freesav() and
key_freesp().  When the callback runs on a crypto return thread, no
vnet is set after the restore, and key_freesav() panics with "vnet is
not set" on INVARIANTS kernels.  Without INVARIANTS, the last reference
would be released without a vnet.

Restore the vnet last, as the ESP callbacks do.

Reviewed by:            mjg
Fixes:                  https://cgit.freebsd.org/src/commit/?id=8a9269edd71a ("ipsec: sprinkle CURVNET_ASSERT_SET")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61386
5d2e81f29a8aa5b093cd2343c604466332eca2d4 R. Christian McDonald 2026-11-10 13:40:53

debug: classified in 03-filenames_plain1 by 'sys/netipsec/'

iflib: simplify TXQ_AVAIL
Simply the TXQ_AVAIL() macro to avoid using
get_inuse(txq->ift_size, txq->ift_cidx, txq->ift_pidx, txq->ift_gen)
and instead define it in terms of txq->ift_in_use.

Note that in_use is equivalent, because it is updated at the same time
as cidx/pidx and gen, and under the same serialization. The advantage
is that its cheaper due to using one read and no branches, and
safer, since unlocked reads get an atomic snapshot of availability,
but an unlocked read of multiple counters can produce inconsistent
results.

Reviewed by: kbowling, kgalazka
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D61279
44df82b11c535ae50b1e5888a361a2bd15d4182b Andrew Gallatin 2026-11-10 15:37:00

debug: classified in 03-filenames_plain1 by 'sys/net/'

iflib: rate limit deferred tx ring drain
When simple_tx gives up & return ENOBUFS because the tx ring is full,
we were doing a GROUPTASK_ENQUEUE(&txq->ift_task) each time.
On a tx ring that has overflowed and is being hammered on
by a fast UDP sender, this can result in a massive increase in
context switches (I've seen over 30M ctxw/sec due to this, and
the ctxsw codepath taking roughly 50% CPU).

This change removes the GROUPTASK_ENQUEUE() and replaces it
with a call to a callout which drains the tx ring. The callout time is
determined based on the link speed, estimating how long it would take
for a large fraction of of a ring containing full-MTU packets to drain.

This removes the 30M ctxsw / sec in my test case and reduces it
to roughly a doubling of ctxsws.

Reviewed by: kbowling
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D61313
fe63435bdfae0ec55092efbfa807e324bfb82d75 Andrew Gallatin 2026-11-10 15:42:11

debug: classified in 03-filenames_plain1 by 'sys/net/'

krb5: Import MIT 1.22.3
Major changes in 1.22.3 (2026-11-09)
====================================

This is a bug fix release, with a focus on security issues discovered
with the aid of large language models.  See
https://web.mit.edu/kerberos/advisories/MITKRB5-SA-2026-001.txt for
information on the risks of continuing to use unpatched releases.

* Fix a logic error when checking PAC server checksums
   [CVE-2026-111423].

* Check for unkeyed checksums when validating CAMMAC verifiers
   [CVE-2026-71199].

* Fix a loophole in the KDC's client authdata filtering which could
   allow clients to include fake PAC and CAMMAC authdata values when
   requesting service tickets.  These fake values would be rejected by
   application servers, were it not for the two bugs noted above.

* Check for the lockdown_keys attribute when processing password
   change protocol requests in kadmind [CVE-2026-107884].

* In libgssrpc, when processing RPC messages using the RPCSEC_GSS
   flavor, use the verified service type included in the RPC request to
   determine how to unwrap arguments and wrap return values, instead of
   the unverified service type included during authentication
   [CVE-2026-118380].

* In libgssrpc, disable the AUTH_GSSAPI server auth flavor unless the
   "GSSRPC_ALLOW_AUTH_GSSAPI" environment variable is set.  AUTH_GSSAPI
   is only needed for very old (pre-1.4) clients [CVE-2026-112322]
   [CVE-2026-112323].

* Fix numerous null pointer deferences, read overruns, unbounded
   memory allocations, and memory leaks that could be used as denial of
   service attacks against the KDC, kadmind, application servers, or
   client programs [CVE-2026-40355] [CVE-2026-40356] [CVE-2026-71200]
   [CVE-2026-107364] [CVE-2026-107708] [CVE-2026-107778]
   [CVE-2026-112314] [CVE-2026-112315] [CVE-2026-112316]
   [CVE-2026-112317] [CVE-2026-112318] [CVE-2026-112319]
   [CVE-2026-112320] [CVE-2026-112321] [CVE-2026-112323]
   [CVE-2026-119079].

* Fix a client crash when a KKDCP proxy daemon closes the TLS session
   without supplying any response data.

* Shut down kpropd gracefully when a termination signal is received,
   when operating in incremental propagation mode.

* Detect when an incremental propagation update is applied to a
   nonexistent principal; when this happens, force a full resync
   instead of crashing.

* Fix a KDC crash when the LDAP KDB module loses its connection to the
   LDAP server.

* Avoid a crash on macOS when the native API ccache type is used
   before and after forking a process.

* When an application accepts a GSS context without asking for
   delegated credentials, discard any credentials sent by the initiator
   without parsing them first.

Security:       https://web.mit.edu/kerberos/advisories/MITKRB5-SA-2026-001.txt
MFC after:      3 days
Merge commit '5f11ec7e8ab9647977a56fca934c40951e051779' into krb5-1.22.3
7e4c0a34ea3aff51405d2a3ac2908db1a98d6c5f Cy Schubert 2026-11-10 05:13:11

debug: classified in 05-summary-prefix by 'krb5:'

netipsec: Release the sahtree lock on the AH and IPComp EAGAIN paths
183513d15f22 made the AH, ESP and IPComp input callbacks hold the
sahtree read lock, but only esp_input_cb() drops it before resubmitting
a request that the crypto framework completed with EAGAIN.
ah_input_cb() and ipcomp_input_cb() return with the lock still held.

crypto_invoke() completes requests with EAGAIN while their driver
detaches.  Detaching ossl(4) under inbound AH traffic then hangs the
next rmlock writer, and the system panics with "spin lock held too
long" in smp_rendezvous_cpus() called from _rm_wlock().

Release the lock as esp_input_cb() does.

Reported by:            llm-postcr
Reviewed by:            kib
Fixes:                  https://cgit.freebsd.org/src/commit/?id=183513d15f22 ("sys/netipsec: ensure sah stability during input callback processing")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61399
2af08ab3f125ce5988a641c32c777afc52f917e1 R. Christian McDonald 2026-11-11 02:31:22

debug: classified in 03-filenames_plain1 by 'sys/netipsec/'

carp: Check if_carp under carp_sx in carp_nl_get()
carp_nl_get() tested ifp->if_carp for NULL before taking carp_sx and
walked the softc list afterwards.  When the last vhid on the interface
is removed in between, carp_free_if() clears if_carp and the walk
dereferences a NULL pointer.  A reader that passes the check while the
removal holds carp_sx always hits this.

The check was done with the lock held until the ioctl(2) API was
retired.  Do it under the lock again.

Reported by:    Marcos Mendoza <mmendoza@netgate.com>
Fixes:          https://cgit.freebsd.org/src/commit/?id=72472e52e310 ("carp: retire ioctl(2) API")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
41bdbe7dc06ca85baa774a97f585711e32544554 R. Christian McDonald 2026-11-11 19:26:30

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

esp: Allocate the crypto request and its callback state together
esp_input() and esp_output() allocated a cryptop from the crypto layer,
then malloc'ed the xform_data the callback needs, and with ESN a third
buffer for the separate AAD.  The callback freed all three.  That is
two or three allocation pairs for every packet.

Put the three in one structure, allocated once per packet from a
dedicated UMA zone.  The crypto layer provides crypto_initreq() and
crypto_destroyreq() for an embedded cryptop, as wg(4) and ktls use.
The AAD buffer is sized for the ESP header, the longest IV and the
high-order half of the sequence number, which is all the separate AAD
can hold.

No functional change intended.

Reviewed by:            markj
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61395
5c237bdbf7a4dcfd67c05e12daa2a49283218fa4 R. Christian McDonald 2026-11-11 20:55:19

debug: classified in 03-filenames_plain1 by 'sys/netipsec/'

routing: Fix buffer size in merge_nhgrps()
merge_nhgrps() sized its temporary nexthop array as twice
the existing group instead of the sum of both groups.

Fixes:  https://cgit.freebsd.org/src/commit/?id=dd945c6ba4ff ("routing: Implement merge of nhgrp in new multipath route")
9d2cdb3fd5741685622b0b9c0e17e22583c9ceff Pouria Mousavizadeh Tehrani 2026-11-11 22:50:18

debug: classified in 03-filenames_plain1 by 'sys/net/'

ipsec: Do not reference the default policy for packets without a PCB
When no security policy matches a packet, ipsec[46]_getpolicy() returns
the default policy with a new reference, and the caller drops it right
after looking at the policy type.  Once any security policy is
configured, every forwarded packet goes through ip_forward() and
ipsec4_forward(), which checks the inbound and the outbound policy.
That is four atomic operations per packet on one reference count that
all CPUs write.

The default policy is allocated with its vnet and freed only when the
vnet goes away, and the sysctl limits it to NONE or DISCARD.  A packet
without a PCB has no policy cache to keep it in.  In that case, check
the policy type directly and take no reference, for NONE as well as for
DISCARD.  Packets with a PCB still take the reference, because the PCB
caches the policy.

No functional change intended.  DISCARD still drops the packet, and the
policy violation counters are incremented as before.

Reviewed by:            kib
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61384
53d8733b3dd754852ec7a2c22b01c82906b8130e R. Christian McDonald 2026-11-12 12:53:25

debug: classified in 03-filenames_plain1 by 'sys/netipsec/'

ctld: Fix namespace IDs for exported NVMe namespaces part 2
This is the same fix as in commit
9c8be6518e2e5f396055ecdab8098ce19c4b2218 just applied to another
method that also accepts namespace IDs.  The original commit handled
configuration statements assigning a named LUN to a namespace.  This
change handles anonymous namespaces configured within a controller
context.

Fixes:          https://cgit.freebsd.org/src/commit/?id=66b5296f1b29 ("ctld: Add support for NVMe over Fabrics")
Sponsored by:   Chelsio Communications
9a99fa3932ddd794234becc6eab6519d56ae6947 John Baldwin 2026-11-12 15:43:55

debug: classified in 03-filenames_plain1 by 'usr.sbin/ctld/'

ctld: Use expand_unsigned for parsing unsigned NVMe option values
Sponsored by: Chelsio Communications
cc33771bf77102291db1e50037a07c1501a24075 John Baldwin 2026-11-12 15:44:18

debug: classified in 03-filenames_plain1 by 'usr.sbin/ctld/'

gre(4): Add full support for gre key
Allow multiple gre tunnels between the same source and destination
addresses, distinguished by their incoming gre key.
Add greikey and greokey to ifconfig(8) to set the incoming and
outgoing keys separately and grekey now sets both.
Add a net.link.gre.key_fallback sysctl for backward compatibility
and set it to true by default.
Also write multikey tests for both IPv4 and IPv6 families.

Relnotes:       yes
Reviewed by:    adrian
Discussed with: zlei
Differential Revision:  https://reviews.freebsd.org/D59849
1555dff3bf5619278c80ba843555ac2c84d671c3 Pouria Mousavizadeh Tehrani 2026-11-12 19:33:41

debug: Commit manually moved from "unknown" to "network".

routing: Fix nhop double free in rib_copy_route()
add_route_flags() consumes the nexthop reference on every
failure path, so nhop_free() in rib_copy_route() releases it for
the second time.

This is reachable when growing net.fibs while two existing fibs
hold the same pinned prefix.

MFC after:      3 days
Fixes:  https://cgit.freebsd.org/src/commit/?id=40503b792f7e ("routing: populate fibs with interface...")
efa14ab698fe5c3a1586aec006f98e3781f4af78 Pouria Mousavizadeh Tehrani 2026-11-12 21:34:06

debug: classified in 03-filenames_plain1 by 'sys/net/'

if_geneve: Do not byte-swap the option length
geneve_optlen is a 6-bit bitfield within a single byte, so it has no
byte order.  Applying ntohs() to it on little-endian machines turned
an option length of 1 into 256, causing every received packet carrying
options to dropped.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300453
Reviewed by:    pouria
Fixes:  https://cgit.freebsd.org/src/commit/?id=e44d2e941e8e ("if_geneve: Add Support for Geneve (RFC8926)")
7ba9c38b703d7acdc472939d54703b9bc38fb6f3 Kevin Day 2026-11-13 11:26:54

debug: classified in 03-filenames_plain1 by 'sys/net/'

if_geneve: Ignore reserved bits on receive
RFC 8926 section 3.4 requires the reserved fields of geneve header
to be ignored on receipt.

While here, remove the needless htons() from the version check, as
geneve_ver is a 2-bit bitfield with no byte order.

Fixes:  https://cgit.freebsd.org/src/commit/?id=e44d2e941e8e ("if_geneve: Add Support for Geneve (RFC8926)")
39b97c10e6d0ed21f65bf0cb8bd8e359c2c2d8d3 Pouria Mousavizadeh Tehrani 2026-11-13 11:35:13

debug: classified in 03-filenames_plain1 by 'sys/net/'

if_geneve: Read the outer IP header from the start of the packet
The offset passed to geneve_udp_input() points at the UDP header,
which for IPv6 comes after any extension headers.
The outer header is always at the start of the mbuf.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=e44d2e941e8e ("if_geneve: Add Support for Geneve (RFC8926)")
503ecf5bf454a7d716111365471e879560e870c7 Pouria Mousavizadeh Tehrani 2026-11-13 13:51:43

debug: classified in 03-filenames_plain1 by 'sys/net/'

ip6_forward: Free the ICMPv6 copy on all error paths
ip6_forward() keeps a copy of the start of the packet in case it has
to send an ICMPv6 error.  Every exit must either pass the copy to
icmp6_error() or icmp6_redirect_output(), or free it.  Three exits did
neither and leaked the copy:

 - the destination scope check, when a packet would leave the zone of
   its destination address;
 - a packet that a pfil hook redirected to a local address, which is
   queued for local input;
 - a packet whose checksum has to be computed here and whose last
   header offset is not valid.

Free the copy in these three cases.

Reviewed by:            tuexen, pouria
Fixes:                  https://cgit.freebsd.org/src/commit/?id=8a006adb2441 ("Add support for IPv6 to ipfw fwd...")
Fixes:                  https://cgit.freebsd.org/src/commit/?id=bcb298fa9e23 ("sctp, tcp, udp: improve deferred computation...")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61509
3d88ee6af2961deefe7412b2e393aa0c05d4102c R. Christian McDonald 2026-11-13 17:37:42

debug: classified in 03-filenames_plain1 by 'sys/netinet6/'

tcp: count only the SACK blocks that fit in tcp_maxseg()
tcp_addoptions() sends only the SACK blocks that fit in TCP_MAXOLEN.
tcp_maxseg() counted every pending block and clamped the total, so
without timestamps and with five or more blocks pending it came out 4
bytes below the segment tcp_output() sends.  Limited transmit after an
RTO then sent one full segment and failed the "sent too much" KASSERT.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282605

Approved by:    adrian (mentor)
Signed-off-by:  Nick Price <nprice@FreeBSD.org>
Reviewed by:    tuexen, glebius, adrian
Differential Revision:  https://reviews.freebsd.org/D60460
d3b02115d4b373c719d9a716da38d94511de3f07 Nick Price 2026-11-13 20:27:46

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

rtnetlink: Use default weight for unset weights in NHA_GROUP
newnhg() copied the weights of a nhgrp as is and a group
whose members all have a zero weight, which is what
userland sends when it leaves the weight unset, made
calc_min_mpath_slots_fast() divide by zero.

Therefore replace weight of zero with RT_DEFAULT_WEIGHT.

While here, return early from calc_min_mpath_slots_fast()
if all weights are zero.

MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=7e5bf68495cc ("netlink: add netlink support")
1db6e2c6c3554efe5acdcc20bc7aa889e1efe372 Pouria Mousavizadeh Tehrani 2026-11-13 21:40:45

debug: classified in 03-filenames_plain1 by '['sys/net/', 'sys/netlink/']'

tcp bbr: cleanup
No functional change intended.

MFC after:      3 days
MFC to:         stable/14
MFC to:         stable/15
Sponsored by:   Netflix, Inc.
34436bb7cf971dba1c0dcdb1d45f22fff1a4b6c1 Michael Tuexen 2026-11-14 17:36:42

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

if_bridge: Use bridge's FIB for incoming unicasts
A unicast frame for the bridge is handed to the stack with rcvif set
to the bridge, but it kept the FIB of the member it arrived on.  With
the bridge in another FIB, replies were looked up in the wrong routing
table and dropped.

Set the FIB of the bridge on such frames.  If member_ifaddrs is
enabled and the bridge inherited its MAC address from a member, keep
the old behaviour, since the frame may be for an address configured on
that member.

Reviewed by:    zlei
Differential Revision:  https://reviews.freebsd.org/D61517
e24434f286fdd2d6ba1924ecd7eadea6f563f08a Pouria Mousavizadeh Tehrani 2026-11-15 18:43:52

debug: classified in 03-filenames_plain1 by 'sys/net/'

tcp bbr: improve invalidating rtt
Invalidate the rtt based on t_rxtshift instead of resetting t_srtt to 0,
because using the latter also affects the retransmission timeout.

Reviewed by:            Peter Lei
MFC after:              Netflix, Inc.
MFC to:                 stable/15
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61585
8018d75601dfe804a8d70f4f08bdb0e4e3a8c5c9 Michael Tuexen 2026-11-15 18:56:25

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

tcp bbr: improve retransmit timout calculation
The retransmission timeout should the srtt + 4 * rttvar.
The srtt is using 5 bits of fractions and rttvar is using 4 bits of
fractions, some specific shifting is required.

Reviewed by:            Peter Lei
MFC after:              3 days
MFC to:                 stable/15
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61581
2f98793a13fe3e69cf6b698fa469550b4ba0fea1 Michael Tuexen 2026-11-15 19:04:33

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

tcp bbr: improve persits timeout computation
t_srtt and t_rttvar use different lengths of fractions, therefore use
the appropriate shift value.

Reviewed by:            Peter Lei
MFC after:              3 days
MFC to:                 stable/15
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61600
751882926dc0bb1f7a4834c4b5e8d951cee61c7c Michael Tuexen 2026-11-15 20:21:14

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

tcp bbr: improve handling of retransmissions in LAST-ACK
When performing a timer based retransmission, clear the
BBR_RWND_COLLAPSED flag. If it sticks, t_rxtshift is never incremented
resulting in unlimited retransmissions in the LAST-ACK state.

Reported by:            Illia Vynohradov
Reviewed by:            Peter Lei
MFC after:              3 days
MFC to:                 stable/15
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61586
3c6fd437b1824caeddb5f0d4570d43cf0c999c14 Michael Tuexen 2026-11-15 21:13:50

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

netipsec: Select outbound transmit queues by SA instead of inner flow
Outbound IPsec packets retain the flow ID of the inner traffic. Multi-queue
interfaces use this ID to select a transmit queue (iflib's QIDX()) or a member
port (lagg(4) with use_flowid). Consequently, packets belonging to the same
security association (SA) can be distributed across independently draining
queues.

ESP and AH sequence numbers are assigned before encryption, but the packets
can be transmitted out of order when different queues drain at different
rates. This can cause legitimate packets to fall outside the receiver's
anti-replay window and be dropped as possible replays. RFC 4303, Section
3.4.3, makes 32 packets the smallest window a receiver must support, and
strongSwan installs that minimum by default.

Assign each SA a flow ID derived from a Jenkins hash of its SPI, computed once
when the SA is created, from the SPI in host byte order so that the value is
the same on every architecture. Set this ID on outbound packets in
ipsec{4,6}_perform_request(), with M_HASHTYPE_OPAQUE_HASH, once the SA is
known and before ipsec_accel_output(): it then applies whether the SA is
processed in software (ESP, AH, and IPCOMP) or by a network interface that
implements it, since the offload path keeps the packet header and hands the
packet to the interface's own transmit queue selection, and in a bundle the
last SA decides. Whether the flow ID selects the queue is up to the consumer:
a driver with its own selection (iflib's isc_txq_select) may ignore it.

Hashing the SPI distributes SAs across transmit queues regardless of whether
the queue-selection mechanism uses low-order bits (iflib) or shifted
high-order bits (lagg(4) with flowid_shift). It also avoids the poor
distribution that consecutive manually assigned SPIs would produce if used
directly.

All packets belonging to an SA now select the same transmit queue,
eliminating reordering caused by independently draining queues. Reordering
before enqueue, including skew in asynchronous crypto completion, remains
possible and is addressed separately.

Binding an SA to one transmit queue also binds it to one port or path when
using lagg(4) with use_flowid or flow-ID-based multipath routing. This trades
parallelism within an SA for packet ordering. Scaling a tunnel across
multiple queues is instead possible with multiple SAs, each with its own
sequence-number space, as supported by RFC 9611's per-resource Child SAs or
by separate policies or interfaces.

The net.inet.ipsec.sa_flowid sysctl restores the previous inner-flow-based
selection.

Reviewed by:            kib, ae
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61194
1b9a8e1dcc69d239c7ec2b2d8aa255fd11c97884 R. Christian McDonald 2026-11-16 13:10:32

debug: classified in 03-filenames_plain1 by 'sys/netipsec/'

netipsec: Release the SA and SP when mb_unmapped_to_ext() fails
ipsec4_perform_request() maps unmapped (M_EXTPG) mbufs before the
software transforms run.  mb_unmapped_to_ext() frees the chain when it
fails, and the error return then kept both the SA reference taken by
ipsec4_allocsa() and the SP reference that this function must release.
The SA, its crypto session and the SP were never freed after they were
deleted.

The conversion fails with ENOMEM when an mbuf allocation fails, for
example for sendfile(2) data sent through a software IPv4 SA, and with
EINVAL for every packet of a NIC kTLS connection that matches an IPsec
policy.  Take the common error path instead; it skips m_freem() when
the mbuf pointer is NULL.

IPv6 is not affected: ipsec6_perform_request() does not call
mb_unmapped_to_ext().

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=0ff2d00d2aa3 ("ipsec: allow it to work with unmapped mbufs")
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
698d94219061eaca8dd5fd4d58bbece48ced3ac4 R. Christian McDonald 2026-11-16 15:16:55

debug: classified in 03-filenames_plain1 by 'sys/netipsec/'

tcp: improve sender side SWS avoidance
When checking for a full sized segment, take all TCP options that will
be included into account. This fixes a bug which can trigger the
"sent too much" KASSERT related to limited transmit.

Reported by:            olivier
Reviewed by:            rscheff, Peter Lei
MFC after:              3 days
MFC to:                 stable/15
MFC to:                 stable/14
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61605
d174085f9f895ed444bd95120da3eff481a58f1a Michael Tuexen 2026-11-16 17:25:32

debug: classified in 03-filenames_plain1 by 'sys/netinet/'

netipsec: Clear the crypto error before dispatching a request again
When a crypto driver unregisters, a request on one of its sessions
completes with EAGAIN.  The ESP, AH and IPComp callbacks then move the
SA to the new session and pass the same request to crypto_dispatch()
again, with crp_etype still set to EAGAIN.

crypto_dispatch() requires a request without an error.  A kernel with
INVARIANTS panics there with "incoming crp with error".  The other
consumers that dispatch a request again after EAGAIN clear the field
first.

The six callbacks prepare the request for the retry with the same
code.  Move that code to a new function, ipsec_crypto_retry(), and
clear the error there.  ipsec_updateid() has no other callers and
becomes static.  The callbacks still dispatch the request themselves,
because the input callbacks have to release the sahtree lock first.

Reviewed by:            markj, kib
Fixes:                  https://cgit.freebsd.org/src/commit/?id=c03414326909 ("Refactor driver and consumer...")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61515
b9e45c2dca5cf003bb999dffba5eb3c8ed053e51 R. Christian McDonald 2026-11-16 17:41:39

debug: classified in 03-filenames_plain1 by 'sys/netipsec/'

ipfw_nat: fix the buffer length check in IP_FW_NAT44_XGETLOG
nat44_get_log() compared the user buffer length against the request
header plus another ipfw_obj_header instead of the request header plus
the log buffer.  A buffer that passed this check but was shorter than
the full reply left too little room in the sockopt window, so
ipfw_get_sopt_space() returned NULL and the following memcpy() of the
log wrote through a NULL pointer, panicking the kernel.

The handler was cloned from nat44_get_cfg() in the commit below, under
the convention of that time where ucfg->size held the payload only and
the ipfw_obj_header was added back in the length check.  9f925e8a920e
("Fix IP_FW_NAT44_LIST_NAT size calculation.") later switched
nat44_get_cfg() to count the header in ucfg->size and reduced its check
to "valsize < size", but nat44_get_log() was not updated.  It kept the
stale idiom, whose check counts the header twice, and by coincidence of
the struct sizes that never leaves room for the log.

Compare against the full reply length and check the result of
ipfw_get_sopt_space().  Also report the full reply length, including
the ipfw_obj_header, in the size field returned with ENOMEM, as
nat44_get_cfg() now does: ipfw(8) retries with that value, and the old
one was itself too short to pass the check.

Add tests:
  getlog_short_buffer - every buffer shorter than the reply gets ENOMEM
                        and the reply length; the reply length works.
  getlog_retry        - a retry with the length reported along with
                        ENOMEM succeeds.
Without the fix, getlog_short_buffer panics the kernel and getlog_retry
fails.

Reviewed by:    ae
Fixes:          https://cgit.freebsd.org/src/commit/?id=d6164b77f8b7 ("Make ipfw_nat module use IP_FW3 codes.")
Co-Authored-By: Claude Opus 4.8
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D61587
1c8725c9e900da333d376e22133a95193805ded3 Maxim Konovalov 2026-11-12 08:39:57

debug: classified in 03-filenames_plain1 by 'sys/netpfil/'

System administration

Stuff in man section 8 (other than networking).

tcpdrop: improve handling of -C and -S
Handle empty strings for -Cand -S correctly.

Reported by:            maxim
Reviewed by:            maxim
MFC after:              1 week
MFC to:                 stable/14
MFC to:                 stable/15
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D60210
e2279d5ba9a91407239cba4bed80abff73b15798 Michael Tuexen 2026-10-01 19:09:11

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

stand/images: remove translucent pixels around orb
Remove semi-transparent pixels around the orb. These become more
pronounced when the orb is used as the spash screen image.

While here also strip metadata.

MFC after:      3 days
Reviewed by:    tsoome
Differential Revision:  https://reviews.freebsd.org/D60163
f7663278c2ba527dc681b1a806d4cc78ea49452b Ahmad Khalifa 2026-10-02 02:11:32

debug: classified in 03-filenames_plain1 by 'stand/'

Commit group #51: stand
stand: Remove const from zfs_lookup's zfsmount argument

Dynamic system attribute layout can require modifications to the mount
structure on lookup. Drop the const to allow that.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D60260
acbcb68c9f744dedc49835b8e235a0afa13f6c26 Warner Losh 2026-10-03 14:41:40

debug: classified in 03-filenames_plain1 by 'stand/'


stand: zfs_dnode_stat move from spa to mount argument

When reading dynamic system attributes, we'll need the mount argument
since we can no longer hard-code the offsets. Adjust zfs_dnode_stat to
take it.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D60261
ecd41c0df3a0e5f98716c5aabbdeb36c2c29b86f Warner Losh 2026-10-03 14:42:21

debug: classified in 03-filenames_plain1 by 'stand/'


stand: zfs_dnode_readlink move from spa to mount argument

For the dynamic system attributes, we'll need the mount argument. Adjust
zfs_dnode_readlink to take that argument.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D60262
16cf795d3e0bf9cc605ea64564c8cfecae74ff76 Warner Losh 2026-10-03 14:42:27

debug: classified in 03-filenames_plain1 by 'stand/'


stand: Load dynamic system attribute offsets

zfs_sa_load looks up all the system attribute offsets and stores them in
the mountpoint.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D60264
32fcc66dd311207451cd4916f9ed837ee19f9e07 Warner Losh 2026-10-03 14:42:38

debug: classified in 03-filenames_plain1 by 'stand/'


stand: Lookup the offsets for this SA bundle

Compute the offset for the data for this bundle and the requested data
type.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D60265
4175fa107f77e93c7e5c7d0dbd3662b0a6ae620b Warner Losh 2026-10-03 14:42:43

debug: classified in 03-filenames_plain1 by 'stand/'


stand: Lookup specific SA value in a dnode

zfs_dnode_sa_lookup will look in the bonus part of the dnode for the
requested SA values, and fall back to the spill as if it's not there.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D60266
8bc06ba211b962c4742fe2acb17c22b86256d592 Warner Losh 2026-10-03 14:42:48

debug: classified in 03-filenames_plain1 by 'stand/'


stand: update zfs_dnode_stat to use zfs_dnode_sa_lookup

Find the SA values with the zfs_dnode_sa_lookup and read out the
relevant bits for the stat buffer.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D60267
f382ef1dc82cf0679b164be1e6cce51c022a204c Warner Losh 2026-10-03 14:42:53

debug: classified in 03-filenames_plain1 by 'stand/'


stand: Implement zfs_dnode_readlink in terms of zfs_dnode_sa_lookup

Get the link offset using the zfs_dnode_sa_lookup helper now.

Recently, the symbolic links we rely on in the boot loader have stopped
working.

Prior to OpenZFS commit e90badec11d3 ("Inherit the project ID for every
object type", Matt Turner, 2026-08-14), symbolic link information was
written at a fixed offset in the SA data. Since that commit, the
inherited PROJIDs mean that all pools with quota enabled have started
writing symbolic links with a new, non-fixed offset. Old symbolic links
remained unchanged, but new ones were written with a different
offset. At work, we have all these things: rewritten BEs, quotas, and a
dependence on symbolic links in our boot path.

This came in on 2026-08-24 OpenZFS merge (22649d4dba73). This was 12
hours after stab week for August, so we didn't hit this until the
September stab week. Since the new kernel has to write links at the new
offset, the initial tests worked, but the second ones didn't.

Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D60268
262fa4695d90207b9080f2cc5cb01eccf07fe243 Warner Losh 2026-10-03 14:42:58

debug: classified in 03-filenames_plain1 by 'stand/'

nuageinit: apply meta-data if user-data is a script
Tested by:    adam.mizerski@ovhcloud.com
Sponsored by:   OVHcloud
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2446
de0a279c8b6967ffd1cb0c9f76d3cc4658a0f1aa Adam Mizerski 2026-09-25 08:54:48

debug: classified in 03-filenames_plain1 by 'libexec/'

stand: Bump version to 3.1
Sponsored by:         Netflix
edc51d1de57cf735f1276511779202f111e48fbc Warner Losh 2026-10-04 05:15:14

debug: classified in 03-filenames_plain1 by 'stand/'

camcontrol: Add support for firmware uploading on HPE-branded drives
b30e67dc130ea8217e92e0b4c462f189e2268eba Peter Eriksson 2026-10-02 16:45:59

debug: classified in 03-filenames_plain1 by 'sbin/'

rtld-elf/i386: remove no longer true __unused args annotations
Fixes:        https://cgit.freebsd.org/src/commit/?id=d45d7aea6197 ("i386 rtld: implement support for TLSDESC relocation")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
ea23918b025baf72a43c0ce6f3f505ef153c2644 Konstantin Belousov 2026-10-06 07:09:34

debug: classified in 03-filenames_plain1 by 'libexec/'

stand: userboot: improve userdisk error handling
Currently, userdisk_init() iterates through disks and
checks whether DIOCGSECTORSIZE and DIOCGMEDIASIZE ioctls
are available for the device. If either ioctl fails, userdisk_init()
returns ENXIO with ud_info only partially initialized.
devinit() records the failure, but loader_main() ignores
devinit()'s return value, so later code may access an
uninitialized entry.

In certain cases this code can still boot from a disk even if
userdisk_init() returns ENXIO, for example, when the first of
two disks is valid and the second errors out.

To address this issue while not breaking the current behavior, do
the following:

 - Zero-initialize the userdisk_info array and use a zero media size
   to mark disks that do not support the ioctls mentioned above or
   report an empty medium.
 - Update userdisk_print() not to print unusable disks.
 - Update userdisk_open() to return EIO for unusable disks.
 - Update extract_currdev() to pick the first usable disk
   instead of the first disk. Introduce userboot_disk_firstunit()
   for that.

Additionally, reset counters on ud_info allocation failure to prevent
accessing unallocated data.

Reviewed by:    jhb (previous version), markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59262
4445d039583a0a47fc335e0d34401581bcbc104e Roman Bogorodskiy 2026-08-28 16:43:26

debug: classified in 03-filenames_plain1 by 'stand/'

rtld.c: avoid double-free on dso load failure in do_load_object()
The obj->path is assigned directly from the path argument, and
load_object() frees the path on do_load_object() failure.  Do not free
it in obj_free() on the error path.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60402
274236ed084a259a0e8a11df1afebd2f2f1fb097 Konstantin Belousov 2026-10-06 08:22:21

debug: classified in 03-filenames_plain1 by 'libexec/'

camcontrol: Add Spectra Logic copyright
The majority of lines of code currently in fwdownload.c come from ken@'s
rework in commit 0e358df062dd ("Revamp camcontrol(8) fwdownload support
and add the opcodes subcommand.").  Add the appropriate copyright.

Approved by:    ken
e3f5a83b8f3c75651c1acb93c7f0edb8172b5eaa Ed Maste 2026-10-06 20:03:58

debug: classified in 03-filenames_plain1 by 'sbin/'

Commit group #52: dhclient
dhclient: recognize the Captive Portal DHCP options

Rename option 114 from "url" to "captive-portal" (RFC 8910) and retain
"url" as a deprecated alias.  Rename option 160 from the generic
"option-160" to "captive-portal-legacy" (RFC 7710).

Reviewed by:    emaste, dch
Apprived by:    emaste, dch
Differential Revision:  https://reviews.freebsd.org/D60256
a1789e345db7f7c5f248006b49bb287067e03a45 Baptiste Daroussin 2026-10-02 19:53:30

debug: classified in 03-filenames_plain1 by 'sbin/'


dhclient: request the Captive Portal options

Add DHCP options 114 (captive-portal) and 160 (captive-portal-legacy)
to the default Parameter Request List so that servers advertise the
Captive Portal API URI.

Approved by:            emaste
Reviewed by:            emaste
Differential Revision:  https://reviews.freebsd.org/D60257
afee6fb209d18209f5b7707b944b30b80051e193 Baptiste Daroussin 2026-10-02 19:53:50

debug: classified in 03-filenames_plain1 by 'sbin/'


dhclient: export the Captive Portal URI to the script

Differential Revision=  https://reviews.freebsd.org/D60259
7ba72855939fc53eb8b6d9def386564579780786 Baptiste Daroussin 2026-10-02 19:54:25

debug: classified in 03-filenames_plain1 by 'sbin/'

dhclient-script: store the Captive Portal URI
Write the URI received in DHCP option 114 to
/var/run/captive-portal.IFACE atomically, with the legacy option 160 as
a fallback, and remove the file on EXPIRE and FAIL.

Reviewed by:    bcr (manpage)
Differential Revision:  https://reviews.freebsd.org/D60259
0f1ca95d7740e0800572ed436fd61e70f76eb6c3 Baptiste Daroussin 2026-10-02 19:55:28

debug: classified in 03-filenames_plain1 by 'sbin/'

dwatch(1): Use mdo(1) instead of sudo(8) when configured
Reviewed by:  dteske, olce
Approved by:    christos (mentor)
MFC after:      1 week
Sponsored by:   fme AG
Differential Revision:  https://reviews.freebsd.org/D60408
b6a573aa771e4a4b239a7bfeb074d1d25e811c1b Mateusz Piotrowski 2026-10-06 14:02:42

debug: Commit manually moved from "unknown" to "admin".

rc.d/mountd: Do not require /etc/exports
mountd exits if it cannot read any exports files. Requiring
/etc/exports, however, unconditionally stops mountd from starting on a
server that exports ZFS datasets only (/etc/zfs/exports).

Let sbin/mountd handle requirements itself, instead of hardcoding
/etc/exports, which is also wrong, because different files can be
specified in mountd_flags.

This patch also works with nfsv4_server_enable="YES", by preserving the
behavior of failing to start if there is no "V4:" line in the exports
file, which is missing by default on ZFS-only exports.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Reviewed by:    rmacklem, markj, emaste
Differential Revision:  https://reviews.freebsd.org/D60044
26203cca52621c215f60640bf59128dcd9780be7 Christos Margiolis 2026-10-07 16:53:28

debug: classified in 03-filenames_plain1 by 'libexec/'

loader.efi: devinit() just after parsing args instead
c4640126f1160 ("loader.efi: Apply command-line DHCP overrides earlier")
was really good, but moving it just one statement earlier is even
better.  polarian on Libera describes a GELI setup on a system that
doesn't advertise a serial console via ConOut.  They don't have serial
input at the point that they would get prompted for the GELI passphrase,
but if we parse args just before devinit() then he can override the
console with `efibootmgr -e`.  This gives UEFI one advantage over BIOS
loader, as /boot.config isn't available to provide that kind of override
if your impediment is GELI.

We also considered reading loader.env earlier, but we have a chicken/egg
problem in that we must have probed for the ESP to be able to open() it.
We would instead need a devinit_early() and devinit_late() scheme that
allows GELI probing to be deferred until the later pass, after reading
loader.env to pick up the console override.  That's an idea I'd still
like to discuss because it's more robust than hoping that firmware won't
wipe out our efibootmgr(8) entries.

Tested by:      polarian on Libera
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D60449
78887369c47fda5707ef72ef46a1c903df5b7cae Kyle Evans 2026-10-08 02:16:28

debug: classified in 03-filenames_plain1 by 'stand/'

bhyve: Remove unneeded include of <machine/iodev.h>
This is a kernel-only header for /dev/io.  The user-facing header
defining the ioctl commands is <dev/io/iodev.h>.

Reviewed by:    bnovkov, imp
Differential Revision:  https://reviews.freebsd.org/D60399
b40ba68a65027b9a13b9ce28a5c43c4ffb7b003d John Baldwin 2026-10-08 15:20:45

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

sysconf: accept a unique prefix of a target keyword
Exact match still wins.  An ambiguous prefix is rejected with the
list of matches.  Move keyword selection and the rc pass-through
into sysconf-targets.c.  Bump sysconf(8) to 2.1.

Reviewed by:    kfv
Differential Revision:  https://reviews.freebsd.org/D59924
439eb9c9771b8a62b5bcc8d2f7337f26c4d717e2 Devin Teske 2026-10-08 16:26:02

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

sysconf: add a poudriere target
poudriere.conf is handed to sysrc(8), including the jail, tree, and
set overlays poudriere(8) consults.  make, src, and src-env are
sub-targets over the matching make(1) files under poudriere.d.  -l
and -L list one path per line; -L includes overlays that do not exist
yet.  A bare -- ends the sub-target so the next word is a variable.
Bump sysconf(8) to 2.2.

Reviewed by:    fuz, kfv, bcr
Differential Revision:  https://reviews.freebsd.org/D59943
398b29f07f7d1fa6a045b3ccf242a55cb61207c0 Devin Teske 2026-10-08 16:26:43

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

makefs/zfs: count "." in the link count and size of dataset roots
The root directory of a dataset is populated from an fsnode that is the
"." entry of the staging directory, and its children are the siblings of
that node, so the loop that computes the link count and the size of the
directory (which expects "." among the children, as the nodes of the
other directories have) never counts it.  The link count of the root of
every dataset is one less than it should be (1 for an empty dataset
instead of 2, 19 instead of 20 for a root with 18 subdirectories), and
so is its size.

fts(3) trusts the link count of the directories of ZFS when called with
FTS_NOSTAT and FTS_PHYSICAL: it stops looking for subdirectories once it
has seen as many as the link count says, and does not descend into the
ones it did not look at.  As a result find(1), and rm(1) when it does
not need to stat the entries, silently skip directories of a pool made
by makefs.  On a root filesystem made by makefs, find / does not list
/etc at all.

Start the loop at the "." node itself for the roots of datasets, so that
it is counted the same way as in every other directory.  Add a test that
checks the link counts and the sizes of the dataset roots and of the
other directories, with nested datasets and a dataset whose mountpoint
is not in the staging tree, and that find(1) sees the whole tree.

Fixes:          https://cgit.freebsd.org/src/commit/?id=240afd8c1fc ("makefs: Add ZFS support")
MFC after:      1 week
Approved by:    markj
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60439
81b5b2265d7734f9c4d4603031b3e8254c7e23d8 Renato Botelho 2026-10-07 11:32:45

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

rtld: fix indent
Sponsored by: The FreeBSD Foundation
MFC after:      3 days
46399049f8876ca877604f51689aed8cf9105722 Konstantin Belousov 2026-10-10 15:02:55

debug: classified in 03-filenames_plain1 by 'libexec/'

rtld: release rtld_bind_lock around calls to .preinit_array initializers
We unlock the bind lock around .init calls anyway.  Also, the main
object cannot be unloaded.

Reported and reviewed by:       dim
PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298943
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60588
ef758b59a44e6b5b2d2dc178b97c01cde1b34570 Konstantin Belousov 2026-10-10 15:05:55

debug: classified in 03-filenames_plain1 by 'libexec/'

safe_eval.sh add safe_var_set
safe_var_set can be used to safely handle var=val args from command line.
eg.

        while :
        do
                case "$1" in
                *=*)    # eval "$1" can be very dangerous
                        # safe_var_set will only eval if
                        # both var and value are sane.
                        if ! safe_var_set "$1"; then
                                case "$?" in
                                1) echo invalid variable name;;
                                2) echo invalide value;;
                                3) echo variabel not allowed;;
                                esac
                        fi
                        shift
                        ;;
                *)      break
                        ;;
                esac
        done
0fa0966b6a5a6000e4b98104e17629161f6f1f04 Simon J. Gerraty 2026-10-11 04:58:50

debug: classified in 03-filenames_plain1 by 'libexec/'

safe_eval.sh: add safe_set_var
Get the log message right!
Fix default allowed chars (untabify clobbered TAB)
Add a couple more : messages to help debugging.
475e3bc18a108dca375424c97de13939224c2d89 Simon J. Gerraty 2026-10-11 05:54:59

debug: classified in 03-filenames_plain1 by 'libexec/'

safe_eval.sh fix description of safe_set_var returns.
The description was out of sync wrt return values.
1. invalid var
2. invalid val
3. var not in allowed list
9f0432041b8fb69832f10c32da50a67f34feeb61 Simon J. Gerraty 2026-10-11 06:05:52

debug: classified in 03-filenames_plain1 by 'libexec/'

pfctl: remove the prototype of pfr_ina_define()
The function went when DIOCRINADEFINE was converted to netlink; pfctl
calls pfctl_ina_define() from libpfctl instead.  Name that one in the
error message that pfctl_load_tables() prints when it fails.

Fixes:          https://cgit.freebsd.org/src/commit/?id=219ce3063840 ("pf: convert DIOCRINADEFINE to netlink")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
40d42dc214ba0bcd283c5ccc34909a17b8a43455 R. Christian McDonald 2026-10-11 17:03:59

debug: classified in 03-filenames_plain1 by 'sbin/'

safe_eval.sh: safe_set_var avoid positional args
Use options to set ssv_{allow,only,extra}
Improve the documentation.
Add a test harness for safe_set_var.
7c75c96d176f600c7d17cb4652a1e655b44b2943 Simon J. Gerraty 2026-10-11 18:12:59

debug: classified in 03-filenames_plain1 by 'libexec/'

safe_eval.sh: safe_set_var use [:space:] if possible
Also use $ssv_extra$ssv_only as the default for $ssv_only has '-'
which must be last in the character class.
58a8f100a6fdb84997ed4740bd794779375e376f Simon J. Gerraty 2026-10-11 21:55:11

debug: classified in 03-filenames_plain1 by 'libexec/'

Commit group #53: tests: add UFS synchronous write durability tests
tests: add UFS synchronous write durability tests

Check that once fsync(2), fdatasync(2), or a write(2) with O_SYNC or
O_DSYNC returns, the new data, the file size and every block pointer
leading to the data are on disk.  The cases append a block, fill a hole,
append the first block that needs an indirect block and append below an
existing indirect block.  Two more append after another write left a
new direct block unsynced, which with soft updates cuts the size and the
later pointers of an inode written meanwhile.  With O_SYNC and O_DSYNC
on soft updates, those also check that the open already made the
unsynced block durable.
Each case runs on UFS without soft updates, with soft updates and with
SU+J.

The file systems live on md(4) and the checks read the inode, the
indirect block and the data block straight from the device with libufs
right after the synchronous call returns.  There is no cache in front
of the disk device, so this shows what would survive a crash at that
moment without having to crash anything.

Sponsored by:   Sippy Software, Inc.
Reviewed by:    pho
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60134
MFC after:      1 month
afe1dec7425c9f3bec1aafcfed15229a385894eb Maxim Sobolev 2026-10-13 02:45:12

debug: classified in 03-filenames_plain1 by 'etc/'


tests/sys/fs/ufs/sync_test.c: hide the alignment warning

Reported and tested by: dhw
Fixes:  https://cgit.freebsd.org/src/commit/?id=afe1dec7425c ("tests: add UFS synchronous write durability tests")
Sponsored by:   The FreeBSD Foundation
af08f29e5fc05d1e67370b36800b20ac95937a51 Konstantin Belousov 2026-10-13 12:17:57

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

debug: moved to admin because 'Need to be grouped with afe1dec7425c9f3bec1aafcfed15229a385894eb'

safe_eval.sh: safe_set_var add allow list for values
Complete the controls with -v "values":

sh ./safe_eval.sh set_var -a "knob" -v "no yes" knob=yes knob=no knob=ok ok=yes
knob=yes
knob=no
denied value 'ok' for 'knob'
denied variable 'ok'
5efc40dd13a7ebd17fe79ab40a424ad894316675 Simon J. Gerraty 2026-10-13 23:05:21

debug: classified in 03-filenames_plain1 by 'libexec/'

debug.sh avoid trouble from set -e
The setting of _TTY ran afoul of set -e.

Also the handling of Myname blew up if debug.sh included by
a login sheel (eg in .profile).

For non-posix shell, leave false alone if it is a builtin.
064edc2ceb77389d17655c8aa347084e10d64add Simon J. Gerraty 2026-10-13 23:08:15

debug: classified in 03-filenames_plain1 by 'libexec/'

hooks.sh allow running DebugO{n,ff} from hooks_run
We need to watch out for _debugO{n,ff}_hooks.

Also add add_list (hook lists are just lists).

Fix bug in hooks_has() - should look for $2 in list.
34e92fb6bd8da6569c90ae9ee79c9a01890b8a6b Simon J. Gerraty 2026-10-13 23:59:32

debug: classified in 03-filenames_plain1 by 'libexec/'

Commit group #54: bhyve
bhyve: Fix handling of the xhci event ring

rts->erst_p and rts->erstba_p are pointers to guest-controlled memory
which describe the event rings and pending event array, respectively.
The device model was not validating the size nor saving the value.
As a result, the bounds checks in pci_xhci_insert_event() were
susceptible to TOCTOU races.

Fix pci_xhci_rtsregs_write() to save the ring size in a softc field.
Validate that the size isn't larger than the maximum allowed by the XHCI
specification (64KB, or 4096 TRBs).

When processing TRBs, make sure we don't load fields more than once.
Make sure that pci_xhci_trb_next() doesn't return a pointer to host
memory.  When handling ERDP writes, make sure that the guest-supplied
address is actually a pointer into the TRB array, and ignore the write
if not.

Approved by:    so
Security:       FreeBSD-SA-26:72.bhyve
Security:       CVE-2026-101309
Reported by:    Brian Delgado from Intel using Anthropic Opus 4.8
Differential Revision:  https://reviews.freebsd.org/D60677
1d14ab14dd72f5141eddce84df8ec5b74dbb8cd7 Mark Johnston 2026-10-13 19:56:47

debug: classified in 04-filenames_plain2 by 'usr.sbin/'


bhyve: Improve HDA stream descriptor validation

The length of each block in the stream must be non-zero.  This is
assumed in hda_transfer(), otherwise an out-of-bounds read or write is
possible.

Use atomic loads to access stream descriptor fields, since they are
guest-controlled.  Make sure that the descriptor array is suitably
aligned so that we can drop the __packed annotation from the structure
definition; per section 3.3.42 of the HDA spec the BDL pointer is
supposed to be 128-byte aligned, in fact.

Approved by:    so
Security:       FreeBSD-SA-26:72.bhyve
Security:       CVE-2026-101310
Reported by:    Brian Delgado from Intel using Anthropic Opus 4.8
Reviewed by:    christos
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60678
81b9fcfa0bbca2f9931a9b9a5e6fde0972f08cfa Mark Johnston 2026-10-13 19:58:36

debug: classified in 04-filenames_plain2 by 'usr.sbin/'


bhyve: Fix handling of framebuffer resizing

The rfb code maintains an array of CRCs for 32x32 tiles in the
framebuffer.  This array is sized statically based on the rfb code's
notion of the maximum framebuffer size, which changed in commit
fb51ddb20d57 without updating the rfb code.

Morever, writes to the framebuffer BAR can modify the recorded height
and width of the framebuffer.  These values were not validated against
the maximum at all, unlike the parameters set via bhyve config.

Fix these problems:
- Define the maximum width and height in a shared header file so that
  they do not get out of sync again.
- In pci_fbuf_render(), don't resize the console if the new dimensions
  are too large.
- Add a mutex to synchronize framebuffer BAR I/O with the rfb thread.

Approved by:    so
Security:       FreeBSD-SA-26:72.bhyve
Security:       CVE-2026-101311
Fixes:          https://cgit.freebsd.org/src/commit/?id=fb51ddb20d57 ("bhyve: increase fbuf display resolution limit")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60680
ac6f9513b210097410dcd6f44e9523f990ba7b92 Mark Johnston 2026-10-13 19:59:10

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

ggate: fix test intermittency
* ggatel: fix piped output.  Flush stdout before daemonizing, so the
  output can be read when it's in a command pipeline.

* ggated: bind the port _before_ daemonizing, so an invoking script can
  be sure that the port is bound as soon as the command returns.

* tests: allow ggatec or ggatel to automatically allocate a device
  number instead of choosing one in a racy way.

With all of these changes I can no run the tests 1000 times without
fail.  And in parallel, too.

MFC after:      1 week
Sponsored by:   ConnectWise
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298942
Reported by:    siva
Reviewed by:    ngie
Differential Revision: https://reviews.freebsd.org/D60707
802f5e4d6926f0be9294d71c6cadcbe872dbddf2 Alan Somers 2026-10-13 17:40:22

debug: classified in 03-filenames_plain1 by 'sbin/'

rtld: add .cfi_undefined lr to rtld_start.S on powerpc*
Without it, LLVM libunwind doesn't know where to stop when unwinding the
main thread, so it uses a stale LR as the return address and crashes.
Our libunwind doesn't do that since 5866c369e4fd reverted it, but
programs that bundle their own copy, like ClickHouse, are hit by it.

amd64, arm64, i386 and riscv already have the same annotation.

Approved by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60740
c4fde87a3236b500246d4fce76dbca2a3d64f73a Piotr Kubaj 2026-10-15 13:58:04

debug: classified in 03-filenames_plain1 by 'libexec/'

dhclient: Avoid out-of-bounds reads in check_classless_option()
The loop did not verify that the option buffer is large enough before
reading an address.

Reported by:    Andrew Griffiths <andrew@calif.io>
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60484
368a1bfcd49315e8dd3e56ca6744ce5d74ef737b Mark Johnston 2026-10-14 21:12:42

debug: classified in 03-filenames_plain1 by 'sbin/'

tcpsso: fix the level error messages
tcpsso incorrectly referred to the optname instead of
the level name/number.

MFC after:      2 weeks
c7cf285bb2069ff5adc3ca63dbdaf3deb0fe3aeb Maxim Konovalov 2026-10-16 21:29:17

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

sysrc: Be quiet when changing values
Make it easier for the rc group to facilitate having an option to fully
boot muted (à la OmniOS) without resorting to /dev/null redirections.

Reviewed by:    imp, dteske
Differential Revision:  https://reviews.freebsd.org/D46120
454e8ffbd237f05b08eadbe4b22abf4089799b83 Jose Luis Duran 2026-10-17 21:02:16

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

sysconf: report a truncated keyword match list
snprintf(3) returns the length that would have been written, so an
ambiguous prefix can fill the match buffer with no sign that names
were cut off.  Append " (truncated)" when that happens.  Drop the
empty statement when scanning option arguments: only a separate
argument consumes the next argv entry.

Bump sysconf(8) to 2.2.1.

Suggested by:   fuz
Reviewed by:    fuz
Differential Revision:  https://reviews.freebsd.org/D60815
158c59210d9530af64b2bd6a08c7ffd216b243a8 Devin Teske 2026-10-18 15:43:37

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

bsdinstall: use the GPT label for swap in fstab
The GPT layout already labels the swap partition swapN, but fstab
named the disk device. That name changes when disks are added or
reordered, and swap does not come up until fstab is edited. Write
/dev/gpt/swapN instead, appending .eli when swap encryption is on.
Mirrored swap still uses /dev/mirror/swap, with the same suffix.

Submitted by:   Wanpeng Qian <wanpengqian@gmail.com>
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D32936
49e3c256e4619c56acc09660bc3c49b68ec32c20 Devin Teske 2026-10-18 19:06:48

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

Commit group #55: nvmecontrol
nvmecontrol: select format by sector size

Add automatic selection of lbaf value based on a single sector size. The
lbas (the data sector size) is selected based on the power of 2 in the
sector size, and the metadata size is selected by the remainder. If an
lbaf matches these values is used, otherwise we exit with an error.
When there's a tie, we prefer the higher performance.

Manual selection of these values remains as well for times when we
select incorrectly.

Reviewed by:            seuros, chuck
Differential Revision:  https://reviews.freebsd.org/D59833
4623bbfe7bfc81d2626a5c2a7a5cfb2ff15c0360 Warner Losh 2026-10-19 04:42:12

debug: classified in 03-filenames_plain1 by 'sbin/'


nvmecontrol: support controller-wide sector sizes

Extend sector-size selection to controller-wide formats when every
namespace has one compatible format index and matching effective
metadata and protection settings. Reject ambiguous or inconsistent
layouts so heterogeneous fleets can request a sector size without
risking an unintended controller-wide format.

Reviewed by:            seuros, chuck
Differential Revision:  https://reviews.freebsd.org/D59834
b991e2dd824cc6a120a346a183837875ff75b66d Warner Losh 2026-10-19 04:42:43

debug: classified in 03-filenames_plain1 by 'sbin/'


nvmecontrol: add format dry-run support

Add -n/--dry-run to resolve and print the Format NVM command without
submitting it. This lets users verify namespace selection and format
parameters before making destructive media changes.

Reviewed by:            seuros, chuck
Differential Revision:  https://reviews.freebsd.org/D59835
3b66efc6e9b8999053f11a449056fad5ebc1c1ac Warner Losh 2026-10-19 04:43:00

debug: classified in 03-filenames_plain1 by 'sbin/'


nvmecontrol: Use admin device for admin-passthru

When we're doing admin-passhtru, we need to use the admin device, not
the namespace device. So when we're passed in ndaX or nvdX, we need to
translate that to nvmeY for this command for the admin-passthru command,
but not the io-passthru command. Note namespace nuance in man page.

Differential Revision:  https://reviews.freebsd.org/D59878
bf3726998fc7655fa116dd99be24842407d8263b Warner Losh 2026-10-19 04:43:09

debug: classified in 03-filenames_plain1 by 'sbin/'


nvmecontrol: Fix mixup between pi and pil

pi and pil were extracted from the incorrect place. Swap how we get/set
there to be correct. However, since these are always 0, this is a nop.
ee96770ee37591d5fc9f7ee39aa1386636e8dc8d Warner Losh 2026-10-19 06:19:17

debug: classified in 03-filenames_plain1 by 'sbin/'

bhyveload: Factor global variables into a software context
This will make it easier to port bhyveload's functionality into the main
bhyve executable.

No functional change intended.

Reviewed by:    novel
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60481
55d0e022fbcd83ec5a29fe5751af85e2c3ebf19b Mark Johnston 2026-10-19 13:45:36

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

bhyve: Fix virtio-input event array resizing
Use the new array size when calling realloc().  Note that this queue
stores events read from a host evdev device, i.e., it is not
guest-controlled.

While here, use the cdefs.h __unused macro and use them correctly, i.e.,
don't mark "arg" as unused when it isn't.

Reported by:    Brian Delgado from Intel using Anthropic Opus 4.8
Fixes:          https://cgit.freebsd.org/src/commit/?id=054accac71e0 ("Add a virtio-input device emulation.")
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60679
f1986e5b88630b1404a202251499bca0f97f5f06 Mark Johnston 2026-10-19 13:54:33

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

bhyve: fix integer overflow in qXfer packet parser
doff + dlen overflows unsigned int when both values are close to UINT_MAX,
causing the wrong branch to execute and passing an unbounded length to
append_binary_data().  Rewrite the comparison to avoid the addition.

Reviewed by:    markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=f81cdf24ba54 ("bhyve: Add support for XML register definitions")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60847
5ce0ab7355264d38fcde4684f0a64347ec0f5234 Osvaldo Janeri Filho 2026-10-19 18:53:05

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

pfctl: Report the error of a failed fingerprint flush
pfctl_flush_fingerprints() returns an error number instead of setting
errno, so a failed flush was reported with whatever errno held: "No
error: 0" on a kernel with ALTQ, ENODEV from the ALTQ probe on one
without.  Every "pfctl -f" flushes the fingerprints first, so on a
kernel that predates PFNL_CMD_OSFP_FLUSH every ruleset load fails this
way without saying why.

Reviewed by:    kp
Fixes:          https://cgit.freebsd.org/src/commit/?id=75c0a8376204 ("pf: convert DIOCOSFPFLUSH DIOCOSFPGET DIOCOSFPADD to netlink")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
1594fbd7f2f4c1af3262d1abd8cb100be2fed414 R. Christian McDonald 2026-10-19 18:44:09

debug: classified in 03-filenames_plain1 by 'sbin/'

pfctl: Report why a table definition failed
pfctl_ina_define() returns an error number instead of setting errno, but
both of its callers print errno.  A table that failed to load was
reported as "cannot define table t: No error: 0", or with a stale errno,
both in the main ruleset (process_tabledef()) and in anchors
(pfctl_load_tables()).

Reviewed by:    kp
Fixes:          https://cgit.freebsd.org/src/commit/?id=219ce3063840 ("pf: convert DIOCRINADEFINE to netlink")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
96944ab79acd48d8a552e6b1229fc46361e65341 R. Christian McDonald 2026-10-19 18:47:05

debug: classified in 03-filenames_plain1 by 'sbin/'

Commit group #56: hastd: Use void pointers for opaque data
hastd: Use void pointers for opaque data

Use void, not char, for pointers to opaque data in our send and receive
functions.

Sponsored by:   Klara, Inc.
Reviewed by:    allanjude
Differential Revision:  https://reviews.freebsd.org/D60729
a5e6bee5a0bff9e9c12037e0b2c76c4f2ab5e046 Dag-Erling Smørgrav 2026-10-20 13:28:42

debug: classified in 03-filenames_plain1 by 'sbin/'


hastd: Fix build failure

Fixes:          https://cgit.freebsd.org/src/commit/?id=a5e6bee5a0bf ("hastd: Use void pointers for opaque data")
Reported by:    garga@
dff56e8118985248678e1a6916cdefd708a9d85f Dag-Erling Smørgrav 2026-10-20 14:58:45

debug: classified in 03-filenames_plain1 by 'sbin/'

Commit group #57: caroot: Regenerate
caroot: Regenerate

Regenerate using certificate data from NSS 3.131.1.

Upstream dropped emSign_ECC_Root_CA_-_G3.pem entirely; we deliberately
move it to untrusted instead to block its reintroduction through e.g.
an outdated copy of security/ca_root_nss.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D60906
82af7f44ebefbe46cd635f63db300a066de48ee1 Dag-Erling Smørgrav 2026-10-20 19:24:31

debug: Commit manually moved from "unknown" to "admin".


ObsoleteFiles.inc: Add dropped certificates

Reported by:    michaelo@
Fixes:          https://cgit.freebsd.org/src/commit/?id=82af7f44ebef ("caroot: Regenerate")
21ac4761428c60c48bb5c3a0367a04dae164c414 Dag-Erling Smørgrav 2026-10-20 19:38:42

debug: classified in 03-filenames_plain1 by 'ObsoleteFiles.inc'


ObsoleteFiles.inc: Add moved certificates

These two moved from trusted to untrusted.

Fixes:          https://cgit.freebsd.org/src/commit/?id=21ac4761428c ("ObsoleteFiles.inc: Add dropped certificates")
dd6a1fef0ed2bf760a294106ab93fbcdcfdcae3d Dag-Erling Smørgrav 2026-10-20 19:55:21

debug: classified in 03-filenames_plain1 by 'ObsoleteFiles.inc'

debug: moved to admin because 'Need to be grouped with 21ac4761428c60c48bb5c3a0367a04dae164c414'

inetd: use snprintf() in inetd_setproctitle()
inetd_setproctitle() formats se_service (the service name taken verbatim
from inetd.conf) and the peer address into an 80-byte buffer with
sprintf(). A long service name can overflow it. Bound both calls with
snprintf().

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D60879
9ab2bf0f4296e8bfafe4dc70f2f200265e6933bd Osvaldo Janeri Filho 2026-10-20 15:40:28

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

bhyve: Treat BAR registration failures as non-fatal
Some guest operating systems (at least 9front) will leave device I/O
space decoding enabled while probing BAR sizes.  In this case, a
sufficiently large 32-bit BAR can overlap with the HPET MMIO region
fixed at 0xfed00000.  This results in an assertion failure in
modify_bar_registration(), even though the collision is transient, i.e.,
the guest will promptly map the BAR elsewhere.

Tolerate such overlaps.  Keep track of a BAR's registration state and
make sure that modify_bar_registration() doesn't try to unregister an
I/O space if registration failed.

This fixes a problem where a 32MB framebuffer ends up overlapping with
the HPET MMIO region, causing some guests to crash with an assertion
failure when probing BARs during boot.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290098
Reviewed by:    bnovkov
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60748
6f051f0e56feba19731adfa6f6bd2a098b5091de Mark Johnston 2026-10-20 15:41:21

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

bhyve: add command to list config options
For a software built on top of bhyve(8) and/or managing bhyve(8),
it is very convenient to know what specific features the given binary supports.
Currently, bhyve(8) provides some of this information, and it could be
retrieved by parsing `bhyve -h`, `bhyve -s help`, `bhyve -l help`.

Sometimes it is not enough, for example, the recently added
"oemstrings" feature cannot be fully probed using these commands.
Over time, some workarounds were suggested. Specifically:

 - Mapping features to __FreeBSD_version. I see at least two issues with
   that:

     * __FreeBSD_version does not directly map to bhyve(8) features,
       so this is simply not accurate.
     * bhyve(8) might be updated separately from the system, which
       is not so uncommon, especially for development purposes.
       Then such a probing will be inaccurate.

 - Manual pages parsing. I see more disadvantages with that:

     * Manual pages are meant to be read by a human. Extracting
       information from it by a machine is not the most convenient thing.
       Especially understanding side notes like: "Note, feature 'foo'
       is arm64-only!".
     * Manual pages might be inaccurate, they might miss options.
     * bhyve(8) could be used in an environment where manual pages
       are not installed.

This commit attempts to close this gap by introducing the "bhyve -o
help" command which prints all the supported configuration variables.
In my opinion, it is, in combination with the other commands mentioned
above, sufficient to retrieve most of the capabilities of the given
bhyve(8) binary.

The current implementation defines a simple configuration schema for
common and machdep code and prints out a list of supported configuration
variables for the current architecture.

The next step as I see it would be extending set_config*() functions
to validate the user provided values against the schema, so users get
notified early on incorrect or misspelled configuration variables.
It would also be nice to allow users to only validate their
configuration, think of 'nginx configtest / -t'.

Reviewed by:    chuck (previous revision), bnovkov
MFC after:      1 month
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58419
e809c7d810ced2307741a7c0c135a8b1bef1851b Roman Bogorodskiy 2026-07-22 16:08:09

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

rtld: fix leak in get_program_var_addr() on the error path
Fixes:        https://cgit.freebsd.org/src/commit/?id=1e370f038778 ("rtld: stop using unbound alloca()")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
91d8163803b4fa25e51afe1209d0f5c30c603b93 Konstantin Belousov 2026-10-25 15:28:14

debug: classified in 03-filenames_plain1 by 'libexec/'

rtld: some cosmetics in donelist_init()
Add a missing word in the comment.
Make each assignment a separate statement.
Fix formatting.

Fixes:  https://cgit.freebsd.org/src/commit/?id=1e370f038778 ("rtld: stop using unbound alloca()")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
e2979f4cbbf6546daa7ad9fd1cd544d22c286315 Konstantin Belousov 2026-10-25 15:30:20

debug: classified in 03-filenames_plain1 by 'libexec/'

dl_iterate_phdr(3): do not return garbage for objects not using TLS
For objects without a TLS segment, tlsindex is zero. tls_get_addr_slow()
then reads dtv_slots[-1], which is dtv_size, and returns it as the TLS
address. Set dlpi_tls_data to NULL for such objects instead.

Fixes:  https://cgit.freebsd.org/src/commit/?id=d36d68161517 ("rtld dl_iterate_phdr(): dlpi_tls_data is wrong")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
175595ba6c5253e395c028e792787dffd2875910 Konstantin Belousov 2026-10-25 15:35:21

debug: classified in 03-filenames_plain1 by 'libexec/'

All Jetway NF541 seem to have the same UUID
dca2ad4c6fa64a091a2447b88258a8e2a5e5bf55 Poul-Henning Kamp 2026-10-28 08:31:23

debug: classified in 03-filenames_plain1 by 'libexec/'

Mark network_interfaces as deprecated
c9dbbe382d0802acdaac9fcffd3d518965af659f Poul-Henning Kamp 2026-10-28 09:36:10

debug: classified in 03-filenames_plain1 by 'libexec/'

sbin/nvmecontrol: fix signedness comparison warning
sector_size is guaranteed to be non-zero here, so cast to
uint32_t to match the comparison.

This fixes the [gcc14 build in CI][0]:

/workspace/src/sbin/nvmecontrol/format.c: In function 'find_lbaf':
/workspace/src/sbin/nvmecontrol/format.c:132:60: error: comparison of integer expressions of different signedness: 'uint32_t' {aka 'unsigned int'} and 'int' [-Werror=sign-compare]
  132 |                 if (NVMEV(NVME_NS_DATA_LBAF_LBADS, format) != lbads ||
      |                                                            ^~

[0] https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc14_build/5051/

Reviewed by:    imp
Fixes:          https://cgit.freebsd.org/src/commit/?id=b991e2dd824c ("nvmecontrol: support controller-wide sector sizes")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
25024d96492e51c250789d16de5064d4c00c7a86 Siva Mahadevan 2026-10-27 20:51:39

debug: classified in 03-filenames_plain1 by 'sbin/'

Commit group #58: rtld
rtld: extract donelist heap allocation into donelist_alloc()

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
53cbd14ea7ca78c140ee90c1e459589bb574d938 Konstantin Belousov 2026-10-25 17:57:39

debug: classified in 03-filenames_plain1 by 'libexec/'


rtld: add RtldLockState initializer

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
500924a6b16d61070f16fb8de49afc0b796d1170 Konstantin Belousov 2026-10-29 13:50:22

debug: classified in 03-filenames_plain1 by 'libexec/'


rtld: add lockstate_rlocked()

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
87a7419c63756580278fcbdebdbca8b16f3bdd24 Konstantin Belousov 2026-10-25 17:57:40

debug: classified in 03-filenames_plain1 by 'libexec/'


rtld: free heap donelists abandoned by the lookup restart

A symbol lookup done under the read-locked rtld_bind_lock is restarted
with the write lock when it needs to load filtees.  The restart is done
by siglongjmp() from lock_restart_for_upgrade(), which skips
donelist_free() for the heap donelists of the unwound frames.  Only
do_dlsym() freed one such donelist, tracked by SymLook.donelist_mem.
The donelist of symlook_default() called from _rtld_bind(), the
donelist of get_program_var_addr() called for dlopen(RTLD_TRACE), and
the donelists of nested symlook_obj_load_filtees() calls were leaked.

Link the heap donelists allocated under the read lock into the list
owned by RtldLockState, which also owns the sigjmp_buf, instead of the
symlook request.

Fixes:  https://cgit.freebsd.org/src/commit/?id=1e370f038778 ("rtld: stop using unbound alloca()")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
ed059dbfe2ef85ea79c5bc2834e75b2a33bb8a61 Konstantin Belousov 2026-10-25 17:57:40

debug: classified in 03-filenames_plain1 by 'libexec/'

pfctl: add -l to use an inherited Netlink socket
pf's Netlink commands are checked against the credentials of the socket,
so a socket opened by a privileged process keeps its authority across a
privilege drop and exec, as the /dev/pf descriptor passed as -p
/dev/fd/N already does. -l takes the descriptor number of such a socket
and uses it for every request instead of creating a new one.

authpf(8) uses this to run pfctl as the logged-in user.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291981
Signed-off-by:  Avinash Duduskar <avinash.duduskar@gmail.com>
Reviewed by:    kp
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2508
87a5d76973ca8eec3e112d4c8bf89933b813fe96 Avinash Duduskar 2026-10-26 14:38:11

debug: classified in 03-filenames_plain1 by 'sbin/'

rpc.tlsservd.c: Check the malloc return
The NULL return is used by the following memcpy()
call.  Fail the request instead.

Unlikely to happen in practice, since the rpc.tlsservd
daemon runs as root and does not allocate a lot or memory.

Reviewed by:    rmacklem
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60927
6d705f2bf17f2c221ffd0d9b0824ba0fb429392e Osvaldo Janeri Filho 2026-10-31 03:04:10

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

usbconfig: Add SSPx2 support
libusb has one speed for all SSP links, so print "SUPER+ (>=10Gbps)".

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57196
2802f8d4a0c23ccc99af9a6648d009ac3b7de7be ShengYi Hung 2026-05-22 15:40:32

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

hastd: Remove pidfile on exit
Make hastd remove its pidfile before exit after catching a signal or a
stop control message, not just on failure to start.

MFC after:      1 week
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D60192
3f2f6bb8f7b562276bffd04a9ae4c05a351b4435 Dag-Erling Smørgrav 2026-11-02 12:30:42

debug: classified in 03-filenames_plain1 by 'sbin/'

pfctl: err(3) family functions should not be used with trailing \n
Obtained from:        OpenBSD, deraadt <deraadt@openbsd.org>, 3c04d8eee2
Sponsored by:   Rubicon Communications, LLC ("Netgate")
e4a2b19aa961eca9775c5fde6512619d3141b1c6 Kristof Provost 2026-11-02 10:32:14

debug: classified in 03-filenames_plain1 by 'sbin/'

hastd: Allow overriding the node name
Normally, hastd will use the hostname, hostuuid, or hostid as node name.
Allow overriding this with a new -n command-line option.  The argument
is treated as a replacement for the hostname, but also disables the
hostuuid and hostid logic.  This allows running multiple nodes on the
same system, which is useful for testing.

Differential Revision:  https://reviews.freebsd.org/D59675
a4c5803ecd03d3a95eedd3bd988f89784ec1a8d4 Dag-Erling Smørgrav 2026-11-03 12:07:29

debug: classified in 03-filenames_plain1 by 'sbin/'

bhyve: check paddr_guest2host return in _vq_record
_vq_record() stored the result of paddr_guest2host() without checking for
NULL. A guest descriptor with an invalid address causes a NULL dereference
in every virtio driver. Return early on failure; the caller sees zero
descriptors and discards the chain.

The indirect path already performs this check (line 357).

Reviewed by:    bnovkov
Differential Revision:  https://reviews.freebsd.org/D60870
MFC after:      1 week
d67c363e85e7c720b1e0ac16e30cb64317c0dc2f Osvaldo Janeri Filho 2026-11-04 16:11:02

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

bhyve: restore the BARs at the addresses the guest gave them
A restore set the addresses in the BARs and the command register to
those of the snapshot, but left the regions registered where
pci_emul_alloc_bar() had put them when bhyve started.  That is only
right for a guest that kept bhyve's addresses.  The UEFI firmware moves
64-bit BARs above 4 GB, and after a restore every access to such a BAR
went nowhere:

  Emulating access to non-existent address to 0x800001014

Before the devices are restored, unregister the regions of all of them;
when a device is restored, register its regions at the restored
addresses, if the restored command register enables them.  All devices
go first because a restored BAR may be where another device's BAR is
before the restore.

Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>
Sponsored by:   keelos.dev
Reviewed by:    bnovkov
Differential Revision:  https://reviews.freebsd.org/D60235
MFC after:      2 weeks
Tested by:      bnovkov
75b1f96772688c4feb698bd5aece8793324b9e23 Wanpeng Qian 2026-11-04 17:32:43

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

loader: Handle unavailable VBE during mode lookup
When VBE is unavailable, vbe_init() frees the controller information
buffer and sets vbe to NULL. Console initialization still calls
vbe_default_mode(), which reaches an unguarded memset() in
vbe_find_mode_xydm(). Under BTX, the null write can overwrite the
loader's own code and cause a later protection fault.

Guard vbe_default_mode() with vbe_check(), as the other public
functions in vbe.c already do, and return 0 to indicate that no
graphics mode is available. This allows console initialization to
continue on headless systems.

Reviewed by:    rmoeller, imp
MFC ater:       2 weeks
Differential Revision:  https://reviews.freebsd.org/D61145
1cd9aa5cbb02434242fd8f3beff78983ac71061a Hayzam Sherif 2026-11-04 19:40:56

debug: classified in 03-filenames_plain1 by 'stand/'

pmc(8): zero-initialize the event descriptor in stat mode
cmd_pmc_stat allocated the event descriptor with malloc and then set
only some of its fields, so the rest held whatever was on the heap.
Use calloc() instead.

Reviewed by:    mhorne
MFC after:      3 days
Sponsored by:   AMD
Signed-off-by: Andre Silva <andasilv@amd.com>
Differential Revision:  https://reviews.freebsd.org/D59364
a97914284c2e7a7dc330f4d93218e8d7f1e758b2 Andre Silva 2026-11-05 13:54:31

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

tests: add a regression test for the orphaned IBS NMI
Toggle IBS op and fetch through /dev/cpuctl0 with hwpmc loaded and
check that every NMI hwpmc declined was claimed.  Without the fix both
cases fail on an EPYC 9654.

Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   AMD
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>
Differential Revision:  https://reviews.freebsd.org/D60766
fdfb611461aeb2501a4e99fa143b6a274a28da78 Osvaldo Janeri Filho 2026-11-06 14:47:33

debug: classified in 03-filenames_plain1 by 'etc/'

nvmecontrol: Factor out namespace Identify printing
Move print_namespace() from identify.c to identify_ext.c and rename
it to nvme_print_namespace(), to match nvme_print_controller().
This allows other consumers (notably camcontrol(8)) to print NVMe
namespace Identify data.

No functional changes intended.

sbin/nvmecontrol/identify.c:
        Remove print_namespace(), and call nvme_print_namespace()
        instead.

sbin/nvmecontrol/identify_ext.c:
        Add nvme_print_namespace(), moved here from identify.c.

sbin/nvmecontrol/nvmecontrol.h:
        Remove the print_namespace() prototype.

sbin/nvmecontrol/nvmecontrol_ext.h:
        Add the nvme_print_namespace() prototype.

sbin/nvmecontrol/ns.c:
        Include nvmecontrol_ext.h, and rename print_namespace() calls
        to nvme_print_namespace().

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed by:    imp
MFC after:      1 week
Sponsored by:   Spectra Logic
Differential Revision:  https://reviews.freebsd.org/D59530
46198fba6dff5a01e9c0119b5b7cc85e24a06ec6 Kenneth D. Merry 2026-11-07 01:05:53

debug: classified in 03-filenames_plain1 by 'sbin/'

Commit group #59: camcontrol
camcontrol: Add support for NVMe namespace Identify

Add a -N argument to camcontrol identify.  This will fetch and
display namespace Identify data for NVMe drives, using
nvme_print_namespace() from nvmecontrol(8).

This gets the namespace Identify data via XPT_DEV_ADVINFO (i.e.
data cached in the kernel) like the standard NVMe identify command
does, and so works even on NVMe devices that do not support NVMe
Namespace Management.

sbin/camcontrol/camcontrol.c:
        Add a -N argument to camcontrol identify.

        Rename nvme_get_cdata() to nvme_get_data(), and give it the
        ability to fetch controller or namespace Identify data.
        While here, improve its error reporting with
        cam_error_print(), and only look at the CAM status bits of
        the returned CCB.

        Change identify(), ataidentify(), and nvmeidentify() to
        handle the extra arguments.

        Give nvmeidentify() the ability to fetch and print NVMe
        namespace data, using nvme_print_namespace() from
        nvmecontrol(8).

sbin/camcontrol/camcontrol.h:
        Add the nvme_get_data() prototype, for use by future NVMe
        subcommands living outside camcontrol.c.

sbin/camcontrol/camcontrol.8:
        Document camcontrol identify -N.  Make it clear that the
        NVMe data is from data cached in the kernel.  Add a cross
        reference to nvmecontrol(8).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed by:    imp
MFC after:      1 week
Sponsored by:   Spectra Logic
Differential Revision:  https://reviews.freebsd.org/D59533
961fa195b3486a0c3a02a8cf7aa95ccbc91c95de Kenneth D. Merry 2026-11-07 01:05:55

debug: classified in 03-filenames_plain1 by 'sbin/'


camcontrol: Support NVMe reservations via the persist subcommand

The NVMe reservation model is closely patterned after SCSI Persistent
Reservations, so support NVMe devices through the existing persist
subcommand rather than adding a transport-specific subcommand.  The
persist subcommand now dispatches on the device protocol, in the same
way the identify subcommand does.

The SCSI syntax is unchanged.  For NVMe devices, the -i modes all map
to the Reservation Report command (read_full_status requests the
extended data structure, which contains 128-bit Host Identifiers), and
the -o service actions map to the corresponding NVMe reservation
operations: register, register_ignore, reserve, preempt,
preempt_abort, release and clear, plus two NVMe-only actions,
unregister and replace.  The reservation type names for -T are shared
between SCSI and NVMe.  A new -c option gives explicit control over
the NVMe Persist Through Power Loss State; -p is equivalent to
-c enable.  SCSI-only options return an error for NVMe devices.

Tested against a PASCARI X200 series SSD (reservation capabilities:
WR_EX, PTPL, IEKEY13): register, reserve, release, replace,
unregister, -c enable/disable (Persist Through Power Loss State change
verified in the report output), reservation report, and the error
paths.  register_ignore is rejected by drives that implement NVMe 1.3
IEKEY semantics, as expected.  SCSI persist against a da(4) device is
unchanged.

sbin/camcontrol/nvres.c:
  New file, the NVMe reservation backend for the persist
  subcommand.

sbin/camcontrol/camcontrol.c:
  Dispatch the persist subcommand to scsipersist() or
  nvmepersist() based on the device protocol.

sbin/camcontrol/camcontrol.h:
  Add the nvmepersist() prototype.

sbin/camcontrol/Makefile:
  Add nvres.c to the build.

sbin/camcontrol/camcontrol.8:
  Document NVMe support in the persist subcommand section, and
  note the differences from SCSI where they occur.

Co-authored-by: Reid Linnemann <reidl@spectralogic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed by:    imp
MFC after:      1 week
Sponsored by:   Spectra Logic
Differential Revision:  https://reviews.freebsd.org/D59534
ba75cf05727e7f3130e6e6884f4dc7085b7aec3a Kenneth D. Merry 2026-11-07 01:05:55

debug: classified in 03-filenames_plain1 by 'sbin/'


camcontrol: Support NVMe namespace formatting via the format subcommand

Support formatting NVMe namespaces through the existing format
subcommand.  The format subcommand now dispatches on the device
protocol, in the same way the identify and persist subcommands do,
and issues the NVMe FORMAT NVM command for NVMe devices.

The SCSI syntax and behavior are unchanged.  The NVMe-specific
options are -e (secure erase setting), -G (format all namespaces),
-f (LBA format), -l (protection information location), -m (metadata
setting) and -p (protection information type).  The -q and -y options
work for both protocols; NVMe formats gain the same confirmation
question that SCSI formats have always had.  The -r and -w options
are SCSI only; -r returns an error for NVMe devices and -w has no
effect, since the NVMe format command does not complete until the
format is finished.

The default timeout for NVMe is 30 seconds for a cryptographic erase
and 30 minutes otherwise; the generic -t option overrides it.

sbin/camcontrol/nvformat.c:
  New file, the NVMe format backend for the format subcommand.

sbin/camcontrol/camcontrol.c:
  Dispatch the format subcommand to scsiformat() or
  nvmeformat() based on the device protocol.

sbin/camcontrol/camcontrol.h:
  Add the nvmeformat() prototype.

sbin/camcontrol/Makefile:
  Add nvformat.c to the build.

sbin/camcontrol/camcontrol.8:
  Document NVMe support in the format subcommand section, and
  note the differences from SCSI where they occur.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed by:    imp
MFC after:      1 week
Sponsored by:   Spectra Logic
Differential Revision:  https://reviews.freebsd.org/D59535
80f090111ae46ae8b4e115c9d80d783d0d00d445 Kenneth D. Merry 2026-11-07 01:05:56

debug: classified in 03-filenames_plain1 by 'sbin/'


camcontrol: Add a feature subcommand for NVMe Get/Set Features

Add a feature subcommand for the NVMe Get Features and Set Features
commands:

  camcontrol feature ndaX -a <get|set> -f feature [-d data]
      [-s num] [-U]

There is no transport-specific prefix in the name: SCSI has no
feature command (the closest equivalents are mode pages), and the
ATA SET FEATURES subcommands are already exposed through dedicated
camcontrol subcommands (apm, aam, epc and the power commands), so
the name is unclaimed.  The subcommand returns an error for
non-NVMe devices.

Currently, only the hostid feature is fully implemented.  The
hostid value for set is specified with -d as a UUID or an integer
in decimal, hex, or octal, and -U outputs the hostid as a UUID on
get.

The -s argument exposes the feature select / save fields from the
NVMe specification.  If bit 4 of the Optional NVM Command Support
(ONCS) field of the Identify Controller data is set, each feature
has a default, saved and current value, plus a capabilities mask:

  - For get, -s selects which to display: 0 (current),
    1 (default), 2 (saved) or 3 (capabilities).
  - For set, -s is the save flag; a value of 1 sets the saved
    value as well as the current value, so the feature
    persists across an NVMe reset.  Setting the save flag only
    works if the feature's capability mask includes saveable.

sbin/camcontrol/nvfeature.c:
  New file, the camcontrol(8) feature subcommand for getting
  and setting NVMe features.

sbin/camcontrol/camcontrol.c:
  Add the feature subcommand, dispatched only to NVMe devices.

sbin/camcontrol/camcontrol.h:
  Add the nvmefeature() prototype.

sbin/camcontrol/Makefile:
  Add nvfeature.c to the build.

sbin/camcontrol/camcontrol.8:
  Document the feature subcommand.

Co-authored-by: Reid Linnemann <reidl@spectralogic.com>
Co-authored-by: Dave Baukus <daveb@spectralogic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed by:    imp
MFC after:      1 week
Sponsored by:   Spectra Logic
Differential Revision:  https://reviews.freebsd.org/D59536
6eae951cd51b5b8603c119f21c77871a8595ff88 Kenneth D. Merry 2026-11-07 01:05:56

debug: classified in 03-filenames_plain1 by 'sbin/'


camcontrol: Fix -Wcast-align errors in the NVMe reservation report

Casting the byte buffer that holds the Reservation Report payload to
the status structures trips -Wcast-align on strict-alignment
architectures, which broke the CI builds there.  Put the buffer in a
union with the two status structures instead, so it is properly
aligned and no casts are needed.

Reported by:    FreeBSD CI
Fixes:  https://cgit.freebsd.org/src/commit/?id=ba75cf05727e ("camcontrol: Support NVMe reservations via the persist subcommand")
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
MFC after:      1 week
Sponsored by:   Spectra Logic
68ba58a064d1004a031fac6f299f968dfc39241f Kenneth D. Merry 2026-11-07 03:33:21

debug: classified in 03-filenames_plain1 by 'sbin/'

camdd: Fix the worker startup race
The reader can hand off its first buffer before the writer sets
CAMDD_DEV_FLAG_ACTIVE.  camdd_queue_peer_buf() then mistakes the writer
for an exited peer and releases the buffer instead of queueing it.  This
can make a copy fail with bytes read but nothing written, without an
error message.

Mark both devices active before creating either worker, leaving the
workers to clear the flag on exit.  The work queues and EVFILT_USER
events are already initialized, so queued buffers and their notification
can wait for the writer to start without a startup barrier.

Treat pthread_create() failure as fatal.  Returning through the normal
cleanup path can free devices that an already-started worker is still
using, and an unstarted peer cannot consume any queued buffers.

Reviewed by:    imp, markj, ken
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61277
c17aa0984de83a1079cda81b5cce521e73c7a64d Hayzam Sherif 2026-11-07 01:19:07

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

ppp: drop config packets whose options overrun the packet
fsm_readopt() advanced the decode cursor by the option length without
checking it against the end of the packet.  A crafted LCP/CCP/IPCP
option could then make the Config-Reject/Nak echo copy past the
received packet into adjacent heap, disclosing heap bytes to the peer
before authentication.

Check the option framing once in fsm_Input() and drop the packet before
decoding per RFC1661

Reviewed by:    adrian, markj
Differential Revision:  https://reviews.freebsd.org/D61008
Approved by:    adrian (mentor)
Signed-off-by: Nick Price <nprice@FreeBSD.org>
922fd62ec36351929c273792971219e301021843 Nick Price 2026-11-08 01:34:05

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

ppp: bound Predictor-1 decompression output
Pred1Input() decompressed CCP data into a MAX_MRU+2 mbuf with no limit
on the output, so a peer could expand a short compressed frame (up to
8:1) past the buffer and overflow adjacent heap.  An input length below
4 also drove decompress() with a negative length.

Reject out-of-range input lengths and stop decompression at the
destination buffer size.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D61011
Approved by:    adrian (mentor)
Signed-off-by: Nick Price <nprice@FreeBSD.org>
2bb983123b0f3f7d45833fef59f0989e09ef6ae8 Nick Price 2026-11-08 01:35:00

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

gptzfsboot: Use snprintf() to format file names
The stack buffer in fs_list() can be overflowed if a file name is too
long.

Reported by:    Yudi Yang <yudi.yang@rice.edu>
MFC after:      1 week
956a05c3cbf5f5cb9d1c4d58e3a5fc22db1446b8 Mark Johnston 2026-11-08 15:40:03

debug: classified in 03-filenames_plain1 by 'stand/'

stand: ufs directory corruption sanity checks
Add sanity checks for corrupt UFS directory blocks.  Don't allow bad
data to cause buffer overflows or infinite loops.

Reviewed by:    dab, imp (previous version)
Differential Revision:  https://reviews.freebsd.org/D59378
cbd7e7fa5327fe91d5a6649b92f8f2e2fb383e87 Ryan Libby 2026-11-09 17:15:54

debug: classified in 03-filenames_plain1 by 'stand/'

stand: check for short reads in ufs
Reviewed by:  imp, jhb
Differential Revision:  https://reviews.freebsd.org/D59379
897d3ae913452b1832322da625a5dcc7b29ecfc6 Ryan Libby 2026-11-09 17:15:55

debug: classified in 03-filenames_plain1 by 'stand/'

camcontrol: Fix swapped protection information defaults in nvformat
When no -p or -l arguments are given, the nvformat subcommand fills
in the protection information type and location from the
namespace's current settings.  The two were swapped: pi was taken
from the DPS metadata location bit and pil from the protection
information type field.  Formatting a namespace with protection
information enabled would therefore silently change its PI
settings, and before the Format NVM command builder masked its
fields, a namespace with PI type 2 enabled would set bit 9 of
cdw10, turning the format into a user data erase.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=80f090111ae4
MFC after:      1 week
Sponsored by:   Spectra Logic
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
ef69484b4295e84c74877b439db5caf025906b0c Kenneth D. Merry 2026-11-09 18:46:59

debug: classified in 03-filenames_plain1 by 'sbin/'

camcontrol: Require a reservation type for reserve, preempt and release
res_type was initialized to 0, but the checks that enforce the -T
argument for the reserve, preempt and release reservation actions
compare it against -1, so they could never fire and camcontrol
silently sent a reservation type of 0, which is invalid.
Initialize res_type to -1 so the checks work, and default the
reservation type to 0 for the release action's clear variant,
which does not take -T and ignores the field.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=ba75cf05727e
MFC after:      1 week
Sponsored by:   Spectra Logic
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
b95e2b2ce907cde89bc3e7be2ffeae03cfed55ab Kenneth D. Merry 2026-11-09 18:47:00

debug: classified in 03-filenames_plain1 by 'sbin/'

camcontrol: Don't close the CAM device in nvme_get_data()
nvme_get_data() closed the supplied CAM device on every error
path, but its callers either pass the device that main() opened
and closes, or close the device themselves, so an error resulted
in a double cam_close_device() and a double free.  Move the error
path close into print_dev_nvme(), the one caller that opens its
own device, and leave the device alone in nvme_get_data().

This predates the recent camcontrol NVMe additions, but they added
more callers.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=6ee13c54dad0
MFC after:      1 week
Sponsored by:   Spectra Logic
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
f7c24ef1e9a47b889eaaae8514c61e95d9738cf8 Kenneth D. Merry 2026-11-09 18:47:01

debug: classified in 03-filenames_plain1 by 'sbin/'

pw: reject ' and ` in user/group names
pw_checkname() already refuses $ ( ) and freinds, but backtick and
single quote slipped thru, so `pw useradd 'foo`id`'` went in just
fine. Thats command substitution in any unquoted context. Add both
to badchars, plus a test.

Reported by:    Harry Sintonen (Reversec)
Sponsored by:   Entersekt
MFC after:      2 weeks
Approved by:    bapt
Differential Revision:  https://reviews.freebsd.org/D61392
1de93128e75a8571f0fcefc3394d2f875adf970f Muhammad Moinur Rahman 2026-11-10 14:15:10

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

tests/sys/pmc: add pidtrack, callchain, pmc(8), RAPL and AMD tests
Add to the suite of ATF tests for hwpmc(4).  Vendor-neutral tests go in
tests/sys/pmc; tests that depend on AMD hardware interfaces go in
tests/sys/pmc/amd, which is only built on amd64.

tests/sys/pmc:
  pmc_pidtrack_test      process-mode PMCs follow their PID: a live
                         self-read counts the process' own work, an idle
                         process sharing the CPU with a busy one does not
                         pick up its work, and the count survives a
                         context switch
  pmc_callchain_ur_test  pmcstat -U collects user callchains through the
                         PMC_UR ring; regression test for the KASSERTs
                         fixed in rGaf3929c5152b and rG66118c3f1011
  pmc_cli_test           pmc(8): missing log, list-events, record/info
                         round trip with the "instructions" alias
  pmcstat_tsc_test       (amd64) tsc_freq in the initlog record, TSC
                         column of pmcstat -R, tsc in pmc filter -j,
                         pmcstat -G callgraph
  pmc_rapl_test          (amd64) RAPL class: 64-bit counters, system
                         mode only, PKG and CORES energy increase under
                         load

tests/sys/pmc/amd:
  pmu_detect_test        K8 class with 48-bit counters, at least six core
                         counters, TSC class alongside it
  pmu_event_test         pmu-events lookup and EventSelect/UnitMask/OS/USR
                         encoding checked against the amdzen1..amdzen6
                         tables; ex_ret_instr counts a known loop
  pmu_event_neg_test     raw PMCALLOCATE rejects an otherwise valid config
                         word with HOST, GUEST, HOST|GUEST, reserved bit
                         44 or PRECISERETIRE without PMC_CAP_PRECISE
                         (pmc_exterr_test covers an all-ones config word)
  pmu_mux_test           every core counter that CPUID reports can be
                         held at once, one more is refused, a released
                         one is reusable
  rapl_domains_test      AMD RAPL has at most PKG and CORES rows and no
                         DRAM domain
  pmc_frontend_test      pmc(8) frontend study on IBS fetch samples
  amd_pmc_test_common.h  CPUID-based Zen generation detection and helpers

Reviewed by:    mhorne
Discussed with: netchild
MFC after:      1 month
Sponsored by:   Advanced Micro Devices, Inc.
Signed-off-by:  Osvaldo Janeri Filho <ojanerif@amd.com>
Differential Revision:  https://reviews.freebsd.org/D59549
546a7646312352237e49c3a7144e967d2e89b044 Osvaldo Janeri Filho 2026-11-10 16:00:39

debug: classified in 03-filenames_plain1 by 'etc/'

pwd_mkdb: validate login names
vipw(8) never looked at names, it just hands the file to pwd_mkdb,
and pwd_mkdb only cared abuot the field layout. So something like
`user1$(id$IFS-A)` in master.passwd went straight into the db.

Do the same check pw(8) does, in scan(), so vipw, chpass and hand
edits all hit it. NIS +/- entries get checked after the prefix.
Bail out rather then warn; a file with junk names wont rebuild
anymore, whcih is kinda the point.

Add tests while here.

Reported by:    Harry Sintonen (Reversec)
Sponsored by:   Entersekt

Approved by:    bapt
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D61405
b15b789d93c804f30896ddd568af13a475a0d972 Muhammad Moinur Rahman 2026-11-10 14:15:10

debug: Commit manually moved from "unknown" to "admin".

bsdinstall: Set TMPDIR in pkgbase install
The FreeBSD-base repository (aka "pkgbase") is now created using 'pkg
repo -l' in order to make 'pkg rwhich' work.  Unfortunately this makes
the data.pkg file considerably larger, and FreeBSD 15.2-BETA1 fails to
install using a remote repository since the installer has a small /tmp
(20 MB).

Run pkg commands with 'env TMPDIR=<chrootdir>/tmp' since the /tmp in
the system being installed is considerably larger than the tmpfs which
the installer runs with.  Create <chrootdir>/tmp first so we can ensure
it has 1777 permissions.

Reviewed by:    bapt
MFC after:      1 day
Differential Revision:  https://reviews.freebsd.org/D61380
a7163bd76986282fdcb059b91301d3214da49642 Colin Percival 2026-11-10 02:34:43

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

Commit group #60: nvmecontrol: Mask the fields in the Format NVM command
nvmecontrol: Mask the fields in the Format NVM command

The format command composed cdw10 by hand without masking any of
the fields and with no support for the LBAFU field.  Since commit
2c41f7d8a034 the LBA format index defaulted from FLBAS can exceed
15 on an NVMe 2.0 namespace using FIDXU, and such an index would
bleed into the MSET and PI fields.  An out of range index supplied
with -f for a whole-controller format was not caught either.

Build the command with nvme_admin_format_cmd(), which masks all of
the fields and encodes LBA format indexes above 15 in LBAFU, and
reject LBA format indexes greater than 63 for whole-controller
formats.  Per-namespace formats already validate the index against
NLBAF.

This is the same problem that llm-postcr reported in camcontrol's
copy of this code, fixed in 3892a6453fc6; the unmasked composition
originated here (635c517ae9ca).

Reported by:    llm-postcr
Reviewed by:    imp
Fixes:          https://cgit.freebsd.org/src/commit/?id=2c41f7d8a034
MFC after:      1 week
Sponsored by:   Spectra Logic
Assisted-by:    Claude Fable 5 <noreply@anthropic.com>
Differential Revision:  https://reviews.freebsd.org/D61356
eae727676169de58052fd512ebb0ee565ad6e246 Kenneth D. Merry 2026-11-09 19:35:00

debug: classified in 03-filenames_plain1 by 'sbin/'


nvmecontrol: Range-check the format command's field values

The format command accepted any 32-bit value for -m, -p, -l and
--ses and passed it into the Format NVM command.  Before
eae727676169 an out-of-range value spilled into the adjacent cdw10
fields, which usually drew an error from the controller; after it,
the value is masked to the field width, so a mistyped value is
silently accepted with a different meaning.  Most seriously,
--ses 8 masked to SES=0 and performed a plain format with no erase
at all, exiting 0.  A value like --ses 10 masked to a cryptographic
erase while bypassing the FNA cryptographic erase capability check,
which compares the unmasked value.

Reject values outside the ranges nvmecontrol.8 documents, which are
the values the spec defines: 0-1 for -m and -l, 0-3 for -p, and
0-2 for --ses.  The checks run at option validation time, before
the device is opened, and the capability check now only ever sees
valid values.

While here, document --ses in nvmecontrol.8; it was missing from the
format subcommand's option list.

Reported by:    llm-postcr
Reviewed by:    imp
Fixes:          https://cgit.freebsd.org/src/commit/?id=eae727676169
MFC after:      1 week
Sponsored by:   Spectra Logic
Assisted-by:    Claude Fable 5 <noreply@anthropic.com>
Differential Revision:  https://reviews.freebsd.org/D61406
3d6f886151f9ee6f3bf16ea3367a4b540df3f911 Kenneth D. Merry 2026-11-10 21:12:21

debug: classified in 03-filenames_plain1 by 'sbin/'

ppp: bound IPCP IP-Address replies to the reply buffers
`ipcp_ValidateReq()` appended `IP-Address ack/nak/reject` records to the fixed `fsm_decode` buffers without a bound check. A `Config-Request` with ~17 or more `IP-Address` options overran a buffer into its own end pointer, so later writes could go wherever the peer chose.

Emit the option through `fsm_ack()/fsm_nak()/fsm_rej()` like the other options.

Reviewed by:    markj
Approved by:    adrian (mentor)
Signed-off-by:  Nick Price <nprice@FreeBSD.org>
Differential Revision:  https://reviews.freebsd.org/D61326
dfdc0cfda058ea8ff8ed3ef1a7e249786627029f Nick Price 2026-11-11 02:26:56

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

rc: Generate ML-DSA44/Ed25519 host keys by default
Commit bd9d7cdd1420 ("OpenSSH: Update to 10.5p1") introduced support for
ML-DSA44/Ed25519 host keys.

Generate these keys by default when the sshd service is first started.

Reported by:    Herbert J. Skuhra
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D61433
74ae9accdc2f9be13c8dab27c94ed42f6a7c8360 Jose Luis Duran 2026-11-11 14:41:47

debug: classified in 03-filenames_plain1 by 'libexec/'

nuageinit: Add support for uid
Adds support for specifying an explicit UID when creating users through nuageinit. Both numeric and string UID values are supported. Invalid or negative UIDs are rejected. The new uid option is documented in nuageinit(7). Existing automatic UID allocation remains unchanged when no UID is specified. A UID already in use or out of range is left to pw(8) to reject.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293716
Reported by:    Einar Bjarni Halldórsson <einar@isnic.is>
Reviewed by:    dtxdf, bapt
Signed-off-by:  Kushagra Chauhan <zenzesama@gmail.com>
Differential Revision:  https://reviews.freebsd.org/D61174
eca5b28692eac5ae597eff6a13629c17c1e40ace Kushagra Chauhan 2026-11-03 23:48:00

debug: classified in 03-filenames_plain1 by 'libexec/'

bhyve: rfb: do not destroy a mutex that was never initialized
rfb_init()'s error path tests pixfmt_mtx against NULL, which only
compiles where pthread_mutex_t is a pointer, and destroys it.  Every
jump to that label is before the mutex is initialized, so there is
nothing to destroy.  The test and the destroy came in with the
SetPixelFormat support (D46402).

Signed-off-by:  Wanpeng Qian <wanpengqian@gmail.com>

Fixes:          https://cgit.freebsd.org/src/commit/?id=dda0f9837b1c ("bhyve: support noVNC SetPixelFormat request")
Reviewed by:    markj
MFC after:      1 week
Sponsored by:   keelos.dev
Differential Revision:  https://reviews.freebsd.org/D61425
e1e4790d7de20f28683031ac806adb6abbafe867 Wanpeng Qian 2026-11-11 15:05:50

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

bhyve: nvme: initialize the AEN condition variable
aen_cond is used with pthread_cond_wait() and pthread_cond_signal() but
never initialized.  That works where a zeroed pthread_cond_t is
initialized on first use; elsewhere pthread_cond_wait() fails at once
and aen_thr() spins with aen_mtx held.

Signed-off-by:  Wanpeng Qian <wanpengqian@gmail.com>

Reviewed by:    markj
MFC after:      1 week
Sponsored by:   keelos.dev
Differential Revision:  https://reviews.freebsd.org/D61424
b3860403a7cfbd32e4b21f214c2d3a46ef1a27b9 Wanpeng Qian 2026-11-11 15:06:53

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

periodic: Fix empty output check
The empty_output variable is normalized to YES or NO, but we were
comparing it to TRUE, so the comparison always failed no matter what it
was set to.  Compare it to YES instead.

This feature has been disabled since 2007, so flip the default to NO to
preserve the current behavior.  Adjust the documentation accordingly.

Relnotes:       yes
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300676
MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=68c35072f914 ("Add an option to make periodic(8) quiet when no output was generated.")
Reviewed by:    ivy, emaste
Differential Revision:  https://reviews.freebsd.org/D61435
004bba2b6b0ea5313480be65bc9506c5628e5a78 Dag-Erling Smørgrav 2026-11-11 18:07:57

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

Commit group #61: tftpd
tftpd: Fix off-by-one in get_field()

Due to a logic error, get_field() would behave as if the passed-in size
was one greater than it actually is.  Fix it so it always fails if no
terminating NUL is found within the buffer, instead of succeeding if the
first byte past the end is a NUL.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D61032
14541ca2bf3766e659a22c5ea9ed3dc2d5f11fa5 Dag-Erling Smørgrav 2026-11-11 19:45:14

debug: classified in 03-filenames_plain1 by 'libexec/'


tftpd: Keep proper track of header length

When parsing a header, keep track of the length of the unparsed portion
and pass that to get_field() instead of the length of the entire header.

Reported by:    n0ps1ed
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D60902
579e428a551a11b43e341297dd0ef9d38c4fcda7 Dag-Erling Smørgrav 2026-11-11 19:45:18

debug: classified in 03-filenames_plain1 by 'libexec/'


tftpd: Keep proper track of option length

When parsing options, keep track of the length of the unparsed portion
and pass that to get_field() instead of the length of the entire header.

While here, switch both make_options() and parse_options() to using
size_t for sizes and lengths.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D61048
35cd70490f4b7ec1921db980ae3992192e4cbfbb Dag-Erling Smørgrav 2026-11-11 19:45:24

debug: classified in 03-filenames_plain1 by 'libexec/'

loader.efi: Allocate ram disks as EfiReservedMemoryType
The kernel adds EfiLoaderData ranges to physmap and reuses the pages, so a
memdisk=root is overwritten while the system runs. The kernel skips
EfiReservedMemoryType, which ACPI requires for a registered RAM disk.

Fixes:          https://cgit.freebsd.org/src/commit/?id=85fb40bad584
Reviewed by:    imp
Approved by:    imp
Sponsored by:   Netflix
Differential Revision:  https://ron-dev.freebsd.org/FreeBSD/src/pulls/96
46c2d93c572865f6441788ad8416ff7ff971829a Olivier Cochard 2026-11-08 20:35:08

debug: classified in 03-filenames_plain1 by 'stand/'

stand: Accept any device name in disk_parsedev()
disk_parsedev() only accepted names starting with "disk" or "vdisk", so other
DEVT_DISK devices using disk_fmtdev() could print a name they could not parse
back, e.g. "md0s2a:".
Skip any alphabetic prefix instead; devparse() has already matched it to the
devsw.

Reviewed by:    imp
Approved by:    imp
Sponsored by:   Netflix
Differential Revision:  https://ron-dev.freebsd.org/FreeBSD/src/pulls/97
d687c9fc7efe55d1ba7bc7bea056352ce0437588 Olivier Cochard 2026-11-08 21:34:05

debug: classified in 03-filenames_plain1 by 'stand/'

loader.efi: Give the md probe a struct disk_devdesc
probe_md_currdev() named md through set_currdev_devsw(), which builds a plain
struct devdesc. Once md uses disk_fmtdev(), that reads d_slice and d_partition
past the end of the struct, and currdev becomes a name built from stack garbage.

Use a struct disk_devdesc instead, and open the device first so the name shows
the slice and partition actually found. When the image has no partition table,
fall back to the whole image, as before.

Add md_get_size() and move MD_BLOCK_SIZE to bootstrap.h so main.c
can open the device.

Reviewed by:    imp
Approved by:    imp
Sponsored by:   Netflix
Differential Revision:  https://ron-dev.freebsd.org/FreeBSD/src/pulls/98
9ff8ab26dcacebb50183c5bd767e7c5939116598 Olivier Cochard 2026-11-08 21:39:43

debug: classified in 03-filenames_plain1 by 'stand/'

loader: Read the partition table of md images
md is a DEVT_DISK device but never called disk_open(), so reads always started
at offset 0 of the image. A partitioned image, such as a memstick image booted
memdisk=, has its partition table there, not a filesystem, and the loader stops
with "MD not present".

Reviewed by:    imp
Approved by:    imp
Sponsored by:   Netflix
Differential Revision:  https://ron-dev.freebsd.org/FreeBSD/src/pulls/99
6046a35b71c297ebe64a766c0d5c04fb62fc0f5f Olivier Cochard 2026-11-08 21:44:38

debug: classified in 03-filenames_plain1 by 'stand/'

loader.efi: Free the unused tail of the memdisk buffer
The buffer is sized from a guess, 4x the compressed size for most formats, so
free the pages past the image once it is complete.

Reviewed by:    imp
Sponsored by:   Netflix
Differential Revision:  https://ron-dev.freebsd.org/FreeBSD/src/pulls/100
a2adf568cdfe83d8aca49f9eb9ba7891e88ff3cd Olivier Cochard 2026-11-08 22:14:52

debug: classified in 03-filenames_plain1 by 'stand/'

Commit group #62: snmp_hostres(3): strengthen work on the devd(8) socket
snmp_hostres(3): strengthen work on the devd(8) socket

Use the SOCK_SEQPACKET version of the socket.  This guarantees that
messages read won't be glued together.  Use sufficient buffer size to
read any message.

Close socket on any kind of error or a short read.

This also fixes a bug when a SOCK_STREAM socket containing exactly
multiple of 512 bytes would block the daemon in read(2) until some
other devd(8) event.  Thank to David for catching and analyzing it.

Reported by:            David Pfitzner <dpfitzner@netflix.com>

Reviewed by:            imp
Differential Revision:  https://reviews.freebsd.org/D61146
4edbd4e35c4e0fb7cf10ed5e9b12a2b76bef2cec Gleb Smirnoff 2026-11-13 02:37:33

debug: classified in 04-filenames_plain2 by 'usr.sbin/'


snmp_hostres(3): check if sysconf(3) fails

While here inline single time use function.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=4edbd4e35c4e0fb7cf10ed5e9b12a2b76bef2cec
b352368bfbe85aa73840c4b8d161bcffbc242ca3 Gleb Smirnoff 2026-11-14 19:50:40

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

bhyve/riscv: fix PCIe FDT interrupt-map entry stride
In bhyve arm64, each PCIe interrupt-map entry spans 10 cells because the
ARM GIC specifies #interrupt-cells = 3. On RISC-V, the APLIC uses
#interrupt-cells = 2, so each entry spans only 9 cells.

When the PCIe FDT code was originally adapted from arm64, the property
allocation size and cell assignments were reduced to 9 cells per entry,
but the loop multiplier retained the 10-cell stride. This caused the
interrupt-map array to be packed incorrectly with gaps, breaking PCI
interrupt routing in guest operating systems and overflowing the
allocation by 16 cells.

Correct the loop stride to 9 cells so the interrupt map is properly
formed.

Reviewed by:    jrtc27
Fixes:          https://cgit.freebsd.org/src/commit/?id=7ab1a32cd43c ("bhyve/riscv: Initial import")
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D61473
fabdac3abcbb06551415ca64b69b0e29946834f9 Doongar Singh 2026-11-13 12:35:14

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

nuageinit; Skip SSH keys and doas/sudo if adduser fails
Previously we would still try to add SSH keys after a failed adduser,
which would result in an uncaught Lua error, causing the remainder of
the setup to be skipped.

Reported by:    llm-postcr
Reviewed by:    dtxdf, bapt
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61441
d9fa6016011efe39022a25f26783590690aa2fe2 Ed Maste 2026-11-11 15:51:55

debug: classified in 03-filenames_plain1 by 'libexec/'

sysconf: Add ucl and pkg targets
ucl reads and rewrites Universal Configuration Language files with
libucl(3), the private library pkg(8) links, so what sysconf reads is
what pkg reads. Each file is parsed on its own and every scalar is
addressed by its dotted path (FreeBSD-ports.enabled); the last file
to define a path is authoritative. A write changes only the one
statement, in the file's own separator, terminator, quoting, and
boolean style, then re-parses the result with libucl and refuses the
write unless the parsed contents differ in exactly the requested key.
Removing the last key of an object removes the object.

Arrays are leaves, read back as compact JSON. name+=word and
name-=word on an array add and strike elements. Under an array a
path component is an index, as uclcmd(1) spells it: name.i reaches
one element (name.i=value sets it, name.i+=word edits it, -x name.i
strikes it), name.i.j reaches into a nested array, and name.# is the
count (name.#=value appends). A negative index counts from the end.
Under an object the same component is a key, so a key named 404 or #
or * is addressed as written. A key the library cannot take bare is
written quoted; a file that leaves such a key bare, as uclcmd(1) may,
is still read. An element is added or taken out on its own line in
the style of its neighbours, a trailing comment going with a struck
line as a sysrc(8) removal would take it.

pkg is ucl over the files pkg(8) reads: /etc/pkg/*.conf,
/usr/local/etc/pkg.conf, and /usr/local/etc/pkg/repos/*.conf. Files
under /etc/pkg are read-only; a repository key found there is
overridden in /usr/local/etc/pkg/repos/FreeBSD.conf, created in the
base file's style, and a global key goes to pkg.conf. `pkg config`
only reads, and `pkg repositories` enable/disable records a side file
under the package database, so neither covers `sysconf pkg` ability.

The pkg keyword makes `p' ambiguous with poudriere; pk and po select
them.

Co-authored-by: Devin Teske <dteske@FreeBSD.org>
Reviewed by:    dteske
Approved by:    dteske (mentor)
Differential Revision:  https://reviews.freebsd.org/D61064
6871285f194d3f83fd270b4b5d5783503c2b86d6 Faraz Vahedi 2026-11-15 10:53:54

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

loader.efi: Clear the zstd stream pointer in zstd_fini()
do_download_ramdisk() calls decomp_fini() a second time to free the buffer when
it gives up after a finished download, so zstd freed its strem twice and libsa
libsa panicked. Clear the pointer like xz_fini().

Reported by:    llm-postcr
Reviewed by:    imp
Approved by:    imp
Fixes:          https://cgit.freebsd.org/src/commit/?id=afee781523e4 ("loader.efi: Recognize new memdisk=<url> and memcd=<url> options")
Sponsored by:   Netflix
cf58c8667cfd1fd4e866a0609918d6e44960dd6e Olivier Cochard 2026-11-12 11:27:45

debug: classified in 03-filenames_plain1 by 'stand/'

ubldr: Pass the whole loaderdev name to disk_parsedev()
p - 4 is one byte before the string for 3-letter types, so whether
loaderdev=mmc0p2 parsed depended on that byte. disk_parsedev() now skips any
name prefix itself.

Reported by:    llm-postcr
Reviewed by:    imp
Approved by:    imp
Fixes:          https://cgit.freebsd.org/src/commit/?id=d18ed8e19c3c ("stand: Try to parse vdisk correctly")
Sponsored by:   Netfix
Differential Revision:  https://ron-dev.freebsd.org/FreeBSD/src/pulls/105
70cf7c62ee14f54c5c0a4d3aea8be35e36166d58 Olivier Cochard 2026-11-12 10:54:22

debug: classified in 03-filenames_plain1 by 'stand/'

nuageinit: Skip ssh keys if default user adduser fails
Commit d9fa6016011e ("nuageinit; Skip SSH keys and doas/sudo if adduser
fails") handled nil return from a failing adduser when adding secondary
users, but the same issue also existed in the default user handling.

Reported by:    llm-postcr
Reviewed by:    dtxdf
Supported by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61511
b3b73816f531624e73789e6b911e01881f578be2 Ed Maste 2026-11-13 16:09:27

debug: classified in 03-filenames_plain1 by 'libexec/'

uefisign: use ASN1_STRING_set0() instead of ASN1_STRING_set()
Prepare for future OpenSSL API changes.

OpenSSL 4.1 deprecates ASN1_STRING_set. Move to ASN1_STRING_set0 which
requires the DER buffer to be allocated with OPENSSL_zalloc so ownership
can be assumed by the string.

Reviewed by:            imp
Differential Revision:  https://reviews.freebsd.org/D61532
4ce723fb2550241970a58491b969ac3a7ac7127b Gordon Tetlow 2026-11-08 03:50:44

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

bhyve: e82545: deassert the interrupt when its last cause is masked
A write to IMC only cleared the bits in the mask.  If the device was
asserting INTx for a cause that the write masked, the line stayed up
until the guest cleared the cause in ICR.  The hardware deasserts INTx
as soon as no unmasked cause is left, and a guest may rely on that:
Windows masks all causes and unloads its driver when it shuts down, and
then spends its time in the handlers of whatever shares the interrupt.

Do what the comment in the code asked for.

Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>

Reviewed by:    jhb
Sponsored by:   keelos.dev
Differential Revision:  https://reviews.freebsd.org/D60230
596a470a1baa5c828ab78918ce4301a96a057f4c Wanpeng Qian 2026-11-16 17:52:42

debug: classified in 04-filenames_plain2 by 'usr.sbin/'

ipfw: print the log, not the config, for "nat <name> show log"
Add a test too.

Reviewed by:    ae
Fixes:          https://cgit.freebsd.org/src/commit/?id=d6164b77f8b7 ("Make ipfw_nat module use IP_FW3 codes.")
Found with:     Claude Opus 4.8
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D61588
611046b15dbb92226c346cfbd61dffb4b402b4f6 Maxim Konovalov 2026-11-14 13:25:45

debug: classified in 03-filenames_plain1 by 'sbin/'

Libraries

libc/stdlib/getenv.c: always allocate new environment
in particular, if the old environment is NULL.

Among making it less surprising for userspace to observe NULL environ,
the change also prevents NULL deref in __rebuild_environ() when
terminating the empty as NULL environment with the NULL pointer.

Reported by:     Leo Bicknell <bicknell@ufp.org>
PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298747
Reviewed by:    emaste, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D59996
dec68aeff8ce0ce154e93325a74bba6af71c87af Konstantin Belousov 2026-09-24 18:30:57

debug: classified in 04-filenames_plain2 by 'lib/'

libpfctl: remove the state getters that do not take a handle
Nothing in the tree calls any of the three.  Remove them rather than
fix them: pfctl_get_states_h() does the same with the handle that the
caller has.  pfctl_free_states(), struct pfctl_states and the list
entry in struct pfctl_state were there for pfctl_get_states() alone,
and go with it.

Reviewed by:            kp
Approved by:            kp (mentor)
Fixes:                  https://cgit.freebsd.org/src/commit/?id=2a478dfc7f9c ("libpfctl: retrieve family id only once")
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60248
a5b1b2d2c5e585364809fdf8f165d6dc742faadb R. Christian McDonald 2026-10-04 12:06:10

debug: classified in 04-filenames_plain2 by 'lib/'

libcasper: tolerate kernels without PD_NOWAITPID
Commit 1a296762b3d0 made libcasper pass PD_NOWAITPID to pdfork(2).
Kernels predating the flag (15.1 and earlier, since the flag first
ships in 15.2) reject it with EINVAL, which makes cap_init() and every
service fork fail when a newer world runs on an older kernel, for
example in a poudriere jail.

Add casper_pdfork(), which retries without the flag on EINVAL, and use
it at both pdfork(2) call sites.  The retry is safe because the kernel
validates pdfork flags before creating a child.  On such kernels the
zombie must still be reaped with waitpid(2), as before the flag was
introduced.

The fallback is compiled out once __FreeBSD_version reaches 1700000,
so it disappears from main when stable/16 branches while remaining in
the stable/15 and stable/16 branches that need it.

Reviewed by:    kib
MFC after:      3 days

Differential Revision: https://reviews.freebsd.org/D60401
b4e2c9abaf14d6eabbce59656d448c064e0dc40b Xin LI 2026-10-06 07:17:21

debug: classified in 04-filenames_plain2 by 'lib/'

lib80211: fix build with eXpat 2.9.0
eXpat 2.9.0 deprecates XML_GetCurrentLineNumber() in favour of
XML_GetCurrentLineNumber64().  The new function behaves the same
as the old one but is not prone to 32 bit integer wrap-around.
657c089950a0388811c7ba3f6d3e7127c297864e Philip Paeps 2026-10-06 03:14:03

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: Consume error in check_and_init_mutex
MFC after:      2 weeks
192781bf5d047cceff3a1947bfc754c8b5eb0835 ShengYi Hung 2026-10-06 23:08:42

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: Do not rely on UB in counter
counter + 1 > 0 is a undefined behavior and nobody guarantee that it
will be honestly perform by the compiler that counter + 1 will always be
INT_MIN. We switch to INT_MAX check instead to provide a deterministic
result.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60426
1d21e67e720a08992e81d626cff9d76524a81f22 ShengYi Hung 2026-10-07 01:41:55

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: reject count < 0
This causes count == -1 spin for INT_MAX times in userspace.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60425
627e7d5b72cf967eae3cd9e9e0707ce0ff63a4da ShengYi Hung 2026-10-07 01:30:56

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: Reorder pthread mutex to prevent false sharing
On a 64 byte cache line CPU (amd64), m_owner is contended by all of
the shared processes. However, after finding one winner, mtx is
enqueued, which trigger a cache refresh from other processors. Reorder
mtx so that m_lock and m_qu will not be in the same cache line.

Notice that this doesn't affet arch that expose 128 bytes cache line
line aarch64 or powerpc.

Reviewed by:    kib, markj
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60434
99edcc3bd52614c6cf972ea8424a7807ed3fe1e3 ShengYi Hung 2026-10-07 07:22:13

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: Fix some bugs in trylock
1. When contester > 2, a release causes kernel set CONTENTION bit but
   with no owner. In this case, the userspace should be able to try the
   lock instead of fall immediately. We copy this from trylock2.
2. A PI mutex should consult to kernel instead of decided by userspace
   itself.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60427
de2c0f157a9cce0b763da9ae97ada870fa4d1824 ShengYi Hung 2026-10-07 02:30:48

debug: classified in 04-filenames_plain2 by 'lib/'

libsysdecode: Fix some cpp conditionals
While testing the bare values happens to work, the intent is to test
for their definition.

Reviewed by:    emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=9a16bd169e8c ("libsysdecode: support errno and syscalls for arm64 Linux")
Fixes:          https://cgit.freebsd.org/src/commit/?id=b69ae1a34c6f ("libsysdecode: Add preliminary support for decoding Linux syscalls")
Differential Revision:  https://reviews.freebsd.org/D60415
23be969c12b2c2bb879aa1f2d606478a67a20852 John Baldwin 2026-10-08 15:21:06

debug: classified in 04-filenames_plain2 by 'lib/'

openssl: make libcrypto export the same symbols as upstream
Make the libcrypto Version.map export the same symbol names as upstream
3.5.8 (and 3.5.9, no new symbols were added).

Remove 52 names that upstream does not export:
- the internal threading and record layer functions (ossl_crypto_*,
  ssl3_cbc_*, tls1_cbc_*), which only libssl used;
- the internal WPACKET_quic_* functions;
- OPENSSL_cpuid_setup;
- ASN.1 item functions that are not in util/libcrypto.num.

Add 7 public names that were missing (ASYNC_get_mem_functions,
ASYNC_set_mem_functions, CMS_EnvelopedData_it, EVP_CipherPipeline*) to
OPENSSL_3_5_0, where the other symbols from upstream 3.1 to 3.5 are.

EC_GFp_nistp224_method, EC_GFp_nistp256_method and
EC_GFp_nistp521_method stay unexported (see 6f6446b33064).

Compatibility: libssl.so.35 from earlier builds imports the removed
internal symbols, so it does not load with this libcrypto.so.35.
libcrypto and libssl must be updated together.  This change needs the
previous libssl change, which gives libssl its own copies.
Nothing in the base system imports a removed symbol.

Reviewed by:    ngie, markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60397
c01c0a27cb82ca40ed507889c8f78fb2dcf76568 Gordon Tetlow 2026-10-08 21:10:10

debug: classified in 03-filenames_plain1 by 'secure/lib/'

libthr: Support disable spinloop
Like yieldloops, we shoulde be able to set _thr_spinloops to zero.
Originally, it makes us to enformce default spin time even if we try to
disable it. Make MUTEX_ADAPTIVE_SPINS a one time initialization now.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60486
305c3044e0249ea24a9b4571dfa6ae319a5bcdec ShengYi Hung 2026-10-08 18:38:06

debug: classified in 04-filenames_plain2 by 'lib/'

libpfctl: Fix the counts returned by pfctl_ina_define()
The counts of a table definition were stored only if the caller's
variables already held a non-zero value, and read uninitialised ones
otherwise.  pfctl_ina_define() passes the address of two uninitialised
locals and sums them up.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=219ce3063840 ("pf: convert DIOCRINADEFINE to netlink")
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60614
5fc8fe3df5b9ede9e1cc1e35a0d10e6390b030d9 R. Christian McDonald 2026-10-11 14:46:41

debug: classified in 04-filenames_plain2 by 'lib/'

libpfctl: Return max_win and mss of state peers
The kernel sends PF_STP_MAX_WIN and PF_STP_MSS for both peers of a
state, but struct pfctl_state_peer has no fields for them and libpfctl
dropped them.  Add the fields and parse the attributes.

Reviewed by:            kp
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60544
9664345efb8bb598536fd069c0dd797fc60ce1d2 R. Christian McDonald 2026-10-13 14:48:15

debug: classified in 04-filenames_plain2 by 'lib/'

lib/libifconfig: Fix pointer-sign warnings
Fix all pointer-sign warnings generated when compiling libifconfig.

A couple more snuck in while the previous batch of fixes was landing.

Fixes:          https://cgit.freebsd.org/src/commit/?id=963f1a5455c9 ("ifconfig: add CMIS support for 400GbE optics")
Reviewed by:    kevans
Approved by:    kevans (mentor)
Differential Revision:  https://reviews.freebsd.org/D60573
a3c57739ca07c655fbb0f9e7ddd38968186b8a76 Ryan Moeller 2026-10-13 16:41:52

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: Fix LIBPTHREAD_QUEUE_FIFO range
LIBPTHREAD_QUEUE_FIFO is used in bitwise offset, we set the limit to
0~31 so that it won't cause undefined behavior. Also, create a new
helper function to do getenv++strtol directly and check the boundary of
the valid value.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60487
5fb07bbcd5d5d9a865d9e7765fb93e9ba5edef1c ShengYi Hung 2026-10-08 18:53:06

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: Remove deadcode in join_common
The while loop previous can only be break when ret == ETIMEDOUT. They
never produce EBUSY. Remove the deadcode here.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60711
a0e152973613e0d0d55257f4e1f614509b7ec4c9 ShengYi Hung 2026-10-13 19:41:00

debug: classified in 04-filenames_plain2 by 'lib/'

sbuf(3): increase test coverage
This change adds additional explicit test coverage for the following
sbuf(3) APIs:
- sbuf_clear_flags
- sbuf_get_flags
- sbuf_set_flags

While here, add a missing `sbuf_delete` to `sbuf_drain_ret0_test`: while
it isn't strictly required (the library's state is cleaned up shortly
after the test process ends), tools such as Coverity and LSAN flag
issues with leaked memory. Adding the sbuf_delete(3) call to the test
quells that issue.

MFC after:      1 week
Reviewed-by:    ngie
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2367
642b3d965eb6ef3ecf733950e66fad565a27c967 Joao Bonifacio 2026-08-09 22:43:26

debug: classified in 04-filenames_plain2 by 'lib/'

sbuf(3): clean up tests
- Update the copyright dates and add "Joao Bonifacio" to the top of
  `sbuf_core_test.c`.
- Use `SPDX-Identifier` instead of longform copyright tort.
- Remove `sbuf_test_common.h`: the header was originally added to help
  with the 10.x/11.x split, but is no longer needed given that those
  releases have been EOLed for multiple years now.

MFC after:      1 week
3593be37a49e3f5268259bcc2af58cf730b08335 Enji Cooper 2026-10-18 18:24:20

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: drop use of try_gc in the end of thr_join
thr_try_gc unlock and lock again to make sure the lock order. However,
there is no reason for such roundtrip if the caller holds the correct
oder. As a result, we create a new helper function to add the thread
to gc list without unlock + lock and wire the join_common to this new helper.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60717
894f70a2bd8c7f67f131b76b9ce122a752818af3 ShengYi Hung 2026-10-13 22:40:05

debug: classified in 04-filenames_plain2 by 'lib/'

pam_exec: fix the stderr close test and avoid a double close
The cleanup tested cherr[0] when closing cherr[1].  The parent also closed
chin[0]/chout[1]/cherr[1] after pdfork() without clearing them, so the out:
cleanup path closed them again.  Clear each fd after closing and test the right
one.

Reviewed by:    des, markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60924
06abe08de45d251410949eac1bbb025367275260 Osvaldo Janeri Filho 2026-10-20 22:04:17

debug: classified in 04-filenames_plain2 by 'lib/'

libarchive: merge from vendor branch
libarchive 3.8.10

ChangeLog:
https://github.com/libarchive/libarchive/compare/v3.8.9...v3.8.10

Obtained from:  libarchive
Vendor commit:  0c48412be2d94afe1859a807ea7896a18d8900bd
MFC after:      3 days
61c70dc16a79efcb9db732d37706cd311f555d9a Martin Matuska 2026-10-26 21:47:32

debug: classified in 05-summary-prefix by 'lib.*:'

libthr/thr_mutex.c: make mutex asserts more useful
Print the file and line number of the caller where the assert fired.
Use _thread_exitf() directly for this.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
4ab9e73994e673e518d1b0631f8ce7d1faec6d80 Konstantin Belousov 2026-10-27 13:05:59

debug: classified in 04-filenames_plain2 by 'lib/'

libarchive: update config_freebsd.h
Fixes: use of external filter programs, tests
MFC after: together with 61c70dc16
d48b93e5e97593b3052684abf3e043a3a1c7822f Martin Matuska 2026-10-29 09:19:19

debug: classified in 04-filenames_plain2 by 'lib/'

libc: Fix stack buffer overflow in cgetnext()
`cgetnext()` copies a capability record's name field into a fixed
1024 byte on-stack buffer (`nbuf[BSIZE]`) one character at a time,
but never checks that the write pointer stays within the buffer.
Therefore, a record name that is longer than `BSIZE` (either on a
single line, or accumulated across several `\`-continued lines as
the pointer is not reset amidst continuation) writes past the end
of `nbuf` and smashes the stack.

The name field is read directly from the capability file, so any
consumer of `cgetnext()`/`cgetfirst()` that processes an untrusted
`termcap(5)`- or `printcap(5)`-style database (e.g. `cap_mkdb(1)`,
`lpr(1)`, or any third-party caller) can be exposed and hence made
to corrupt the stack.

Reviewed by:    fuz, dteske
Approved by:    fuz (mentor), dteske (mentor)
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2309
13bcc9a882603da216c7c38c086fcb501bd9d0ec Faraz Vahedi 2026-07-05 15:03:31

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: Deduplicate some rwlock code
1. abstime calculation
2. rdlock flags judgement

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60958
8e3a6d7f5aaf64c98fcd8896858492dc6b5b7fdb ShengYi Hung 2026-10-21 06:14:25

debug: classified in 04-filenames_plain2 by 'lib/'

Commit group #63: libthr: Robust tryjoin test
libthr: Robust tryjoin test

We cannot actually rely on a status (finish) before thr_exit. The
thread needs the kernel signal status=1 to userspace. Before that,
any tryjoin fails. The previous one works as we sleep 1 and should be
enough for normal case.

Reviewed by:    kib, markj
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60832
56a490f9c5e64f2ee346fc93332c7ab78f9237c4 ShengYi Hung 2026-10-18 02:15:18

debug: classified in 04-filenames_plain2 by 'lib/'


libthr: Add missing include header

Fixes:          https://cgit.freebsd.org/src/commit/?id=56a490f9c5e6 ("libthr: Robust tryjoin test")
MFC after:      2 weeks
6a65632e1a6aeb4277769ae7cc38c076fb1a5146 ShengYi Hung 2026-10-29 19:14:50

debug: classified in 04-filenames_plain2 by 'lib/'

libc: provide the declaration for __libsys_errno in libc_private.h
Reviewed by:  aokblast, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60838
7f309ac03989032903cce945a743a6046e496b10 Konstantin Belousov 2026-10-19 22:18:24

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: fix the race between pthread_getname_np() and thread exit
The exiting thread frees the thread name in exit_thread() without
holding the thread lock.  This makes it possible for a thread doing
pthread_getname_np() to observe the non-null thread->name and try to
copy its content, accessing the memory after free.

Set the thread->name to NULL under the thread lock.  Note that other
thread might still set the exiting thread name, until the PS_DEAD state
is assigned.  Since code should not call free() after
_malloc_thread_cleanup(), re-check thread->name in _thr_free().

Reviewed by:    aokblast, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60838
49e0c6270c73f1570efc67028004db9da56da2d1 Konstantin Belousov 2026-10-19 21:59:52

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: pthread_query_np(3) and pthread_query_all_np(3)
Reviewed by:  aokblast, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60838
588bd8bb6c1331dad1bbe1cf222db970f6476c44 Konstantin Belousov 2026-10-18 09:46:56

debug: classified in 05-summary-prefix by 'lib.*:'

libthr: test pthread_query_np(3) and pthread_query_all_np(3)
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60838
9bd30915963157d975969649f8b3143408ecdf3c Konstantin Belousov 2026-10-22 21:28:43

debug: classified in 04-filenames_plain2 by 'lib/'

libpfctl: add pfctl_open_from_nl_fd() and pfctl_nl_fd()
pfctl_open_from_nl_fd() opens the pf device as pfctl_open() does but,
when given a descriptor, adopts it as the Netlink socket instead of
creating one. The handle's sequence numbers start at a random value:
replies are matched by sequence number, so a random start makes it
improbable that a reply an earlier owner of the socket left unread is
taken for the answer to one of ours, or one of ours for theirs, however
many times the socket has been handed on. pfctl_open() becomes a
wrapper that passes -1.

pfctl_nl_fd() returns the handle's Netlink descriptor, as pfctl_fd()
does for the device, so a caller can hand it to a child process.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291981
Signed-off-by:  Avinash Duduskar <avinash.duduskar@gmail.com>
Reviewed by:    kp
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2508
727e413ff3f18af8788ea78043b506e0111bfadc Avinash Duduskar 2026-10-26 14:38:10

debug: classified in 04-filenames_plain2 by 'lib/'

msun: fix behaviour of nextafter*() and nexttoward*() for MAX value
For an edge case at an extreme, e.g., nextafter(-DBL_MAX,-INFINITY)
do not return x+x.  Instead, evaluate x+x and assign it to a volatile
to raise an exception, and then fall through to return the correct
result in current rounding mode.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299389
MFC after:      6 days (for inclusion into releng/15.2)
1fb5d8265bc4bbbf1f5bc79cc1d2a7f280b446b2 Steve Kargl 2026-10-31 10:18:06

debug: classified in 04-filenames_plain2 by 'lib/'

libusb: Add SSP and SSPx2 enum support
Report the new kernel speeds as LIBUSB20_SPEED_SUPER_PLUS.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57195
1a382091363f6549d329c4de263d9f7618616c14 ShengYi Hung 2026-05-22 15:37:22

debug: classified in 04-filenames_plain2 by 'lib/'

libfetch: Use C locale for dates
MFC after:    1 week
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299084
Reviewed by:    arrowd, kevans
Differential Revision:  https://reviews.freebsd.org/D60901
581d5098ec2c9738db8a98bb1ef3c36ca33033b9 Dag-Erling Smørgrav 2026-11-02 12:27:46

debug: classified in 04-filenames_plain2 by 'lib/'

libfetch: Apply timeout to SSL handshake
When the SSL handshake cannot proceed because the server is slow to
respond, poll() with a timeout instead of spinning.

MFC after:      1 week
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298962
Event:          Oslo Hackathon 2026
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D60975
d6678851308d3cec767f07b0712a429cdc5895de Dag-Erling Smørgrav 2026-11-02 12:27:53

debug: classified in 04-filenames_plain2 by 'lib/'

libexpat: cath up with import of expat 2.10.0
Update expat_config.h and the libbsdxml(3) manpage to reflect the most
recent import.

MFC after:      3 days
MFC with:       765f30b9f3af
a377d25bd25c0739d50c4dfe34ec2066821018d3 Philip Paeps 2026-11-03 00:59:30

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: Return EDEADLK if it is held by ourself
Reviewed by:    kib, markj
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60959
6071292d39ab1b571b7e6b6858c4b59b652784d7 ShengYi Hung 2026-10-21 06:09:00

debug: classified in 04-filenames_plain2 by 'lib/'

libc/locale: Check EILSEQ return
_citrus_iconv_std_iconv_convert can return EILSEQ without setting
invlen. As a result, we should check EILSEQ in the return value or it
will incorrectly return -2

Reviewed by:    kevans
Fixes: https://cgit.freebsd.org/src/commit/?id=e2030ca246a7 ("libc: fix c*rtomb/mbrtoc*")
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D61151
b138d017c70421e9d074096fcc3ac676f7e1c846 ShengYi Hung 2026-11-03 05:54:14

debug: classified in 04-filenames_plain2 by 'lib/'

libsecureboot: add support for more signatures
For 2027 we need to support new, stronger signatures and hashes.

Re-work Makefile.inc and local.trust.mk to define
VE_SIGN_URL_LIST or VE_SIGNATURE_LIST (can be derrived from
VE_SIGN_URL_LIST) containing tuples of sig/method/hash/flags and
for VE_SIGN_URL_LIST the same plus /url.

From VE_SIGNATURE_LIST we derrive VE_SIGNATURE_EXT_LIST used to populate
signature_ext_list which defines the order in which we look for
signatures for a manifest.

We also populate signature_info_list which maps a signature ext to the
needed hash and flags to indicate whether that hash needs to be repeated.

verify_sig will lookup signature_info_list, no match means not
supported.  For asc we just call verify_asc() otherwise we call
verify_ec() or verify_rsa() depending on the key type found in the
certificate chain, we pass the signature_info entry to these so they
know which hash to use and whether to repeat it.

The need to repeat the hash is a consequence of sending a hash to a
server using signature methods that insiste on hashing their input.
To-date only our original ECDSA signatures use this.
A FakeHash class added in 2012 avoids that wrinkle.

This is a much more flexible arrangement and should be more
readily usable by others.

Sponsored by:   Hewlett Packard Enterprise Development LP.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D61007
9ca2cfeb4e4de98be0f165a12dba00de970d6f58 Simon J. Gerraty 2026-11-04 23:07:09

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: Cache recent pshared_key
For a pshare key, we can actually cache the last one as a fast path
instead of trapping into kernel directly. It makes sense as a lock and
unlock should be a pair on the same key and at the same time. For
example, lock(A) -> unlock(A) -> lock(B) -> unlock(B). Each unlock is
a hit and refresh later (50% hit).

For a single pshare lock, it is evne a 100% hit as the key never
changed.

For nested lock lock(A) -> lock(B) -> lock(C) -> unlock(C) ->
unlock(B) -> unlock(A). It only cache the last one. However, we should
really think about rewritting this logic as it is a pshare lock shared
by many processes and nested should be uncommon.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60957
7806832f23fb31d28386d42692b221776c9f4ee4 ShengYi Hung 2026-10-21 07:03:27

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: Predict libthr is initialized in _thr_check_init
_thr_check_init() is called on hot paths such as pthread_once(), and
the uninitialized case can only happen once. Mark it with
__predict_false so the compiler lays out the initialized case as the
fall-through path.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D61213
71937d8e11a6b7fdb3c1b308d5f7c8b30dac5ca7 ShengYi Hung 2026-11-05 15:58:18

debug: classified in 04-filenames_plain2 by 'lib/'

Commit group #64: libthr: Create landing pad in thr_once in C++ exception
libthr: Create landing pad in thr_once in C++ exception

In _thr_once, if init_routine fails with exception, the stack allocate
__cup will become invalid when unwinder walk back and free the stack of
thr_once. This cause cleanup linked list be dangling. In here, we give
the cleanup function a landing pad so that we td can correctly point
to previous cleanup function.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D61212
2734bbbcba3cd6ff2bf4382fb6e85b884beb966e ShengYi Hung 2026-11-05 00:03:01

debug: classified in 04-filenames_plain2 by 'lib/'


libthr: require both _Unwind_ForcedUnwind and _Unwind_GetCFA for !PIC

Static linking must bring in both symbols for the unwind to work.

The landing pads added by 2734bbbcba3c reference _Unwind_Resume and
__gcc_personality_v0. In a static link, these pull UnwindLevel1.o
from libgcc_eh.a, which also defines _Unwind_ForcedUnwind, but
not UnwindLevel1-gcc-ext.o, which defines _Unwind_GetCFA. Unless
something else pulls that object in, as libcxxrt does for C++ programs,
thread_unwind_stop() calls a NULL _Unwind_GetCFA on every thread exit.

Reported and tested by: dch
Fixes:  https://cgit.freebsd.org/src/commit/?id=2734bbbcba3c ("libthr: Create landing pad in thr_once in C++ exception")
Sponsored by:   The FreeBSD Foundation
9dae9b31d2c7834de72a27c6d635ebeab53cebc6 Konstantin Belousov 2026-11-06 14:26:18

debug: classified in 04-filenames_plain2 by 'lib/'

libc: Export timespec_getres(3) and add tests
timespec_getres() has been declared in <time.h> and built into libc,
but never listed in a symbol map.  It is therefore local to libc.so,
and dynamically linked callers fail to link.

Reviewed by:    ziaee, fuz, des
Approved by:    fuz (mentor)
Fixes:          https://cgit.freebsd.org/src/commit/?id=9b5d724cad10 ("libc: Add timespec_getres(3) as per C23.")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60799
3ac9299ee90cc7a6330c560d8c49d5151185f80e Faraz Vahedi 2026-11-05 20:09:01

debug: classified in 04-filenames_plain2 by 'lib/'

libsecureboot restore default trust anchors
If site.trust.mk does not set VE_SIGNATURE_LIST
initialize it based on content of VE_SIGNATURE_EXT_LIST
which is in turn initialized from TRUST_ANCHORS.

Sponsored by:   Hewlett Packard Enterprise Development LP

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D61245
b22b999afc2d1ecb320928c03f2d8e0f6ae1c1fe Simon J. Gerraty 2026-11-06 00:27:00

debug: classified in 04-filenames_plain2 by 'lib/'

libfetch: Use monotonic clock for timeouts
MFC after:    1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D61225
feab010f44143bda407438ede72f4b8e0c1bd15d Dag-Erling Smørgrav 2026-11-06 11:16:42

debug: classified in 04-filenames_plain2 by 'lib/'

openssl: build legacy provider as upstream does
- Build with libcrypto's compile flags: modules/Makefile.inc now
  includes libcrypto's Makefile.inc, which brings in Makefile.common
  (NDEBUG, the asm dispatch defines, OPENSSL_PIC, the directory
  defines).  Before this change, assertions were enabled in legacy.so.
- Use upstream's per-architecture source list: the provider's own CPU
  capability code (cpuid asm and armcap.c/ppccap.c, or mem_clr.c
  without asm), and the MD5, RC4 and DES asm where upstream uses it.
  The provider no longer uses libcrypto's exported RC4, SHA1 and
  CRYPTO_*128 functions.
- Drop the objects that upstream's linker leaves out of legacy.so
  (fcrypt_b.c, md5_one.c, md5_sha1.c, provider_err.c and
  ciphercommon_{ccm,gcm}*.c / ciphercommon_hw.c).  Without them,
  params_idx.c is not needed either.
- Add a version script, a copy of upstream's providers/legacy.ld, so
  that only OSSL_provider_init is exported.  Around 209 symbols were
  exported before.

Reviewed by:            ngie
MFC after:              2 weeks
MFC to:                 stable/15
Event:                  FreeBSD Vendor Summit 2026
Differential Revision:  https://reviews.freebsd.org/D60398
46453f0abb85c1c93dce7139950c6343a6cf04df Gordon Tetlow 2026-11-06 18:42:45

debug: classified in 03-filenames_plain1 by 'secure/lib/'

openssl: restore removed libcrypto symbols as compat symbols
c01c0a27cb82 (D60397) stopped exporting 52 names from libcrypto.so.35 that
upstream does not export.  Binaries and libraries linked against the
earlier libcrypto.so.35 can still import them; the libssl.so.35 from
15.0 and 15.1 imports 15 of them, so it fails to load with the new
libcrypto.

Provide all 52 again as non-default (compat) versions, in the version
nodes they had before: OPENSSL_cpuid_setup@OPENSSL_3_0_9, the others
@OPENSSL_3_5_0.  Existing consumers resolve them; new links cannot bind
to them.  The default exports do not change and still match upstream.

The wrappers live in a new FreeBSD-only file, compat.c.  Remove it at
the next SHLIB_MAJOR bump.

Reviewed by:            ngie
Fixes:                  https://cgit.freebsd.org/src/commit/?id=c01c0a27cb82 ("openssl: make libcrypto export the same symbols as upstream")
MFC after:              2 weeks
MFC to:                 stable/15
Event:                  FreeBSD Vendor Summit 2026
Differential Revision:  https://reviews.freebsd.org/D61229
f3b6bb1404906494e4ee24ae36a288942055177d Gordon Tetlow 2026-11-06 18:54:13

debug: classified in 03-filenames_plain1 by 'secure/lib/'

openssl: export only the engine entry points
Upstream links every dynamic engine with a version script,
engines/<name>.ld, that exports bind_engine and v_check and makes
everything else local.  FreeBSD's engines had no version script, so
they exported every global symbol, including _init and _fini.
loader_attic.so compiles its own copy of crypto/pem/pvkfmt.c and so
also exported 21 of its functions; 14 of them (b2i_*, i2b_*) have the
same names as public libcrypto functions.

Add one Version.map for all engines, the same as upstream's, and use it
from engines/Makefile.inc.

The engines are loaded only with dlopen(), and libcrypto looks up only
bind_engine and v_check, so hiding the other symbols does not affect
any consumer.

Tested via tinderbox: capi.so, devcrypto.so and loader_attic.so link
with --no-undefined-version and export only bind_engine and v_check.
devcrypto lists the same ciphers as before, and loader_attic loads and
reads a PVK RSA key through "openssl storeutl -engine loader_attic".

Reviewed by:            ngie
MFC after:              1 week
MFC to:                 stable/15
Event:                  FreeBSD Vendor Summit 2026
Differential Revision:  https://reviews.freebsd.org/D61273
769c49de261fbbd1293adab9188e5099516675cf Gordon Tetlow 2026-11-09 05:39:08

debug: classified in 03-filenames_plain1 by 'secure/lib/'

Commit group #65: libcasper: Use pdfork() for the zygote
libcasper: Use pdfork() for the zygote

Use pdfork(2) rather than fork(2) to fork the zygote, and close the
descriptor when the main loop terminates.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   Qualys, Inc.
Reviewed by:    oshogbo
Differential Revision:  https://reviews.freebsd.org/D60176
425e4c102f8aedfc7c439bb01d648aabac798888 Dag-Erling Smørgrav 2026-11-09 22:13:42

debug: classified in 04-filenames_plain2 by 'lib/'


libcasper: Use casper_pdfork()

Fixes:          https://cgit.freebsd.org/src/commit/?id=425e4c102f8a ("libcasper: Use pdfork() for the zygote")
d0fd70983b6b93d4a6a4671457619eb34786b38d Dag-Erling Smørgrav 2026-11-09 22:45:00

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: fix __thr_pshared_offpage() to not use cancellable close()
__thr_pshared_offpage() is used by pthread functions that must not be
cancellation points according to POSIX.  Use direct __sys_close() instead
of interposed close() there.

Fixes:  https://cgit.freebsd.org/src/commit/?id=1bdbd705993e ("Implement process-shared locks support ...")
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61343
e55d4398708623522ce773e0cd118180e2ee17fe Konstantin Belousov 2026-11-09 17:10:45

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: explain why pshared lock bumps locklevel
Reviewed by:  markj, aokblast
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61343
eff19ace066f133ed85a0e0c6cae5777d4b7db99 Konstantin Belousov 2026-11-09 16:37:11

debug: classified in 04-filenames_plain2 by 'lib/'

lib/libthr: add helper to check valid clockid to use with _umtx_op(2)
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
62e53516f73247d2ed80d8dc452f02d9a92575a0 Konstantin Belousov 2026-11-05 20:39:40

debug: classified in 04-filenames_plain2 by 'lib/'

pthread_cond_clockwait(3): explicitly reject unacceptable clockids
Otherwise they are rejected by kernel in do_wait(), reached through
_thr_sleep()/UMTX_OP_WAIT_UINT_PRIVATE on the user-mode path. Then,
since cond_wait_user() only leaves its loop on a wakeup, a cancellation
or ETIMEDOUT, the EINVAL from do_wait() results in a loop.

If hit, this indicates a bug in user code, but the system library
must be resilient to such misuse.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
8331d5a2fe967016343fb4322f1ed73e55ff9655 Konstantin Belousov 2026-11-05 21:38:37

debug: classified in 04-filenames_plain2 by 'lib/'

libthr cond_wait_user(): do not loop forever on clock error
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
e81badcfc010268d4935f4b4d28ebdbc0faebe0f Konstantin Belousov 2026-11-06 00:46:06

debug: classified in 04-filenames_plain2 by 'lib/'

pthread_mutex_timedlock(3): return EDEADLK on detected recursion attempt
for ERRORCHECK and ADAPTIVE_NP mutexes, instead of ETIMEDOUT. This is
explicitly specified by POSIX.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
bf2939ea60872d7791987d1727798e90eb904279 Konstantin Belousov 2026-11-05 22:01:18

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: add pthread_mutex_clocklock(3)
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
b7c2db4c772ba3c61f4760eca011332c9c12da1c Konstantin Belousov 2026-11-05 17:23:49

debug: classified in 05-summary-prefix by 'lib.*:'

libthr: add pthread_rwlock_clock{rd,wr}lock(3)
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
5577567bd0d0c695c25ddb4ea32b8c8231d8b0fe Konstantin Belousov 2026-11-05 17:24:12

debug: classified in 05-summary-prefix by 'lib.*:'

libthr: add tests for pthread_mutex_clocklock(3)
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
7689242d6bdf7f8633885795e6528f9d8f2f2428 Konstantin Belousov 2026-11-06 01:37:09

debug: classified in 04-filenames_plain2 by 'lib/'

libthr: add tests for pthread_rwlock_clock{rd,wr}lock(3)
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
083b44ddc07c6e07bcf889aa1f38c240d9dc0fc6 Konstantin Belousov 2026-11-06 01:38:17

debug: classified in 04-filenames_plain2 by 'lib/'

libthr mutex_self_lock(): handle signals and clock steps
Relocking an owned NORMAL mutex with an absolute timeout has two issues:
- nanosleep(2) is never restarted, so any caught signal causes
  an early ETIMEDOUT.
- If CLOCK_REALTIME or CLOCK_TAI are stepped backward during the sleep,
  the call also returns ETIMEDOUT before the clock reaches the deadline.

The kernel already polls CPU-time clocks and handles realtime steps.
Use _thr_umtx_timedwait_uint() in a loop to handle both issues.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61381
1b4779eef93c6e3c9af1887b941d7700ef143951 Konstantin Belousov 2026-11-10 03:07:01

debug: classified in 04-filenames_plain2 by 'lib/'

libfetch: Prepare for OpenSSL 4
* Always use libmd's MD5 since it's deprecated in OpenSSL.

* Use ASN1_STRING_get_length() instead of ASN1_STRING_length().
51d910a3e0b42e7d147f49776021a868330a1a8a Gordon Tetlow 2026-11-10 13:48:11

debug: classified in 05-summary-prefix by 'lib.*:'

unistd.h: sort sysconf(3) arguments
No functional change.  Keeping it sorted reduces chance of a collision.

Reviewed by:            kfv, imp
Differential Revision:  https://reviews.freebsd.org/D61345
343afa2118ba8aaa17da00e34868544018d9f33a Gleb Smirnoff 2026-11-13 02:37:17

debug: classified in 03-filenames_plain1 by 'include/'

libucl: Import libucl 0.10.0
Tested by:    ivy
Approved by:    bapt, ivy
Differential Revision:  https://reviews.freebsd.org/D61099
76e67376771892994ed44d791daf6cef3ce6c9bd Muhammad Moinur Rahman 2026-11-13 13:28:03

debug: classified in 05-summary-prefix by 'lib.*:'

liblua: Accept + and e in io.popen mode
Our popen(3) accepts more than the historical "r" and "w" types.  Define
the appropriate macro to provide a custom mode check accepting all valid
pipe types.

Reviewed by:    kevans
Approved by:    kevans (mentor)
Differential Revision:  https://reviews.freebsd.org/D61175
8bb34ce5c9f6fad11223dab31846b4377bf8472d Ryan Moeller 2026-11-12 04:52:38

debug: classified in 04-filenames_plain2 by 'lib/'

libifconfig: Fix SFP table generators for Lua 5.5
This fixes Lua 5.5 compat in the .c template, where the first loop
variable '_' becomes const in Lua 5.5.  Use select() to discard inside
the loop instead.

While here, fix a mismatched variable name in the corresponding header
template.

Reported by:    Austin Horstman <khaneliman12@gmail.com>
Reviewed by:    kevans
Approved by:    kevans (mentor)
Closes:         https://github.com/freebsd/freebsd-src/pull/2473
Differential Revision:  https://reviews.freebsd.org/D61455
3e297e9e5532aee36a77d57627915755afd8118f Ryan Moeller 2026-11-13 07:13:47

debug: classified in 04-filenames_plain2 by 'lib/'

libutil: Introduce fhexdump(3)
Extend hexdump(3) to write to a given stream.

Reviewed by:    kevans
Approved by:    kevans (mentor)
Differential Revision:  https://reviews.freebsd.org/D61177
70046933082e2e22646fb270320f070b59957b72 Ryan Moeller 2026-11-12 04:57:53

debug: classified in 04-filenames_plain2 by 'lib/'

stdio: Fix positional %F conversion
When a format uses positional arguments, __find_arguments() walks it
first to learn the type of every argument, and lists the floating
point conversions as A a E e f G g.  F is missing, so a double that
is only referred to through %F never gets a type, its slot in the
argument table stays unset, and the conversion reads whatever is
there:

    printf("[%1$F]\n", -INFINITY);   [0.000000]
    printf("[%1$F]\n", 1.5);         [0.000000]
    printf("[%F]\n", 1.5);           [1.500000]

With a width taken from another argument, "%1$*2$F", vsnprintf(3)
returned lengths like 2103024 for a ten character result; abseil's
str_format test allocates that much and was killed for it on
FreeBSD.  The same format with %1$f, or with any other conversion of
the same argument, works because those give it a type.

Add F ahead of f in both __find_arguments() and __find_warguments(),
and test %F, plain and positional, in snprintf_test and
swprintf_test.

MFC after:      1 week
Signed-off-by:  Showta Ishizaki <zakinko@snowrabbit.org>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2420
eb647dd28137c5f44030645a648e5a8c24e16f4f Showta Ishizaki 2026-09-28 21:55:42

debug: classified in 04-filenames_plain2 by 'lib/'

libgeom: Open the control device read-write
Try to open the control device read-write first, and fall back to
read-only if that fails and the error is EACCES.  This prepares us for a
future in which GEOM requires write access to execute verbs that modify
the configuration.

MFC after:      1 week
Event:          EuroBSDCon 2026 DevSummit
Reviewed by:    imp, markj, emaste
Differential Revision:  https://reviews.freebsd.org/D59592
1e9e198b7f064322687746d26b283c3fcbad4579 Dag-Erling Smørgrav 2026-11-14 16:24:40

debug: classified in 04-filenames_plain2 by 'lib/'

stdio: Fix positional %B / %b conversion
MFC after:    1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=d9dc1603d6e4 ("libc: Implement N2630.")
Fixes:          https://cgit.freebsd.org/src/commit/?id=b9385720f34b ("libc: Add unit tests for N2630 and possible collateral damage.")
0e3fce268adeec8f4c87b99759dae6a592b3d365 Dag-Erling Smørgrav 2026-11-15 16:35:28

debug: classified in 04-filenames_plain2 by 'lib/'

stdio: Fix positional %wN / %wfN conversion
MFC after:    1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=bce0bef3c6ab ("libc: Implement N2680.")
Fixes:          https://cgit.freebsd.org/src/commit/?id=12b1c1e3fb44 ("libc: Add test cases for N2680.")
5e809bf1c93fdc4c52fa46a7eb0e6f881b6c6140 Dag-Erling Smørgrav 2026-11-15 16:37:42

debug: classified in 04-filenames_plain2 by 'lib/'

libm: Implement iseqsig()
C23 adds iseqsig(), the signaling counterpart of ==, which
raises FE_INVALID on any NaN rather than only on signaling
ones (as per §7.12.17.7).  The helpers raise it explicitly
instead of relying on relational operators, which the
compiler may emit as quiet comparisons, and the macro
dispatches on float_t so that wider-evaluated arguments
are not narrowed (§F.10.14.1).

Reviewed by:    kargl, fuz
Approved by:    fuz (mentor)
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D60642
c8341e61540641af9bc591794387e679c0a93513 Faraz Vahedi 2026-11-16 11:26:38

debug: classified in 04-filenames_plain2 by 'lib/'

stdio: Fix error case for positional %wN / %wfN
In the case were N was not a valid bit width, we were taking the wrong
error path.

Fixes:          https://cgit.freebsd.org/src/commit/?id=5e809bf1c93f ("stdio: Fix positional %wN / %wfN conversion")
0bf5d86620d047b4551d7414bf8011a328264b3d Dag-Erling Smørgrav 2026-11-16 11:45:15

debug: classified in 04-filenames_plain2 by 'lib/'

Filesystems

zfs: cherry-pick from openzfs/master (restore reverted commit)
zpool: Add zpool status -vv error ranges (#17864)

Add necessery change to libzfs/Makefile

(cherry picked from commit e903655c50fe2e710a4cdfe6e638454012ef6324)
fc6ed8627222a625a700e99cdfcda19654a0c651 Tony Hutter 2026-09-16 22:12:23

debug: classified in 05-summary-prefix by 'zfs:'

ffs: revalidate mkdir dependencies after vnode lookup
flush_pagedep_deps() drops the soft updates lock while obtaining the
vnode of a newly created directory with get_parent_vp().  The
MKDIR_BODY dependency may complete during this interval, invalidating
the diradd selected before the lock was dropped.

Once the directory's allocdirect is retired, the lookup of its first
block by block number in flush_newblk_dep() can find an older
dependency for a previous use of the same physical block.  The newblk
hash is not unique by block number: when ffs_reallocblks() relocates a
cluster, the completed allocindirs of the old blocks stay on the
indirdep's ir_completehd until the indirect block pointer in the inode
is written, while the old blocks are already free and may be allocated
to a new directory.  flush_newblk_dep() then finds a D_ALLOCINDIR where
it expects a D_ALLOCDIRECT and panics with "flush_newblk_dep: Bad
newblk".

Retain the vnode returned by get_parent_vp(), reacquire the soft
updates lock, and restart dependency selection.  Use the retained vnode
only when the newly selected MKDIR_BODY dependency refers to the same
inode.

Enter flush_newblk_dep() with the soft updates lock held and pass it
the associated diradd.  Recheck MKDIR_BODY after every operation that
may drop the lock, so that completion during the helper's retry loop
cannot result in another lookup of the retired allocation.

Keep the vnode handling in flush_pagedep_deps(), which owns the retained
vnode and the list of unfinished diradds, and move the dependency
selection into flush_pagedep_deps1().  The latter never acquires or
releases a vnode: it returns EJUSTRETURN with the inode number when it
needs one, or with 0 when the retained vnode must be released first,
and every call restarts the selection, so a vnode is only used for a
diradd found while it was held.  This also merges the two
get_parent_vp() call sites.  Every restart goes through that return:
obtaining or releasing a vnode, and continuing after jwait() or
getdirtybuf() had to wait with the softdep lock dropped.  The diradds
deferred on the unfinished list are put back on the pagedep's list
before the lock is dropped for a restart, so that none are kept off it
while other threads can run.  Assert that flush_newblk_dep() is called
with the vnode exclusively locked.

This preserves the original newblk dependency ordering and retains the
existing assertion for an active MKDIR_BODY dependency that resolves to
an unexpected dependency type.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297976
Reviewed by:    kib
Tested by:      pho
Sponsored by:   Sippy Software, Inc.
Differential revision:  https://reviews.freebsd.org/D59356
479c98287ee63496bd44d8d64d63c9ec16323e33 Maxim Sobolev 2026-10-04 19:24:39

debug: classified in 03-filenames_plain1 by 'sys/ufs/'

nfs_nfsdstate.c: Add an extra safety belt check for the backchannel
I do not think that xp_p2 can be NULL at this point,
but add an extra safety belt, just in case.

Reviewed by:    rmacklem
MFC after:      1 week
Sponsored by:   VersatusHPC
a52c50b4b7c2652954ef1bd34710a4b1fc8ef391 Vinicius Ferrao 2026-10-04 21:28:25

debug: classified in 03-filenames_plain1 by 'sys/fs/'

ufssuspend(4): mark non-passable
This fixes long-standing issue where ufssuspend file descriptor could
leak over fork or be passed over unix domain socket, and then closing it
in the opener would not unsuspend the file system.

It should not affect the well-behaving growfs(8) utility, but makes the
userspace API safer on principle.

Reviewed by:    markj
Tested by:      pho (previous version)
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60285
499901dd7a0afc77745ede85c4e6ec063d43a84d Konstantin Belousov 2026-10-04 00:50:57

debug: classified in 03-filenames_plain1 by 'sys/ufs/'

nfscl: Fix oddball cases for session slot release
We have identified some cases where silent slot loss can occur
when operations on NFS mounts are aborted. We experience this
when using NFSv4.2, but it likely also occurs with NFSv4.1.

A slot is acquired for compound operations by nfsv4_setsequence()
and freed by newnfs_request(). Any call path that abandons the
compound before reaching newnfs_request() loses the slot permanently.

We identified four call sites where this happens, one of
which where it actually does happen for us in a semi-reproducible
way, which allowed us to develop a candidate patch, attached.

The patch adds one function, nfsv4_freeunsentslot(), to
nfs_clcomsubs.c. It is called from each of the four call
sites: nfsrpc_writerpc(), nfsrpc_writeds(), and two in
nfsrpc_setextattr().

nfsv4_freeunsentslot() calls nfsv4_freeslot() with resetseq
set to true because the aborted RPC will never be sent and
therefore the slot sequence ID should not advance.

With this patch and other diagnostics, we have confirmed
that slot loss does not occur under the conditions that
otherwise cause it in our environment.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298416
Reviewed by:    rmacklem
MFC after:      1 week
77a7a48a1cb003831ff1d4342b1974fc7f79381e J. David 2026-10-07 01:52:19

debug: classified in 03-filenames_plain1 by 'sys/fs/'

devfs: Explicitly disable inotify
In principle, inotify can be used to leak timing information about I/O
device accesses by privileged process, which might be sensitive, e.g.,
in the case of /dev/input.  See https://inoti.fyi/#1-linux-inter-keystroke-timing

In practice this does not work since I/O to devfs nodes does not go
through vnodes, so the INOTIFY() calls in various VOP hooks do not fire.
But, let's explicitly define a no-op VOP_INOTIFY to help ensure that no
one tries to "fix" this bug.

Alternately we could simply ignore VCHR/VBLK vnodes in vn_inotify().
However, maybe someday it'll be desirable to enable inotify for specific
device files, in which case the filtering should live in devfs.

Add a regression test.

Reported by:    Sudheendra Raghav Neela <sneela@tugraz.at>
Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60364
c2ac0db7150c53d3902dbe1c507d96cbacfcadc6 Mark Johnston 2026-10-07 14:36:26

debug: classified in 03-filenames_plain1 by 'sys/fs/'

makefs/zfs: Allow the autotrim pool property to be set
Add an "autotrim" option taking "on" or "off". The value is stored in
the pool properties object alongside "bootfs", so the imported pool
starts trimming freed space automatically without a separate
"zpool set" step. When the option is omitted nothing is written and
the pool keeps the default ("off"), exactly as before.

A string option is used rather than makefs's boolean option type since
the latter ignores its value, which would make "autotrim=off" enable
the feature.

Define the spa_autotrim_t enumeration in the boot zfsimpl.h, copied
from OpenZFS's sys/spa.h, so that makefs can refer to SPA_AUTOTRIM_OFF
and SPA_AUTOTRIM_ON by name. The loader does not use it.

Document the option in makefs(8) and add a regression test.

Reviewed by:            markj
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60420
dece5b05f577fc4c6b89af7ad48dfbdf7cc4945c R. Christian McDonald 2026-10-07 14:57:40

debug: Commit manually moved from "unknown" to "filesystems".

nfs_nfsdsocket.c: Fix "nfsstats -d" for ERELOOKUP
When ERELOOKLUP is returned by a file operation
(always vop_lookup?) the operation is retried without
doing nfsrv_statsend().

This patch fixes this problem,

The only effect of the bug was bogus "nfsstat -d"
output.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298534
Reviewed by:    rmacklem
MFC after:      1 week
9a237074d380233e93a17ddee6b155cc2f90ee96 Bren 2026-10-08 19:03:51

debug: classified in 03-filenames_plain1 by 'sys/fs/'

ufs: do not busy or reference the mount in ufs_sync_nlink()
With soft updates, mkdir(2), link(2) and rename(2) into a directory
whose i_nlink is at UFS_LINK_MAX while i_effnlink is below it call
ufs_sync_nlink1() to sync the file system and restart.  It busied the
mount with vfs_busy(mp, 0), which sleeps for as long as an unmount is in
progress.  The caller is still between vn_start_write() and
vn_finished_write() there, and the unmount, once it has set
MNTK_UNMOUNT, goes on to suspend writes in VFS_UNMOUNT() and waits in
vfs_write_suspend() for that write to end.  Neither could make progress,
and every later vfs_busy() of the mount, such as from getfsstat(2) or a
lookup crossing the mount point, hung behind them.

The window is wide: after setting MNTK_UNMOUNT, the unmount waits for
the busy references to drain, which includes another thread already
syncing in ufs_sync_nlink1(), and for vfs_periodic().  A forced unmount
of a file system with a directory at the link limit under mkdir/rmdir
load hits it within seconds.

This is the deadlock that 29d03af1e4da fixed for VOP_RENAME(), and the
same reasoning applies: the caller's vn_start_write() already keeps the
unmount from getting past the write suspension, before which
ffs_unmount() tears nothing down, so the mount point does not need to
be busied for VFS_SYNC().  The extra vfs_ref() taken by the callers is
not needed either: a successful vn_start_write() keeps the reference
that VOP_GETWRITEMOUNT() took until vn_finished_write() drops it.  With
both gone, ufs_sync_nlink1() was only VFS_SYNC() and ERELOOKUP, so
remove it and call VFS_SYNC() directly from ufs_sync_nlink() and the
two places in ufs_rename().

Fixes:  https://cgit.freebsd.org/src/commit/?id=8db679af66b0 ("UFS: make mkdir() and link() reliable when using SU and reaching nlink limit")
Fixes:  https://cgit.freebsd.org/src/commit/?id=bc6d0d72f4f4 ("UFS rename: make it reliable when using SU and reaching nlink limit")

Sponsored by:   Sippy Software, Inc.
Reviewed by:    kib
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60204
MFC after:      1 month
a6728314ff6d6c73cab55c5bbd0025ed4ab56d53 Maxim Sobolev 2026-10-13 03:57:26

debug: classified in 03-filenames_plain1 by 'sys/ufs/'

Commit group #66: ufs
ufs: make fdatasync(2) and O_DSYNC writes update the inode

ffs_syncvnode() in the DATA_ONLY case and ffs_write() for IO_DATASYNC
decide whether the inode has to be written by testing IN_SIZEMOD and
IN_IBLKDATA against ip->i_flags, the chflags(2) word, instead of the
in-core state ip->i_flag.  IN_SIZEMOD and IN_IBLKDATA alias UF_READONLY
and UF_ARCHIVE, so for ordinary files the test was always false: after
an fdatasync() or an O_DSYNC write that extended a file or filled a
hole, the data blocks were on disk but the inode size and block pointers
were not, and a crash before the syncer got to the inode lost the
"synced" data.  Files with uarchive or urdonly set got a synchronous
inode write on every call instead.

journal_mount() has the same mixup and sets IN_MODIFIED in i_flags,
which leaves UF_OPAQUE set on the in-core .sujournal inode.  The
synchronous ffs_update() that follows writes the inode regardless, so
only the stray flag is fixed here.

Fixes:  https://cgit.freebsd.org/src/commit/?id=7428630b757 ("UFS: write inode block for fdatasync(2) if pointers in inode where allocated")
Fixes:  https://cgit.freebsd.org/src/commit/?id=52488b51489 ("Further evaluation of the POSIX spec for fdatasync()...")
Fixes:  https://cgit.freebsd.org/src/commit/?id=e7347be9e34 ("ffs: Support O_DSYNC.")
Fixes:  https://cgit.freebsd.org/src/commit/?id=113db2dddb7 ("Merge soft-updates journaling from projects/suj/head into head.")

Sponsored by:   Sippy Software, Inc.
Reviewed by:    kib
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60134
MFC after:      1 month
8ff663dde22fe9f50ba5d71d0237bec9b9b44683 Maxim Sobolev 2026-10-13 02:39:05

debug: classified in 03-filenames_plain1 by 'sys/ufs/'


ufs: make fdatasync(2) write dirty indirect blocks

A data-only ffs_syncvnode() skips dirty indirect blocks on file systems
without soft updates, and with soft updates stops making passes once
only indirect blocks are left dirty.  Indirect blocks only get dirty
when the block pointers in them change, and those pointers are what
makes a newly allocated block reachable.  So when fdatasync() follows
a write that extended the file or filled a hole past the direct blocks,
the data and the inode size reached the disk but the pointer to the new
block did not, and a crash lost the "synced" data.  With soft updates
the indirect block was usually written once, with the new pointer
rolled back, and never rewritten.

POSIX requires fdatasync() to write the metadata needed to retrieve the
data, which 52488b51489 already acknowledged for the inode, so treat
dirty indirect blocks the same way for a data-only sync as for a full
one.  This restores the loop to what it was before 2f514f92cf0.  Plain
overwrites, the case data-only sync is meant to speed up, do not dirty
indirect blocks and still write neither them nor the inode.

Fixes:  https://cgit.freebsd.org/src/commit/?id=2f514f92cf0 ("Implement VOP_FDATASYNC() for UFS.")

Sponsored by:   Sippy Software, Inc.
Reviewed by:    kib
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60134
MFC after:      1 month
1498efc4243e963503179547221335940e2aeded Maxim Sobolev 2026-10-13 02:41:27

debug: classified in 03-filenames_plain1 by 'sys/ufs/'


ufs: flush soft updates dependencies for O_SYNC and O_DSYNC writes

For a synchronous write, ffs_write() writes the data buffers with
bwrite() and then the inode with ffs_update(vp, 1).  With soft updates,
a new block pointer can only reach the disk after the dependencies of
the block, such as the cylinder group map that allocates it, are
written.  Until then initiate_write_inodeblock_ufs[12]() and
initiate_write_indirdep() roll the pointer, and for an extending write
the size, back in the buffer being written.  Nothing in the write path
flushes those dependencies, so the inode went out with the old size and
pointers, ffs_update() cleared IN_SIZEMOD and IN_IBLKDATA, and a crash
before the syncer rewrote the inode lost data that O_SYNC or O_DSYNC
promised was on stable storage.  The same held for a new block below an
indirect block, which ffs_balloc() writes synchronously but with the
pointer rolled back.

When soft updates are enabled and the write allocated blocks, finish it
with ffs_syncvnode(), as fsync(2) and fdatasync(2) do: it flushes the
dependencies, rewrites the rolled back indirect blocks and writes the
inode, or for O_DSYNC only writes the inode when IN_SIZEMOD or
IN_IBLKDATA say it is needed.  The flags cannot tell whether the write
allocated anything, because allocating a block below an existing
indirect block sets neither, so compare the inode's block count before
and after the write instead.  A write that allocated nothing, such as
an overwrite of existing blocks, adds no dependencies of its own and
keeps writing only the inode, so that it does not pay for a sync of the
whole vnode.  ffs_syncvnode() only drops the vnode lock when it has to
resolve directory dependencies, which ffs_write() never sees.

ffs_syncvnode() also writes whatever other descriptors left dirty on
the vnode, so the first synchronous write after a lot of buffered
writes would pay for all of them.  To put that cost on the open
instead, where it is less unexpected for a descriptor opened for
synchronous writes, add ffs_open() and, with soft updates, sync the
vnode there when a regular file is opened for writing with O_SYNC or
O_DSYNC, the same way the writes would: a full sync for O_SYNC, a
data-only one for O_DSYNC.  It calls ffs_syncvnode() rather than
VOP_FSYNC(), whose softdep_fsync() may drop the vnode lock in the middle
of the open.  The sync on open only moves work that the writes would
otherwise do, so it is skipped rather than waited for when writes are
suspended, and its errors do not fail the open.  Without soft updates
the writes sync nothing but their own blocks and the inode, so there is
nothing to move and the open does not sync.

Sponsored by:   Sippy Software, Inc.
Reviewed by:    kib
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60134
MFC after:      1 month
26d84bb8bf9b4acd0aa80b0208c1ba4fc9646ff3 Maxim Sobolev 2026-10-13 02:42:31

debug: classified in 03-filenames_plain1 by 'sys/ufs/'


ufs: do not let a rolled back inode write end a data-only sync

With soft updates, ffs_syncvnode() writes the inode between its passes
while buffers are still dirty.  That write can go out with new block
pointers rolled back, for instance a new indirect block whose contents
are only written in a later pass, yet ffs_update() clears IN_SIZEMOD
and IN_IBLKDATA because the write was synchronous.  A data-only sync
then decides at the end that the inode need not be written, and
fdatasync(2) or an O_DSYNC write that allocated the first indirect
block returned with the on-disk inode not pointing to it.

Note on entry whether a data-only sync has to write the inode, and base
the final write, done once all dependencies are flushed, on that alone:
nothing else can set IN_SIZEMOD or IN_IBLKDATA meanwhile, as the vnode
is locked.  A full sync always writes the inode last and was not
affected.

Sponsored by:   Sippy Software, Inc.
Reviewed by:    kib
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60134
MFC after:      1 month
e8534ba3ad36b88e94de0a3174e9ab7ac04a929d Maxim Sobolev 2026-10-13 02:44:40

debug: classified in 03-filenames_plain1 by 'sys/ufs/'

nfs_clvfsops.c: Set readahead to 15 for RDMA
MFC after:    1 month
Fixes:  https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
5bf3e2a1411151b81eedfa19b263c8832c7f5d7a Rick Macklem 2026-10-18 23:33:45

debug: classified in 03-filenames_plain1 by 'sys/fs/'

nfsserver: use the destination export for the COPY/CLONE write check
The write-permission check on the destination file in
nfsrvd_copy_file_range() and nfsrvd_clone() tested
NFSVNO_EXSTRICTACCESS() on the source export instead of the destination
export.

Rick notes:
    The change is harmless and mostly meaningless.
    NFSVNO_EXSTRICTACCESS() is a placeholder for some site that might
    not want to let the file "owner" get access despite mode bits.

    The "owner override" is a hack that has existed forever in NFS,
    since applications often create files with O_WRONLY, but mode 444.
    This works for POSIX, but would make NFS writes fail, since they
    check mode on every write, instead of just at POSIX open(). The hack
    is to always allow the file owner to have write access.

    Without the hack, lots of applications would break over NFS, so I
    doubt anyone would enable NFSVNO_EXSTRICTACCESS().
    { No one has ever even wanted an export flag for it. }

Reviewed by:    rmacklem, markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60952
d5c2465af8434d3eb7551d12220b4a24e7dca8af Osvaldo Janeri Filho 2026-10-29 20:25:01

debug: classified in 03-filenames_plain1 by 'sys/fs/'

nfs_clrpcops.c: Get rid of bogus rpc_free_rdma_reduction() calls
The calls to rpc_free_rdma_reduction() were cruft left over from
a previous variant of the NFS over RDMA client code.  They resulted
in double free's of the reduction mbuf.

This patch gets rid of them and makes sure that reduction is only
done when an array of pages is provided, so that no anonymous pages
will be allocated.

The reduction mbuf is free'd with the rest of the argument mbuf list
in the client side krpc.

Suggested by:   ferrao@versatushpc.com.br
MFC after:      1 month
Fixes:  https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
fec497b89b1aa8cd73c457158ed975d368e75e86 Rick Macklem 2026-10-31 20:42:24

debug: classified in 03-filenames_plain1 by 'sys/fs/'

nfs_clrpcops.c: Fix an mbuf leak introduced by fec497b89b1a
The calls to rpc_free_rdma_reduction() were removed, but I forgot
that newnfs_request() removes the reduction mbuf from the list
upon success, so it has to be free'd separately.
This patch does that.

The patch also disables reduction after the first loop interation.
This is necessary until nfsm_build_rdma_reduction() is patched
to handle an offset within the page array.

Reported by:    markj
MFC after:      1 month
Fixes:  https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
63302e904a52a30692659a9144825b657269aa4c Rick Macklem 2026-11-01 03:47:34

debug: classified in 03-filenames_plain1 by 'sys/fs/'

nfsd: Fix handling of RPC messages too large to cache
The NFSv4.1/4.2 session negotiates a limit to the size
of an RPC reply message that can be cached for the session
slot.

This patch fixes the code so that it checks that limit and
does not cache replies larger than the limit, even if the
client requested that it be cached.

This patch is slightly different than what the author
submitted, but retains the check for reply cache size limit.

Reviewed by:    rmacklem
MFC after:      1 month
64857418bb2379a7d89b6af04cddf92fa48dd28c Acts1631 2026-11-01 23:27:55

debug: classified in 03-filenames_plain1 by 'sys/fs/'

nfscl: Do not delay recovery for a stale ClientID
When a CREATE_SESSION with the extant ClientID failed with
NFS4ERR_STALE_CLIENTID within nfsc_renew of the previous full recovery,
nfsrpc_setclient() returned EIO and the mount did no I/O until that window
expired (about 45s).
The server has discarded the ClientID, so waiting cannot help; RFC 8881
Section 8.4.2 requires a new ClientID (EXCHANGE_ID) and a state reclaim.

AWS EFS discards both the session and the ClientID of clients whose lease is
current whenever it resets a connection, which makes this path common there.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299221
Approved by:    rmacklem@
Sponsored by:   Netflix
7a0021a0988fa39faee847953dd8df6bc9ff56b9 Olivier Cochard 2026-11-01 23:24:45

debug: classified in 03-filenames_plain1 by 'sys/fs/'

tarfs: Limit file name length
When indexing the tarball on mount, fail if a file or directory name
exceeds MAXNAMLEN.

Reported by:    n0ps1ed
Reported by:    Franz Bettag <franz@bett.ag>
MFC after:      1 week
Reviewed by:    markj, emaste
Differential Revision:  https://reviews.freebsd.org/D60903
a38033234692e9dab6f3f4404adc693fccabc14a Dag-Erling Smørgrav 2026-11-02 12:29:17

debug: classified in 03-filenames_plain1 by 'sys/fs/'

tarfs: Fix length calculation for file read
When the offset is within a block rather than at its beginning, the
length should be clamped to the remaining length of the block, not its
total length.

Reported by:    n0ps1ed
MFC after:      1 week
Reviewed by:    markj, emaste
Differential Revision:  https://reviews.freebsd.org/D60904
18bce6e65cdf059618ff12ace82a9f7334e1b610 Dag-Erling Smørgrav 2026-11-02 12:29:25

debug: classified in 03-filenames_plain1 by 'sys/fs/'

nfs_nfsdstate.c: Partial revert of 64857418bb23
Dropping the cached reply that is too large causes
a correctness problem that is too difficult to fix,
so revert this and leave it the way it was.

Although there is an argument that not doing could
cause resource exhaustion, it has not been reported
in the field as a problem.

MFC after:      1 month
bc7366a340edb366c37352c636b8360de92aa3a2 Rick Macklem 2026-11-02 15:00:40

debug: classified in 03-filenames_plain1 by 'sys/fs/'

nfsserver: Do not increment seqid on BADSEQID
When returning NFSERR_BADSEQID, the server should not have incremented
the sequence ID, yet the call to nfsrv_checkseqid() a few lines above
does precisely that.  Instead, check for a legitimate retransmission
of the original successful request, and reject otherwise, before the
ticket is used and sequence ID incremented.

MFC after:      1 week
Fixes:          https://cgit.freebsd.org/src/commit/?id=ff45b9fc1a8c ("Bjorn reported a problem...")
Sponsored by:   Klara, Inc.
Reviewed by:    rmacklem
Differential Revision:  https://reviews.freebsd.org/D61156
878084c774c6d68fcdb65e00ba8f74726dda0999 Dag-Erling Smørgrav 2026-11-05 21:11:30

debug: classified in 03-filenames_plain1 by 'sys/fs/'

zfs: merge openzfs/zfs@013c77e66
Notable upstream pull request merges:
 #17567 816804dfd Add support for anyraid vdevsG
 #18826 -multiple FDT: don't extend dedup across RAIDZ expansion
 #18861 1ff8fc14a Fix out-of-bound access when resizing in receive_spill
 #19026 518021947 Add alloc factor logic
 #19091 e056f4df3 don't send spill or oversized blocks as WRITE_EMBEDDED
 #19125 6d5d3f635 Wait for the txg-time database write before setting
                  spa_final_txg
 #19170 b060bcb1d zio: drop a queued scan read only when its block is freed
 #19171 3db7dde41 dsl_scan: resume a scan which suspends at the origin
                  snapshot
 #19178 497f28f07 vdev_raidz: keep unverified dRAID rebuild repairs
                  speculative
 #19188 5f1957a15 spa: number new txgs above every uberblock on disk
 #19190 495d09b51 Export zpool_valid_proplist from libzfs
 #19191 ed07ad74e zdb: Lower eviction timeouts on prefetched data
 #19192 86b3fb1f4 Build the pool stats config without the namespace lock
 #19198 a9418818b vdev_rebuild: wait for the syncing txg before rebuilding
                  a metaslab
 #19204 a8ea85249 userspace: remove makedev detection and cleanup headers
 #19206 -multiple spl: remove unused headers
 #19208 f239ea947 Walk snapshot names without holding the objset in
                  list-next ioctl
 #19211 7e556b324 dmu_send: don't send uncompressed ARC data as compressed
 #19212 79b0e2126 zpool: don't print a huge duration when a scan ends
                  before it started
 #19213 d72c45490 libzutil: fix the udev_device_get_is_initialized() config
                  check
 #19216 c97a5a4c2 Clone sparse files in time proportional to their data
 #19217 5e35770b3 Allow cloning a file's tail block past the destination's
                  EOF
 #19218 -multiple Do not hang on a suspended pool in four more waits
 #19222 -multiple vdev_prop_get: report real vdev fragmentation
 #19223 000b4c46d ddt: prune only entries unchanged since the prune walk
 #19227 -multiple libzfs: support refreservation=auto in zfs_create()
 #19228 7f838b8fb libzfs: fix a double free of the btree leaf cache
 #19229 88da095a2 Fix a deadlock between zvol first open and pool export
 #19231 -multiple zfs_file: hide zfs_file_t internals
 #19234 f1f96f5e7 dbuf: restore BP_IS_HOLE() recheck after
                  dnode_block_freed()
 #19236 954472f2d dsl_crypt: say when change-key finds a key it cannot
                  unwrap
 #19250 -multiple Remove userspace umem shim; use kmem_* everywhere
 #19253 e9e24ce2c ZIL: avoid deadlock in xattr owner check
 #19261 7d3e648d5 Allow quota to be changed even when over quota
 #19264 7391add65 ddt: don't prune every unique entry for a target below
                  one entry
 #19267 64c061e33 Zero the last page past EOF when extending a file
 #19268 269d147bb FreeBSD: do not clear dirty bits outside a sub-block
                  write
 #19271 e61fe2571 Open only the named pool when zpool checks a pool name
 #19272 5f68a22f0 Skip the second duplicate search when adding to an nvlist
 #19274 c0688a275 ZIL replay of an indirect write leaks later writes in the
 #19278 -multiple vdev_removal: don't remove a mirror with a child still
                  resilvering
 #19279 100f0e001 raidz: refuse too small replacements during expansion
 #19281 a99330d3e dmu_recv: fix corrective recv of zstd compressed blocks
 #19288 21a89645f zpool: compare special and dedup vdevs only with normal
                  vdevs
 #19292 c7921a82b libzfs: reject malformed numeric ids in userquota props
 #19293 7d534ee08 zpool: fix 'zpool status' error count and list output
 #19297 44efa5044 zoned_uid: print as integer, reject out-of-range uidS
 #19298 23cef4390 zfs: reject 'bookmark -r' to a dataset other than the
                  source's
 #19301 186bf8c93 ddt: fix NULL bp dereference in ddt_repair_entry_done()
 #19304 183ab72c3 spa: make the normal class the last allocation fallback
 #19308 -multiple libzfs: don't abort when a recv target's origin is
                  outside the tree
 #19309 b3e4cf0c8 libzfs: don't require keylocation when receiving an
                  encryption root
 #19310 7eae9e89c dsl_crypt: only expect an IVset guid on snapshots
 #19312 a78337a9d metaslab: use the physical birth to decide checkpointed frees
 #19314 f61e0291a zio: find large gang headers while the pool is loading
 #19315 23feecbbc zfs_ioctl: allow read-only channel programs on read-only
                  pools
 #19316 8b11b983c libzutil: prefer devices of the same pool when fixing up
                  paths
 #19319 -multiple zvol: leave alone a minor that is being removed
 #19320 -multiple ZIL: zero the header bp in zil_crash() only if lwbs own
                  it
 #19322 ae4deb34b Exempt the usage ZAPs from FREE_RANGE_VERIFY() in syncing
                  context
 #19323 f7c15333a dmu_recv: keep rrd->abd current in do_corrective_recv()
 #19325 -multiple metaslab: don't modify ms_weight when verifying it
 #19326 -multiple zap: don't use a stale ptrtbl shift in zap_shrink()
 #19329 9699602a0 ZIL: Sync the txg that a suspended commit waits for
 #19332 -multiple vdev_removal: don't hold ms_lock while loading a space map
 #19337 0080dc9c4 Don't hold spa_errlist_lock while resolving errors
 #19343 9d6e2cc70 Do not refill a plain ARC buf when authenticating it
 #19346 602c474a2 Report EIO when no vdev can take a Direct I/O write
 #19351 9e8e7a964 metaslab: don't gang every block on a degraded
                  single-disk vdev
 #19353 1a0a83b03 spa: don't self-heal while loading an older txg
 #19355 0606e0dcc Build the vdev config in place instead of copying it
 #19356 7c3d85aaf ZIL replay can apply part of a split WR_NEED_COPY write
 #19365 7c546ef8e raidz: refuse expansions that the boot area cannot holD
 #19376 5d7c42cfd Add zfs rewrite -W to skip blocks already at their
                  current size
 #19381 daab47652 zio: Remove the priority match assertion when joining
                  a batch
 #19391 22013c391 zio: free the gang header ABD when its read fails
 #19395 21df1e4f7 raidz: resilver every child a block born before an
                  expansion spans
 #19398 b31984ce4 Find the dataset of a renamed volume by its object number
 #19399 b1f55c3ef vdev_mirror: scrub every copy of a gang block in a sorted
                  scrub
 #19400 83f7e0e8d Translate initialize and TRIM ranges under the config lock
 #19402 cd1b094b2 Accept the dedup NOP of zfs rewrite -P in arc_write_done()
 #19403 15f2b6042 Do not let scrub skip a dedup block its DDT entry does
                  not describe
 #19406 a6fc6209e spl: avoid reclaim for speculative physical allocations
 #19411 48f048c0b icp: record the accelerated GCM hash-table allocation size
 #19414 a6ed3cf31 libspl: split usleep_range() into seconds and nanoseconds
 #19430 b509a677f zvol: remove minors in parallel
 #19433 -multiple raidz: fix scrub repairs during a raidz expansion
 #19440 1e9b428dc raidz: write the scratch uberblocks on non-debug builds
 #19451 -multiple libzpool: fix zfs_file_off() and three zfs_file_* error
                  paths
 #19429 -multiple nvpair: performance optimisations
 #19495 74215dc63 Let zfs rewrite -W skip only blocks that a rewrite would
                  keep
 #19496 e117a84db libzutil: keep the latest label when two vdevs claim one
                  id
 #19503 df0d1bb22 Fix dbuf dirty record traversal locking
 #19506 04586b11f raidz: compute the aggregate copy offset before adding it
 #19508 -multiple libspl/thread: rewrite for kthread semantics and to hide
                  pthread
 #19511 1ad9b782c vdev: atomically account checkpoint space during parallel
                  load
 #19515 4733b98c2 dsl_deadlist_open(): clean up on error
 #19516 dedf1fb18 Fix user accounting after incremental receives into
                  encrypted datasets
 #19518 -multiple libspl: cleanup atomics
 #19520 061dd8a13 zoned_uid: check rename destination permissions
 #19521 5135029ce zoned_uid: preserve global-only zoning property checksG
 #19538 1ccce6d52 Do not copy stale data from a mirror child in a rebuild
 #19549 7bfe0418f ddt: do not prune an entry that a copies=2 write may have
                  extended
 #19550 c8534b99c raidz: don't lose the expansion wakeup when a resilver
                  ends early
 #19554 dce3650fa recv: check the temporary clone name length
 #19556 dc66d8489 Release the upgrade hold before clearing os_upgrade_id
 #19578 df744acc4 vdev: avoid null member access in statistics updates
 #19588 71563e5e1 Wait for dataset evictions when exporting a read-only pool
 #19590 -multiple raidz: keep the scratch copy when import recovery fails
 #19594 1547ff6bc Return ENODEV from vdev_prop_get/set for a missing vdev
 #19601 9c606af17 Include zfs rewrite -P blocks in raw encrypted sends
 #19602 ba46f0833 Keep the logical birth of dedup blocks in zfs rewrite -P
 #19604 03840dd33 Keep the indirect mapping lookup from wrapping below
                  entry 0
 #19628 66184a0dc L2ARC: Do not stop writing when l2arc_headroom is 0
 #19630 6b84a198e zio: initialize all props of gang children
 #19631 cc0d3dc4e L2ARC: Do not write encrypted buffers whose MAC differs
 #19633 924b8c89c Fix direct reads of blocks pending free
 #19634 cea524bd5 zio_reexecute() keeps the old allocation trace
 #19656 af9553c59 Release the new znode when its ZIL commit fails
 #19698 984e7c165 zpool: reject a dRAID children count of zero
 #19679 -multiple FreeBSD: move SPL stuff out of zfs_context_os.h
 #19693 70cba4665 zap: Fix zap_trunc() to account next ptrtbl blocks
 #19705 c9e0d4c89 raidz: take the reflow range lock when spa_ubsync advances
 #19708 8ad60bab5 zpool: reject empty dRAID failure groups and stray
                  devices
 #19709 fbc758d36 Drop spa_namespace_lock while spa_vdev_exit() waits on a
                  suspended pool
 #19713 ef35f1441 Decrypt when holding an unmounted filesystem's objset
 #19716 7704a886e spa_stats: add "misc" pool stats with suspended & resumed
                  counters
 #19728 -multiple anyraid: write the tile map at the vdev's ashift
 #19743 -multiple Fix some small ZPL nits
 #19744 -multiple ZPL: Wrap various error origins with SET_ERROR()
 #19769 -multiple Aarch64 SIMD build fixes
 #19782 ed3001e94 arc: fix use-after-free in synchronous L2ARC read retry
 #19789 -multiple kstat: fix up some sketchy uses of ks_data
                  (incl use-after-free)
 #19793 -multiple Fix FreeBSD build issues

Obtained from:  OpenZFS
OpenZFS commit: 013c77e66e37bc2ac54d8e0725e548d90e53d4b6
29b24020f6fa24bcd47a156f424bee8b5db869b9 Martin Matuska 2026-11-12 10:27:12

debug: classified in 05-summary-prefix by 'zfs:'

Kernel

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

ifuncs: Include <machine/ifunc.h> instead of <x86/ifunc.h>
All architectures have been providing an 'ifunc.h' header with
DEFINE_IFUNC() et alter working both in kernel and userland since commit
cf41d1113377 ("riscv: implement kernel ifunc resolution"), and separate
<i386/ifunc.h> and <amd64/ifunc.h> headers were introduced in commit
2b1db07bec92 ("x86: add machine/ifunc.h"), so stop including
<x86/ifunc.h> directly and use the common <machine/ifunc.h> idiom.

While here, re-order includes in the blocks featuring <x86/ifunc.h>,
which requires fixing <x86/apicvar.h> so that it can be included before
<machine/intr_machdep.h>.

Reviewed by:    kib
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60194
a2fbd988638e94b61cc78449e893f2c02d43dec0 Olivier Certner 2026-09-30 13:01:46

debug: classified in 04-filenames_plain2 by 'sys/'

sendfile: keep the lowat hack more conservative
First, record the original lowat value and later in the wait/EAGAIN loop
look at the original value, rather than on the value that we just faked.
This eliminates some blank syscalls, where socket was reported as writable
and immediate write instantly fails.  In my testing the ratio of such
syscalls was really small, under 2%, however in a different scenario this
negative effect can be more profound.

Second, cap the lowat growth to 1/2 of original socket buffer size, rather
than to current size.  The problem was there before, but it became more
profound after 587c6c121504.

Note: we are considering to evaluate if the lowat hack is needed at all.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D60106
6948f4d5e2b29100b986a96175ef9efb1ab91616 Gleb Smirnoff 2026-10-02 02:53:40

debug: classified in 04-filenames_plain2 by 'sys/'

ssp: Make the panic string more accurate
"stack overflow detected" sounds like the thread faulted because it
ran out of stack space.

Reported by:    Andrew <xxx.sys@protonmail.com>
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
0f4b7d28ccb5c8edd0e4aad8135a4356f8a31961 Mark Johnston 2026-10-01 18:32:58

debug: classified in 04-filenames_plain2 by 'sys/'

jail: note existing process/prison lock order in witness.
d9e2caccfac14c43bf9ad62bdd35d4a03356ff91 Jamie Gritton 2026-10-02 22:18:00

debug: classified in 04-filenames_plain2 by 'sys/'

callout: do not retry a try-lock callout sooner than a tick
When softclock_call_cc() fails to acquire the lock of a CALLOUT_TRYLOCK
callout, it reschedules the callout half its precision after
cc_lastscan and halves the precision. Repeated failures shrink the
delay toward zero, and once the precision reaches 1 the callout is due
immediately: the timer fires again at once and softclock retries the
lock in a tight loop for as long as the lock is held.

If the lock owner runs on the callout's CPU and no other CPU is idle,
the softclock thread preempts it on every attempt, starving the thread
it is waiting on. On an 8-CPU arm64 VM, a test module holding the lock
saw 760,000 attempts per second, each with its own timer interrupt, and
progressed at 38% of its normal rate. On a 4-core amd64 system under
loopback TCP load, a netisr thread holding an inpcb lock made no
progress for 12 minutes while the TCP timer callout was retried 830,000
times per second.

Keep the half-precision retry, but never schedule it less than one
tick from now. Base the deadline on sbinuptime() rather than
cc_lastscan: cc_lastscan is the time of the last callout_process()
scan, which can be a tick or more in the past by the time softclock
runs the callout, leaving cc_lastscan + tick_sbt already expired.

Floor the precision at a tick as well. With a precision of 1 the
retries of many contended callouts cannot share a timer interrupt: the
timer is armed for the earliest retry, each interrupt collects only
those already due, and every callout_process() call walks all the
contended callouts in the callwheel bucket. On the same VM, with
10,000 callouts on one lock, the owner took 5.0 to 5.8 s to finish 1 s
of work with a precision of 1 and 1.3 s with the floor, and
callout_process() ran about 58,000 times against about 900. A single
contended callout is now retried about every two ticks.

Reviewed by:            kib
Fixes:                  https://cgit.freebsd.org/src/commit/?id=efcb2ec8cb81 ("callout: provide CALLOUT_TRYLOCK flag")
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60246
f12b76524d7bbf3d6c1a890834b6f8d018704ef0 R. Christian McDonald 2026-10-03 23:55:32

debug: classified in 04-filenames_plain2 by 'sys/'

nfscl: Add support for b_pages to be used by RDMA
This patch updates the NFS client RDMA glue so that I/O
can be done directly to/from b_pages for buffer cache
blocks.
It also adds a flag to disable read reduction, that might
be needed against some non-FreeBSD servers and sets readahead
to 8 for RDMA unless the "readahead" option has been
specified.

This commit should not affect non-RDMA behaviour.

MFC after:      3 months
Fixes:  https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
c2089b654ad2568cdd5ddc7baa9ac47db7c3b00c Rick Macklem 2026-10-04 00:40:04

debug: classified in 04-filenames_plain2 by 'sys/'

rpc_generic.c: Initialize "cp" to shut the compiler up
This patch does not fix any semantics issue.

MFC after:      3 months
Fixes:  https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
2050abe804836cb79ced55ea983bb4edc993fa64 Rick Macklem 2026-10-04 01:54:39

debug: classified in 04-filenames_plain2 by 'sys/'

g_part: access leak causes process to hang
So if one inserts a USB drive with a GPT that doesn't match the media
size, a resize is initiated, so gpart takes g_access(cp, 1, 1, 1) on the
disk and holds it until the resize is accepted or rejected. The orphan
path releases it, but the spoil path does not. So if the drive is
ejected while the resize is in flight, we call spoil directly, without
releasing the access. Since gpt_opened is not cleared for the spoil
path, this causes several different process to hang in the open path
waiting for the leaked access.

Move the release into the wither function when gpt_opened is set, and
remove the release elsewhere. Since all paths to destroy the geom pass
through wither, this ensure that access is always released when we've
taken the access for resize.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297777
Reported by:            Rick Richard
MFC After:              1 week
Sponsored by:           Netflix
Differential Revision:  https://reviews.freebsd.org/D59138
35b59986b5aaedbafefbb79e3da30789ca9aeb24 Warner Losh 2026-10-04 19:19:59

debug: classified in 04-filenames_plain2 by 'sys/'

clnt_vc.c: Fix handling of backchannel xprt
When clnt_vc_destroy() is called, it might not be the
current connection.  Without this patch, if it is not
the current connection, xp_p2 is set NULL and xprt is released
when it should not be released.

This patch adds a check for "current connection" to fix
the problem.  Found during testing to the client RDMA code,
but could happen for TCP as well.

MFC after:      1 week
81a6514689cefdaa5c92b5539ae885ec8c6b3336 Rick Macklem 2026-10-04 20:29:43

debug: classified in 04-filenames_plain2 by 'sys/'

clnt_vc.c: Fix handling of broken TCP connections
After more than, I don't know, maybe 10k operations: mount, copy,
remove, verify and unmount cycles, one cp command hung in
close() / ncl_flush and never recovered. The machine and the mount
continued to work normally through a new connection, but the writes
using the old connection stayed frozen.

I did not understand exactly what happened.  I traced what appears to
be the issue in the code. My current understanding is that
clnt_vc_soupcall() saw the EOF and woke the caller waiting for RPC
replies, but one caller remained blocked in sosend().
That thread continued holding a reference to the old client, preventing
it from being completely cleaned up.

The attached patch calls socantsendmore() when EOF is received, which
should wake the blocked sender and let the normal reconnect code replace
the connection.

Reviewed by:    rmacklem
MFC after:      1 week
Sponsored by:   VersatusHPC
49bec8c3dc58cf8e944f9bbbbea07e7e856ad897 Vinicius Ferrao 2026-10-04 21:07:30

debug: classified in 04-filenames_plain2 by 'sys/'

LinuxKPI: Add crc16.h for amdkfd support
Reviewed by:  wulf
Differential Revision:  https://reviews.freebsd.org/D60275
d7e7397c217137c9f2465f60a7faf129c87934ec Sourojeet A 2026-10-05 12:10:41

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #67: cdevsw: add D_NONPASSABLE flag
cdevsw: add D_NONPASSABLE flag

to make the opened device files non-passable.

Reviewed by:    markj
Tested by:      pho (previous version)
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60285
850d4562928ea9308dd9188d5014bcabe7049938 Konstantin Belousov 2026-10-04 00:50:23

debug: classified in 04-filenames_plain2 by 'sys/'


devfs_open: do not access dsw after dev_relthread()

Noted and reviewed by:  markj
Fixes:  https://cgit.freebsd.org/src/commit/?id=850d4562928e ("cdevsw: add D_NONPASSABLE flag")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60393
1e595e959f66e11d0490e90270b9fb701cbc6739 Konstantin Belousov 2026-10-05 23:35:32

debug: classified in 03-filenames_plain1 by 'sys/fs/'

debug: moved to kernel because 'Need to be grouped with 850d4562928ea9308dd9188d5014bcabe7049938'

jaildesc: Lock prison pointer when filling kinfo
Submitted by: Yuri Tkachenko <yura.tkachenko at gmail.com>
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D60392
a5ae2a9bfb1ca7f49e79ee63ed39216c42326d02 Jamie Gritton 2026-10-05 23:54:21

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #68: sendfile: Fix build for kernels without INET or INET6
sendfile: Fix build for kernels without INET or INET6

Don't cap the new low watermark to a TCP-specific setting in kernels
without TCP.

Fixes:          https://cgit.freebsd.org/src/commit/?id=6948f4d5e2b2 ("sendfile: keep the lowat hack more conservative")
1d8c5f8e02558faa578329eb9e2076e04de3fc5d John Baldwin 2026-10-05 21:00:56

debug: classified in 04-filenames_plain2 by 'sys/'


sendfile: Include opt_inet*.h

Pointy hat to:  jhb
Reported by:    markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=1d8c5f8e0255 ("sendfile: Fix build for kernels without INET or INET6")
cb55ad8ff89cbbae776190842d2d71ef7a185098 John Baldwin 2026-10-08 15:19:25

debug: classified in 04-filenames_plain2 by 'sys/'

uiomove_object_page: a failed copy can still dirty the page
For writes, if we fail in the middle of reading from the source, the
destination may have already been dirtied.  For example, the source may
cross a page boundary, and the second page is inaccessible.
Conservatively mark the destination as dirty, even on errors.

Reported by:    Claude (Opus 5.5)
Reviewed by:    kib, markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60280
d8dfbeb5701769832e84e5bb52f2e8b4e3ab902b Alan Cox 2026-10-03 17:19:36

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #69: sched: New scheduler interface definition scheme
sched: New scheduler interface definition scheme

Define the scheduler interface once and for all (in 'sys/sys/sched.h')
and remove all code duplication related to it (function signatures, slot
names, dispatch, scheduler instance declaration), making it easier to
modify the interface or to add new schedulers.

This is implemented by defining the interface as X macros, which are
passed a macro (and additional arguments for it) that is "called" with
a variable number of arguments describing a single function of the
interface.  The convention used for a function's parameters is that each
parameter is represented with two macro arguments, the first one being
the type and the second one being the name.  Helper macros allow to
process arguments described in this convention in order to generate
a list of arguments for function definitions (currently, up to
4 function parameters).  The chosen convention eliminates the need for
any specific declaration of functions depending on their number of
arguments.

DECLARE_SCHEDULER() has been changed to automatically declare and fill
a 'struct sched_instance' structure.  Its number of parameters has been
reduced to the minimum, and the symbol part used to produce distinct
structure names can now start with a digit (useful for 4BSD).

The new implementation has the following additional benefits:
1. The name of implementations for the interface functions is imposed
   (same name as the interface function but with the scheduler symbol
   that was passed to DECLARE_SCHEDULER() added just after the 'sched_'
   prefix, e.g., for ULE, 'sched_ule_*()') and checked at compile-time.
2. Missing functions in an implementation are detected at compile-time
   (and not at runtime with a NULL dereference).
3. Failures to fill correctly the 'struct sched_instance' object
   associated to an implementation are eliminated.

Preserve comments/categories of interface functions by moving comments
that were in the old explicit interface declarations to the SCHED_ITF*()
macros, and while here, marginally improve some (and move the common
documentation for sched_initticks() from the implementations to the
interface).  Several of them are not exact, but this will be fixed in
a separate commit.

Make the active scheduler instance object internal, as it is not used
outside of the shim implementation and one of the purposes of the
interface is also to hide the actual implementation.  If the need
arises, it would be easy to add scheduler-specific routines as new
fields in 'struct sched_instance' and to extend the machinery to
automatically assign routines returning EOPNOTSUPP to these fields, and
then to provide a macro to register non-trivial implementation, instead
of making the current instance object visible again.

Additionally, in order to avoid collision with C and C++ keywords:
1. Fields in 'struct sched_instance' are now suffixed with '_impl', so
   that, e.g., 'switch()' does not require special treatment anymore and
   the corresponding implementations can be renamed back to
   `sched_*_switch()`.  This suffix avoids any collision with existing
   C++ keywords as new functions are added to the interface.  (See
   SCHED_ITF_FIELD_NAME().)
2. Actual interface functions' C declarations do not list parameter
   names anymore (sched_class() was causing a problem in C++ with its
   'class' parameter).
allowing to remove the bracketing with '#ifndef __cplusplus'.

Reviewed by:    mchoo, kib
Fixes:          https://cgit.freebsd.org/src/commit/?id=ce38acee8d0b ("Add kern/sched_shim.c") (+ some followups)
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59988
42490d5cd29d7a6acd3c28dacfbdc527c2d39028 Olivier Certner 2026-09-07 16:19:53

debug: classified in 04-filenames_plain2 by 'sys/'


sched.h: Fix a typo and remove an extra line

Fixes:          https://cgit.freebsd.org/src/commit/?id=42490d5cd29d ("sched: New scheduler interface definition scheme")
Sponsored by:   The FreeBSD Foundation
0bccbb9e98930f55bff5a943c881e460d4f31aec Olivier Certner 2026-10-06 16:18:14

debug: classified in 01-style by '[tT]ypo'

debug: moved to kernel because 'Need to be grouped with 42490d5cd29d7a6acd3c28dacfbdc527c2d39028'

cam: Rename cam_iosched_bio_complete to cam_iosched_bio_update_stats
The function updates scheduler statistics but does not complete the
bio. Rename it to avoid implying ownership of bio completion.

Sponsored by:           Netflix

Reviewed by:    ali_mashtizadeh.com
Differential Revision:  https://reviews.freebsd.org/D60349
0040d1fb7a251daa0690f4858ddb495bee79ae52 Warner Losh 2026-10-06 22:45:31

debug: classified in 04-filenames_plain2 by 'sys/'

nda: Update trim stats with the periph lock held
Separate the updating the stats for the completion from the biodone for
each one.

Sponsored by:           Netflix
Reviewed by:            ali_mashtizadeh.com
Differential Revision:  https://reviews.freebsd.org/D60155
4a3a5de8ace3c41da35f0fbac4d2549b868d1091 Warner Losh 2026-10-06 22:45:36

debug: classified in 04-filenames_plain2 by 'sys/'

da: Update trim stats with the periph lock held
Separate the updating the stats for the completion from the biodone for
each one.

Sponsored by:           Netflix
Reviewed by:            ali_mashtizadeh.com
Differential Revision:  https://reviews.freebsd.org/D60156
bd86f0508e461526ba7342e52bd9778394b183f7 Warner Losh 2026-10-06 22:45:46

debug: classified in 04-filenames_plain2 by 'sys/'

ada: Update trim stats for every bio
Separate the updating the stats for the completion from the biodone for
each one.

Sponsored by:           Netflix
Reviewed by:            ali_mashtizadeh.com
Differential Revision:  https://reviews.freebsd.org/D60157
7845cf8de8db3f6dd60a69379907b51b80123eae Warner Losh 2026-10-06 22:45:55

debug: classified in 04-filenames_plain2 by 'sys/'

cam: Assert we have the periph lock when updating the iosched stats
Sponsored by:         Netflix
Differential Revision:  https://reviews.freebsd.org/D60350
ab7249c288a4d7d09c88f4de705b58a2afbf35f9 Warner Losh 2026-10-06 22:46:03

debug: classified in 04-filenames_plain2 by 'sys/'

sched.h: Include <sys/pcpu.h> unconditionally
Even if SCHED_STATS is not defined, this header is necessary to provide
a definition of 'curthread' used in sched_pin() and sched_unpin().

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
b6d10a962448bf03400dd381b2083d1f547f869c Olivier Certner 2026-10-06 09:27:55

debug: classified in 04-filenames_plain2 by 'sys/'

linux: Initialize per-VNET state earlier
Make sure that linux_ifnet_departure() can't run after
linux_ifnet_vnet_uninit() has destroyed the per-VNET unit number
allocator.  Otherwise, when ifc_detach_cloner() destroys instances of an
interface type, it might be running too late.  Most cloner-based drivers
tear themselves down during SI_SUB_PSEUDO or SI_SUB_PROTO_IF.

Reviewed by:    pouria, glebius
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60389
a23901a37be9d8567db42f20d2ccc40fc5b7ee2a Mark Johnston 2026-10-06 22:05:03

debug: classified in 04-filenames_plain2 by 'sys/'

vn_open_cred(): rename VN_OPEN_NAMECACHE flag to VN_OPEN_COREDUMP
The flag only use is for special handling of core dump vnodes.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60283
ccd44c5e4881ece004fa23d3b479d4ee57b2a58e Konstantin Belousov 2026-10-03 23:59:30

debug: classified in 04-filenames_plain2 by 'sys/'

kern/coredump_vnode.c: avoid dumping to the mount point we suspended
PR:   https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299095
Reported by:    Rick Richard <rick@sloservers.com>
Reviewed by:    markj
Tested by:      Rick Richard <rick@sloservers.com> (previous version)
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60283
bea382f25b16fec0e9a1c2be130935e739075287 Konstantin Belousov 2026-10-03 23:59:30

debug: classified in 04-filenames_plain2 by 'sys/'

mlx5: support DevX UMEM page size bitmap
rdma-core's mlx5dv_devx_umem_reg_ex() passes the page sizes the caller
can use in MLX5_IB_ATTR_DEVX_UMEM_REG_PGSZ_BITMAP.  Add the attribute and
choose the UMEM page size, page offset and MTT count the way Linux commit
7610ab57de56 ("RDMA/mlx5: Allow larger pages in DevX umem") does.

Linux looks at the DMA list only.  The UMEM is mapped at an IOVA equal to
the DMA address of its first byte, ib_umem_find_best_pgsz() picks the
largest page size of the bitmap that this mapping allows, and
devx_umem_find_best_pgsize() halves it while the first DMA address is not
aligned to it or the length is not a multiple of it, stopping at
PAGE_SIZE, even if that is below every size in the bitmap.

The FreeBSD OFED layer has none of the ib_umem helpers this relies on,
so local copies of the current Linux ones are added.
ib_umem_find_best_pgoff() and ib_umem_dma_offset() come from Linux
commit b045db62f6f6 ("RDMA/mlx5: Use ib_umem_find_best_pgoff() for
SRQ"), ib_umem_num_dma_blocks() from Linux commit a665aca89a41
("RDMA/umem: Split ib_umem_num_pages() into ib_umem_num_dma_blocks()").
The ib_umem_find_best_pgsz() logic includes Linux commit 486055f5e09d
("RDMA/core: Fix best page size finding when it can cross SG entries"),
without which no page size above 4K would ever be found, as FreeBSD's
ib_umem_get() maps every page as an SG entry of its own, and Linux
commit 09ea6837a043 ("RDMA/umem: Be careful about boundary conditions in
ib_umem_find_best_pgsz()").

Without the attribute the bitmap defaults to GENMASK_ULL(63, 12), as in
Linux.  The attribute is read with uverbs_copy_from(), FreeBSD's
uverbs_get_const_default() works on an s64 and rejects any value with bit
63 set, the default included.  The page size is kept in a u64, Linux
returns it as an unsigned int and so fails registrations that would use
pages of 4G or more.

Reviewed by:  kib
Sponsored by: Nvidia networking
MFC after:    1 month
78ae174e420a2eaa340b41247a260bc067fae0c6 Ariel Ehrenberg 2026-10-06 10:45:06

debug: classified in 04-filenames_plain2 by 'sys/'

LinuxKPI: firmware: remove `enoentok` logic in `*firmware_request(..)`
Prior to this change, in the event that a firmware module could not be
loaded, the linux_firmware driver would return a partially initialized
structure with uninitialized/zeroed out values for certain fields. Linux
does not do this, however, so some drivers that use
`request_firmware_nowait` expecting Linux behavior, like `if_bcrmfmac`,
would crash trying to dereference a NULL pointer.

This doesn't address the load/unload situation completely as the driver
remains loaded after the "firmware crashes", but it makes a completely
unusable situation (a kernel panic) into a slightly more usable situation
(driver does not unload).

As a sidenote: the raw free(9) call was replaced with a call to
`linuxkpi_release_firmware` because the latter call [better] ensures
that all resources allocated earlier on in the function are cleaned up.

MFC after:      1 weeks
Reviewed by:    bz
Differential Revision:  https://reviews.freebsd.org/D58451
ef947bb97302d8862545cd0a5f38b24fa1bae2f6 Enji Cooper 2026-10-07 18:22:00

debug: classified in 04-filenames_plain2 by 'sys/'

sysctl: don't loop when EAGAIN is returned
When userland_sysctl() experiences EAGAIN, don't loop internally but
leave retrying to the caller.
Looping was a problem in case of using tcpsso(8) to switch a TCP stack
where the acceptance check of the new TCP stack results in EAGAIN.

Reviewed by:            kib, glebius
MFC after:              1 week
MFC to:                 stable/15
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D60444
d39b12e9030b20410cecbcbb0c22847d7f8b5471 Michael Tuexen 2026-10-08 13:05:11

debug: classified in 04-filenames_plain2 by 'sys/'

systm.h: Remove unused <sys/kpilite.h>
It only contains sched_pin_lite() and sched_unpin_lite(), which have
been unused in-tree for the past 8 years, and were only briefly used
between 6573d7580b85 ("epoch(9): allow preemptible epochs to compose")
and a760c50c9ea7 ("With epoch not inlined, there is no point in using
_lite KPI. (...)").

Additionally, these functions are redundant with the existing
sched_pin() and sched_unpin() in <sys/sched.h>, which are already
themselves inline functions.  The only difference is that the
sched_*_lite() ones do not require the full definition of 'struct
thread', which may have been useful to circumvent namespace pollution.

That problem, if it materializes again, could be quickly circumvented
without this trickery by the use of non-inline functions, or using
inline functions referencing a variable filled at kernel startup with
the desired offset.  The trickery of using offsets computed at
compile-time appears necessary only in the case of extremely performance
sensitive functions.  Cleaning up namespace pollution should stay the
preferred way forward whenever possible.

Reviewed by:    glebius, imp
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60404
e478037df4f12e3d1b6b551f05ea7ce23c096886 Olivier Certner 2026-10-06 09:36:09

debug: classified in 04-filenames_plain2 by 'sys/'

nmount: Introduce the "check_fsid" option
See the manpage addition for rationale

Reviewed by:    ziaee, kib
Approved by:    ziaee, kib
Differential Revision:  https://reviews.freebsd.org/D59930
c3ac06161dd5b1ac61bcf097060d1e7ae5f0cd57 Gleb Popov 2026-09-23 15:35:42

debug: classified in 04-filenames_plain2 by 'sys/'

lindebugfs: implement debugfs_create_devm_seqfile()
Implement debugfs_create_devm_seqfile() keyed by device and a
read function.

This was implemented months ago in order to support debugfs with mt76
but hasn't been exercised since.

The code does not really seem to belong in lindebugfs, but also does
not really fit into debugfs.h (rather fs.h?); leave it here with a
comment for now as neither dumbbell nor I could come up with a better
place.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D57524
3521cce445d4238aa425629c5fcc1c723b427d3e Bjoern A. Zeeb 2026-06-10 11:15:42

debug: classified in 04-filenames_plain2 by 'sys/'

LinuxKPI; factor out parts of device.h into device/devres.h
In [1] it was pointed out that devm_kmemdup_* have moved apparently
in Linux 7.0 into their own device/devres.h header file from device.h.
Move them and other parts (some being dependencies) along.

device/devres.h gets included from device.h so all that changes is
prototype, macro, and inline function ordering.

This should prepare us in case drivers start directly including
the sub-header.  It also helps to keep device.h more reasable.

Suggested by:   dumbbell (in D56396) [1]
MFC after:      3 days
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D60213
53beb6950f9415eb06dc24b9addea5932e3bd0da Bjoern A. Zeeb 2026-10-01 23:09:14

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #70: LinuxKPI
LinuxKPI: re-implement pm_runtime.h

The original implementation was based on OpenBSD under public domain
but just defined the functions to void.
FreeBSD later extended the file with more inline functions or dealing
with differences in Linux versions.

This rework tries to group some functions, adds properly typed arguments
and return values in some cases.
It further adjusts return values based on the !CONFIG_PM expectations.

Lastly pr_debug() calls are added so we could see if/how much these
functions are used in new/other works rather than code just compiling
but the functions entirely being ignored without the knowledge of the
person porting code.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D58169
863fe7ae5152926fab0380a78ba26b6ba4a2d65f Bjoern A. Zeeb 2026-07-11 14:36:06

debug: classified in 04-filenames_plain2 by 'sys/'


LinuxKPI: introduce LINUXKPI_DEBUG to enable LinuxKPI debugging

This allows us to build kernels which will (if the sysctl is enabled
too) show pr_debug() and pr_devel() output.

Enable it by default for debug kernels.

This option can later also be used for other LinuxKPI parts, like
skbuffs, netdevice, rcu, ... to conditionally compile in debugging
support to further justify its existence beyond an in-code #define.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell, emaste
Differential Revision: https://reviews.freebsd.org/D54060
9820afb99e6fdc471cb820f321530c52ed2c31ac Bjoern A. Zeeb 2025-11-25 17:17:55

debug: classified in 04-filenames_plain2 by 'sys/'


LinuxKPI: use LINUXKPI_DEBUG to determine on witness lock tracing

LinuxKPI by default tells witness to ignore the locks, which is
unhelpful in case of panics like 'panic: sleeping thread holds lnxspin'.
While I have edited the lock initialitzation manually in the past,
make this dependent on both LINUXKPI_DEBUG and WITNESS.
Define an internal _LKPI_MTX_NOWITNESS (and equivalent for other lock
types used) and set them accordingly in kconfig.h, a file automatically
included to all LinuxKPI compiled code (like global.h). (*)
In addition, in the debug case, also define WITNESS_ALL to get file,
line, and lock name as a lock name rather than just, e.g., lnxspin.

(*) We will need another follow-up as -include ordering is currently
wrong for LinuxKPI modules. See D60207.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D59231
bbfd52dcbeb7b6e540220b3b24b664df6d200200 Bjoern A. Zeeb 2026-08-21 13:15:22

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #71: LinuxKPI
LinuxKPI: pci: cleanup lkpinew_pci_dev_release()

Factor out some cleanup routines from the device detach path so
we can re-use them here too.
Also clarifying that lkpinew_pci_dev_release() should only run
from the (*release) callback function means that we adjust our
other calls to what we had already envisioned in comments, to
go through the official pci_dev_put() path.

Compared to the device detach path, we have little chance to know
if we held the last reference and if the device is really gone or
not but in this case a later release would be fine (if it happens).
In contrast to the device detach path we cannot do the hack of
setting the .release callback to NULL and check upon return from
pci_dev_put() as in this case the pdev is freed.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell (before rebase for ac9c07a3e908 instead of D57430)
Differential Revision: https://reviews.freebsd.org/D57431
9d82546ac2def568ff2f55c63cd77c8d8ff959e2 Bjoern A. Zeeb 2026-06-03 03:39:09

debug: classified in 04-filenames_plain2 by 'sys/'


LinuxKPI: pci: make internal variables file local

The only reason the internal lists and lock are shared seems to be
because the SYSINIT code was in linux_compat.c.

Migrate the three variables (pci_drivers, pci_devices, and pci_lock)
to linux_pci.c and make them file local.

While doing so adjust a few things:
(a) mark the various sections of the linux_pci.c file as we add new
    SYSINIT code to the middle of the file.  The file currently really
    contains three parts.
(b) rename the variables by adding a lkpi_ prefix indicating that they
    are part of our internal code and not part of the public KPI, and
    to clearly distinguish them from any native PCI code upon which
    we call as well.
(c) factor the locking code out into macros as we have often done in
    various parts of the kernel to make the lock itself more opaque.

No functional changes intended.

Sponsored by:   The FreBSD Foundation
MFC after:      3 days
Reviewed by:    emaste, dumbbell (before rebase)
Differential Revision: https://reviews.freebsd.org/D57432
e2bef7e30aa74ed3d46a5ce5d171993e9e2c14b8 Bjoern A. Zeeb 2026-06-03 04:32:45

debug: classified in 04-filenames_plain2 by 'sys/'


LinuxKPI: pci: first round of file cleanup

While the multiple sections of the file are mostly clearly separated
some bits were spread around.

Get the device methods array to the end of the file saving us a lot
of forward function delcarations and making it easier to rename them
to a common lkpi_ prefix instead of linux_ showing that they are file
local internal functions not part of any official LinuxKPI KPI.

Sort the various lkpi_pci_* bus attachment functions together,
followed by the lkpi_pci_iov_ ones.  Then add the
pci_[un]register_driver* driver bits.  This keeps the group
logically together.

For the PCI functions then group the pdev allocations and free/release
functions--for the two paths--together, giving them more homogeneous
names and add comments to some of them so it is more clear which
ones are shared ("common") and which ones belong to which code path.

Move some helper function around to where they are needed now.

There is still more to do for the resource section which sits somewhere
in the middle but that will better be a separate pass.

For the DMA and backlight parts, rename various private bits to
a lkpi_ prefix as well (structures, variables, functions) away
from the public linux_ prefix which should belong to the linuxolator
in first place.

No functional changes intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell (before rebase)
Differential Revision: https://reviews.freebsd.org/D57433
7c9ee41f4fe4a6de6e5f4c3d7c3a38ff447c8cf3 Bjoern A. Zeeb 2026-06-03 05:36:35

debug: classified in 04-filenames_plain2 by 'sys/'

rms: Order a writer's stores before its readers see it leave
Readers check rms->writers without a fence, and rms_wunlock() drops
it with a plain store.  rms_wlock() interrupts every CPU before the
first writer blocks readers, but nothing orders them when the last
writer leaves: on a weakly ordered CPU a reader can see the count
reach zero and still read what the writer replaced, such as callbacks
of a module unloaded under the lock.

Fence every CPU before the last writer drops the count: rename
rms_wlock_switch() to rms_block_readers() and add
rms_unblock_readers(), a wrapper for cpus_fence_seq_cst().  Readers
stay fence-free; the cost lands on the rare unlock.

Reviewed by:            mjg
Discussed with:         kib
Fixes:                  https://cgit.freebsd.org/src/commit/?id=1f162fef76a0 ("Add read-mostly sleepable locks")
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60658
2b911d947b5c1157a495454123ea972a18e4743d R. Christian McDonald 2026-10-12 20:44:32

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #72: mbuf: simplify m_free
mbuf: simplify m_free

The check for  (M_PKTHDR|M_NOFREE) was added by np@ in
"91d1b03d3617 Merge r254736 from user/np/cxl_tuning."
in order to support a clever rx mode optimization used
by cxgbe at the time.  That optimization was removed in
46e1e307edb6 several years ago.  This check is otherwise
unneeded and adds an extraneous test to every mbuf free,
so let's remove it.

Reviewed by: glebius, np
Differential Revision: https://reviews.freebsd.org/D60686
Sponsored by: Netflix
398254f9999eb1af5f0842570111d584aaf8d01a Andrew Gallatin 2026-10-12 21:32:52

debug: classified in 04-filenames_plain2 by 'sys/'


pfil: Avoid potential mbuf tag leak

In '398254f9999e mbuf: simplify m_free' we removed tag processing
on m_free() of M_NOFREE mbufs. It is possible that a packet filter
could attach a tag to this stack mbuf and call m_free()
on it, meaning that 398254f9999e may have introduced a tag leak.

However,if a tag is attached without anyone calling m_free(), then
this leak was pre-existing.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D60686
Fixes: https://cgit.freebsd.org/src/commit/?id=398254f9999e
Sponsored by: Netflix
f4ff995e361fa72cea240c4dbac2d0931965c80f Andrew Gallatin 2026-10-13 13:01:26

debug: classified in 03-filenames_plain1 by 'sys/net/'

debug: moved to kernel because 'Need to be grouped with 398254f9999eb1af5f0842570111d584aaf8d01a'

Reformat the shutdown messages when debug.bootverbose is set
Reported by:  bz
Fixes:          https://cgit.freebsd.org/src/commit/?id=b551cb063c5 ("During shutdown, announce each file system")
MFC after:      1 week
Sponsored by:   ConnectWise
Differential Revision: https://reviews.freebsd.org/D59744
228d2ac511de3dda45c85a3af465c05b14c9162b Alan Somers 2026-09-16 21:37:30

debug: classified in 04-filenames_plain2 by 'sys/'

mbuf: move leaf_rcv union farther back in the pkthdr
When the leaf_rcv union was introduced to support ktls RX offload in
4d88d81c3166 it was put at the front of the pkthhdr, and pushed the
more commonly accessed csum_flags and rsstype into the next cacheline.

Given that csum_flags is accessed on every pkt sent and every pkt freed,
but the leaf_rcv fields are only used for ktls rx offload, it makes more
sense to have csum_flags in a cacheline that is already likely to be hot.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D60691
Sponsored by: Netflix
9890a0d5e04a1b4cd398a52be6374734b9496cd3 Andrew Gallatin 2026-10-13 13:12:10

debug: classified in 04-filenames_plain2 by 'sys/'

__FreeBSD_version: Bump for changing pkthdr layout
Changing the layout of the pkthdr requires external drivers
to be rebuilt, lest they access the wrong fields.

Sponored by: Netflix
Differential Revision: https://reviews.freebsd.org/D60691
83f5b5c2eeba2a2d66d87d4367ca5406322386a4 Andrew Gallatin 2026-10-13 13:51:41

debug: classified in 04-filenames_plain2 by 'sys/'

linuxulator: Accept 0 as signal in rt_sigqueueinfo
Linux allows 0 as a signal for rt_sigqueueinfo(2) the same as it does
for kill(2).  This is used to check for process existence and
permissions.

Allow this value through as a special case in linux_rt_siqgueueinfo the
same way as was done for linux_kill.

Before this change, lio_listio(3) would fail with EINVAL under
Linuxulator.  Now it is functional.

MFC after:      1 week
Reviewed by:    kevans
Approved by:    kevans (mentor)
Differential Revision:  https://reviews.freebsd.org/D60574
33d9fbf5f95301f6eefbbf7e7fd49b4e9c098919 Ryan Moeller 2026-10-13 16:42:45

debug: classified in 04-filenames_plain2 by 'sys/'

linux: cap mount id to INT_MAX
linux stores mount id as a int32_t, using xor would make it becomes
negative in some cases. As a result, we cap the value to INT_MAX to
prevent getting a negative value from userspace.

MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D59202
23626eb9e3d61928358c9c813aa5a17e797ba404 ShengYi Hung 2026-08-26 20:44:47

debug: classified in 04-filenames_plain2 by 'sys/'

ip_encap: Recompute flowid for packets received over tunnel
Packets decapsulated by a tunnel interface carry the NIC's flowid
computed over the outer tunnel tuple, which is the same for every
flow a peer carries. Therefore mpath nhop selection places all
traffic on one path.

Add encap_set_flowid() to ip_encap.c, which rehashes a decapsulated
IP packet on its inner addresses.

The feature is off by default and is enabled with the per-vnet
net.route.hash_inbound sysctl.

Reviewed by:    gallatin
Differential Revision:  https://reviews.freebsd.org/D60552
84f790e5b6ccca9d7253834b7dcac5f4432b2917 Pouria Mousavizadeh Tehrani 2026-10-09 11:08:44

debug: classified in 04-filenames_plain2 by 'sys/'

epoch: Queue drain callbacks from each CPU's callback task
epoch_drain_callbacks() bound the calling thread to each CPU in turn
to queue a callback on that CPU's record.  Callers are often user
threads, such as kldunload or ifconfig destroy, and ULE does not
preempt a CPU-bound thread for a migrating thread of no better
priority, so each bind could wait out a time slice.  On an 8-CPU VM
with six busy loops running, destroying an epair interface took 1.5 s
and kldunload pflow 0.8 s.

Instead, set a request flag on each record and enqueue that CPU's
callback task, which queues the callback before it polls the record.
The task runs on the CPU's softirq gtaskqueue thread at PI_SOFT, which
preempts a busy user thread, so the request is served at once; the
caller no longer migrates.  Both operations now take under 10 ms, idle
or under load.

Reviewed by:            markj
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60646
fe90f180047bc2cb4d15d4a31033741add5f5d10 R. Christian McDonald 2026-10-14 00:16:35

debug: classified in 04-filenames_plain2 by 'sys/'

newvers.sh: Report -dirty also with staged changes
We add -dirty to the uname version string if the tree does not match the
reported hash. Previously, staged but uncommitted changes were ignored.
Noted by naddy@ in D60606.

Reviewed by:    cperciva, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60722
617c700abae7aba74777fca137458395936f5053 Ed Maste 2026-10-14 12:42:40

debug: classified in 04-filenames_plain2 by 'sys/'

ktls: Take the receiving interface of each packet in sbappend_ktls_rx()
sbappend_ktls_rx() read the receiving interface of each packet header it
demotes from the chain's first mbuf, whose header it had zeroed on the first
pass. A chain of two packets or more thus had no interface, and a change of
input interface went unnoticed: the TLS receive tag stayed on the old interface
until a later append of one packet.
Read it from the packet being demoted, as the decrypted mark is.

Fixes: https://cgit.freebsd.org/src/commit/?id=fe8c78f0d202 ("ktls: Add full support for TLS RX offloading via network interface.")

Approved by:    gallatin
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D60758
c9599b80015a50e66c907dc667334a53bc234dab Olivier Cochard 2026-10-16 04:32:29

debug: classified in 04-filenames_plain2 by 'sys/'

ktls: Fix capability checks in ktls_reset_receive_tag()
IFCAP2_RXTLS4 and IFCAP2_RXTLS6 are bit numbers, not masks, so
ktls_reset_receive_tag() tested if_capenable2 against 0 for IPv4 and against the
RXTLS4 bit for IPv6. An IPv4 connection with NIC receive TLS offload thus never
got a new receive tag after its packets moved to another interface, and fell
back to software decryption for good.
c721694 fixed the same checks in ktls_alloc_rcv_tag(); use IFCAP2_BIT() here
as well.

Fixes: https://cgit.freebsd.org/src/commit/?id=fe8c78f ("ktls: Add full support for TLS RX offloading via network interface.")

Approved by:    gallatin, kib
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D60757
32a981471c0147ea494745477434807cf8b6dadb Olivier Cochard 2026-10-16 04:40:03

debug: classified in 04-filenames_plain2 by 'sys/'

linux: preserve epoll descriptors across fork using KQUEUE_CPONFORK
Linuxulator implements epoll instances using kqueues. Currently,
epoll_create_common() creates the backing kqueue with copy-on-fork
disabled. When fork() copies the descriptor table, the kqueue is
omitted from the child's table.

This differs from Linux, where an epoll descriptor survives fork(),
including when it was created with EPOLL_CLOEXEC. That flag controls
descriptor lifetime across exec(), not fork().

The missing descriptor breaks dbus-daemon daemonization. The daemon
creates its epoll instance before forking and continues using the
saved descriptor number in the child. F_GETFD initially fails with
EBADF. Once another open reuses that number, subsequent epoll_ctl()
calls fail with EINVAL because the descriptor no longer refers to
an epoll instance. The daemon then exits, preventing applications
that depend on the session bus from starting correctly.

Enable KQUEUE_CPONFORK for epoll's backing kqueue. This preserves the
descriptor number and copies supported event registrations into the
child, allowing the daemonized process to continue using epoll.

This is a partial compatibility improvement, not a complete
implementation of Linux epoll inheritance. Linux parent and child
reference the same epoll instance, whereas KQUEUE_CPONFORK creates
independent queues. Consequently, registration changes and one-shot
event consumption in one process are not reflected in the other.
Applications relying on shared epoll state across fork still require
further work.

Validation:
- A static Linux x86-64 C reproducer fails under the original
  Linuxulator and passes on a real Linux kernel under QEMU.
- Before this change, the child loses its epoll descriptor with
  both EPOLL_CLOEXEC enabled and disabled, while ordinary pipe
  descriptors survive.
- After this change, descriptor flags, inherited readiness and
  event data remain available in the child. epoll_ctl() also
  succeeds after allocating additional descriptors.
- Both dbus-daemon --session --fork and dbus-launch start
  successfully and answer a ListNames request from a separate
  client.
- Shared-state regression tests still fail for parent visibility
  of child ADD/MOD/DEL operations and EPOLLONESHOT consumption,
  documenting the remaining semantic differences.

Reviewed by:    kib
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60783
b3836322a1e6863734427ac9c01381ab25458126 Vladimir Grebenshchikov 2026-10-12 18:40:23

debug: classified in 04-filenames_plain2 by 'sys/'

linuxkpi: implement irqs_disabled
This adds a function which is used from various places in drm-kmod
to detect if the code can sleep or not. Currently, these locations
(such as intel_guc_send_busy_loop) are ifdeffed to freebsd specific
solutions (usually drm_can_sleep).

This change implements irqs_disabled. We check td_pinned as spinlocks
will call sched_pin, and td_critnest to check if we are in a critical
section.

Approved by:    wulf, khng (mentor)
Differential Revision:  https://reviews.freebsd.org/D57782
4f2f26fb1e8aefb529e6186d8f39e1255dc98036 Austin Shafer 2026-06-23 18:55:31

debug: classified in 04-filenames_plain2 by 'sys/'

mbuf: remove remnants of caddr_t
caddr_t is a typedef for a character pointer (char *) that originated in
Version 7 Unix, released by AT&T in 1979.  It became obsolete in 1989,
when ANSI C introduced void *.

There is a lot of code that uses m->m_data for arithmetics, thus we can't
switch it to void * easily.  Let's at least stop proliferation of caddr_t.
We have developers that are twice younger than obsoletion of this type.

Reviewed by:            zlei, tuexen, adrian
Differential Revision:  https://reviews.freebsd.org/D60736
690c3fbbe1ed31d551a81e665e3f6dbdaadb045e Gleb Smirnoff 2026-10-16 21:09:19

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #73: linuxkpi
linuxkpi: add strncpy_from_user()

Same semantics as Linux: returns the string length without the NUL,
count if the string was truncated, or -EFAULT. Implemented with
copyinstr(9). Unlike linux_copyin() it does not translate the remapped
ioctl argument window; its user, drm/virtio, passes a pointer taken
from the ioctl payload, so that is not needed.

Signed-off-by:  Denis Borovikov <denis.borovikov@gmail.com>
Reviewed by:    wulf
Differential Revision:  https://reviews.freebsd.org/D60198
59642e07f4272d56d5a2b68169e388123d01b03b Denis Borovikov 2026-10-17 19:55:17

debug: classified in 04-filenames_plain2 by 'sys/'


linuxkpi: add uuid_t and helpers

linux/uuid.h has only the guid_t family. Add uuid_t, next to guid_t,
with uuid_equal(), uuid_copy(), import_uuid() and export_uuid(),
mirroring the guid_ versions.

Used by drm/virtio for dma-buf UUID export.

Signed-off-by:  Denis Borovikov <denis.borovikov@gmail.com>
Reviewed by:    wulf
Differential Revision:  https://reviews.freebsd.org/D60199
fce354b0e9ebd682b251de17bc743d8d855e0cdd Denis Borovikov 2026-10-17 19:55:17

debug: classified in 04-filenames_plain2 by 'sys/'


linuxkpi: add pci_is_vga()

Returns true for a VGA-compatible display controller and for the
pre-PCI 2.0 VGA class (base 0x00, subclass 0x01), as Linux's
pci_is_vga() does. Used by drm/virtio to decide whether to remove
the firmware framebuffer on virtio-vga.

Signed-off-by:  Denis Borovikov <denis.borovikov@gmail.com>
Reviewed by:    wulf
Differential Revision:  https://reviews.freebsd.org/D60200
8558dd61e6747fef424ef924b19f4095072fc2f3 Denis Borovikov 2026-10-17 19:55:17

debug: classified in 04-filenames_plain2 by 'sys/'


linuxkpi: Fix sysfs_remove_group() for groups without a name

sysfs_create_group() handles a group with a NULL name by creating its
attributes directly under the object node, but sysfs_remove_group() passed
the NULL name to sysctl_remove_name(), which then panics in strcmp().

Mirror the creation path: for an unnamed group, remove each attribute and
binary attribute individually.

This was not hit before because the devres actions of a PCI device
(e.g. the one registered by devm_device_add_group()) were not run when
the driver was detached.

Sponsored by:   Beckhoff Automation Gmbh & Co. KG
bf876046e4b13c348de0414a69184026678bbf10 Emmanuel Vadot 2026-10-28 11:17:37

debug: classified in 04-filenames_plain2 by 'sys/'


linuxkpi: Release devres on PCI driver detach

linux_pci_detach_device() called the driver remove method and then only
dropped its reference on the device, expecting the devres list to be
released from lkpi_pci_dev_release() once the last reference is gone.

That never happens when a devres action itself holds a reference on the
device.  The typical case is devm_drm_dev_alloc(): the drm_device takes a
reference on its parent and the matching drm_dev_put() is a devres
action.  The device is thus never released, drm_dev_release() is never
called and the DRM device and everything it owns is leaked, which makes
unloading drm-kmod drivers fail ("failed due to N other pending
references on the LinuxKPI device") and leaves the module unloadable or
crashing.

Linux releases the devres resources when a driver is unbound, so do the
same: call lkpi_devres_release_free_list() right after the remove method.
The list is empty when lkpi_pci_dev_release() runs later.

Reviewed by:    bz
Sponsored by:   Beckhoff Automation GmbH & Co. KG
71d26da7e43db58116911e432dcb261f745e520b Emmanuel Vadot 2026-10-28 11:17:37

debug: classified in 04-filenames_plain2 by 'sys/'


linuxkpi: Fix lkpi_i2c_del_adapter() leaving the devices behind

lkpi_i2c_del_adapter() looked for the lkpi_iic or lkpi_iicbb device to
delete with device_find_child() on increasing unit numbers, and stopped at
the first unit that does not exist.  Units are allocated globally per
devclass, so as soon as one adapter was removed (leaving a hole) or when the
units of a parent do not start at 0, the adapter was not found and its
device was never deleted.  The i2c devices of a driver such as i915 then
accumulate, with a new set of unit numbers, each time it is loaded.

Walk the children of the parent instead and match on the adapter.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
c15aab01e9ea281f5fb071866619d9e664667672 Emmanuel Vadot 2026-10-28 13:05:32

debug: classified in 04-filenames_plain2 by 'sys/'


linuxkpi: Do not wait for a disabled tasklet in tasklet_unlock_wait()

tasklet_unlock_wait() waited for the tasklet state to become idle.  Linux
only waits for TASKLET_STATE_RUN, i.e. for a tasklet that is currently
executing.  A tasklet which is scheduled but disabled does not run until
it is enabled again, so in LinuxKPI it stays in the BUSY (queued) state and
the waiter never returns.

This is what happens when unloading i915: execlists_reset_prepare()
disables the engine tasklet with __tasklet_disable_sync_once() while the
tasklet is queued and kldunload loops forever in pause().

Do not wait if the tasklet is only queued and disabled.

Reviewed by:    bz
Sponsored by:   Beckhoff Automation GmbH & Co. KG
f739d9f46c24da39651ae981a549a55eb2a3d006 Emmanuel Vadot 2026-10-28 15:02:00

debug: classified in 04-filenames_plain2 by 'sys/'

clntrdma.h: Add some fields to RDMA structures (glue for nfsclrdma.ko)
This patch adds some fields to NFS client side RDMA
structures and an additional argument to xprt_rdma_release_send().
This patch does not fix any semantics issue.

MFC after:      3 months
Fixes:  https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
02971f200083837e7a5001b00e11753d1abddc00 Rick Macklem 2026-10-17 23:24:00

debug: classified in 04-filenames_plain2 by 'sys/'

vfs_subr.c: fix signature mismatch for close method
Reviewed by:    jhb
Differential Revision:  https://reviews.freebsd.org/D49166
fe6aee442d4de11864f511509ece76286b73f5b9 ShengYi Hung 2026-05-23 14:43:06

debug: classified in 04-filenames_plain2 by 'sys/'

LinuxKPI: account for delayed work cancelled after taskqueue dequeue
I encounter intermittent shutdown/restart hangs with i915/GuC and the
normal 34 ms scheduling-disable delay. Setting that delay to zero has
avoided the hang in my testing. This change fixes a reproducible
LinuxKPI cancellation-accounting defect that can leave the
corresponding context reference unreleased, rather than changing the
driver's delay.

Commit 79e290d96786 corrected the ordinary queued and already-executing
return values of cancel_delayed_work_sync(). There is still a gap
between native taskqueue dequeue and LinuxKPI callback ownership:

1. In sys/kern/subr_taskqueue.c, taskqueue_run_locked() removes the
   task, clears ta_pending and sets tb_running before calling its
   handler.
2. Before linux_work_fn() claims the callback,
   linux_cancel_delayed_work_sync_int() atomically changes WORK_ST_TASK
   to WORK_ST_IDLE.
3. taskqueue_cancel() can now return EBUSY with pending == 0: the
   native task is busy, but the Linux callback has not started.
4. linux_work_fn() subsequently sees IDLE and skips the callback. The
   cancelling thread drains the task and retries, but returns false
   because neither the timer-stop result nor the native pending count
   records what it cancelled.

The task can also finish consuming IDLE before taskqueue_cancel() is
called, giving success with pending == 0 and the same incorrect false
return. This affects zero-delay WORK_ST_TIMER and WORK_ST_CANCEL left
by a failed nonblocking cancellation as well. A zero-delay self-requeue
handled by linux_work_fn()'s executor loop can similarly be pending
without a native queue entry.

Use the old state returned by the atomic transition to account for
pending work suppressed by this cancellation: TIMER, TASK and CANCEL
contribute a true result. EXEC does not: the callback has already been
claimed, or has finished with that sticky state. Keep the native
pending-count aggregation, drain operations and retry decisions
unchanged; use a separate local variable for the callout-stop result.
In particular, EBUSY alone is not treated as successful cancellation,
which would regress the already-running-callback case fixed by
79e290d96786.

One affected consumer is guc_request_alloc() in drm-kmod's
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c. It calls
intel_context_sched_disable_unpin() when cancel_delayed_work_sync()
returns true. Suppressing the delayed callback while returning false
can leave neither path responsible for releasing that reference,
retaining the engine wakeref that shutdown later waits for.

Fixes:  https://cgit.freebsd.org/src/commit/?id=79e290d96786 ("Fix cancel_delayed_work_sync() return value")
Signed-off-by:  JustAnotherHumanBeing <oleglelchuk@gmail.com>
Differential Revision:  https://reviews.freebsd.org/D60046
2ff9182d89215322de1958057bf2345d34a6576e JustAnotherHumanBeing 2026-10-18 15:15:54

debug: classified in 04-filenames_plain2 by 'sys/'

namei: retry absolute symlink expansions from the native root
For a Linux ABI process, namei() resolves a path first under the ABI
root (compat.linux.emul_path) and, if that fails, restarts the walk
of the original path from the native root.  Since 459ac3044b51 an
absolute symlink target found during the ABI pass stays under the
ABI root, so self-contained Linux userlands resolve their own
symlinks correctly (PR 289739); but when the target names a file
that exists only in the native namespace, the walk fails and the
restart cannot recover: it re-walks the original path, whose
ABI-visible prefix (the symlink itself) does not exist natively.

Casualties are the absolute symlinks planted under the emulator root
to integrate the host into the Linux namespace -- among them
linux-rl9-fontconfig's /compat/linux/etc/fonts ->
/usr/local/etc/fonts (Linux fontconfig cannot load its
configuration, degrading font matching to arbitrary results) and
similar links from linux-rl9-alsa-lib and linux-rl9-ca-certificates
-- and linprocfs' /proc/<pid>/exe, whose target is a host path:
following it fails for any Linux binary whose text lives outside the
emulator root (Chromium-based browsers execve /proc/self/exe to
spawn helpers), unless procfs(5) mounted at the native /proc masks
the failure.

Remember the expansion produced while following an absolute symlink
during the ABI pass and, when that pass fails with ENOENT before the
target has resolved, perform the one allowed native restart walking
the saved expansion in place of the original path.  The target has
resolved once the walk has consumed it, leaving no more than the
suffix appended past it; an ENOENT after that point restarts from
the original path as it always has.  Lookups that succeed under the
ABI root are unaffected, preserving 459ac3044b51; lockless lookups
are unaffected because cache_fplookup_symlink() already aborts to
the locked path for absolute symlinks whenever an ABI root is
active.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297426
Fixes:          https://cgit.freebsd.org/src/commit/?id=459ac3044b51 ("namei: Preserve ABI root for absolute symlinks before fallback")
MFC after:      1 month
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D58855
23b326728778fd3a6c37b33686dea98d010eb1cf Devin Teske 2026-10-18 15:44:12

debug: classified in 04-filenames_plain2 by 'sys/'

sched_ule: tdq_runq_add(): Scope variables, delineate the different steps
For better readability.

No functional change (intended).

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
d5e9c642307c13b8058609f421b63e2c72bab45f Olivier Certner 2026-10-09 09:19:58

debug: classified in 04-filenames_plain2 by 'sys/'

sched_ule: sched_affinity(): Delineate steps
No functional change (intended).

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
a1fe7f00bc452653426493c511d288e5a4e7862d Olivier Certner 2026-10-09 14:50:59

debug: classified in 04-filenames_plain2 by 'sys/'

sched_ule: Use TDQ_CPU() macro instead of fiddling with DPCPU
No functional change (intended).

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
79ca9f787ca92018a1374242bb77252af6fce0d0 Olivier Certner 2026-10-13 08:28:18

debug: classified in 04-filenames_plain2 by 'sys/'

sched: INVARIANTS: Check sched_preempt() is called on 'curthread'
sched_preempt() does not support operating on a remote thread.  If you
are looking to influence CPU allocation on another thread, see, e.g.,
cpuset_setthread(), which in the end calls sched_affinity().

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
f19009020a33d07d7cad9393b4bf0a36f267cd07 Olivier Certner 2026-10-13 08:31:36

debug: classified in 04-filenames_plain2 by 'sys/'

kmsan: Add a required forward type declaration
MFC after:    1 week
ad37abf653f77c59ce6c296eda9976c74c905d2e Mark Johnston 2026-10-16 14:11:03

debug: classified in 04-filenames_plain2 by 'sys/'

inotify: Open target the directory when adding a watch
When an application uses inotify to watch a directory,
vn_inotify_add_watch() reads the directory entries and does a name
lookup so as to induce the filesystem to create namecache entries.
Some filesystems expect the directory to be opened before VOP_READDIR
can be called, so do that.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299239
Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60782
de80428118101624aaeaae02d59665d1027ff10e Mark Johnston 2026-10-19 13:44:41

debug: classified in 04-filenames_plain2 by 'sys/'

mbuf: make m_pullup() an inline over most expected case
Implement a most typical use of m_pullup() as an inline and leave only the
heavy part as a function.  A sweeping change to make benefit of the new
version follows.

Reviewed by:            pouria, zlei, gallatin
Differential Revision:  https://reviews.freebsd.org/D60688
671babc79497587ef5a59f58578f8fce9359398c Gleb Smirnoff 2026-10-19 17:31:50

debug: classified in 04-filenames_plain2 by 'sys/'

linux: implement sched_getattr()
This change adds the necessary glue to translate Linux scheduler policy
and priority from FreeBSD so this information is available to Linux
applications.

Please note that this change does not fill in the `.sched_nice` property: this
will be handled in a follow up commit (see bug 299617 for more details).

This unbreaks using the Linux version of Chromium on FreeBSD.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297468
Signed-off-by:  Joao Bonifacio <joaoboni017@gmail.com>
Pull Request: https://github.com/freebsd/freebsd-src/pull/2370
Reviewed by:    olce
Differential Revision:  https://reviews.freebsd.org/D60214
e45c7bc6115ef3cd9567a397e1351c608c0269a7 Enji Cooper 2026-10-10 18:18:23

debug: classified in 04-filenames_plain2 by 'sys/'

Retire bogus predicts on case statements.
They are ignored by clang.

No functional changes (nor .o changes).

Sponsored by:   Rubicon Communications, LLC ("Netgate")
dbbff47e274c16d56c6adf42fecbb33157718287 Mateusz Guzik 2026-10-20 05:24:13

debug: classified in 04-filenames_plain2 by 'sys/'

vfs: unbreak builds when MAC is not defined
Sorts out powerpc.QORIQ64 build failure.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
e6fb3b518ac453a714dcf2fa3fbb84f31907d84c Mateusz Guzik 2026-10-20 05:49:18

debug: classified in 04-filenames_plain2 by 'sys/'

devfs: make persistent controlling terminal an ABI property
Linux leaves the session's controlling terminal in place after the
last file descriptor on the slave is closed, so a later open of
/dev/tty succeeds.  FreeBSD drops the session vnode reference on that
close. /dev/tty then fails, which breaks Linux programs such as xterm
that close the pty slave during startup and expect /dev/tty to keep
working.

When the closer is a Linux process, leave the session reference in
place.  Still pass FLASTCLOSE to the driver so the master sees hangup.
Native close behavior is unchanged.

Add the SV_PERSISTENT_CTTY sysentvec flag for ABIs that retain the
controlling terminal after the last slave descriptor is closed.  This
keeps the devfs behavior ABI-agnostic and allows other ABIs to request
the same semantics if needed.  Use the flag in devfs_close().

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60701
e8923c7346a882418352683f72e7c4f8e68d6907 Vladimir Grebenshchikov 2026-10-13 23:04:27

debug: classified in 04-filenames_plain2 by 'sys/'

arm64: enable ossl accelerated AES-GCM on arm64
Connect the baseline OpenSSL ARMv8 fused AES-GCM kernels to the OCF
ossl driver. Advertise the algorithm only when the system-wide capability set
includes both AES and PMULL.

Note that get_kernel_reg() is used to detect features such as PMULL
because the ossl device attaches before arm64 populates elf_hwcap when
ossl is built into the kernel or pre-loaded at boot.

Prefer OSSL over armv8crypto for AES-GCM sessions while retaining
armv8crypto as a fallback.

This provides about a 50% speedup for a Netflix ktls workload on a small
neoverse N1 board.

Reviewed by: markj
Constructive review feedback from: andrew, ngie
Differential Revision: https://reviews.freebsd.org/D60097
Sponsored by: Netflix
ceb575553b222a310346f6a98b3c39bff49cb069 Andrew Gallatin 2026-10-20 18:58:39

debug: classified in 04-filenames_plain2 by 'sys/'

sys/sysent.h: align SV_* flags values, provide full 32bit
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
dca0b0ad8bc7df6119b04d1b766289406e3274a3 Konstantin Belousov 2026-10-20 17:43:58

debug: classified in 04-filenames_plain2 by 'sys/'

sys: centralize SV_* flags definitions for several FreeBSD ABIs
The omitted ABI is compat32 on arm64, which lacks SV_ASLR.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
f69d974bf6d2f7ccaa3e6a5f9609cfca0d66ec8d Konstantin Belousov 2026-10-20 17:50:34

debug: classified in 04-filenames_plain2 by 'sys/'

sys: centralize SV_* flags definitions for ELF Linux ABIs
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
8dfa23d81f5e0969ac31c34279201f9286358e44 Konstantin Belousov 2026-10-20 18:23:26

debug: classified in 04-filenames_plain2 by 'sys/'

LinuxKPI: restore several hard coded return values for the CONFIG_PM case
drm-kmod sets CONFIG_PM (unclear if for other parts) but LinuxKPI
has no understanding of a dev->power implementation for pm_runtime.h.

The return values based on !CONFIG_PM thus cause problems to drm-kmod.
Return the previous values under CONFIG_PM but leave the TODO logging
as the actual implementation is missing and return values may not be
universally correct (beyond the known drm-kmod use cases).

The following functions having a return value but none sepcific for
CONFIG_PM as (based on drm-kmod master):
pm_runtime_resume          only caller ignores the return value
pm_runtime_set_active      two callers ignore the return value
pm_runtime_put_autosuspend all callers seem to ignore the return value
pm_runtime_autosuspend     2/3 callers ignore the return value;
                           3rd is #ifdef __linux__
pm_runtime_suspended       3/4 callers ... do check the return value
                           but the logic expects the false, which also
                           matches the previous value.

Fixes:          https://cgit.freebsd.org/src/commit/?id=863fe7ae5152 ("LinuxKPI: re-implement pm_runtime.h")
Reported by:    markj
MFC after:      3 days
Tested by:      markj, Oleg V. Nauman (oleg.nauman gmail.com)
Differential Revision: https://reviews.freebsd.org/D60878
d2145e9b96448da34d3cfede24c509af6d830c92 Bjoern A. Zeeb 2026-10-19 21:30:14

debug: classified in 04-filenames_plain2 by 'sys/'

kernel: Use external retpoline thunks
External retpoline thunks for amd64 and i386 were added in commit
74d971fe1561 ("x86: Add external retpoline thunk").  Use them when
WITH_KERNEL_RETPOLINE is set.

There should not be any material performance impact -- the call sites
are identical, and this just replaces (on amd64) compiler-generated
__llvm_retpoline_r11 functions in each object with our
__x86_indirect_thunk_r11.

After this change we could implement boot-time patching, replacing
__x86_indirect_thunk_r11 with just jmp %r11 when retpoline is not
required.

Note on i386: An i386 build WITH_KERNEL_RETPOLINE was successful, but
has not been extensively tested.  Clang may use registers other than
just eax on i386 and so in the future additional thunks beyond the one
added in 74d971fe1561 could be required for i386.  Patches are welcome
if this is important to you.

Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
bea44a83631704110de8bbd7693b683c81d4fe55 Ed Maste 2018-03-16 02:29:38

debug: classified in 04-filenames_plain2 by 'sys/'

linux: correct errors from mremap(2)
Linux returns EFAULT when the range to be remapped is not mapped at all,
and ENOMEM only when it is mapped but cannot be grown in place. Callers
depend on that distinction: musl's pthread_getattr_np() measures the
main thread stack by growing a one page mapping and retries while errno
is ENOMEM. Returning ENOMEM for every growth request makes that loop
spin forever.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299835
MFC after:      1 week

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #74: rtwn: add support for the RTL8188FTV USB chipset
rtwn: add support for the RTL8188FTV USB chipset

Add support for the RTL8188FTV chipset to rtwn(4)/rtwn_usb(4).

Differential Revision: https://reviews.freebsd.org/D60875
2c38dc04d6f8bc84620bb3b67c8ccd9f910c4d03 Mir Saheb Ali 2026-10-19 19:10:27

debug: classified in 04-filenames_plain2 by 'sys/'


rtwn: fix 8188f channel offset / width programming

* rtwn_chan2centieee() already calculates the proper centre
  frequency, so it doesn't need to be further offset.
* Don't program R92C_RF_CHNLBW with further 20MHz wide bits;
  the rest of the programming works correctly for 20/40MHz
  operation.

Tested:

* Verified against the linux rtl8xxxu/8188f.c code.
* Tested w/ 20 and 40MHz 11n; 40MHz is now operating at higher
  speed.

Fixes: https://cgit.freebsd.org/src/commit/?id=2c38dc04d6f8bc84620bb3b67c8ccd9f910c4d03
66ecb413fe7061d7d515e0199dc6c06cef37ac9e Mir Saheb Ali 2026-10-29 01:18:30

debug: classified in 03-filenames_plain1 by 'sys/dev/'

debug: moved to kernel because 'Need to be grouped with 2c38dc04d6f8bc84620bb3b67c8ccd9f910c4d03'

vm_glue: Use the right type for size arguments to {user,kern}acc()
MFC after:    1 week
Sponsored by:   The FreeBSD Foundation
c525db0c44b7db430b67fdd276f0a22c2f8e9f61 Mark Johnston 2026-10-27 16:47:36

debug: classified in 04-filenames_plain2 by 'sys/'

malloc: Fix realloc() for large allocations
min() truncates its parameters.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
ca16e7a4920415bf9d09cf76bd2c3cda7447c098 Mark Johnston 2026-10-22 16:41:04

debug: classified in 04-filenames_plain2 by 'sys/'

linux: Preserve partial results from recvmmsg()
linux_recvmmsg_common() currently returns the error from the next
recvmsg() attempt even when one or more datagrams have already been
received and copied to userspace.

This is especially visible with non-blocking UDP sockets.  After
receiving the first datagram, the next iteration commonly returns
EAGAIN.  The syscall then reports EAGAIN instead of the number of
messages already stored in the mmsghdr array, causing applications to
discard successfully received packets.

This differs from Linux recvmmsg() semantics, where an error encountered
after receiving at least one message is deferred and the number of
received messages is returned.

Return the accumulated datagram count and clear the error whenever at
least one message was received.  Preserve the original error when no
messages were received.

This fixes packet loss in applications such as wireguard-go, whose
non-blocking receive path uses recvmmsg() for batches of UDP packets.
In the observed failure, WireGuard handshake responses reached the UDP
socket, but a subsequent EAGAIN caused recvmmsg() to hide the received
response and the handshake timed out.

Reviewed by:            kib
Pull Request:           https://github.com/freebsd/freebsd-src/pull/2484
Differential Revision:  https://reviews.freebsd.org/D60961
afeb885b4ae41357a648f547d3835a5e0dcde81e Vladimir Grebenshchikov 2026-10-21 22:14:33

debug: classified in 04-filenames_plain2 by 'sys/'

amd64 FRED: fix dtrace fbt
- jump to dtrace_invop_jump_addr on kernel #BP
- use ERETS instead of IRETQ when done

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
cf4ff7bd369e42fb0a1c6f5cf2dc4fa7a990158e Konstantin Belousov 2026-10-29 03:34:45

debug: classified in 04-filenames_plain2 by 'sys/'

vm_kern: wrap around in kmem_back() when the last domain is empty
kmem_back() picks the domain from the address and, when that domain has
no memory, steps forward until it finds one that does:

domain = (addr >> KVA_QUANTUM_SHIFT) % vm_ndomains;
while (VM_DOMAIN_EMPTY(domain))
        domain++;

Nothing stops the walk at vm_ndomains.  When the empty domain is the
last one, the loop runs through the unused tail of vm_dom[] (all empty)
and on into whatever follows vm_dom[MAXMEMDOM] in memory, until a word
there happens to look like a non-zero page count; kmem_back_domain()
then allocates from that garbage domain.  Ordinary allocations never
get here, because the per-domain arenas and the domainset iterators
skip empty domains.  Only the direct callers of kmem_back() do: kinst
(one trampoline per thread, allocated when the module loads) and
memguard.

Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>

Reviewed by:    kib, markj
Sponsored by:   keelos.dev
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60935
710a12b355fd985eec0f2a85626480c636f5468b Wanpeng Qian 2026-10-29 17:27:04

debug: classified in 04-filenames_plain2 by 'sys/'

mbuf: Match TCP RSS hash types exactly
RSS hash types are encoded values, not independent flags.  The bitmask
check in M_HASHTYPE_ISHASH_TCP() also accepts UDP, address-only and opaque
hash types, causing the syncache to retain them instead of falling back
to a software TCP hash.

Compare against the three TCP four-tuple hash types after masking the
inner-header flag.  Keep the existing macro interface and use an inline
helper to preserve single evaluation of its argument.

Add ATF coverage for all 256 hash-type byte values, including inner-header
hashes, and verify single evaluation of the mbuf argument.

Reviewed by:    cc, gallatin
Fixes:  https://cgit.freebsd.org/src/commit/?id=a485399f8834 ("tcp: restrict flowtype copying to specific RSS TCP types")
Sponsored by:   BBOX.io
b06db8c9dafb1734923e0483323920b4b0a05cc9 Kevin Bowling 2026-10-29 07:15:14

debug: classified in 04-filenames_plain2 by 'sys/'

mmccam: Add a helper to change the host settings
The same five lines to build and send an XPT_SET_TRAN_SETTINGS request to the
controller were repeated for the bus timing, bus width, VCCQ and clock
changes.  Add sdda_set_host_ios() and use it at those places.

No functional change.

Reviewed by:    bz
Differential Revision:  https://reviews.freebsd.org/D60921
2a6580e15b62da11dbe728c6c4f512c15283cd49 Emmanuel Vadot 2026-10-20 17:41:01

debug: classified in 04-filenames_plain2 by 'sys/'

fdcopy(): properly update fd_freefile when skipping non-copyable fd
fd_freefile is maintained to fulfill the POSIX guarantee that the lowest
possible file descriptor is allocated on open.  If we skip copying an
fd, it is a possible candidate for the lowest index.

First, the file descriptor installed with a kqueue created
without KQUEUE_CPONFORK missed this handling [*].

Second, fd_freefile should be updated only when the current fd index is
below it.  A skipped fd above fd_freefile could raise it past a free slot.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300234 [*]
Reported by:    Andrea Venturoli <freebsd@netfence.it>
Reviewed by:    markj
Fixes:  https://cgit.freebsd.org/src/commit/?id=1265516c5c61 ("struct file: add DFLAG_FORK, indicate copying on fork")
Fixes:  https://cgit.freebsd.org/src/commit/?id=809f3121be66 ("fd: assign fd_freefile early when copying")
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61054
99a58803f9a306253df36c82f11991bc1e36e5a5 Konstantin Belousov 2026-10-30 16:02:34

debug: classified in 04-filenames_plain2 by 'sys/'

jailmeta: reject empty keys in metadata lookups
Reject empty keys in metadata lookups with EINVAL to prevent an infinite
loop while holding allprison_lock and pr_mtx. Add tests for empty-key
reads and writes with empty and populated meta/env buffers, trailing
newlines, and empty final values.

Reviewed by:    igoro, jamie
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D61025
d1a465f02b14c9eed8a87c31092bb9251dc053c1 Yura Tkachenko 2026-10-30 20:20:24

debug: classified in 04-filenames_plain2 by 'sys/'

kern: Remove unreachable compat_freebsd8 FEATURE
COMPAT_FREEBSD8 does not exist as a kernel option, so this is dead code.

No functional change intended.

Fixes:          https://cgit.freebsd.org/src/commit/?id=e256f71389fb ("kernel: add missed FEATUREs compat_freebsd 8-14")
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Reviewed by:    kib
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/80
9da2c05a748fd17757638e1a9e78215cdb8b80d0 Christos Margiolis 2026-10-27 10:49:46

debug: classified in 04-filenames_plain2 by 'sys/'

vfs: Avoid integer overflow when faulting
In vn_io_fault1(), the read / write length can easily exceed INT_MAX.
Passing it directly to uiomove(), which expects an int, results in a
negative uio_resid, which to the caller looks like we read more than
was requested.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298159
MFC after:      1 week
Reviewed by:    olce, kib
Differential Revision:  https://reviews.freebsd.org/D59412
b487aca48535e5f04e4913447fcbe33f1bf56c68 Dag-Erling Smørgrav 2026-11-01 20:09:50

debug: classified in 04-filenames_plain2 by 'sys/'

ktls: Check the record type message holds its byte
sosend_generic() read the TLS record type past a TLS_SET_RECORD_TYPE
control message holding only a cmsghdr, and sent that stale byte.

Approved by:    markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=b2e60773c6b0 ("Add kernel-side support for in-kernel TLS.")
Sponsored by:   Netflix
bd4975e5fb051c2b2e8d5218940b7e8ef87b5bdf Olivier Cochard 2026-10-16 16:43:30

debug: classified in 04-filenames_plain2 by 'sys/'

jail: return a new descriptor from jail_get(JAIL_USE_DESC | JAIL_GET_DESC)
Prior to this change, `jail_get` when called with `JAIL_USE|JAIL_GET_DESC`
would fail to return a valid descriptor in the positive case because the
`JAIL_USE_DESC` block jumped to `found_prison` before the descriptor was
allocated. This resulted in the returned jail descriptor always being -1,
despite the call being successful.

This change fixes the logic so `jfd_out` is properly initialized in the
aforementioned scenario.

MFC after: 3 days

Reviewed by:    jamie, ngie, adrian
Differential Revision:  https://reviews.freebsd.org/D60984
b3b50cbd4647bb095e0cb5b72e933bc3036e412d Abdelkader Boudih 2026-11-02 20:09:55

debug: classified in 04-filenames_plain2 by 'sys/'

mqueuefs: set *a_eofflag in VOP_READDIR
mqfs_readdir() never reported end of directory.  Since 77b273d8f5f4
VOP_READDIR_APV() asserts that a readdir which returns no entries also
sets *a_eofflag, so with INVARIANTS the final zero-length
getdirentries(2) that ls(1) issues on a mounted mqueuefs panics:

    panic: VOP_READDIR: eofflag not set

Report end of directory when the child list was walked to its end;
leave the flag clear when the walk stopped because the buffer was full.

MFC after:      1 week
fbac0abdc5ab1fe867ac85635662ef06b2ee9d10 Xin LI 2026-11-03 03:02:03

debug: classified in 04-filenames_plain2 by 'sys/'

critical_exit_preempt(): Re-check for preemption locked
Once we have the thread lock, we are in a spinlock section and thus will
not be preempted, which ensures stability of 'td_owepreempt'.  Check it
again for the improbable case where we were already preempted before
entering that section (after 'td_critnest' reached 0 in critical_exit()
but before clearing 'td_owepreempt', because of an IPI_PREEMPT received
in the meantime or any interrupt whose handler uses critical sections),
in which case there is no need to switch to another thread.

It is however still necessary to temporarily raise 'td_critnest' around
the thread_lock() call, and that is not an optimization contrary to what
the old comment stated.  As explained in the new comment, thread_lock()
can lead to entering and exiting a spinlock section multiple times,
which would cause recursion with critical_exit_preempt() in some
circumstances.

Reviewed by:    kib, markj
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60860
28c31242758323499eaf8af1f03fc4ae4a960205 Olivier Certner 2026-10-13 13:20:43

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #75: sched: Automatically namespace schedulers' implementation functions
sched: Automatically namespace schedulers' implementation functions

This renames back scheduler implementation functions to their old names,
i.e., the same name as the interface functions, in the source code,
while providing the infrastructure to still produce from them C symbols
namespaced by the scheduler implementation, in order to avoid symbol
collisions with interface dispatching functions and other scheduler
implementations when multiple ones are compiled in.  In a nutshell, the
implementation consists in re-routing interface names to implementation
names via the C preprocessor.

The main reasons for this change are that different implementation names:
1. Break navigating code with ctags-like tools like in-tree ctags,
   Global and Universal Ctags.
2. Spoils inlining opportunities in internal scheduler code if not
   careful.  This alternatively could be regained by changing call
   points to use scheduler-specific names, but that does not prevent
   people from inadvertently adding more calls to interface functions.
   Also, having to namespace calls with the implementation name in the
   implementation itself can be seen as code clutter.
3. Introduces avoidable cognitive burden, for example in the form of
   having to ask oneself whether internal scheduler functions should be
   namespaced or not, and then when calling them which their actual
   names are.

However, C symbol collisions create difficulties with debugging and ELF
manipulation tools, including when printing backtraces (which scheduler
implementation is in use?).  For example, as of this writing,
'disassemble' in GDB will choose one of the existing functions and
disassemble it without mentioning the existing others; our ddb(4) will
set a breakpoint on one of these functions only (which should be
improved); etc.  So keeping namespaced symbol names was desirable, which
is why symbol re-routing via the C preprocessor was chosen.

People wanting to extract information from ELF files will have to use
full symbol names instead of source code names.  This is certainly
a drawback, but we expect that people will spend by far more time on the
code rather than trying to disassemble some particular implementation
function, so the inconvenience will barely occur in practice.  Also,
DWARF information matching machine code to source code location stays
undisturbed and gdb will continue to display matching source code
correctly.  ctags-like tool are likely to never implement macro
substitution when definitions are in other files, or if they do to never
enable it by default, as this would considerably slow down source
parsing (Universal Ctags reports a 2x slowdown just by enabling
expansions for definitions that are in the *same* file).  LSPs have not
been tested; we however expect this change will cause nothing but minor
annoyances when using them.  Writing new calls to scheduler functions
should work as usual in terms of help/completion (including in
implementations, as corresponding implementation and interface functions
have same signature).  Even automatically producing implementation
function signatures when adding a new definition is expected to work.
Please report if not the case.

The implementation of the machinery to substitute interface names by
implementation names has two parts.

First, a new generated per-implementation-specific header has to be
included in each implementation ("sched_<NAME>_ns.h").  It contains
simple C preprocessor substitutions, such as, taking the example of ULE:

 #define sched_clock sched_ule_clock
 #define sched_switch sched_ule_switch

allowing to use the interface names in place of the implementation names
in the implementation itself.  It also checks that an implementation
actually defined SCHED_IMPLEMENTATION and to the same value that was
used to produce it.

These headers are generated from the pattern header
'sys/kern/sched_ns.h' through directives in 'sys/conf/files', via the
C preprocessor using the already existing X macros and some light
post-processing by the new 'sys/tools/sched_impl_ns.awk' script.

Second, <sys/sched.h> declares all implementation functions when
included from an implementation, so that out-of-order references within
the implementation do not cause problems, as it was before multiple
schedulers could coexist.

Implementations must define SCHED_IMPLEMENTATION to their name used as
the namespacing symbol part (e.g., ule or 4bsd), which used to be the
name passed as the first argument to DECLARE_SCHEDULER().  This argument
is now redundant and has been removed.  That same macro with same value
has to be defined in the directives from 'sys/conf/files' for each
implementation's namespacing header to be produced properly.

For added safety, <sys/sched.h> does not provide interface functions'
declarations when SCHED_IMPLEMENTATION is defined anymore, so that
implementations can never inadvertently call these functions.

Reviewed by:    mchoo
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60644
510331fa376309ae0860b91bd501c9c5a73e86a7 Olivier Certner 2026-10-09 14:29:06

debug: classified in 04-filenames_plain2 by 'sys/'


sched: Fix building kernel independently of world

Regular '-I' directives must be passed to ${CPP} so that when
pre-processed, 'sched_ns.h' can find the files it includes in the proper
places, instead of relying on what is in ${WORLDTMP}, i.e., nothing if
'_includes' was not executed, which happens, e.g., when using 'make
kernel-toolchain' and then 'make buildkernel' without having executed
a 'make buildworld', or possibly some outdated copy not matching an
updated source.

Reported by:    Claude Opus 5.5, imp
Fixes:          https://cgit.freebsd.org/src/commit/?id=510331fa3763 ("sched: Automatically namespace schedulers' implementation functions")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61167
e89d0e74e23e95fa79989a9053e788e6378eee07 Olivier Certner 2026-11-03 21:31:11

debug: classified in 04-filenames_plain2 by 'sys/'

sys/modules.h: Fix too long line
No functional change (intended).

Fixes:          https://cgit.freebsd.org/src/commit/?id=f4b3640475ce ("inline atomics and allow tied modules to inline locks")
Sponsored by:   The FreeBSD Foundation
cd33fd75e856f1d91412062da2bd9d98e8897039 Olivier Certner 2026-10-22 11:50:52

debug: classified in 04-filenames_plain2 by 'sys/'

kern/vfs_syscalls.c: extract privilege check from kern_chroot()
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60963
f809179ba9811decc518cb5694a289d169a5d6ae Konstantin Belousov 2026-09-26 16:31:21

debug: classified in 04-filenames_plain2 by 'sys/'

pwddesc: add sharecount
The pd_refcount field counts both sharing processes and the transient
pdhold() references taken by sysctls and mountcheckdirs(), so it
cannot answer "is this pwddesc shared".  As a result pdunshare() made
needless copies while the pwddesc was held, and a copy made while
mountcheckdirs() held it lost the cwd/root update.

Add pd_sharecount, counting only processes using the pwddesc, and use
it for the sharing decision. Existing pd_refcount still manages the
lifetime.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60963
5276fba9fd55bf2e79c54df18a70b46d11cc15a1 Konstantin Belousov 2026-10-21 22:54:59

debug: classified in 04-filenames_plain2 by 'sys/'

kern: do not allow unprivileged chroot when pwd is shared
Unprivileged chroot(2), fchroot(2), chaltroot(2), and fchaltroot(2)
rely on PROC_NO_NEW_PRIVS to make set-ID images harmless under the
new root.  But the pwddesc can be shared by rfork(2) without RFFDG
with a process that has not enabled PROC_NO_NEW_PRIVS, and the
change of the root affects that process as well.  It can then
execute a set-ID image whose ELF interpreter is resolved under the
root controlled by the caller.

Refuse the unprivileged operations when the pwddesc is shared.
Processes that start sharing it later are created by the caller and
inherit PROC_NO_NEW_PRIVS.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60963
e95e010fd0de721ae0e87bb24e20ec53aec8629e Konstantin Belousov 2026-10-24 12:59:08

debug: classified in 04-filenames_plain2 by 'sys/'

cap_enter(2): stricter checks
- single-thread the process
  Make cap_enter() a serialization point, ensuring that no threads are
  executing with old credentials cached after the syscall returned.

- disallow entering capability mode if the file descriptor table or pwd
  are shared. They are shared after rfork(2), and allowing it lets another
  process grant additional privileges to the process in capability mode.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60963
b357c94448997b1702c5d3be9cc3a9531ba92ffc Konstantin Belousov 2026-10-21 21:57:59

debug: classified in 04-filenames_plain2 by 'sys/'

LinuxKPI: Add drm support to dev_is_pci() function
drmn driver is attached to PCI bus via intermediate vgapci driver.
Check for it presence in device tree branch too to handle drm-kmod
cases.

MFC after:      2 month
Reviewed by:    emaste (LGTM)
Differential Revision:  https://reviews.freebsd.org/D60138
485ffe067324e314a08411fd11ec89f0581c7cfa Vladimir Kondratyev 2026-11-04 17:13:50

debug: classified in 04-filenames_plain2 by 'sys/'

add NOTRIM to PRINT_UMA_ZFLAGS
This was missed when commit cf907074674206b1825f79c6864c4c4a32089ecc landed.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300341
Fixes:          https://cgit.freebsd.org/src/commit/?id=cf907074674206b1825f79c6864c4c4a32089ecc
Sponsored by:   Dell Inc.
Differential Revision:  https://reviews.freebsd.org/D61060
dd9804f30c6cb20a370dbda6d4f82f368c5f4912 Anton Rang 2026-11-04 18:33:15

debug: classified in 04-filenames_plain2 by 'sys/'

kobj: Avoid initializing pointer from boolean value
Prior to change 477c594d9063, the struct kobj_class has six members but
the DEFINE_CLASS_[0..3] only initialize the first four of them. The
change 477c594d9063 intends to initialize the two new members but
actually acts on the wrong ones.

```
error: initialization of pointer of type 'kobj_ops_t' (aka 'struct kobj_ops *') to null from a
      constant boolean expression [-Werror,-Wbool-conversion]
```

Fix by initializing the two new members implicitly.

Reported by:    clang (-std=gnu23 -Wbool-conversion)
Reviewed by:    mmel, kib
Fixes:          https://cgit.freebsd.org/src/commit/?id=477c594d9063 kobj: allow multiple inheritance with per-class softc
MFC with:       477c594d9063
Differential Revision:  https://reviews.freebsd.org/D61173
8e429142feaaf96456566d3111fa893e29e8fd53 Zhenlei Huang 2026-11-04 19:28:30

debug: classified in 04-filenames_plain2 by 'sys/'

sched: Add sysctl flag CTLFLAG_TUN to loader tunable kern.sched.name
So that `sysctl -T` can report it correctly.

Reviewed by:    olce, kib
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D61178
5e54a402f896106ed6b402e25387ad7402b8944c Zhenlei Huang 2026-11-04 19:28:31

debug: classified in 04-filenames_plain2 by 'sys/'

nfscl: Fix the RDMA write reduction code
The write reduction code was broken in a few ways:
- It didn't handle non-zero b_dirtyoff.
- It didn't advance the uiop fields such that they could be
  backed up for a retry.
- It didn't handle the rare retry case with a partially
  written buffer.

This patch fixes the above and now write reduction seems
to be working ok.

MFC after:      1 month
Fixes:  https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
db8444c1b7e4cfe3df105268fa963a93c3780b02 Rick Macklem 2026-11-04 20:50:48

debug: classified in 04-filenames_plain2 by 'sys/'

LinuxKPI: set pci_dev msi_cap and msix_cap
Linux drivers find their MSI and MSI-X registers through pdev->msi_cap and
pdev->msix_cap, which hold where those capabilities start in PCI config
space.  LinuxKPI never set them, so they stayed 0, and every access meant
for the MSI registers went to the start of config space instead.

Drivers using these fields, e.g. ath11k and amdgpu, are affected.

Fill in both fields from the capability offsets that the native PCI code
already records.

Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D61125
Event: NetApp/Vendor Summit Hackathon 202611
0ecbb75c33d38645ea72dca7219c082eedbc8677 Quentin Thébault 2026-11-04 22:49:18

debug: classified in 04-filenames_plain2 by 'sys/'

ioctl: Add a macro for extracting the ioctl number from a command
Sprinkle it in various drivers which hard-coded the command layout.

No functional change intended.

Reviewed by:    dumbbell, emaste
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61045
12b3c29a985d1753693d732372dafe915a890259 Mark Johnston 2026-11-04 22:38:17

debug: classified in 04-filenames_plain2 by 'sys/'

mmccam: Add HS200 support for eMMC
Switch eMMC cards to HS200 when both the card and the host support it,
falling back to high speed on failure.  Bus settings changes now wait for
the SIM to complete, which runs from its own taskqueue.  Also fix a race
where a new request could be lost when the SIM task cleared the current
request after completing it, and fail bios queued for a partition whose
switch failed.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D60884
5728d1bb2ba0f954dfecdc80955005e271cdc084 Emmanuel Vadot 2026-10-20 08:09:18

debug: classified in 04-filenames_plain2 by 'sys/'

cam: Fix XPT_MMC_IO buffer unmap order in cam_periph_unmapmem()
XPT_MMC_IO maps two nested buffers: cmd.data, then cmd.data->data whose
address is derived from cmd.data.  cam_periph_unmapmem() restored them in
forward order, so it put cmd.data back to its userspace value and then
dereferenced that pointer to reach cmd.data->data from kernel context,
panicking in vm_fault_lookup().

Unmap in reverse order, mirroring how the mappings were created.  This is
a no-op for single-buffer func_codes and for the other two-buffer cases
(XPT_DEV_MATCH, XPT_SMP_IO), whose buffers are independent.

The bug is only reachable via the pass(4) userspace path, which maps and
unmaps CCB buffers; in-kernel MMCCAM consumers never call
cam_periph_{map,unmap}mem().  Triggered by a userspace SDIO CMD53
transfer from sdiotool(8) through pass(4).

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D61021
49204732f67c32922a7ccc71f3b45f0d1d194cd2 Emmanuel Vadot 2026-10-22 06:33:54

debug: classified in 04-filenames_plain2 by 'sys/'

cam: Fix the mmc_data mapping length for XPT_MMC_IO
cam_periph_mapmem() and cam_periph_unmapmem() map the user-provided
struct mmc_data for XPT_MMC_IO CCBs, but use sizeof(struct mmc_data *)
instead of sizeof(struct mmc_data) as the length.  Only the pages
covering a pointer are mapped, so accessing a field past the first
pointer-sized region (for instance cmd->data->flags) faults if the
structure happens to straddle a page boundary and the following page is
not mapped.

The failure is intermittent because it depends on where the caller places
the struct mmc_data.  Issuing a CMD53 CCB through pass(4) to an MMCCAM
SDIO card whose struct mmc_data lands at the end of a page panics with
"data abort in critical section or under mutex" in the host driver.

Map the whole structure in both the map and unmap paths.

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D61022
bf99b74302bdeb533a7f89149b0fcd2d9e225dad Emmanuel Vadot 2026-10-22 06:33:54

debug: classified in 04-filenames_plain2 by 'sys/'

mmccam: Wait for the power to settle when probing a card
The mmc(4) stack waits after powering up a card: mmc_power_up() waits 1 ms
after the supplies are on and 2 ms after the clock is running, before the
first command is sent.  The MMCCAM probe had no such wait: it went from the
power_up request to the power_on request to CMD0 without any delay.

Some devices do not answer the first commands if they are sent too early and
then never enumerate, with no error.  On a RockPro64 the Broadcom SDIO Wi-Fi
(BCM4359) was not detected on any of 8 boots without a delay.  It was
detected on 8 out of 8 with the same waits as mmc_power_up() added to the
probe.

Add the same two waits, once the power_up request and once the power_on
request are done.  This replaces the delay that was in mmc_fdt_set_power(),
which was a fixed 10 ms for FDT hosts only; the waits of the legacy stack are
enough and apply to every MMCCAM host.

MFC after:      1 week
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D61077
1af3197bbe356e87e0b446177e820f18d6d7c277 Emmanuel Vadot 2026-10-22 06:33:55

debug: classified in 04-filenames_plain2 by 'sys/'

iflib: Use a single tx dma map
The need for a separate map for TSO and non-TSO seems to have arisen from
a misunderstanding about the DMA requirements for Intel drivers like
ice/ixl/iavf. Specifically, this Intel hardware has a quirk where no
more than N (=8) segs can be DMA'ed per packet on the wire. This limit
was enforced using a DMA map with a low segment limit for non-TSO and a
driver specific check for TSO. This led to a *lot* of complexity in
iflib (~80 extra lines of code that this change removes) when the
limit can simply be enforced via the existing EFBIG mechanisms.

This change adds a new flag, IFLIB_SPARSE_TX, that drivers for hardware
with this quirk must set.  When set, it causes non-TSO sends that
exceed isc_tx_nsegment to be treated as if bus_dmamap_load_mbuf_sg()
had returned EFBIG.

Due to the API/KABI change, I've bumped the FreeBSD version as well.

Note kgalazka suggested the flag, rather than a more awkward
mechanism that I had in my initial patch.

Reviewed by: kbowling
Sponsored by: Netflix
Differential Revision:  https://reviews.freebsd.org/D60175
4b732459f030a568a93dbe31230c5a17caa035e5 Andrew Gallatin 2026-11-05 16:35:41

debug: classified in 04-filenames_plain2 by 'sys/'

xdr_mbuf.c: Add a check for the return value for xdrmbuf_getbytes()
The xdrmbuf_getlong() function failed to check for the return
value from xdrmbuf_getbytes().  This could have resulted in
a failure during NFS RPC message processing.

Reviewed by:    rmacklem
MFC after:      2 weeks
Sponsored by:   VersatusHPC
cf59649539e653db8285996af2b161be9693a49d Vinicius Ferrao 2026-11-05 23:58:56

debug: classified in 04-filenames_plain2 by 'sys/'

sys/security/audit: add kern_ implementations
675739153bde1d871bd55448b4315f76f1479c57 Brooks Davis 2026-11-06 13:58:14

debug: classified in 04-filenames_plain2 by 'sys/'

cam: Add NVMe reservation, format and features CCB building functions
Add NVMe CCB (union ccb / struct ccb_nvmeio) building functions for
the four NVMe reservation opcodes, Format NVM, and Get Features /
Set Features.  These use the nvme_command building blocks added to
sys/dev/nvme/nvme.h, and are used by the new camcontrol(8) nvres,
nvformat and nvfeature subcommands that will be added separately.

sys/cam/nvme/nvme_all.c:
        Add NVMe CCB building functions for the four NVMe reservation
        opcodes: nvme_resv_report(), nvme_resv_register(),
        nvme_resv_acquire() and nvme_resv_release().  Data direction
        is set internally (CAM_DIR_IN or CAM_DIR_OUT as appropriate),
        so no flags parameter is needed.

        Add a new nvme_format() CCB building function.

        Add nvme_get_feature() and nvme_set_feature() CCB building
        functions, along with nvme_get_feature_hostid() and
        nvme_set_feature_hostid() convenience wrappers for the hostid
        feature.  nvme_set_feature_hostid() takes an sv argument so
        the caller can request that the hostid persist across reset.

sys/cam/nvme/nvme_all.h:
        Add prototypes for the above.  Wrap the declarations in
        __BEGIN_DECLS / __END_DECLS so C++ compilers don't mangle the
        names of the C symbols.

Co-authored-by: Reid Linnemann <reidl@spectralogic.com>
Co-authored-by: Dave Baukus <daveb@spectralogic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed by:    imp
MFC after:      1 week
Sponsored by:   Spectra Logic
Differential Revision:  https://reviews.freebsd.org/D59532
9814633f631b41b8026a826b7731ec04c3d7d678 Kenneth D. Merry 2026-11-07 01:05:54

debug: classified in 04-filenames_plain2 by 'sys/'

mac syscalls: add kern_ implementations
Where the kern_ interfaces map trivially to the syscall interface, follow
the syscall name even if awkward (e.g., sys___mac* -> kern___mac*).
Otherwise use shorter names.

Effort:         CHERI upstreaming
Sponsored by:   DARPA, AFRL
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
7b18863d597e0dad0734cf6e06c5e7689be2047c Brooks Davis 2026-11-07 12:10:45

debug: classified in 04-filenames_plain2 by 'sys/'

acct(2): add kern_acct
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
d7c0ab90cde19e2184f2d76d0fe43e85c74785d4 Brooks Davis 2026-11-07 12:10:45

debug: classified in 04-filenames_plain2 by 'sys/'

cpuset(2): add kern_cpuset
Effort:               CHERI upstreaming
Sponsored by:    Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
3369af6f98ca606877e2c6c96e67f082d3f0f25d Brooks Davis 2026-11-07 12:10:46

debug: classified in 04-filenames_plain2 by 'sys/'

fstat(2): add user_fstat
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
230d581d4e8c3017d4e711dc97f2b53ebe1ea7ee Brooks Davis 2026-11-07 12:10:46

debug: classified in 04-filenames_plain2 by 'sys/'

kenv(2): add kern_kenv
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
4ca929100407f62aba146aa04bb0c8c44d1fe292 Brooks Davis 2026-11-07 12:10:46

debug: classified in 04-filenames_plain2 by 'sys/'

sys/kobj.h: Convert macro DEFINE_CLASS to designated initializers
So that it is less error prone when adding new struct members or
refactoring in future.

No functional change intended.

Reviewed by:    kib, imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D61276
6b38db44f0ea36e8336758a460615e9c52def28c Zhenlei Huang 2026-11-07 14:34:38

debug: classified in 04-filenames_plain2 by 'sys/'

xdr: Limit xdr_wrapstring
The previous commit (re)introduced the possibility that a malicious or
corrupt message can cause the receiver to allocate a very large amount
of memory before realizing that the message is much shorter than
claimed.  Revert the change to xdr_wrapstring() to avoid this.

Fixes:          https://cgit.freebsd.org/src/commit/?id=d2018cedb414 ("xdr: Fix xdr_string")
Reported by:    bjk@
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D60898
838ff5548b4f83707f34cfd28769e35393da3f05 Dag-Erling Smørgrav 2026-11-07 23:02:44

debug: Commit manually moved from "unknown" to "kernel".

linux: do not truncate the listxattr() size
listxattr() sized its buffer with min(), which truncates the 64-bit
size to 32 bits, so a size of 2^32 + k allocated k bytes while the
copy-out guard used the full size.  The walk then read record lengths
past the buffer and copied kernel heap out to the caller, and could
panic the kernel.  Any user can reach it through a user.* attribute on
a file it owns.

Use MIN(), and fail with EIO if a record runs past the data returned.

Reviewed by:    adrian, markj
Approved by:    adrian (mentor)
Differential Revision:  https://reviews.freebsd.org/D61006
Signed-off-by: Nick Price <nprice@FreeBSD.org>
fbe4835e6b1eec36103a5ce97efbab11b3b5fc72 Nick Price 2026-11-08 01:32:08

debug: classified in 04-filenames_plain2 by 'sys/'

LinuxKPI: Add non-ACPI version of ACPI_COMPANION macro
Required to build drm-kmod om powerpc64.

GHPR:           https://github.com/freebsd/drm-kmod/pull/529
Reported by:    pkubaj
Reviewed by:    manu
Differential Revision:  https://reviews.freebsd.org/D61299
6c2e1cd39ed57f75bcc612515b70907b6f33170d Vladimir Kondratyev 2026-11-08 06:45:05

debug: classified in 04-filenames_plain2 by 'sys/'

link_elf_obj: bounds-check a relocation section's sh_info
sh_info is used to index the section header array without checking it
against e_shnum, so a malformed object can make the linker read out of
bounds.  Reject such a file with ENOEXEC in both the preload and kldload
paths.

MFC after:      1 week
Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D60937
8644c3bfe2406d00235c4d242022fc7bd61e2276 Osvaldo Janeri Filho 2026-11-08 15:43:44

debug: classified in 04-filenames_plain2 by 'sys/'

link_elf_obj: guard reltab/relatab frees in link_elf_unload_file()
link_elf_unload_file() frees the per-section relocation tables by iterating
ef->nreltab / ef->nrelatab, but dereferences ef->reltab / ef->relatab
unconditionally. The counts are set while scanning the section headers, before
the tables are allocated, so an error on the load path reaches it with a
non-zero count and a NULL table, faulting on ef->relatab[0].rela. Reachable
from link_elf_load_file() once a valid relocation section has been counted,
e.g. a later section with sh_info >= e_shnum (D60937).

Guard the loops with the table pointer, as is already done for ef->progtab
above.

MFC after:      1 week
Reviewed by:    markj, kib
Differential Revision:  https://reviews.freebsd.org/D61140
14d828a2ff6e130b76754fd6e9947e332469fd09 Osvaldo Janeri Filho 2026-11-08 15:45:19

debug: classified in 04-filenames_plain2 by 'sys/'

link_elf_obj: fix an off-by-one in the symbol string table index check
link_elf_load_file() checks the symbol table's sh_link against
e_shnum with ">" instead of ">=", so a malformed object whose sh_link
equals e_shnum makes the linker read one entry past the section header
array before the sh_type check rejects it.  Use ">=", as
link_elf_link_preload() already does.

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61055
097f6d7a573369503ef5b8503fb2b721a6f66d85 Osvaldo Janeri Filho 2026-11-08 16:45:01

debug: classified in 04-filenames_plain2 by 'sys/'

cryptodev: zero key material before freeing it
The /dev/crypto cipher and MAC keys are copied from userland and
released with free(), leaving the key bytes in freed kernel memory.
Use zfree() so the key material is cleared on session teardown and on
the setup error path.

Reviewed by:    markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61324
edaa6ba7be8666d4f543317845899e1a1b684bbf Osvaldo Janeri Filho 2026-11-09 00:50:17

debug: classified in 04-filenames_plain2 by 'sys/'

linux: Bound native getdents and getdents64 batches
linux_getdents() and linux_getdents64() round their native read size up
to DEV_BSIZE before converting entries. For an unaligned caller buffer,
the native batch can contain more entries than fit in the Linux buffer.
Conversion then returns EINVAL even after copying complete entries,
and the native read has already advanced the directory position.

For counts of at least DEV_BSIZE, use min(args->count, MAXBSIZE) instead.
A 768-byte request, such as rustix's initial directory read, now uses a
768-byte native buffer rather than 1024. The converted Linux dirent and
dirent64 records are no larger than their native counterparts, so the
whole translated batch fits. Returning a short batch is allowed, and
consuming the whole native batch avoids needing to rewind the directory
position.

Keep the existing sizing for counts below DEV_BSIZE. This fixes the
oversized-batch case in both getdents interfaces, including legacy
getdents for 32-bit and 64-bit callers. The remaining small-buffer,
copyout-failure and old single-entry readdir problems are outside the
scope of this change.

Fixes:  https://cgit.freebsd.org/src/commit/?id=110f2567cb51 ("linux_file.c: Fix handling of NFS [...]")
MFC after:      3 days
Sponsored by:   Alchemilla Ventures Private Limited
Reviewed by:    kevans, markj
Differential Revision:  https://reviews.freebsd.org/D60760
ec6629628cbed2816f27aed8a6d5f9eb3521c1c1 Hayzam Sherif 2026-11-09 03:06:11

debug: classified in 04-filenames_plain2 by 'sys/'

kevent(2): add kern_kevent_generic
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
0a42a5c783beebdaee8fad0142c969a6c64e8b57 Brooks Davis 2026-11-09 11:07:57

debug: classified in 04-filenames_plain2 by 'sys/'

wait4(2): add kern_wait4
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
2e3ba764b21f8f48ea2d48c0118a8f8e2eb4dd41 Brooks Davis 2026-11-09 11:07:57

debug: classified in 04-filenames_plain2 by 'sys/'

wait6(2): add user_wait6
sys_wait6 is a little more complicated than typical as compat layers
need to translate siginfo_t.

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
52bd0d1812b6c3fb31db9709ff56393fb082046c Brooks Davis 2026-11-09 11:07:57

debug: classified in 04-filenames_plain2 by 'sys/'

ffclock: add kern_ interfaces
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
d4775425c16ceb3933c45cfe1a78bbed0a6fdf92 Brooks Davis 2025-11-21 17:22:24

debug: classified in 04-filenames_plain2 by 'sys/'

pdfork(2): add kern_pdfork
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
7c9060c7f38cf07908ee37baa0205848ea2bdaba Brooks Davis 2025-11-21 17:33:07

debug: classified in 04-filenames_plain2 by 'sys/'

[ku]trace(2): add kern_[ku]trace
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
6189085715dbd71ba6aff1b965950f3331ba1128 Brooks Davis 2025-11-21 17:42:02

debug: classified in 04-filenames_plain2 by 'sys/'

kern_linker.c: add kern_ implementations
kldsym(2) is more complex than typical because it requires translation
of struct kld_sym_lookup which is a weird in/out structure.  Out of
paranoia we avoid copying out the symname pointer in the capability
version to eliminate the possiblity of leaking a capability (but not
invalidating a pointer userspace might be using via copyout()).

Effort:         CHERI upstreaming
Sponsored by:   DARPA, AFRL, Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
58a758c2bbfe4beb48c44ae798f7eaaf3ef2aab7 Brooks Davis 2025-11-24 13:55:36

debug: classified in 04-filenames_plain2 by 'sys/'

kern_loginclass.c: add kern_ implementations
Effort:               CHERI upstreaming
Sponsored by:   DARPA, AFRL, Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
133344405f532bd54ff3629a77d4c4e062f01fdb Brooks Davis 2025-11-24 14:16:16

debug: classified in 04-filenames_plain2 by 'sys/'

linux: Allow connect() with destination port 0
Linux allows connect() with destination port 0, but FreeBSD returns
EADDRNOTAVAIL in in_pcbconnect() and in6_pcbladdr(). Some Linux programs
(e.g. the new Android CLI tool) rely on this for routability checks,
however.

Add an SV_CONN_PORT0 flag to sv_flags which is set in the Linux sysvecs,
allowing the port 0 guard in the connect paths to be bypassed.

Reviewed by:    glebius, kib
Differential Revision:  https://reviews.freebsd.org/D60659
dbeadd4326a05d6a972e6e319a580944e136f931 Aymeric Wibo 2026-09-25 13:20:19

debug: classified in 04-filenames_plain2 by 'sys/'

link_elf_obj: bounds-check e_shstrndx in link_elf_load_file()
e_shstrndx is used to index the section header array after only being
checked against zero, so a malformed object can make the linker read up
to about 64K entries past the end of shdr[].  Reject such a file with
ENOEXEC, as link_elf_link_preload() already does.

Reported by:    llm-postcr
Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61321
f0683276b4334f4b7e7faf73471a2afe937a9f5d Osvaldo Janeri Filho 2026-11-09 23:18:01

debug: classified in 04-filenames_plain2 by 'sys/'

link_elf_obj: validate symbol name offsets
A symbol name offset (st_name) indexes the string table in several
places without being checked against ddbstrcnt, so a corrupt object
causes an out-of-bounds read.  Check that the string table is
NUL-terminated and that every st_name lies within it, in both the
preload and file paths, and reject the object with ENOEXEC.

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61322
4e2c2842e6f779edb44483dfcabe35acc64fe23e Osvaldo Janeri Filho 2026-11-09 23:18:27

debug: classified in 04-filenames_plain2 by 'sys/'

link_elf: bounds-check the DT_HASH offset
parse_dynamic() builds the symbol hash table at ef->address + d_ptr
without checking that d_ptr lies within the mapped image, so a crafted
DT_HASH entry causes an out-of-bounds read of the hash header.  Reject
the object with ENOEXEC when the header does not fit in the image.

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61323
ad8f475be2c5920f9a90145c071cba390a4ec6d2 Osvaldo Janeri Filho 2026-11-09 23:18:40

debug: classified in 04-filenames_plain2 by 'sys/'

link_elf_obj: validate section name offsets
A section name offset (sh_name) indexes the section name string table
without being checked against shstrcnt, and the result is passed to
strcmp(), so a corrupt object causes an out-of-bounds read.  Check that
the table is NUL-terminated and that every sh_name lies within it, in
both the preload and file paths, and reject the object with ENOEXEC.

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61338
4b1963dbb36f9928097a6f26cf3aaff88573b77d Osvaldo Janeri Filho 2026-11-09 23:18:58

debug: classified in 04-filenames_plain2 by 'sys/'

namei(9): fix restart for NDINIT_ATVP
namei() might restart for altroot or for ERESTART from
nameicap_tracker_add().

vfs_lookup() consumes the reference on ni_startdir and clears it, so
a restarted NDINIT_ATVP() lookup started from the current directory
instead of the vnode passed by the caller.

Save the starting vnode in a local variable, hold it while the lookup
can be restarted, and reference it before the restarted pass. Do not
assert NAMEI_DBG_HADSTARTDIR on the internal restart.

Noted and reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61315
2f3d64f63677a6ed4c7bb6629d92161555948038 Konstantin Belousov 2026-11-08 19:20:37

debug: classified in 04-filenames_plain2 by 'sys/'

namei(9): allow NDINIT_ATVP() lookups in capability mode
NDINIT_ATVP() initializes dirfd to AT_FDCWD, which is denied for a
process already in cap mode.  Since NDINIT_ATVP() is a special lookup
operation performed by the kernel, it should be allowed to proceed for
the paths beneath vp.

Fabricate a pseudo dirfd value that is an unused placeholder,
which fails the AT_FDCWD comparison and allows the lookup to proceed in
cap mode.

Note that failed cap-mode NDINIT_ATVP lookup returned ECAPMODE without
releasing the caller reference on ni_startdir, which is fixed by this
change.

Reported by:    ivy
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61315
922eaa623076b4b8878022b3cbad1bef1f023de8 Konstantin Belousov 2026-11-08 04:11:21

debug: classified in 04-filenames_plain2 by 'sys/'

kern_umtx.c: validate clockid used for _umtx_op(2) timeouts
Only allow clocks that make sense for the umtx_sleep().

While there, do not ignore errors from kern_clock_gettime(). The invalid
clock ids are filtered, but if the clock can't be read (CLOCK_TAI before
the TAI-UTC offset is known), the functions operate on uninitialized
memory.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
524f1bf7f9fd8d5d0eee48346d6c1adb0413f95c Konstantin Belousov 2026-11-05 20:21:14

debug: classified in 04-filenames_plain2 by 'sys/'

umtxq_sleep(): do not wait forever for zero absolute timeouts
For msleep(), zero sbt means no timeout. If the timeout was specified as
absolute {0, 0} on MONOTONIC/UPTIME clocks, consider the call timed out
immediately, instead of sleeping until a signal is delivered.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
8c13acc68517f785df4b6c4b016dfd1c6f38c8cf Konstantin Belousov 2026-11-06 00:09:12

debug: classified in 04-filenames_plain2 by 'sys/'

sysent: add support for COMPAT15 syscalls
Sponsored by: DARPA, AFRL, Innovate UK

Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D61342
57763e6eb45d97d437a4b2bdf07dd796e5bd7d80 Brooks Davis 2026-11-10 10:14:34

debug: classified in 04-filenames_plain2 by 'sys/'

sysent: regen after adding COMPAT15 support
daa4c25953a75dab8d7d2fbdb822c00c48620d5c Brooks Davis 2026-11-10 10:14:59

debug: classified in 04-filenames_plain2 by 'sys/'

kern_module.c: add kern_ implementations
In the case of modstat(2) use a cast to access the name member of the
old struct version so the compiler see the right array size.  This
addresses a sub-object bounds bug.

Effort:         CHERI upstreaming
Sponsored by:   DARPA, AFRL, Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
b96dc2c04fb4f504ad0c752c5d4b074c5bfbf7e0 Brooks Davis 2026-11-10 11:49:20

debug: classified in 04-filenames_plain2 by 'sys/'

kern_prot.c: add kern_ and user_ implementations
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
91e5dbdc4da68a1a1001efb47ccbc2257ad106ee Brooks Davis 2026-11-10 11:49:21

debug: classified in 04-filenames_plain2 by 'sys/'

rctl_*(2): add kern_ implementations
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
52830cb4e63d3bfbb1b6243acd98aa9ecb0cffef Brooks Davis 2026-11-10 11:49:21

debug: classified in 04-filenames_plain2 by 'sys/'

rtprio*(2): add kern_ implementations
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
985faddcb6edf7263202bd982a9204c1db66ac91 Brooks Davis 2026-11-10 11:49:21

debug: classified in 04-filenames_plain2 by 'sys/'

getrlimitusage(2): add user_ implementation
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
e3bdb45e811fe9577fc187f45654d5003b970350 Brooks Davis 2026-11-10 11:49:21

debug: classified in 04-filenames_plain2 by 'sys/'

kobj: Make the containers of pointers to base classes constant
The containers (arrays) will not be modified during runtime.

Reviewed by:    kib, imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D61297
8910f9e5a0cc378147d53c8440b97433671447ec Zhenlei Huang 2026-11-10 13:27:09

debug: classified in 04-filenames_plain2 by 'sys/'

sig*(2): add kern_ and user_ implementations
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
698ba43e0ec7a3cb107a4b14be6f781965b1d3c4 Brooks Davis 2025-11-24 15:33:34

debug: classified in 04-filenames_plain2 by 'sys/'

__sysctl(2): add kern_ implementation
The flags argument will be used by compat impelementations.

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
23abe1880071fed7f422af9b556db87afe426070 Brooks Davis 2025-11-24 15:40:30

debug: classified in 04-filenames_plain2 by 'sys/'

thr_set_name(2): add kern_ implementation
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
a81038c0dc02a7721e2a636013ae3e343966511e Brooks Davis 2025-11-24 15:51:26

debug: classified in 04-filenames_plain2 by 'sys/'

kern_time.c: add kern_ and user_ implementations
Expose user_clock_nanosleep globally.

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
22f93edf2014e39cc96822d1bf2e4804350f266f Brooks Davis 2025-11-24 15:58:25

debug: classified in 04-filenames_plain2 by 'sys/'

uuidgen(2): add user_ implementation
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
3d101bbff45e53999418496807a51ee5da39d4f6 Brooks Davis 2025-11-24 16:02:36

debug: classified in 04-filenames_plain2 by 'sys/'

namei(9): fix two ni_startdir leaks
namei() leaks the caller's ni_startdir reference on the empty-path
ENOENT return and on namei_getpath() failure.

On ZFS with the default zfs_xattr_compat=1, an empty user-namespace
extattr name on a file that has an xattr directory leaks one reference
on that directory per call.

Reported by:    llm-postcr
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61366
5feb271df85fe6bd968052d5bdd02b6d80335610 Konstantin Belousov 2026-11-10 00:49:33

debug: classified in 04-filenames_plain2 by 'sys/'

vn_open_cred(9): fix ni_startdir leak
vn_open_cred() returns EINVAL before calling namei() for
O_CREAT|O_EXCL|O_DIRECTORY and for O_CREAT|O_EMPTY_PATH.
That leaks an NDINIT_ATVP() start directory.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61366
7ac5569c5d9e601201c811786e6d0026f8aa3c1b Konstantin Belousov 2026-11-10 01:03:47

debug: classified in 04-filenames_plain2 by 'sys/'

sched_4bsd.4: sync current scheduler sysctls
Reviewed by:  bcr, jhb, olce
Approved by:    jhb, olce (mentor)
MFC after:      2 weeks
Sponsored by:   FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60002
be25f6d75d26e233ae7501a76d79fe4898c48e40 Minsoo Choo 2026-09-25 15:43:57

debug: classified in 04-filenames_plain2 by 'sys/'

sched_ule.4: sync current scheduler sysctls
Reviewed by:  bcr, jhb, olce
Approved by:    jhb, olce (mentor)
MFC after:      2 weeks
Sponsored by:   FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60002
7cb4d4dfdd181fb070794ff203b158783c617218 Minsoo Choo 2026-09-25 15:44:26

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #76: modstat: avoid copying from freed memory
modstat: avoid copying from freed memory

If a module is unloaded after the module is looked up in kern_modstat,
but before one of the copyout's occurs, then the memory being copied
might be freed and reused leading to an information disclosure.

The LLM was particularly concerned about a TOCTOU issue in the length
of the name, but it seems likely that there are issues with all the
copyout's.  As such, hold the shared lock throughout.

Reviewed by:    markj
Reported by:    llm-postcr
MFC after:      3 days
Sponsored by:   Innovate UK
Fixes:          https://cgit.freebsd.org/src/commit/?id=9b3851e9e3b1 ("- Lock down the ``module'' structure...")
Differential Revision:  https://reviews.freebsd.org/D61398
7f8c2056db1e39e44c3eda15aa4e53f7fc971cd8 Brooks Davis 2026-11-11 09:40:40

debug: classified in 04-filenames_plain2 by 'sys/'


modstat: don't copyout while holding a lock

If a user arranges for a page fault to never be filled (e.g., via a
FUSE file system), this can hold the shared lock forever.

To make this all work, refactor kern_modstat and freebsd32_modstat to
malloc a temporary buffer and fill it before copying it out rather
than doing a bunch of copies.

Add COMPAT_* ifdefs around compat code.  The module_stat_v1 code is
really for a.out binaries in practice and thus a bit questionable.

Reviewed by:    markj
Reported by:    llm-postcr
Sponsored by:   Innovate UK
Fixes:          https://cgit.freebsd.org/src/commit/?id=7f8c2056db1e ("modstat: avoid copying from freed memory")
Differential Revision:  https://reviews.freebsd.org/D61432
1ebf46ecb6278e31d7ae029b0f8af3d64e7bc1f9 Brooks Davis 2026-11-12 10:23:24

debug: classified in 04-filenames_plain2 by 'sys/'


modstat: allow compat support to fail in tests

v1 and v2 versions of stuct module_stat are now gated by COMPAT_ ifdefs
so allow the otherwise valid query to fail with EINVAL.

Effort:         CHERI upstreaming
Reviewed by:    markj
Reported by:    llm-postcr
Sponsored by:   Innovate UK
Fixes:          https://cgit.freebsd.org/src/commit/?id=1ebf46ecb627 ("modstat: don't copyout while holding a lock")
Differential Revision:  https://reviews.freebsd.org/D61460
ef726c645300870b6bdf3573079b1f89f3b45c74 Brooks Davis 2026-11-13 10:06:52

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'


modstat: check errno before calling feature_present

feature_present will overwrite errno if COMPAT_FREEBSD13 is not present.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=ef726c645300 ("modstat: allow compat support to fail in tests")
acd270c8c6542b45e404078b28e1a732106aa76c Brooks Davis 2026-11-13 10:24:17

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

debug: moved to kernel because 'Need to be grouped with ef726c645300870b6bdf3573079b1f89f3b45c74'

sched_*(2): add user_ implementations
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
e5100cd50a051dce571444ab4b8a821580f3dda4 Brooks Davis 2026-11-11 09:40:40

debug: classified in 04-filenames_plain2 by 'sys/'

profil(2): add kern_ implemenation
Effort:               CHERI upstreaming
Sponsored by:   Innovate, UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
1c17a0983ac329f053af69640e8844f4f58b80ac Brooks Davis 2026-11-11 09:40:40

debug: classified in 04-filenames_plain2 by 'sys/'

sys_capability.c: add kern_ and user_ implementations
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
974320334844517558365608615dc6f3cc86cdae Brooks Davis 2026-11-11 09:40:41

debug: classified in 04-filenames_plain2 by 'sys/'

sys_generic.c: add kern_ and user_ implementations
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
9acec4c863702ea4c3713dbde60dc57542133e5c Brooks Davis 2026-11-11 09:40:41

debug: classified in 04-filenames_plain2 by 'sys/'

getrandom(2): add kern_getrandom
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
1eada4295600ecb4bc639cd7e9dcd4f743a9298a Brooks Davis 2026-11-11 09:40:41

debug: classified in 04-filenames_plain2 by 'sys/'

pipe2(2): add kern_pipe2
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
1b2f03fe94ef4a1680a77db825b4471e9181b43b Brooks Davis 2025-11-24 17:53:30

debug: classified in 04-filenames_plain2 by 'sys/'

pdgetpid(2): add user_pdgetpid
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
22dd3a0df230da613b0ec173605a1275ebce00fb Brooks Davis 2025-11-24 17:55:08

debug: classified in 04-filenames_plain2 by 'sys/'

uipc_shm.c: add kern_ implementations
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
0e100820c4bb87dc3c365fa1f6a16e6f84363f5b Brooks Davis 2025-11-24 18:14:57

debug: classified in 04-filenames_plain2 by 'sys/'

uipc_syscalls.c: add kern_ and user_ implementations
Rename accept1 and sendit to user_accept and user_sendit.

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
65e94d4621c811af607053ffeb7159456bd25f32 Brooks Davis 2025-11-25 22:32:53

debug: classified in 04-filenames_plain2 by 'sys/'

__acl_*(2): add kern_ implementations
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
6e87733f73ff2bc1a5b2d1a370c15e4907deb326 Brooks Davis 2025-11-24 20:28:54

debug: classified in 04-filenames_plain2 by 'sys/'

pass(4): Wake select/kqueue waiters when an immediate CCB completes
In the CAMIOQUEUE ioctl, a queued CCB completes through passdone(),
which moves it to the done queue and calls selwakeuppri() and
KNOTE_LOCKED() so that a consumer blocked in select(2), poll(2) or
kevent(2) wakes up and collects the CCB with CAMIOGET.  An immediate
CCB (e.g. XPT_DEV_ADVINFO or XPT_DEV_MATCH) is instead executed
synchronously in the ioctl and moved to the done queue directly,
with no notification, so a consumer sleeping while waiting for its
completion never wakes up until some other queued I/O completes.

Send the same notification that passdone() sends.  The peripheral
lock is held at this point and backs the knlist, so KNOTE_LOCKED()
is the correct variant.

A version of this fix has been in production use at Spectra Logic
since 2024.

Co-authored-by: Dave Baukus <daveb@spectralogic.com>
Reviewed by:    imp
MFC after:      1 week
Sponsored by:   Spectra Logic
Assisted-by:    Claude Fable 5 <noreply@anthropic.com>
Differential Revision:  https://reviews.freebsd.org/D61416
6442a92a7d9c20c666999cc699610f1f5bec3cfd Kenneth D. Merry 2026-11-10 23:01:38

debug: classified in 04-filenames_plain2 by 'sys/'

pass(4): Don't drop the periph lock before selrecord() in passpoll()
passpoll() checked the done queue while holding the peripheral lock,
dropped the lock, and only then called selrecord().  A CCB completing
in the window between the unlock and the selrecord() call sent its
selwakeuppri() before the polling thread was on the selinfo list, so
the wakeup was lost and select(2) or poll(2) slept until another
completion arrived or the timeout expired.

Call selrecord() before dropping the lock.  This lock order is
already established: passdone() calls selwakeuppri(), which takes
the selinfo lock, while holding the peripheral lock.

kqueue is not affected, since the knlist is backed by the peripheral
mutex.

Reported by:    llm-postcr
Fixes:          https://cgit.freebsd.org/src/commit/?id=a9934668aa13
MFC after:      1 week
Sponsored by:   Spectra Logic
Assisted-by:    Claude Fable 5 <noreply@anthropic.com>
88c5709e91ad2cc6df51380673837f0ebd8a2d50 Kenneth D. Merry 2026-11-11 14:26:19

debug: classified in 04-filenames_plain2 by 'sys/'

user_connectat: correctly pass fd through
In the original adaptation of connect/connectat to use user_connectat in
CheriBSD, I failed to pass the fd through in the connectat case and
always passed AT_FDCWD.  This did trigger failures in the unix_connectat
test which I somehow missed in prior test runs.

Reported by:    llm-postcr
431cc94c0395205f7859d5f65289f9f2ebbe8162 Brooks Davis 2026-11-11 14:41:40

debug: classified in 04-filenames_plain2 by 'sys/'

p1003_1b: Add capability mode checks
The sched_* syscalls can operate either on the calling process (by
setting pid = 0) or by specifying a pid.  They are allowed in capability
mode, but previously were not scoped to only operating on the calling
process.

Reviewed by:    olce
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57346
70d08c69f4d0cb3e53347f2dd8dd06007c5d635a Ed Maste 2026-05-29 20:57:49

debug: classified in 04-filenames_plain2 by 'sys/'

sysvsem: Plug another place where we leak __sem_base to userspace
Leaking this pointer isn't harmful, but other places take care to clear
it, so handle this in SEM_STAT too.

Reviewed by:    imp, kib
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61396
73117931984add2f1e9a763de11be847ad872658 Mark Johnston 2026-11-11 14:14:01

debug: classified in 04-filenames_plain2 by 'sys/'

sysvmsg: Fix sequence number wraparound races
The SysV message queue code has the same problem that we fixed in the
semaphore code in SA-26:54.sysvsem and SA-26:64.sysvsem.  That is,
kern_msgrcv() and kern_msgsnd() are susceptible to TOCTOU races when
they sleep waiting for messages and queue space, respectively.  Unlike
the semaphore code, however, the message queue array is never resized
and there is no notion of message queue sets, so such races do not open
up any memory safety bugs.

Fix the races, following the pattern from the SysV semaphore changes:
use a global sequence number array with wide counters, to avoid changing
the KBI which is embedded in userspace tools.  Fix kern_msgsnd(), which
did not validate the sequence number at all after sleeping.  Use a
msgvalid() helper to factor out some duplicated checks.  Convert a
couple of local flag variables to bools.

Reported by:    Apex Security Research
Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61397
57bee493fdfae53453cdcbb63235067d95127621 Mark Johnston 2026-11-11 14:14:14

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #77: link_elf
link_elf: bounds-check the dynamic section's tables

parse_dynamic() only checks the DT_HASH header.  nbuckets, nchains and
the other DT_* tables come from the module unchecked.  Check them
against the mapping, and reject a size without its table.

Reported by:    llm-postcr
MFC after:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D61387
e0f08341a68e64111b58eac3cbe21f57c3840178 Osvaldo Janeri Filho 2026-11-11 14:43:02

debug: classified in 04-filenames_plain2 by 'sys/'


link_elf: validate symbol name offsets

st_name isn't checked against the string table size, for any of the
symbol tables used here.  Do what link_elf_obj.c does since 4e2c2842e.

Reported by:    llm-postcr
MFC after:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D61388
35d9a9b2fa4796a7e7a9c3bf17547e66007e6b14 Osvaldo Janeri Filho 2026-11-11 14:58:04

debug: classified in 04-filenames_plain2 by 'sys/'


link_elf: validate the section headers in link_elf_load_file()

e_shentsize isn't checked, and e_shstrndx, sh_link and sh_name are used
unchecked.  Do what link_elf_obj.c does.

MFC after:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D61389
e4b9fec671b6f45ab18c6292be7586a7d5d9b85f Osvaldo Janeri Filho 2026-11-11 15:04:28

debug: classified in 04-filenames_plain2 by 'sys/'

__getcwd(2), __getrealpath(2); add kern_ implementations
This corrects a accidentialy introduced definition of kern___getcwd.

Effort:         CHERI upstreaming
Fixes:          https://cgit.freebsd.org/src/commit/?id=d718de812fe1 ("Introduce kern_mmap_req().")
Sponsored by:   DARPA, AFRL, Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
7ca5de287e5804aaba354afd4a871f49e2af519a Brooks Davis 2026-11-12 10:23:23

debug: classified in 04-filenames_plain2 by 'sys/'

extattr*(2): add kern_ and user_ implementaions
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
f20c712f167acd692240350179d4d98d33971375 Brooks Davis 2026-11-12 10:23:23

debug: classified in 04-filenames_plain2 by 'sys/'

nmount(2): add kern_nmount
Effort:               CHERI UK
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
87d8a910d30f88eb53dd00272aefb5dfc59e0d6b Brooks Davis 2026-11-12 10:23:23

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #78: vfs_syscalls.c: add kern_ and user_ implementations
vfs_syscalls.c: add kern_ and user_ implementations

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
7273d80ba18c4af0cc6f9ec6c953e2b0bab263d7 Brooks Davis 2026-11-12 10:23:23

debug: classified in 04-filenames_plain2 by 'sys/'


kern_undelete: remove unused pathseg argument

I'd failed to pass it down to NDINIT, but nothing calls kern_uninit
with a path argument in sys space here or in CheriBSD so just drop it.

Effort:         CHERI upstreaming
Reported by:    llm-postcr
Sponsored by:   Innovate UK
Fixes:          https://cgit.freebsd.org/src/commit/?id=7273d80ba18c ("vfs_syscalls.c: add kern_ and user_ implementations")
b75412fea1dab5e49f7c55230033200c914fbcf6 Brooks Davis 2026-11-12 12:59:47

debug: classified in 04-filenames_plain2 by 'sys/'


kern_revoke: remove always UIO_USERSPACE pathseg argument

In FreeBSD and CheriBSD pathseg was always UIO_USERSPACE and when I
extracted the patch for FreeBSD, I failed to propogate it to NAMEI.
Since it's always the same, remove it as needless generality.

Reported by:    netchild
Sponsored by:   Innovate UK
Fixes:          https://cgit.freebsd.org/src/commit/?id=7273d80ba18c ("vfs_syscalls.c: add kern_ and user_ implementations")
143da26632a9ece8a789f24fd2c7ed4457783016 Brooks Davis 2026-11-13 15:25:01

debug: classified in 04-filenames_plain2 by 'sys/'

ntp_gettime(2): add kern_ntp_gettime
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
622365caf3bde45c459e566701ba0c8f9d8afa89 Brooks Davis 2026-11-12 10:23:23

debug: classified in 04-filenames_plain2 by 'sys/'

zfs: fix build after recent import
Sponsored by: Rubicon Communications, LLC ("Netgate")
2b85ea0ae47348a2b4f24eeb110a092132b552a6 Mateusz Guzik 2026-11-12 10:57:13

debug: classified in 04-filenames_plain2 by 'sys/'

swap{on,off}(2): add/expose kern_ implementations
Effort:               CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
965170da4548176cb0ec4ee65e01248af37f8824 Brooks Davis 2026-11-12 11:01:29

debug: classified in 04-filenames_plain2 by 'sys/'

SysV SHM: make kern_shmat static
This is the opposite of most kern_ cases, but SysV IP is designed to be
loaded as a module and freebsd32 support lives inside the main
implementation file.  Arguably it should be in a seperate module with a
dependency, but that's a refactor for another day.

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
b1482e09830e8ad3c55cbe183ce517736abd7f69 Brooks Davis 2026-11-12 11:01:30

debug: classified in 04-filenames_plain2 by 'sys/'

pdrfork(2): add kern_pdrfork
Effort:               CHERI upstreaming
Sponsored by:   DARPA, AFRL
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
9f47314ebdb61a9d7368f2bc75b122d62be5694d Brooks Davis 2026-11-12 11:01:30

debug: classified in 04-filenames_plain2 by 'sys/'

pdwait(2): add user_pdwait
Effort:               CHERI upstreaming
Sponsored by:   DARPA, AFRL
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
30d759067be91e3f74b98f537512eb5030c89e57 Brooks Davis 2026-11-12 11:01:30

debug: classified in 04-filenames_plain2 by 'sys/'

freebsd14_[gs]groups: add kern_ and user_ implementations
Effort:               CHERI upstreaming
Sponsored by:   DARPA, AFRL
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
d60162816083c0dc54c1c6655bceb5f0257e40a7 Brooks Davis 2026-11-12 11:01:30

debug: classified in 04-filenames_plain2 by 'sys/'

zfs: add missing vdev_anyraid.c to module build after 013c77e66 merge
0246afd32ce878bb4376a770a3f667b6177e58a3 Martin Matuska 2026-11-12 11:47:40

debug: classified in 04-filenames_plain2 by 'sys/'

rtprio*: Add capability mode checks
These syscalls are allowed in capability mode but accept an arbitrary
pid or lwpid.  Restrict them to the calling process in capability mode.

In capability mode rtprio_thread(2) only looks up threads of the
calling process, and returns ECAPMODE for any other lwpid, including
one that does not exist.

Sponsored by: Advanced Micro Devices, Inc.
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>
Reviewed by:    olce
9b6ea599c955cfdffac0a5e0204f57a72e6f7cda Osvaldo Janeri Filho 2026-11-12 15:05:10

debug: classified in 04-filenames_plain2 by 'sys/'

getpgid,getsid: Add capability mode checks
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57385
93f78e8fb89a54b6f2c37437a5b912203369daef Ed Maste 2026-06-01 17:13:07

debug: classified in 04-filenames_plain2 by 'sys/'

nvmft: Document all CTL_NVMF status codes
Sponsored by: Chelsio Communications
02c0eefc4e0ba2208d97fb4a80cd9bc4ec0dc47f John Baldwin 2026-11-12 15:44:57

debug: classified in 04-filenames_plain2 by 'sys/'

devd: define _PATH_DEVD_SOCKET in <paths.h>
Sweep through consumers and use the define.

Reviewed by:            kfv, imp
Differential Revision:  https://reviews.freebsd.org/D61344
039ec3ca1becc794c21e31ea6d5acef3fe053544 Gleb Smirnoff 2026-11-13 02:37:10

debug: Commit manually moved from "unknown" to "kernel".

devd: expose maximum record size via sysconf(3)
Use UMA allocation size that holds the buffer.  The buffer is actually
slightly smaller.  Document the latter so that clients don't need to use
+1 if they later want to NUL-terminate a message.

Reviewed by:            mjg, imp
Differential Revision:  https://reviews.freebsd.org/D61346
b1a7434056973c5f19b61db2d198a1c92d456efc Gleb Smirnoff 2026-11-13 02:37:21

debug: Commit manually moved from "unknown" to "kernel".

extattr_list*: avoid panic with absurd buffer lengths
Apply a layered defence:
 - Reject nbytes > IOSIZE_MAX in user_extattr_list_fd and
   user_extattr_list_path.
 - In extattr_list_vp require auiop->uio_resid to be non-negative.

Effort:         CHERI upstreaming
Reviewed by:    markj
Reported by:    llm-postcr
MFC after:      3 days
Sponsored by:   Innovate UK
Fixes:          https://cgit.freebsd.org/src/commit/?id=6453d4240f6b ("vfs: Export exattr methods to reuse by Linuxulator")
Differential Revision:  https://reviews.freebsd.org/D61461
118067f51c111390dbc54760d781cd14a10c499e Brooks Davis 2026-11-13 10:06:52

debug: classified in 04-filenames_plain2 by 'sys/'

swapoff: don't leak vnode pointer to device
After looking up the device path, we compare the vnode to the vnode of
each swap device.  Prior to this change we leaked a vnode reference to
the device we're trying to remove from the swap pool.

Effort:         CHERI upstreaming
Reviewed by:    kib, markj
Reported by:    llm-postcr
MFC after:      3 days
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D61464
9506d8e0b1788068cbd4c2cbc984cb6ee0dcb0ab Brooks Davis 2026-11-13 10:06:53

debug: classified in 04-filenames_plain2 by 'sys/'

aio_cancel(2): add kern_aio_cancel
Effort:               CHERI upstreaming
Sponsored by:   DARPA, AFRL, Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
70cf77eaefa826570287ded6b27087fd5df89298 Brooks Davis 2026-03-12 14:19:04

debug: classified in 04-filenames_plain2 by 'sys/'

hwpmc: switch in process PMCs on a thread's first run
A new thread starts in fork_exit(), not mi_switch(), so its PMCs are
not loaded until its next context switch.  Call the switch-in hook
there.

Reviewed by:    kib, Osvaldo Janeri Filho <ojanerif@amd.com>, mhorne
MFC after:      1 week
Sponsored by:   Advanced Micro Devices, Inc.
Differential Revision:  https://reviews.freebsd.org/D60565
1bb8b1d99a6cfb81e5b8234434b7ea098d6bef44 Andre Silva 2026-11-13 14:28:14

debug: classified in 04-filenames_plain2 by 'sys/'

clock_gettime: Add capability mode check
clock_gettime is permitted in capability mode, and it calls get_cputime
if clock_id is negative.  get_cputime did not check the target pid in
capability mode.

Reported by:    llm-postcr
Reviewed by:    markj, Osvaldo Janeri Filho <ojanerif@amd.com>
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61469
973698a330c3c956359a99933b02e11e1f609526 Ed Maste 2026-11-12 15:52:18

debug: classified in 04-filenames_plain2 by 'sys/'

callout: optionally spread callouts to all CPUs
By default, if the caller has not used one of the _on() or _cpucpu()
variants of the callout API, the system assigns the callout to CPU0.

Having most callouts running on CPU0 can be problematic in terms of
the amount of CPU time spent executing callouts can have an unfair
impact to CPU0, and a critical callout (like lacp_tick) is certain
to land on the same CPU as everything else, so it is more likely
to be delayed.

This change introduces a change to callout_init* where if
kern.callout_spread is non-zero, callouts initialized after SMP startup
are distributed among CPUs.

This is left as disabled by default, as it may reveal any latent
synchronization bugs that were previously hidden, e.g., two callout handlers
which were always accidentally serialized against each other before may now
run concurrently.  It also may cause a slight increase in power consumption
for mobile users.

Reviewed by: markj, (+ mjg who reviewed the first version and suggested
                   the simpler mechanism used in this commit)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D61361
67f3eac87e41339ce7244e5234f142626972ee82 Andrew Gallatin 2026-11-13 17:12:02

debug: classified in 04-filenames_plain2 by 'sys/'

procctl: Zero the output structure for the compat32 syscall
Otherwise the freebsd32 implementation of PROC_REAP_STATUS leaks
uninitialized kernel stack memory.

Reviewed by:    kib
Reported by:    Dennys Kaluzny Pereira <dennyskaluzny@gmail.com>
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61510
5a834ad15f1f09d43a6840c74da194db6f890aa2 Mark Johnston 2026-11-13 19:44:59

debug: classified in 04-filenames_plain2 by 'sys/'

kernel: Add -mindirect-branch-cs-prefix for WITH_KERNEL_RETPOLINE
-mindirect-branch-cs-prefix adds a CS segment-override prefix (0x2e)
to each call or jmp to a retpoline thunk.  The CPU ignores the prefix,
but it extends the instruction to six bytes instead of five.  This
leaves enough room for a future kernel change to patch all of the call
sites at boot time to disable retpoline if not required.

Support for this option arrived in GCC 12 and Clang/LLVM 16.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61514
cb1627e40d5c0c21f2f7d13e848cf6495390e777 Ed Maste 2026-10-22 18:21:45

debug: classified in 04-filenames_plain2 by 'sys/'

geom: Check file flags before handling control request
Pass fflag down to g_ctl_req() and:

* Refuse all requests unless fflag has the FREAD bit set

* Refuse all but getxml unless fflag also has the FWRITE bit set

This should allow us to restore read access to /dev/geom.ctl for group
operator; they will then be able to run `gpart list` or `gpart backup`
but not commands that actually modify the table.

For backward compatibility, we set the FWRITE bit if it is not already
set and the calling thread has the PRIV_GEOM privilege, which is
automatically granted to a jailed or unjailed superuser.  This should
cover the case of older binaries (which open /dev/geom.ctl read-only)
running as root on a newer kernel.  Since we intend to merge this to
stable/15, the compatibility code is conditional on COMPAT_FREEBSD14.

MFC after:      1 week
Event:          EuroBSDCon 2026 DevSummit
Reviewed by:    imp, markj
Differential Revision:  https://reviews.freebsd.org/D59591
408a1ec93facc8a02f4f7515fb4e036cce85fa39 Dag-Erling Smørgrav 2026-11-14 16:24:45

debug: classified in 04-filenames_plain2 by 'sys/'

Commit group #79: sched_ule
sched_ule: Document fields of 'struct runq_steal_pred_data'

While here, re-order them to have inputs before outputs.

No functional change.

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
2ba9debd3ac9d3cdc49936074cef3d97c47e9346 Olivier Certner 2026-11-12 11:21:53

debug: classified in 04-filenames_plain2 by 'sys/'


sched_ule: tdq_add(): INVARIANTS: Add check, fix name in assertion strings

Change the assertion on the to-add thread's lock so that it also fails
if the thread's lock is not that of the 'tdq' (the checks that it is
lock-unblocked and locked remain).

It is tempting to add another check that the thread's 'ts_cpu'
corresponds to the passed runqueue (in other words, that it has been set
correctly), but that requires to add a call to thread_lock_block_wait()
which should not be present in non-debug code, and that may prevent some
races from happening on INVARIANTS, so I gave up on it.

Fix the function name in assertion strings, as sched_add() is not the
only (direct or indirect) caller of tdq_add().

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
00add43b882c36ce657bc9d60d5644bf147f378b Olivier Certner 2026-11-12 12:21:47

debug: classified in 04-filenames_plain2 by 'sys/'


sched_ule: sched_rem(): Use THREAD_LOCKPTR_ASSERT() instead of MPASS()

This gives a better message.

While here, add some empty lines to make INVARIANTS-only statements
stand out for better readability.

No functional change.

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
136e3a3eba5b59abfae066d4caaeccd4546d8973 Olivier Certner 2026-11-12 12:24:42

debug: classified in 04-filenames_plain2 by 'sys/'

proc.h: Order thread_lock*() functions more logically
Also matches the implementation order in 'kern_mutex.c'.

No functional change.

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
3a1f5a28f00770dec7c793a1c44863a824054ade Olivier Certner 2026-11-12 21:54:37

debug: classified in 04-filenames_plain2 by 'sys/'

sched_ule: tdq_move(): INVARIANTS: Remove a superfluous assertion
That the lock of the stolen thread is the same as the source runqueue is
already checked by sched_rem().

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
2210a2f8d4705eee0bf3d89a8e30f0babb40fed1 Olivier Certner 2026-11-12 22:11:59

debug: classified in 04-filenames_plain2 by 'sys/'

sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread
Thread stealing ultimately happens in tdq_move() which, while holding
the locks of the source and destination runqueues, has to wait for the
stolen thread to be lock-unblocked.  If it is indeed lock-blocked, the
corresponding sched_switch_migrate() needs to re-acquire the lock of the
runqueue of the CPU it is running on before being able to lock-unblock
it.  This amounts to adding a "hidden" and variable additional
lock-ordering dependency between the 'struct tdq' locks held by
tdq_move() and that of an arbitray third 'struct tdq', possibly
violating the ordering established by tdq_lock_pair().  In that case,
other steals occurring in parallel and involving the same queues can
deadlock the scheduler.

Fix that by having sched_switch_migrate() hold its current CPU's
runqueue's lock in addition to the remote CPU's before the migrated
thread can appear on the remote runqueue, so that it does not have to
re-acquire the former, removing the "hidden" lock-ordering dependency.

Thanks to avg@ who reported such a currently extremely rare
(explanations below) deadlock occurrence and analyzed it pretty
thoroughly from the crash dump, as well as doing some code archeology
(see the thread "ULE: run queue lock deadlock in sched_switch_migrate()
+ tdq_move()" in the FreeBSD-current mailing list).  For another,
similar occurrence described in concise steps, please see commit
435068aab79b ("Fix sched_switch_migrate(): (...)").

Below is a thorough explanation of the deadlocks that could occur, an
history of such deadlocks, a description and explanation of avg@'s
occurrence, details on the fix's implementation and why that fix was
chosen.

******

Threads are ultimately stolen via tdq_move(), which finds the highest
priority thread that can be migrated to the destination CPU.  tdq_move()
waits for the stolen thread to become lock-unblocked before assigning it
to the destination CPU's runqueue, because that action requires changing
the thread's lock to the destination runqueue's lock (the blocked lock
is a temporary placeholder for later replacement by the source CPU's
runqueue's lock).  It does so with both the source and destination CPUs'
runqueues locked.

Consider the situation where a CPU steals a thread that is indeed
lock-blocked.  This implies that some sched_switch() is executing on
another CPU, evicting the stolen thread (as a thread lock-blocked by
sched_add()/sched_pickcpu() or sched_throw() cannot be seen on
a runqueue).  That CPU must be at a point where the stolen thread's
runqueue just before the concurrent steal (=source runqueue) was
unlocked, and there are two distinct such cases.  The first is that the
evicted thread gets added to sched_switch()'s current runqueue/CPU, and
we are past sched_switch()'s tdq_unlock(), but before cpu_switch() which
lock-unblocks the thread.  In that case, the cpu_switch() thread does
not block and eventually will execute cpu_switch().  The second case is
that the evicted thread gets migrated to a remote CPU which is
necessarily tdq_move()'s source CPU of the steal with our assumptions.
We are then in sched_switch_migrate() after the thread got added to the
remote CPU's runqueue, the remote CPU possibly signaled (according to
priorities) and after its runqueue was unlocked.  We may however be
before re-locking the current CPU's runqueue.  Then, sched_switch()
depends on that re-locking to happen to finally lock-unblock the thread.
As we have seen above, tdq_move() itself depends on observing the
lock-unblock before it will release the source and destination
runqueues.

The problem is that there exists cases where sched_switch()'s re-locking
of the current runqueue depends on the steal releasing its runqueues,
creating a deadlock.  For example, the steal could happen between the
same CPUs involved in sched_switch() with source and destination
inverted, if sched_switch() migrates the thread prompted by the
long-term load-balancer but the load imbalance suddenly changes and the
latter makes the reverse decision.  In the current long-term
load-balancer, this precise case cannot arise, but it could some years
ago (see below).

The practical case reported by avg@, which prompted this analysis and
commit, is more involved.  There, sched_switch() initiates a migration
as requested by the long-term load-balancer (TDF_PICKCPU is set on the
thread and it is pre-empted, leading to sched_switch() being called).
In parallel, some idle CPU wants to steal a thread from sched_switch()'s
remote CPU, and we end up with a situation as described in the previous
paragraphs.  Finally, the long-term load balancer locks the
sched_switch()'s current CPU's runqueue (before sched_switch() can grab
it again), wanting to migrate a thread from there to the steal's
destination CPU (which was idle) (that runqueue is locked first because
the corresponding CPU's 'struct tdq''s address happens to be smaller
numerically, see tdq_lock_pair()).  That establishes a dependency from
locking the steal's destination CPU to releasing the sched_switch()'s
current CPU, closing a loop in the dependency graph, i.e., a deadlock.

As avg@ points out, the same kind of deadlocks had been reported and
fixed in 2009, as indicated by commit 435068aab79b ("Fix
sched_switch_migrate(): (...)"), but the deadlock was re-introduced by
commit 686bcb5c14ab ("schedlock 4/4") in 2019.  However, it appeared to
be much more frequent back then.  That is most probably because the
long-term load balancer was more aggressive, allowing thread ping-pong,
whereas it now will only try to steal once from a given CPU per run,
giving ample time between two runs for a migrated thread to become
lock-unblocked before the next migration.  avg@ experienced the problem
on a VM with 24 vCPUs "only once in many years on a fleet of thousands
of systems", and we are not aware of any other report of such
a deadlock, including on physical machines.  It probably occurred there
because of an overloaded machine/hypervisor that for some reason would
not execute some vCPU for an unusually long period of time at a bad
moment.

The fix is similar in spirit to what was done in commit 435068aab79b
("Fix sched_switch_migrate(): (...)").  It consists in
sched_switch_migrate() locking both the current and remote runqueues
before migrating the thread.  That way, sched_switch() never needs to
reacquire any locks in order to finally unblock the migrated thread, so
the migrated thread is eventually unlocked, as well as the runqueues
lock by tdq_move().

Contrary to the situation of 2009's fix, however, sched_switch_migrate()
is now called with the current runqueue locked.  So we augment
tdq_lock_pair() with a boolean to indicate that the first queue is
already locked, and optimize it for that property: It will directly lock
the second lock if that follows the (arbitrarily) established lock
order, else it first tries to lock the second one opportunistically, and
if that fails, unlocks the first before locking both in order (second
then first).

Our initial solution consisted in simply not considering a thread that
is still lock-blocked when stealing, so that tdq_move() does not have to
wait for it to become unblocked, which removes the lock dependency
mentioned in the first paragraph.  It is marginally more efficient in
the sense that it does not need to lock both runqueues in
sched_switch_migrate(), which sometimes requires dropping the current
runqueue's lock and then re-acquiring it, and allows to steal another
thread more quickly (no need to wait for the stolen one to unblock), but
it risked proving noticeably pessimistic in the case of a single thread
to steal that is lock-blocked (a context switch has just occurred, and
another thread is now run), as tdq_idled() and tdq_trysteal() are not
prepare to handle this case, causing a missed steal opportunity and
leaving two threads sharing the sched_switch()'s core even if other
cores are free, until the next time the load balancer kicks in.
Ideally, stealing should not require to lock two runqueues at the same
time for increased steal parallelism, but such a change is much more
involved so will be considered at a later time.

Reported by:    avg
Reviewed by:    mchoo, avg (before last tdq_lock_pair() optimization)
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61448
538c48bf6247a2895b364c96f495be4cc7df1933 Olivier Certner 2026-11-11 21:41:45

debug: classified in 04-filenames_plain2 by 'sys/'

swapoff: release vnode held since swapon
kern_swapon looks up the proposed swap path and aquires a vnode which is
held (unlocked) throughout the life of the swap device.  In the device
case (swapgeom) it was never released in the swapoff path.

Remove an incorrect comment about swapgeom_close being called from
biodone.  It is only called directly via swapoff(2) or at the end of the
shutdown path.

Reviewed by:    kib, markj
Reported by:    llm-postcr
MFC after:      3 days
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D61465
933f5f616a8a44b7af6cdccecf959ef1e8bab66e Brooks Davis 2026-11-16 09:57:24

debug: classified in 04-filenames_plain2 by 'sys/'

powerpc64: give processes a 48-bit address space by default
Since ASLR got enabled for ELFv2, the random bases for the heap, the
dynamic linker and PIE binaries can land anywhere in the 52-bit address
space radix gives us. A lot of userland doesn't like that: SpiderMonkey,
JavaScriptCore, QV4 and friends pack pointers into 47 or 48 bits and
crash on startup (gjs, cjs, qml, ...).

Do what amd64 does on LA57 hardware: keep the full range in the kernel
and give processes a smaller map by default through a second set of
sysvecs. The default is 48 bits (256 TiB), the same as arm64.

One caveat for 48 bits: SpiderMonkey's GC allocator has no fallback
there and relies on mmap(2) hints staying 1 MiB-aligned, which ASLR on
FreeBSD breaks (hinted mappings move in 4 KiB steps, 64 KiB on arm64).
The versions in ports need Mozilla's bug 1876632 (MAP_ALIGNED on
FreeBSD, in Firefox 143) to be reliable; with it gjs runs clean.

The full 52 bits stay available per process through the la52 feature
control note (elfctl(1)) and PROC_LA_CTL (proccontrol(1)), and
vm.pmap.prefer_uva_la48 flips the default. la52 is the powerpc64 name
for the note bit amd64 calls la57, the procctl(2) values are the same.

Fixes:          https://cgit.freebsd.org/src/commit/?id=30ed27ff2556 ("sys/powerpc/powerpc/elf64_machdep.c: enable ASLR on ELFv2")
Reviewed by:    kib
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D61331
5f2956673c280fa3de5615dfeecdc6c92e62d307 Piotr Kubaj 2026-11-15 20:57:41

debug: classified in 04-filenames_plain2 by 'sys/'

mac: Fix a couple of bugs in prison label handling
In mac_get_prison(), mac.m_string points to a user address; the
string is copied in by mac_label_copyin_string().  If an error occurs
before that copyin, we end up freeing a user-controlled pointer.

In mac_set_prison_prepare(), the string is leaked.

Fix both problems.  While here, make free_copied_label() a bit more
robust to bugs in callers.

Fixes:          https://cgit.freebsd.org/src/commit/?id=bd55cbb50c58 ("kern: add a mac.label jail parameter")
Reviewed by:    olce, kevans
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61596
c27f0ee61fc4d13c0eb18ab5d542b349c0eab5b4 Mark Johnston 2026-11-16 17:34:26

debug: classified in 04-filenames_plain2 by 'sys/'

hwpmc: call the thread-create hook for Linux and kernel threads
linux_clone_thread() and kthread_add() did not call the
PMC_FN_THR_CREATE hook.  Their new threads had no hwpmc thread
descriptor.  If the process had a sampling PMC, the first switch-in
of such a thread hit KASSERT(pt != NULL) in pmc_process_csw_in().
An unprivileged user could panic an INVARIANTS kernel with
"pmcstat -P" on a threaded Linux program.

Call the hook in both functions, as thread_create() does.

kern_kthread.c did not include opt_hwpmc_hooks.h, so its hwpmc code
never compiled.  Include it, and use newtd in kthread_add1().
Remove the exit log call from kthread_exit(), because thread_exit()
already logs the exit.

Reported by:    llm-postcr
Reviewed by:    kib, mhorne
Fixes:          https://cgit.freebsd.org/src/commit/?id=6161b98c9935 ("hwpmc: Implement per-thread counters for PMC sampling")
Differential Revision:  https://reviews.freebsd.org/D61524
bf7bb731d8a2f42f2eb5d6f1f7a2183e40915545 Andre Silva 2026-11-16 19:47:46

debug: classified in 04-filenames_plain2 by 'sys/'

Build system

man: Link ena.4 to if_ena.4
For consistency, create a symbolic link from ena.4 to also if_ena.4

Reviewed by:            #manpages, ziaee
Differential Revision:  https://reviews.freebsd.org/D60191
MFC after:              3 days
566fdcba48817b0f8fea1f9b2963505b925675fb Juraj Lutter 2026-10-01 07:54:04

debug: classified in 02-filenames_wildcards by '.*Makefile'

__FreeBSD_version: Bump for mkimg -f vmdks
Also, adjust bootstrap tools code in Makefile.inc1 to reflect this; in
addition to rebuilding mkimg if it is out of date, we now need to build
libz, which was not previously needed by mkimg.

Reviewed by:    kevans
MFC after:      2 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60153
a68ba2d2ce55f7c76174239c1f678379caec5348 Colin Percival 2026-09-29 19:44:41

debug: Commit manually moved from "unknown" to "build".

EC2: Pass --vmdk to bsdec2-image-upload if needed
Starting with version 1.5.0, bsdec2-image-upload supports uploading
stream-optimized VMDK files.  If we build images in that format, we
need to upload them appropriately.

MFC after:      2 weeks
Sponsored by:   Amazon
65840afc88553f89c051b96b081061a532cb7df3 Colin Percival 2026-10-03 16:42:07

debug: classified in 02-filenames_wildcards by '.*Makefile'

EC2: Use stream-optimized VMDK format
Once enabled on all of the branches, this will reduce bandwidth
consumption from uploading weekly snapshot builds from ~500 GB to
~100 GB, as well as significantly speeding up the process.

MFC after:      2 months
Sponsored by:   Amazon
34f2f57b836d9cec02130419f5272495860d4ddf Colin Percival 2026-10-03 16:44:03

debug: classified in 02-filenames_wildcards by '.*Makefile'

Commit group #80: bsd.lib.mk: only ctfmerge if objfiles have a CTF section
bsd.lib.mk: only ctfmerge if objfiles have a CTF section

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299013
Reported by:    Trond.Endrestol@ximalas.info
Reviewed by:    emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=222210c6a822 ("libgcc_s: add libgcc_s_asneeded.so wrapper for gcc 16")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60252
fdd3f6f78888b02a1bfa69a0572317413dc14a45 Siva Mahadevan 2026-10-02 19:54:55

debug: classified in 03-filenames_plain1 by 'share/mk/'


sys.mk: CTFMERGE: don't assume objfiles always have CTF sections

There are many instances, e.g. in the kernel, where
object files don't have CTF sections, but still need
to be merged into one that does have a CTF section.

This fixes cases like the following:

--------------------------------------------------------------
>>> stage 3.1: building everything
--------------------------------------------------------------

linking kernel.full
ctfmerge -t -L VERSION -g -o kernel.full ...
ERROR: ctfmerge: Input file force-dynamic-hack.pico was partially built from C sources, but no CTF data was present
Removing kernel.full

    kernel.full ---
    [kernel.full] Error code 1

This partially reverts commit fdd3f6f78888b02a1bfa69a0572317413dc14a45.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299013
Reported by:    markj
Reviewed by:    markj, emaste
Fixes:          https://cgit.freebsd.org/src/commit/?id=fdd3f6f78888 ("bsd.lib.mk: only ctfmerge if objfiles have a CTF section")
Differential Revision:  https://reviews.freebsd.org/D60378
b45d14d3d665e0253391924e5c0595c259b8a773 Siva Mahadevan 2026-10-05 20:13:16

debug: classified in 03-filenames_plain1 by 'share/mk/'

zstream: Downgrade -Watomic-alignment to a warning
Don't complain about unaligned atomic operations on i386.  This
same approach is already used for libspl.
c907302c121acc5ed696544f86a6d44d07faf06c John Baldwin 2026-10-05 20:53:19

debug: classified in 02-filenames_wildcards by '.*Makefile'

sys: Enable pcfclock.ko on all architectures
This driver has been in sys/conf/NOTES (and thus enabled in LINT
builds on all architectures) since the file was renamed from the i386
LINT and there is no i386-specific code in the driver.

Reviewed by:    imp, markj
Differential Revision:  https://reviews.freebsd.org/D60177
228dd4eaae150e68566eb27cb7266cea1a98aea4 John Baldwin 2026-10-08 15:20:21

debug: classified in 02-filenames_wildcards by '.*Makefile'

Makefile.inc1: Update comment wrt world build targets
The utility targets described by this comment are in fact related to
building (buildworld), not installing (which is included in
`make world`).

Reviewed by:    brooks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56715
87f0db8c672446d7690a781c75075c7d503dc44f Ed Maste 2025-05-24 16:53:00

debug: classified in 02-filenames_wildcards by '.*Makefile'

build: Emit a warning for build targets run as root
Build targets should generally be run as an unprivileged user.  Even
though building as root is discouraged many users do so, so just start
with a warning.

Reviewed by:    brooks
Differential Revision: https://reviews.freebsd.org/D50352
24d5194306b573bf3396858b4c0aa5d420c37c91 Ed Maste 2025-05-14 15:23:42

debug: classified in 02-filenames_wildcards by '.*Makefile'

Makefile.inc1: Don't unnecessarily ignore rm errors
For rm -f it's not an error if the files do not exist.  If there's any
other error it's presumably a real issue, so avoid ignoring all errors.

Reviewed by:    brooks, adrian
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56714
d3c788feec4cbe0854dc6f72e2166c0423a7c118 Ed Maste 2024-08-19 16:03:13

debug: classified in 02-filenames_wildcards by '.*Makefile'

bsd.dirs.mk: Improve "installing DIRS" message
Some of these messages looked at first glance like they were incorrectly
concatenated, e.g. "installing DIRS testsFILESDIR".  Add a colon to
clarify.

Reviewed by:    brooks, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60525
39f7dbff606de56d0a4a18cc9b8ccc5fe1d54c2b Ed Maste 2025-05-21 17:45:09

debug: classified in 03-filenames_plain1 by 'share/mk/'

Commit group #81: man: Link mgb.4 to if_mgb.4
man: Link mgb.4 to if_mgb.4

For consistency, create a symbolic link from mgb.4 to also
if_mgb.4

Reviewed by:            #manpages, ziaee, emaste
Differential Revision:  https://reviews.freebsd.org/D60551
MFC after:              3 days
05c49e2aa6439820f8f4d5bbf19634f84f6bad5a Juraj Lutter 2026-10-09 19:54:04

debug: classified in 02-filenames_wildcards by '.*Makefile'


man4: Only link mgb.4 to if_mgb.4 where mgb.4 is installed

mgb.4 is only installed on amd64 and i386, move the MLINKS entry into
the amd64/i386 block next to _mgb.4.

Fixes:          https://cgit.freebsd.org/src/commit/?id=05c49e2aa643 ("man: Link mgb.4 to if_mgb.4")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
e0a5aa37c1ef3a22e2dc8c311e0e32ea363f7ccf Li-Wen Hsu 2026-10-10 21:02:05

debug: classified in 02-filenames_wildcards by '.*Makefile'


man.4: Create if_mgb.4 symlink on supported architectures only.

Fixes:                  https://cgit.freebsd.org/src/commit/?id=05c49e2aa643 ("man: Link mgb.4 to if_mgb.4")
Fixes:                  https://cgit.freebsd.org/src/commit/?id=e0a5aa37c1ef
Differential revision:  https://reviews.freebsd.org/D60551
2d935a1e93af4d552db1f7218ef97e01f058c084 Juraj Lutter 2026-10-10 13:29:03

debug: classified in 02-filenames_wildcards by '.*Makefile'

tests/libc: only build brk_test where libc provides sbrk
Replace the exclusion list with an allowlist of the architectures
whose libc exports brk/sbrk: amd64, i386, arm and powerpc.

On aarch64, riscv and loongarch libc does not export those symbols
and the test cannot run, so do not build it there. New architectures
now default to not building the test unless brk support is added.

MFC after:      1 week
Signed-off-by:  Xiaoqiang Zhao <zhaoxiaoqiang007@gmail.com>
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D60357
8a7df6c58d549bd2eaa5cad30b2ef93c3eca3c18 Xiaoqiang Zhao 2026-10-10 17:45:18

debug: classified in 02-filenames_wildcards by '.*Makefile'

man4: Install mgb.4 on all architectures
mgb(4) is not x86-only now, so install its manpage everywhere and make
if_mgb.4 link creation work, which is already on all architectures.

Sponsored by:   The FreeBSD Foundation
98b7f63c45ec711169c59c90ffa807cad22e27fe Li-Wen Hsu 2026-10-15 17:58:26

debug: classified in 02-filenames_wildcards by '.*Makefile'

sysarch.x86.2: manual page for the sysarch(2) functions on x86
Reviewed by:  ziaee
Discussed with: jhb
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60047
bdcfeac3e1cb8ce3f05c32d8a7ad3597deb48bdf Konstantin Belousov 2026-09-26 11:03:34

debug: classified in 02-filenames_wildcards by '.*Makefile'

build: Support got
Add code for using got(1), matching how git(1) is currently used:
1. Determining the git branch,
2. Determining the checked-out hash,
3. Determining the commit count,
4. Determining the timestamp of the most recent commit,
5. Determining if the tree is "dirty",
6. Generating lists of files for the src and src-sys packages, and
7. Excluding .got directories from src.txz and ports.txz.

The release engineer hopes to use this functionality in release builds,
since got's minimalism makes it a far more manageable build tool than
git.

Reviewed by:    naddy
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60606
a8be899289303c9f83813cfd96d1a62abba09685 Colin Percival 2026-10-14 01:12:07

debug: classified in 05-summary-prefix by 'build:'

Makefile.inc1: Adjust mkimg bootstrap versions
Stream-optimized VMDK support was merged to stable/15 with
__FreeBSD_version 1501504.

Sponsored by:   Amazon
7ccf9ae50ce4e3df8ec2acd1e36aa4f6390629d1 Colin Percival 2026-10-17 17:09:41

debug: classified in 02-filenames_wildcards by '.*Makefile'

OCI: Remove dead code
We don't need to pick a repository URL when all we're doing is enabling
one which was specified in /etc/pkg/.

Reviewed by:    dch, imp
Fixes:  https://cgit.freebsd.org/src/commit/?id=c73ae6734899 ("release/tools: use same pkg settings ...")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60868
93c05b743ea865bb87653e9ee5fbaa837c00eee7 Colin Percival 2026-10-19 17:17:16

debug: classified in 02-filenames_wildcards by 'release/.*'

__FreeBSD_version: Bump for mkimg %align feature
MFC after:    1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60453
0f787e867d217583017181d1a904933939b4c34d Colin Percival 2026-10-08 00:47:49

debug: Commit manually moved from "unknown" to "build".

vmimage.subr: Support partition alignment
If VM_PARTALIGN is set, pass %${VM_PARTALIGN} to mkimg in the
specification of swap, config, root, and ESP partitions.  (Boot
partitions are not aligned, both because they're small and in
case firmware makes assumptions about their locations.)

Reviewed by:    lwhsu, imp
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60454
f46269aba8a0bc2b60a0305bdafd8dfb42e0bb88 Colin Percival 2026-10-08 00:52:01

debug: classified in 02-filenames_wildcards by 'release/.*'

EC2: Align partitions to 1 MB boundaries
Reviewed by:  jlduran, imp
MFC after:      2 months
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60455
5774911bfb304c2c9b5d6c3c798c21e2c40b59de Colin Percival 2026-10-08 00:56:01

debug: classified in 02-filenames_wildcards by 'release/.*'

tests/sys/vfs: use LIBADD for libutil, don't clobber LDFLAGS
"LDFLAGS= -lutil" dropped LDFLAGS from make.conf for every test in the
directory.

Approved by:    glebius
Fixes:          https://cgit.freebsd.org/src/commit/?id=c3ac06161dd5 ("nmount: Introduce the "check_fsid" option")
Sponsored by:   Netflix
1e86bf6009e5b244170064ff0cb1ae48d8cda50a Olivier Cochard 2026-10-28 05:32:56

debug: classified in 02-filenames_wildcards by '.*Makefile'

Commit group #82: Makefile.inc1: Make sure mandoc bootstrap tool depends on libz
Makefile.inc1: Make sure mandoc bootstrap tool depends on libz

It links against both libopenbsd and libz, so reflect this in the
bootstrap tool's dependencies in case of races from highly-parallel
builds.

Reported by:    jkh
MFC after:      1 week
1dbcc7ee92c427480802cd1a40e1a1e3395d9bac Jessica Clarke 2026-10-29 00:45:01

debug: classified in 02-filenames_wildcards by '.*Makefile'


Makefile.inc1: Make bootstrap mandoc's bootstrap libz dependency conditional

We bootstrap libz unconditionally on macOS and Linux, and conditionally
on FreeBSD if pre-1600029 or DISK_IMAGE_TOOLS_BOOTSTRAP is enabled, but
if building on new enough -CURRENT without DISK_IMAGE_TOOLS_BOOTSTRAP
then libz is not bootstrapped and so this libz dependency does not
exist. Add the dependency whenever we are bootstrapping libz but not
otherwise, and do so without duplicating the condition.

Fixes:          https://cgit.freebsd.org/src/commit/?id=1dbcc7ee92c4 ("Makefile.inc1: Make sure mandoc bootstrap tool depends on libz")
MFC after:      1 week
983cb64c05fabe2b83338d4c2087a9114ed27a1c Jessica Clarke 2026-10-29 12:29:54

debug: classified in 02-filenames_wildcards by '.*Makefile'

atf: refer to `common.mk` using `SRCTOP`
This helps make the dependent Makefile (and the values contained within)
easier to catch when upgrading atf in the future.

MFC after:      1 week
36c4912749ab1d12692302386050e25ce8b1d9de Enji Cooper 2026-10-29 17:54:21

debug: classified in 02-filenames_wildcards by '.*Makefile'

[tests] switch GoogleTest tests to `googletest` interface
The new `googletest` kyua test interface--added in 0.15.0 and fixed in
0.15.1--allows tests to be executed and handled in a more fine-grained
manner than the way it was prior to this commit.

This change deletes the `capsicum-test` ATF wrapper script,
`functional.sh`, and all supporting logic in `googletest.test.mk` as
well as this change makes that logic unnecessary.

MFC after:      1 month
MFC with:       b68969979d6b ("contrib/kyua: update to 0.15.1")
3fb03fb35b20d259e0a3a07fc48f2ecc3c5da6e8 Enji Cooper 2026-10-07 18:53:15

debug: classified in 03-filenames_plain1 by 'share/mk/'

GoogleTest: run several tests as plain C++ tests
Some of the tests provided by GoogleTest don't play well with the kyua
GoogleTest engine available in 0.15.0, in part because they test
edgecases that the kyua GoogleTest engine does not expect or handle
gracefully.

Treat the tests as plain C++ tests to keep parity (result-wise) before
switching the testcase type from `plain` (what it is today under the
covers) to `googletest`.

MFC after:      1 month
MFC with:       3fb03fb35b20 ("[tests] switch GoogleTest tests to ...")
eecc84de3572d1ee6caac1fa14dd3140c9601c9c Enji Cooper 2026-10-09 21:33:50

debug: classified in 02-filenames_wildcards by '.*Makefile'

man3: document pthread_query_np(3) and pthread_query_all_np(3)
Reviewed by:  aokblast, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60838
7e904a6ef80321ad6ebd192126e05f8b714dce46 Konstantin Belousov 2026-10-19 20:43:55

debug: classified in 02-filenames_wildcards by '.*Makefile'

man: Add new smp_rendezvous.9
Event:                        Oslo Hackaton 2026
Differential Revision:  https://reviews.freebsd.org/D61040
622bf596b71826d2e10788c81be624cec4d641fb Federico Angelilli 2026-10-30 16:28:30

debug: classified in 02-filenames_wildcards by '.*Makefile'

atf, lutok, kyua: compile with CXXSTD=gnu++20
All three of the test infrastructure components require at least C++20
in order to build. Make that version the default to better match what
is required in recent versions of the projects.

MFC after:      1 week
0e58fb271c6e1cbd4b2ae5d33da181b7e7c2f0d5 Enji Cooper 2026-10-31 20:13:06

debug: Commit manually moved from "unknown" to "build".

release: Expose PORTSDIR to VM image building
Differential Revision:        https://reviews.freebsd.org/D60943
2265b5484597821c8da3b651b7b6e7a00e36ee19 Colin Percival 2026-10-19 01:06:17

debug: classified in 02-filenames_wildcards by '.*Makefile'

GCE: Copy /usr/{src,ports} directly
Distribution sets are going away, so we can't extract those into GCE
images for all-source-code-included compliance purposes.

Differential Revision:  https://reviews.freebsd.org/D60944
2650d01ba0c388fb1fe77ce2a7d40faf8f76a0b7 Colin Percival 2026-10-19 01:14:57

debug: classified in 02-filenames_wildcards by '['.*Makefile', 'release/.*']'

release: No distribution sets by default
Remove the "NODISTSETS" option and add a "DISTSETS" option.  This
option will remain, disabled by default, for the duration of the
16.x branch but will be removed in 17.0.

With hat:       re
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D60945
7b67aa67a71b02afe46d77199dac90d08ea5be41 Colin Percival 2026-10-18 17:46:40

debug: classified in 02-filenames_wildcards by '.*Makefile'

pkg: Enable FreeBSD-base by default
Enable the FreeBSD-base repository in all of the /etc/pkg/FreeBSD.conf
variants, and remove code from various install paths which enabled the
repository via /usr/local/etc/pkg/repos/FreeBSD.conf.

Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D60946
b66922687718be12f8953c6de17f46de3e54a74d Colin Percival 2026-10-18 18:18:59

debug: Commit manually moved from "unknown" to "build".

__FreeBSD_version: Bump for USB 3.1 and 3.2 changes
Bump new USB changes. Also, update RELNOTE and UPDATING.

Sponsored by:   The FreeBSD Foundation
5cc08734add2c758b225a190a562101ac1878437 ShengYi Hung 2026-11-02 03:52:04

debug: Commit manually moved from "unknown" to "build".

i2ctinyusb: do not list i2ctinyusb.c twice in SRCS
The module Makefile named its only source file in both the SRCS= line
and the SRCS+= line that follows.  bsd.kmod.mk tolerates the duplicate
in a normal build, but when the kernel is built with -flto=thin the
linker sees the same bitcode object twice and refuses to link the
module ("Expected at most one ThinLTO module per bitcode file").

Fixes:          https://cgit.freebsd.org/src/commit/?id=54e231b373ef
MFC after:      1 week
b5cd411af6418986fa0da9c12d02b9f26c344a4a Xin LI 2026-11-03 03:00:58

debug: classified in 02-filenames_wildcards by '.*Makefile'

Makefile.inc1: Fix bare $ characters
The '$' characters inside awk commands need to be $$ when appearing
inside a Makefile.  Without this, we generate empty src and src-sys
packages.

Reported by:    Stefan Grundmann
Fixes:          https://cgit.freebsd.org/src/commit/?id=a8be89928930 ("build: Support got")
MFC after:      1 day
6a99232c75f6460b03a95019e2625828a158d457 Colin Percival 2026-11-03 18:31:35

debug: classified in 02-filenames_wildcards by '.*Makefile'

Don't some prune empty dirs created by BSD.tests.dist
Before this change, directories needed when MK_DTRACE_TESTS != no and
MK_ZFS_TESTS != no but not MK_TESTS != no, were being created via
`BSD.tests.dist` as part of the standard build/install process with the
top-level `hierarchy` target. This behavior resulted in `make check-old`
flagging a lot of issues after 30c20ca26e105c, even after `make
delete-old` was run and the directories were removed.

Remove the logic which pruned these empty directories; this "fixes" the
issue with `make check-old`, et al and allows a proper technical solution to
`OptionalObsoleteFiles.inc` to be implemented by pkgbase in an unimpeded
manner without introducing additional complexity.

See the review for more details.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299650
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60928
0df8ed538c620cf021f8dfa2c54892b5ef9620a5 Enji Cooper 2026-11-04 18:53:01

debug: classified in 03-filenames_plain1 by 'tools/build/'

linker_set: Remove obsolete macros
Removed ABS_SET, BSS_SET, and SET_ENTRY. They were initially
introduced in v1.1 to be used with a.out file. After the migration
to ELFs they are equivalent to TEXT_SET and DATA_SET.
Furthermore, these macros are never used in the src tree.

Event: Oslo Hackathon 2026
Reviewed by:    des, jhb
Differential Revision:  https://reviews.freebsd.org/D61035
56b4e685d0fefd8ae99d815741cad2acb4a21694 Federico Angelilli 2026-11-05 12:19:20

debug: Commit manually moved from "unknown" to "build".

openssl: fix engine defines to match upstream
Two engine Makefiles define different macros from upstream's
engines/build.info:

- padlock: engines/e_padlock.c builds the engine only when PADLOCK_ASM
  is defined.  Upstream defines it on x86 and x86_64, but our Makefile
  never did, so padlock.so has been a stub whose bind_engine() returns
  0 and the e_padlock-x86*.S code it links was never called.  Define
  PADLOCK_ASM on amd64 and i386, where that asm is built.

- loader_attic: upstream defines OPENSSL_NO_PROVIDER_CODE; the Makefile
  had OPENSSL_NO_PROVIDER_CORE.  No source tests either name, so the
  build does not change; this only follows upstream.

Found by comparing per-file compile flags against an upstream 3.5.9
build.  Checked by preprocessing e_padlock.c for amd64 and i386:
COMPILE_PADLOCKENG is now defined.

Reviewed by:            ngie
MFC after:              1 week
MFC to:                 stable/15
Event:                  FreeBSD Vendor Summit 2026
Differential Revision:  https://reviews.freebsd.org/D61271
56741ec70e548d9360982e3d7c48c0c6946bc16e Gordon Tetlow 2026-11-09 05:35:10

debug: classified in 02-filenames_wildcards by '.*Makefile'

pam_krb5: Append to CFLAGS instead of replacing
Obtained from:        CheriBSD
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D60723
9e99355a33f2655c5cea704541fa67b0e7b3c8e4 John Baldwin 2026-11-09 18:25:31

debug: classified in 02-filenames_wildcards by '.*Makefile'

krb5: Don't include libsys in LIBADD
This has the curious effect of placing libsys before libc in the link
order even though libc links against libsys.  While this happens to
work currently, it is fragile and fails to link properly in some edge
cases.

Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D60724
f5949447047d8dd0961d162c85d0ef47bd9ca08a John Baldwin 2026-11-09 18:25:42

debug: classified in 02-filenames_wildcards by '.*Makefile'

pthread_mutex_clocklock.3: document
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
1c08e2b915bf44dacd5b14ee8d8214ef40946c65 Konstantin Belousov 2026-11-05 18:32:08

debug: classified in 02-filenames_wildcards by '.*Makefile'

pthread_rwlock_clock{rd,wr}lock(3): document
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
522407f54078e986bca5a74c8335881c6a1afe81 Konstantin Belousov 2026-11-05 22:40:23

debug: classified in 02-filenames_wildcards by '.*Makefile'

scheduler.4: document common scheduler sysctls
Reviewed by:  bcr, jhb, olce
Approved by:    jhb, olce (mentor)
MFC after:      2 weeks
Sponsored by:   FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60002
fb797f841dab55bcac9c81aada1d211aa2026a37 Minsoo Choo 2026-09-25 15:43:30

debug: classified in 02-filenames_wildcards by '.*Makefile'

Commit group #83: auditdistd, bhyve: drop OPENSSL_API_COMPAT
auditdistd, bhyve: drop OPENSSL_API_COMPAT

Neither uses any OpenSSL function deprecated in 3.0 or later. Both build
with no deprecation warnings against OpenSSL 3.5 and 4.1 without it.
12a57b078972c4f2778dfaa2faa96a4c64f59dc6 Gordon Tetlow 2026-11-08 03:51:18

debug: classified in 02-filenames_wildcards by '.*Makefile'


bhyve: Restore OPENSSL_API_COMPAT

It's still needed by the VNC code for now.

Fixes:  https://cgit.freebsd.org/src/commit/?id=12a57b078972 ("auditdistd, bhyve: drop OPENSSL_API_COMPAT")
c60573f3eb6558c4e16dd9e8bcd815cf557c2f6a Mark Johnston 2026-11-14 15:58:15

debug: classified in 02-filenames_wildcards by '.*Makefile'

pkgbase: build the rwhich database repository
Reviewed by:  ivy, bdrewery, lwhsu
Differential Revision:  https://reviews.freebsd.org/D60440
587469824df6b262f05c50b1bb3698dc7022973e Baptiste Daroussin 2026-10-07 14:09:20

debug: classified in 02-filenames_wildcards by '.*Makefile'

Internal organizational stuff

ObsoleteFiles.inc: add more obsolete files
152dd1a0ee3076be117e7897c666df95a5a4447d Antoine Brodin 2026-10-05 19:57:35

debug: classified in 03-filenames_plain1 by 'ObsoleteFiles.inc'

committers-src: Add lytboris mentored by ae@
Reviewed by:    ae
Approved by:    ae (mentor)
bd369bc7c2368b19789cfabcea99e355e1e959da Boris Lytochkin 2026-10-07 11:18:00

debug: classified in 03-filenames_plain1 by '['.mailmap', 'share/misc/committers-src.dot', 'usr.bin/calendar/calendars/calendar.freebsd']'

.gitignore: add tgrep index directory
Sponsored by: The FreeBSD Foundation
MFC after:      3 days
c2b7fe4a9e94a0edba9dd2772874928b565c4f9e Konstantin Belousov 2026-10-08 09:20:16

debug: classified in 03-filenames_plain1 by '.gitignore'

Add Christos Longros as ports committer, update mentor/mentee
Reviewed by:  jrm (mentor)
Approved by:    jrm (mentor)
Differential Revision:  https://reviews.freebsd.org/D60591
3061504326cc62d7883dc9320ccb35c02a84d1cf Christos Longros 2026-10-10 18:44:59

debug: classified in 03-filenames_plain1 by 'share/misc/committers-ports.dot'

ObsoleteFiles.inc: <sys/kpilite.h> was removed
Reported by:    glebius
Fixes:          https://cgit.freebsd.org/src/commit/?id=e478037df4f1 ("systm.h: Remove unused <sys/kpilite.h>")
Sponsored by:   The FreeBSD Foundation
b42793d4bcdf73475b77a26c9dbacd45f8876621 Olivier Certner 2026-10-12 08:38:58

debug: classified in 03-filenames_plain1 by 'ObsoleteFiles.inc'

mailmap: Add mappings for rmoeller
Approved by:  kevans (mentor)
e3d7a9b5ed5f7b0027852dd0a848884fce00b1ee Ryan Moeller 2026-10-13 13:22:20

debug: classified in 03-filenames_plain1 by '.mailmap'

committers-src: Add rmoeller mentored by kevans@
And note the commit bit return date of my previous account, freqlabs@.

Approved by:    kevans (mentor)
8fdf03cd361393765cdba00b87e7b6d614a7e80f Ryan Moeller 2026-10-13 13:24:01

debug: classified in 03-filenames_plain1 by 'share/misc/committers-src.dot'

committers-ports.dot: Restore ahze from alumni
Move back to the current committers section and record acm and dtxdf
as mentors.

Approved by:    dtxdf (mentor)
Differential Revision:  https://reviews.freebsd.org/D60683
b6a34e83651ce2bf4d1eea8d6f7f0f5bf4d9469c Michael Johnson 2026-10-12 19:27:54

debug: classified in 03-filenames_plain1 by 'share/misc/committers-ports.dot'

Remove "All Rights Reserved" from FreeBSD Foundation copyrights
These ones were unambiguous cases where the Foundation was the only
listed copyright holder.
79d491be21209536d7c410cb1ce892379135f3ce Ed Maste 2021-05-22 14:36:52

debug: Commit manually moved from "unknown" to "internal".

github: Only run the checklist checker for PRs against main
Currently this check is run on every push to stable branches which all
fail since they fail to fetch the non-existent .github/path-rules.txt
from the just-updated branches.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D60709
19a5023e45bd34d6bf5ee15e580f945caece5d2c John Baldwin 2026-10-17 15:24:23

debug: classified in 03-filenames_plain1 by '.github/'

bsd-family-tree: add OpenBSD 8.0
97b9e96a7f762102148c45f30fee1ec9e8f7bb50 Sergey A. Osokin 2026-10-20 01:16:44

debug: classified in 03-filenames_plain1 by 'share/misc/bsd-family-tree'

mailmap: Add entry for longros
Approved by:  jrm (mentor)
Differential Revision:  https://reviews.freebsd.org/D60912
e48eb1c5c47fa3e0814f161f17ccf5de98470fe5 Christos Longros 2026-10-11 15:51:48

debug: classified in 03-filenames_plain1 by '.mailmap'

git-arc: add initial non-FreeBSD and `$HOME` install support
Modify the existing code to permit setting a prefix via the `PREFIX`
make variable, similar to what `--prefix` provides in autotools-based
projects.

Add the required compatibility glue in order to function with vanilla
bmake, which enables installing the commands with Linux and macOS:
- vanilla bmake requires `scripts.mk` to install `SCRIPTS`.
- vanilla bmake does not tack `/man` on to the end of `MANDIR`, like
  with FreeBSD.

While here, make the origins for various packages more generic, and
encourage end-users to install the package via the package/port instead
of installing it directly from source.

NOTE:
- regarding Linux support: this should now function out of the box with
  Linux as long as the host has access to an appropriate `arc` binary.
- regarding macOS support: the arcanist/phorge packages do not yet
  exist in Homebrew or [MacPorts][1], but are being added soon.

MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60995

[1]: https://github.com/macports/macports-ports/pull/36217
0729ab54ee8350533f319dd3a2bad25becab5bd5 Enji Cooper 2026-10-29 23:42:56

debug: classified in 03-filenames_plain1 by 'tools/tools/git/'

bsd-family-tree: Add NetBSD 11.1
97d0c19e6af78dc7613563805653d13f03861737 Juraj Lutter 2026-11-04 12:39:03

debug: classified in 03-filenames_plain1 by 'share/misc/bsd-family-tree'

.github: Update actions version to 7
version 4 raises warnings when run as the runners force it to use Node
24 instead of Node 20.  version 5 defaults to Node 24, but version 7
is the current version.

Reviewed by:    emaste
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2477
17a42690bbd70c306dd19981953f30c72563ed2f John Baldwin 2026-11-09 18:21:36

debug: classified in 03-filenames_plain1 by '.github/'

tools/git/ghpr: retire
The project under the .../ghpr subdirectory is an earlier version of the
tool. A newer/supported iteration of the tool can be found on
[GitHub][ghpr-repo].

`ghpr` can be installed via `pkg`, e.g., `pkg install py312-ghpr-5`.

Please see the [README.md][readme] for further details.

MFC after:      1 month

[ghpr-repo]: https://github.com/bsdimp/ghpr/
[readme]: https://github.com/bsdimp/ghpr/blob/main/README.md

Reviewed by:    dteske
Differential Revision:  https://reviews.freebsd.org/D61086
d02883b3d8d0943fdb98cbc365074263f918908b Enji Cooper 2026-11-10 02:15:13

debug: classified in 03-filenames_plain1 by 'tools/tools/git/'

tools/git/arcgit: retire
This too has been superseded by `git-arc`, located in the same directory as
`arcgit`.

Differential Revision:  https://reviews.freebsd.org/D61379
e7f8896eabd9d0fc9f2768fd9b3336e95f4e26c9 Enji Cooper 2026-11-10 03:06:19

debug: classified in 03-filenames_plain1 by 'tools/tools/git/'

Testing

tests/sys/vfs: Fix the Linux kld check
linux and linux64 are file names, not module names.  The corresponding
module names are linuxelf and linux64elf, respectively, so these tests
were always being skipped.

Fixes:          https://cgit.freebsd.org/src/commit/?id=b98d169d1f91 ("tests/sys/vfs: add ABI-root absolute symlink tests")
Sponsored by:   The FreeBSD Foundation
2748019034f036e7c18b0dcd7713d972b6e45eed Mark Johnston 2026-10-01 15:00:46

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

stress2: Fix script bugs in gnop6.sh, gnop7.sh and fdatasync*.sh
gnop6.sh recorded the checkfs result with "checkfs ... || s=1 && s=0",
which the shell parses as "(checkfs || s=1) && s=0", so the test passed
even when the file system check failed.

gnop7.sh only sets s when unmount or fsck_ffs fails and ends with
"exit $s".  On a clean run s is unset, and the script exits with the
status of the preceding "[ $notloaded ] && gnop unload", which is 1
whenever geom_nop was already loaded, for instance by an earlier test.

fdatasync.sh and fdatasync2.sh ran "df -i $RUNDIR" before creating the
directory.  With a RUNDIR that does not exist yet, df failed, the test
printed "[: -lt: unexpected operator" and the free inode check was
skipped.

Reviewed by:    pho
Differential Revision:  https://reviews.freebsd.org/D60136
Sponsored by:   Sippy Software, Inc.
MFC after:      2 weeks
a68d11d310dd5100a18f187c1108df6703315989 Maxim Sobolev 2026-10-01 16:26:06

debug: classified in 03-filenames_plain1 by 'tools/test/'

mkimg: Add tests for vmdks format
This is the 'stream-optimized' version of the VMDK format.

MFC after:      2 weeks
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60154
65b872380ed7f7900fc581d482c5586eeca9e184 Colin Percival 2026-09-29 19:58:04

debug: classified in 02b-filenames_wildcards2 by 'usr.bin/.*/tests/.*'

stress2: add a reproducer for the flush_newblk_dep() "Bad newblk" panic
flush_pagedep_deps() drops the soft updates lock to obtain the vnode of
a new directory.  If its MKDIR_BODY dependency completes in that window,
the lookup of the directory's first block in flush_newblk_dep() can find
a stale allocindir left behind by a previous owner of the same block,
relocated by ffs_reallocblks() and freed, and panic.

The test grows interleaved files past UFS_NDADDR to keep clusters being
relocated, while other workers create subdirectories in a parent with
IN_ENDOFF set, so that ffs_vput_pair() syncs it, and fsync() them to
complete the mkdir dependencies.  The file system layout and the way
the writers put their blocks on disk are arranged so that a new
directory takes over a freed block whose dependency is still retained;
the details are in the script.  With dtrace=1, the test also counts how
often this precondition is met, which works on a fixed kernel too.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297976
Reviewed by:    kib, pho
Tested by:      pho
Sponsored by:   Sippy Software, Inc.
Differential revision:  https://reviews.freebsd.org/D59356
a127039dd0c24bc18b3513322d22fd8fee6724eb Maxim Sobolev 2026-10-04 19:24:16

debug: classified in 03-filenames_plain1 by 'tools/test/'

tests/netinet6: fix ndp_del_gu_success flakiness
The test pinged an unanswered address and then deleted the resulting
INCOMPLETE neighbor entry.
The kernel frees that entry after about 3s, so on a loaded VM,
ndp -d could run too late and fail with ENOENT.

Configure 2001:db8::2 on epair0b so the ping gets a reply and the
entry becomes REACHABLE.

Approved by:    pouria
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D60348
a6a864080cfe2e8308cfae8d07f1affe1a4ac8fa Olivier Cochard 2026-10-07 04:04:16

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/sys/kern: Skip some timer tests if ncpu == 1
62f54beab05a196fd05170eafcc7715b3f4150b0 Mark Johnston 2026-10-08 15:20:59

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

ncal: convert legacy TAP tests to ATF
MFC after:    2 weeks
Sponsored by:   ConnectWise
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2465
Reviewed by:    imp
570d050f4e182ea2cd6c26a996b69fde6049ac4f Alan Somers 2026-10-08 19:19:54

debug: classified in 02b-filenames_wildcards2 by 'usr.bin/.*/tests/.*'

stress2: add a test for forced unmount racing mkdir at UFS_LINK_MAX
On a soft updates file system, keep a directory at UFS_LINK_MAX with
workers removing and recreating subdirectories in it, so that mkdir(2)
keeps going through ufs_sync_nlink(), and force-unmount, check and
remount the file system in a loop.  The workers work relative to the
directory: a lookup through the mount point would wait for the unmount
on the covered vnode lock and never race with it.  Before the fix, the
first forced unmount deadlocked with mkdir(2) sleeping in vfs_busy().

With dtrace=1, count the vfs_busy() calls made during an unmount by
caller, and the mkdir(2) calls that synced and restarted with ERELOOKUP
during an unmount, which shows that the race was hit.

Sponsored by:   Sippy Software, Inc.
Reviewed by:    pho
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60204
MFC after:      1 month
2aca5deff7a0fb9f6f082d562f1ca85e707f674e Maxim Sobolev 2026-10-13 03:59:13

debug: classified in 03-filenames_plain1 by 'tools/test/'

stress2: Add a new FS type: UFS2 to the test.
Workaround for kern.maxfiles limit exceeded.
Workaround for SU disk full issue.
Added some debug info, if umount(8) returns EBUSY.
b5e6d60e57bad805a064b0795434bcf6c454fdd0 Peter Holm 2026-10-13 08:11:15

debug: classified in 03-filenames_plain1 by 'tools/test/'

tests/netinet6: Turn off stable addresses in ndp_prefix_len_mismatch
ndp_prefix_len_mismatch exercises the fallback in in6_ifadd() for an
interface whose link-local address does not have the advertised prefix
length (9e792f7ef729).  Since a2eb0894b79b made stable addresses
(RFC 7217) the default, in6_ifadd() takes the interface identifier from
in6_get_stableifid() and never looks at the link-local address, so the
case passes without reaching the fallback.  Turn stable addresses off
on the interface.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
ee8cb6ab6741014218a9157d316e1a675390edc4 R. Christian McDonald 2026-10-13 13:15:10

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests: Add SLAAC interface identifier cases to ndp.sh
Cover the interface identifier selection in in6_ifadd(): a /64
link-local address provides the identifier, while a /128 link-local
address or no link-local address at all yields the EUI-64 identifier
derived from the MAC address.  Each case asserts the exact
autoconfigured address.  ndp_prefix_len_mismatch reaches the same
fallback with a /127 link-local address, but only checks that some
address was configured.

Stable addresses (RFC 7217) are the default and bypass both paths, so
the host disables them.  The advertisement goes to all nodes, and an
interface only joins that group with its first address, so the case
without a link-local address gives the host a static address from
another prefix.

ra.py now takes the Ethernet source address from --sendif rather than
from a route lookup; for ff02::1 that lookup fails in scapy 2.7.0.

Reviewed by:            pouria
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60520
9fd9039c888d2d3d6cec47a3383c6825b903fcba R. Christian McDonald 2026-10-13 19:33:37

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/netpfil: reference manual pages in atf_skip statements
For those modules that don't have a manual page spell out full name of a
loadable module.
1da1ad38d0731fb39e6685383fa9aa0a503b241f Gleb Smirnoff 2026-10-13 06:35:56

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/sys/kern: stress FP registers across sigreturn on powerpc64
This is the program that found the races fixed in 1f1043d550ea. One
thread keeps a pattern in f14-f31 across a signal, while helpers pinned
to the same CPU keep different patterns in the real registers and get
woken up from another CPU to preempt it at random points. If the kernel
ever hands it somebody else's registers, the pattern doesn't match.

The register loads, the thr_kill() and the handshake with the helper are
in assembly so that nothing touches the FP registers between sigreturn
and the check. It runs for ten seconds and is skipped with fewer than
two CPUs.

Requested by:   adrian
Approved by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60411
35a226dded9934c6beb5945a982a705712454be1 Piotr Kubaj 2026-10-15 14:28:00

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

dhclient: Add some regression tests
Add tests for some recently fixed bugs in dhclient.  All of these tests
set up two VNET jails connected by an epair.  dhclient runs in one jail,
and the test code runs on the other end.  It uses scapy to inject
"interesting" packets in response to DHCPDISCOVER messages from
dhclient, then checks the configured interface and lease file.

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60485
a143197801c680b958ab662c88cf086668a1958b Mark Johnston 2026-10-14 21:12:51

debug: classified in 02b-filenames_wildcards2 by 'sbin/.*/tests/.*'

sound tests: Check the return value of close(2)
While here, remove two munmap(2) calls on mappings the tests require to
have failed, since they are practically dead.

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60800
eb36c35ccf83ea94d46a3bcb282c01ceeaeb3bab Christos Margiolis 2026-10-27 11:27:32

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/pf/igmp: fix attribute error with newer versions of scapy
This fixes the flaky testcase in CI[0].

While here:
* fix a typo in a comment
* remove an unnecessary import
* fix this deprecation warning:

  /usr/local/lib/python3.12/site-packages/scapy/contrib/igmp.py:12:
  DeprecationWarning: scapy.contrib.igmp is deprecated. Please use
  scapy.layers.igmp instead !

[0] https://ci.freebsd.org/job/FreeBSD-main-amd64-test/29813/testReport/junit/sys.netpfil.pf.igmp/py/TestIGMP__test_ip_opts/

Reviewed by:    kp
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
d9d6e77965b32a8d2f9eeffd34e519a087e603e2 Siva Mahadevan 2026-10-27 14:23:11

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/dhclient: import scapy inside vnet
bd87fc2a1c1a20a080c38b12a55b377967a7c4a7 Siva Mahadevan 2026-10-27 17:19:27

debug: classified in 02b-filenames_wildcards2 by 'sbin/.*/tests/.*'

tests/dhclient: Skip tests if scapy is not installed
Fixes:        https://cgit.freebsd.org/src/commit/?id=a143197801c6 ("dhclient: Add some regression tests")
8fa55fdcae4ecbd2ec13ef91cc9d172095e21189 Mark Johnston 2026-10-28 20:26:44

debug: classified in 02b-filenames_wildcards2 by 'sbin/.*/tests/.*'

pf tests: exercise pfctl -l across a privilege drop
Open /dev/pf and a generic Netlink socket as root, drop to nobody and
exec pfctl with both inherited, the way authpf(8) runs it. Without -l
the load is refused with EPERM; with it the rules land in the anchor.
An unusable descriptor is an error, not a fallback to a new socket.
Skips when fdescfs is not mounted, which -p /dev/fd/N needs.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291981
Signed-off-by:  Avinash Duduskar <avinash.duduskar@gmail.com>
Reviewed by:    kp
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2508
a94a6326507c5a901adee15bf3844eaf60479ab1 Avinash Duduskar 2026-10-26 14:38:12

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/if_geneve: Fix ether_ipv6_blind_options flakiness
This test could fail under load due to lack of no_dad before.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299448
Reported by:    siva
Fixes:          https://cgit.freebsd.org/src/commit/?id=aa9f669d09a7 ("geneve: Add tests for geneve")
55ac3c32b9ddba18b78bb3c58325294ba2e0bf6b Pouria Mousavizadeh Tehrani 2026-10-31 17:23:52

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/sys/file: add tests for the lowest fd after fork
fdcopy() skips plain kqueues and close-on-fork descriptors when it
copies the table into the child.  Check that dup(2) in the child still
returns the lowest unused descriptor, both when the skipped descriptor
is the lowest free slot and when it sits above an existing hole.

Test cases:

  kqueue_no_hole      a plain kqueue is the lowest descriptor; the
                      child's dup() reuses its slot
  kqueue_two          two adjacent plain kqueues; the child's dup()
                      returns the lower one
  kqueue_above_hole   a plain kqueue sits above a closed descriptor;
                      the child's dup() returns the hole
  kqueue_cponfork     a KQUEUE_CPONFORK kqueue is copied; the child's
                      dup() returns the next slot
  clofork_no_hole     an O_CLOFORK descriptor is the lowest one; the
                      child's dup() reuses its slot
  clofork_above_hole  an O_CLOFORK descriptor sits above a closed
                      descriptor; the child's dup() returns the hole

Without 99a58803f9a3, kqueue_no_hole, kqueue_two and
clofork_above_hole fail.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300234
Reviewed by:    kib
MFC after:      1 week
MFC with:       99a58803f9a3
Co-authored-by: Claude Code Opus 5.5
Differential Revision:  https://reviews.freebsd.org/D61124
f9f4abe8c9f8b5a783538d2b99254d9845572e70 Maxim Konovalov 2026-11-01 14:59:08

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

usr.bin/diff/tests/diff_test: add SPDX ID
The SPDX ID makes the script's licensing more explicit.

MFC after:      1 week
Reviewed by:    bapt
Differential Revision:  https://reviews.freebsd.org/D60908
a7ec00b71715c36eb60822bf52af5637f3a8d2f3 Enji Cooper 2026-11-03 03:45:44

debug: classified in 02b-filenames_wildcards2 by 'usr.bin/.*/tests/.*'

hastd: Add full lifecycle test
Add a test case that creates and starts two nodes, has one assume the
primary role and the other the secondary role, writes to the device,
verifies that the data is synced to both nodes, then switches the roles,
and finally shuts both nodes down and compares their backing stores.

Differential Revision:  https://reviews.freebsd.org/D59676
2321b3df1f0db4f839cb9dde7c0a9a0060d4bcfe Dag-Erling Smørgrav 2026-11-03 12:07:35

debug: classified in 02b-filenames_wildcards2 by 'sbin/.*/tests/.*'

tests/ip_mroute: Use a router address as the IPv4 RP
pimd 3.0.0 and later refuse an RP in 127.0.0.0/8.

Reported by:    markj
Approved by:    markj
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/92
b61024d6efe6c5d9da1f31ad24884bd70e3300e2 Olivier Cochard 2026-11-04 18:33:13

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

pf tests: make return.py more robust
Sometimes ICMP echo packets get lost, so send more than one during
the sanity check. This should resolve the intermittent failure of the
return.py:TestReturn::test_tcp test.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300511
Sponsored by:   Rubicon Communications, LLC ("Netgate")
8c9be10c1c3e3b454a57838724efcf2787d3aa62 Kristof Provost 2026-11-09 10:11:28

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

Commit group #84: capsicum-test: make the code WARNS=6 clean
capsicum-test: make the code WARNS=6 clean

Make the code WARNS=6 clean by doing the following:
- Renaming variables (-Wshadow).
- Use memcpy instead of assigning the result of CMSG_DATA to a variable
  (-Wcast-align).
- Wrap some macros with do-while(0) to avoid variable collisions
  (-Wshadow).
- Push one of the TRACE statements up by 1 layer to avoid a collision
  between 2 calls of TRACE via the same overarching macro.

This was needed in order for the code to build properly with D61066,
since the code was not compiling with WARNS set to 3 at the testcase
level.

MFC after: 1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D61080
04c4b2084eb93fc2374dbb89f343f3941585a640 Enji Cooper 2026-11-10 01:52:55

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'


capsicum-test: Disable `HAVE_SEND_RECV_MMSG` again

04c4b2084eb9 accidentally added some changes from another WIP commit into that
diff. Instead of wholesale reverting the change, just revert the part that's
currently broken (`HAVE_SEND_RECV_MMSG`). While some of the related tests pass,
one of the testcases (`capmode.cc:AllowedMmsgSendRecv`) doesn't currently pass.

Revert the change to make the CI run more green again.

MFC after:      1 week
Fixes:  https://cgit.freebsd.org/src/commit/?id=04c4b2084eb9 ("capsicum-test: make the code WARNS=6 clean")
71eddb44d7dfa60e43f77c90b51bd091f0693f85 Enji Cooper 2026-11-10 02:05:33

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'


tests/sys/capsicum: Fix -Wshadow issue with `fd_set`

`fd_set` is defined in `sys/select.h`, and prior to this change, was in fcntl.cc as well.

This change renames `fd_set` to `fd_set_` to avoid the name collision.

MFC after:      1 week
Reported by:    gcc 14
Fixes:          https://cgit.freebsd.org/src/commit/?id=04c4b2084eb9 ("capsicum-test: make the code WARNS=6 clean")
a479301abb2c7b384f574fcc641e502f70654835 Enji Cooper 2026-11-10 05:17:26

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/sys/capsicum: restore test coverage with root user
This change builds capsicum_test and installs/runs it as an unprivileged
user ("tests" in vanilla FreeBSD) and root.

This required adjusting logic in the Makefile in order to build two
binaries with the same sources and running them as separate binaries.

Moreover, in order to restore coverage and ensure that some tests which
require `other_uid` (typically specified via `-u` on the CLI with the
test program) don't fail, become the "tests" user when run as root. This
technically doesn't honor unprivileged_user property in kyua.conf: the
property needs to be passed via a command-line parameter to the test
program.

MFC after:      1 week
Reported by:    markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=3fb03fb35b20 ("[tests] switch GoogleTest tests ...")

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D61066
58e5c5cac1e7c8c99a6e7f8846b655afed05b74f Enji Cooper 2026-11-10 01:55:45

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/sys/netlink: mark :overflow as XFAIL when run via CI
This testcase has been failing reliably for 5+ months now. Mark it as an
expected failure to make the standard Jenkins run a bit more green.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289240
MFC after:      1 week
e95fac8b075af0ffed872e7544731d56ef4f296c Enji Cooper 2026-11-11 17:55:25

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests: udp_bindings: connect_bound_socket_from_2address_jail mark XFAIL in CI
This testcase has been failing reliably in CI since it was introduced in
2e16d37e275f. Mark the testcase XFAIL when run via CI to make the
overall test run a bit more green.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300696
MFC after:      1 week
936a1c717c31b9e1561b166dbab56ef72f176936 Enji Cooper 2026-11-11 18:04:21

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/sys/net/if_lagg_test: mark :witness as an XFAIL in CI
The `:witness` "test" has been failing reliably in CI for over 2 months
now. Mark the test XFAIL so the overall CI run is more green.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300697
MFC after:      1 week
845293b16d501a15f8f93f9ca68c0f2002899d36 Enji Cooper 2026-11-11 18:34:28

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/net: unskip tests waiting for bpf fixes
These tests pass for more than 200+ runs consecutively.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292993
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
dcfc4d50b63056efb9fc6d98be219d6df302dad2 Siva Mahadevan 2026-11-12 14:02:44

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/vfs: abi_root_symlink: re-enable xfail'd tests
These tests pass after 23b326728778.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297426
Reviewed by:    dteske
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61434
2b2e637f437e7b1b9d009045250452f7db97ab69 Siva Mahadevan 2026-11-12 18:29:19

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

Commit group #85: tests/sys/kern/ssl_sendfile: :eagain_vs_eof: improve failure messaging
tests/sys/kern/ssl_sendfile: :eagain_vs_eof: improve failure messaging

Convert many raw `ATF_REQUIRE(..)` macro calls to `ATF_REQUIRE_MSG(..)`
and output the sbytes attached to the context in provide meaningful
information with failure messages.

While here, fix a typo in a comment and some indentation in another
testcase (:random).

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299447
MFC after:      1 week
de6328af0c8c0284d28574364db3b8d98d51e005 Enji Cooper 2026-11-12 23:55:46

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'


Correct some nits in the prior commit (de6328af0c8c)

- Remove unnecessary casts.
- Use the right printf qualifier (%z is for *`size_t`; %j is for
  *`maxint_t`). I was mixing up `off_t` in my head.

MFC after:      1 week
Noted by:       des (IRC)
Fixes:  https://cgit.freebsd.org/src/commit/?id=de6328af0c8c ("tests/sys/kern/ssl_sendfile: :eagain_vs_eof: ...")
043d6753ca7c1c1e3ffa09a9f953f0df50d3a22e Enji Cooper 2026-11-13 00:56:40

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

Commit group #86: tests: Add test for vn_io_fault1 bug
tests: Add test for vn_io_fault1 bug

This bug was fixed in b487aca48535, but I did not have a regression
test ready for it at the time.

The test allocates a large buffer, faults part of it in and leaves the
rest unmapped, then tries to read a 3 GiB file into it.  If the bug is
present, the read succeeds, but the return value exceeds the requested
amount by exactly one page less than the amount that was prefaulted.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298159
MFC after:      1 week
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D61475
ba02bbbe86aeca0c95c8e7d12c1be357ebb3ddeb Dag-Erling Smørgrav 2026-11-13 00:46:50

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'


tests: Improve vn_io_fault1 test

* Declare that the test needs 4 GB of memory so it can be automatically
  skipped on systems with low memory.

* Switch back to mmap() as in my initial prototype.  Using malloc() is
  simpler, but on systems with malloc debugging enabled, malloc() will
  prefault the entire buffer, resulting in a false positive.  Using
  mmap() also guarantees that the buffer is page-aligned, which renders
  the test determinstic: we now only need to prefault exactly 2 GB, and
  the difference between ret and len will be exactly the amount that we
  prefaulted.

* To prefault the buffer, instead of a simple loop that writes zeroes
  to it, which a compiler might recognize as dead stores and eliminate,
  read the first INT_MAX bytes from the file into it.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298159
Fixes:          https://cgit.freebsd.org/src/commit/?id=ba02bbbe86ae ("tests: Add test for vn_io_fault1 bug")
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D61508
c5cff3df96c35aa3613c083f151e853b532d88cb Dag-Erling Smørgrav 2026-11-14 00:22:40

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/sys/kern/ssl_sendfile: double timeouts for :grow and :truncate
The :grow and :truncate testcases fail semi-regularly in CI with
timeouts. Double the timeout to reduce false positives with the tests.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300699
MFC after:      1 week
Reviewed by:    siva
Differential Revision:  https://reviews.freebsd.org/D61444
932996069a5343b1d6563e97a12308a81c34d4fe Enji Cooper 2026-11-13 03:17:50

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

capsicum: Add tests for sched_* and rtprio*
Commit 70d08c69f4d0 ("p1003_1b: Add capability mode checks") added
missing capability mode checks to sched_* syscalls, and commit
9b6ea599c955 ("rtprio*: Add capability mode checks") added them to
rtprio*.

Reviewed by: olce, emaste
Sponsored by: Advanced Micro Devices, Inc.
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>
Differential Revision: https://reviews.freebsd.org/D61412
1947932d6f4f7afa678c3e2369e6a6ee919702e1 Osvaldo Janeri Filho 2026-11-12 15:16:29

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

pax: Add tests
Add tests exercising pax copy mode, cpio passthrough mode, the ability
to extract pax, cpio, and tar archives, and the ability to parse pax,
cpio, and tar command lines.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    obiwac
Differential Revision:  https://reviews.freebsd.org/D58469
fb79a940917329183a54dcecd89de389ead3c565 Dag-Erling Smørgrav 2026-11-16 14:44:20

debug: classified in 02b-filenames_wildcards2 by 'bin/.*/tests/.*'

tests/netinet/ip_reass: skip when IP reassembly is disabled
ea390ec31eb6114296ae3e64ac8ea4d7bf0a707d Nick Banks 2026-11-16 18:53:40

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

tests/sys/pmc: add PERF, RDPMC, row, sampling and unload tests
- pmc_perf_test: the pmc.perf(3) class (MPERF, APERF, IRPERF).
- pmc_rdpmc_test: pmc_get_msr() and RDPMC.
- pmc_row_test: row disposition per mode; system sampling needs a log.
- pmc_ss_test: system sampling into a log, and its interrupt accounting.
- pmc_unload_test: unloading hwpmc.ko leaks no memory.

Reviewed by:    mhorne
Sponsored by:   Advanced Micro Devices, Inc.
Signed-off-by:  Osvaldo Janeri Filho <ojanerif@amd.com>
Signed-off-by:  Davi C.A <davi.chavesazevedo@amd.com>
Differential Revision:  https://reviews.freebsd.org/D61062
d546356523f3e4856611fe25e0d9c8cf34ba1941 Mitchell Horne 2026-11-16 20:15:56

debug: classified in 02b-filenames_wildcards2 by 'tests\/.*'

Style, typos, and comments

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

acpi: Tasks: Make OsdSchedule.c whitespace clean
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
f0825f75bab8ae7cb8e0ba717f76110b6f1862f3 Olivier Certner 2026-10-02 17:12:46

debug: classified in 01-style by '[wW]hitespace'

makefs: Correct style(9) nit from a recent change
Fixes: https://cgit.freebsd.org/src/commit/?id=b9811d13572b ("https://cgit.freebsd.org/src/commit/?id=cd9660: merge level 1 and 2 filename conversion")
3ba592cfea1a5625024a0974fa5268f2e0c8f808 Ed Maste 2026-09-23 19:40:16

debug: classified in 01-style by '[sS]tyle'

sound: Whitespace cleanup
In advance of additional sound(4) work, remove EOL whitespace and mixed
tab/space.

Reviewed by:    christos
Differential Revision: https://reviews.freebsd.org/D60442
dd51cef58311ee0024be99116238d1c0032bdf2b Ed Maste 2023-12-02 02:42:36

debug: classified in 01-style by '[wW]hitespace'

updateuio_t: improve comment and style
Reported by:  netchild
Effort:         CHERI upstreaming
Fixes:          https://cgit.freebsd.org/src/commit/?id=afe41f1ab9f6 ("sys/uio: add updateiov()")
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D60169
deadb35becaae2788888e12868428b3a0ebef34f Brooks Davis 2026-10-13 14:01:30

debug: classified in 01-style by '[sS]tyle'

sched_ule: tdq_notify(): Fix a typo in a comment
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
ea1da6a51a5aa0c949fc125aece6b88a68e67a3a Olivier Certner 2026-10-09 09:22:31

debug: classified in 01-style by '[tT]ypo'

bsd-family-tree: polish grammar and style
Reviewed by:  ziaee
d3bad289dfd536d8019e7bcbd7701b1d6dfb11c3 Wolfram Schneider 2026-10-20 07:39:57

debug: classified in 01-style by '[sS]tyle'

ptnet.4: Fix typo
MFC after:    3 days
Reviewed by:    ziaee
Signed-off-by:  Seth Hoffert <seth.hoffert@gmail.com>
Closes:         https://github.com/freebsd/freebsd-src/pull/2480
86a925f538c0f451702e0a2d1d85deb1929b5db6 Seth Hoffert 2026-10-18 13:57:37

debug: classified in 01-style by '[tT]ypo'

jail.8: fix a typo, sort Xr
b9585475ee627e5ea0e17b9d2d2874faaf03a762 Maxim Konovalov 2026-10-24 16:32:58

debug: classified in 01-style by '[tT]ypo'

share/mk/bsd.confs.mk: fix trivial typo in message
The error message noting that the file should not be included said
"bsd.conf.mk" before this change. Now it correctly says "bsd.confs.mk".

MFC after:      3 days
a3214d4e9b661fb173fc25b06b7ee9902b0b57e3 Enji Cooper 2026-10-25 02:56:21

debug: classified in 01-style by '[tT]ypo'

gethostbyaddr_r: correct typo in signature from dc68997328ec6
'man 3 gethostbyaddr_r' was incorrectly showing 9 arguments.
1d450a42583645177071a6bd767bb36e97f02bc1 David E. O'Brien 2026-10-30 06:33:56

debug: classified in 01-style by '[tT]ypo'

gethostbyaddr_r: follow style from other *_r variants
5b41e3df0ba5307574bc6d6f1c8ed6ed25222c4c David E. O'Brien 2026-10-30 06:40:52

debug: classified in 01-style by '[sS]tyle'

nfs_clrpcops.c: Fix typo in commit db8444c1b7e4
Reported by:  markj
MFC after:      1 month
Fixes:  https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
ca190427e1f55a24ed1f8078757c22ea34473052 Rick Macklem 2026-11-04 23:05:02

debug: classified in 01-style by '[tT]ypo'

libthr: Fix whitespace in thr_once.c
Remove trailing whitespace and replace space indentation with a tab.

No functional change.
1e1ce1f6f97b5269c69490814936edecb5c80959 ShengYi Hung 2026-11-05 15:58:17

debug: classified in 01-style by '[wW]hitespace'

tcgetwinsize.3: typo in section name
.Sh RETURN VALUE instead of RETURN VALUES
a84b9db212a7eaf44c5fb49145f4cb425a428cf3 Wolfram Schneider 2026-11-08 17:13:20

debug: classified in 01-style by '[tT]ypo'

manpages: date typos
2b2761316b9b9bbe9b9ed2174f849a887116ce8a Wolfram Schneider 2026-11-08 18:20:08

debug: classified in 01-style by '[tT]ypo'

asmc: Fix style(9) issues
fix operator and comma spacing and three long lines

MFC After: 1 Week
Approved-by: ngie (co-mentor)

Reviewed by:    ngie, imp
Differential Revision:  https://reviews.freebsd.org/D61302
b391f3f3e007c067a7e4475d91d981f91add0596 Abdelkader Boudih 2026-11-09 18:35:57

debug: classified in 01-style by '[sS]tyle'

tests/sys/pmc/Makefile: whitespace
Use similar spacing on adjacent lines, for readability. No functional
change.
724a4374bd19eda9134b5ac0be2ac4b2207cb1f3 Mitchell Horne 2026-11-10 16:16:49

debug: classified in 01-style by '[wW]hitespace'

man.sh: fix variable typo in debug output
MFC after:    3 days
f6bd24546c27fc4592290c626f837c92181ae23c Wolfram Schneider 2026-11-11 15:46:02

debug: classified in 01-style by '[tT]ypo'

tests/sys/kern/ssl_sendfile: improve style(9)
- Sort headers.
- Put `{` on new line after function definition header.

Add `sys/types.h` include while here per API contract for `socket(..)`,
et al.

MFC after:      1 week
b7461ca3be71bbbeb9007f47e8985a9fce737594 Enji Cooper 2026-11-12 07:02:44

debug: classified in 01-style by '[sS]tyle'

nvme: Typo ranage -> range
Sponsored by: Chelsio Communications
bfdce403f4a613bacf2c342a417974a606981b12 John Baldwin 2026-11-12 15:44:39

debug: classified in 01-style by '[tT]ypo'

ip.4: Fix markup typos
At least INADDR_ANY and IP_MULTICAST_IF are definitely Dv's.

MFC after:      3 days
cd7a2cf8b3cc9eb964cc59467129f925d812056f Alexander Ziaee 2026-11-15 07:54:15

debug: classified in 01-style by '[tT]ypo'

sched_ule: Fix two typos in comments introduced in previous commit
Reported by:    kib
Fixes:          https://cgit.freebsd.org/src/commit/?id=538c48bf6247 ("sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread")
Sponsored by:   The FreeBSD Foundation
7d43e93a75e8f9789521ff707a7533c0680503f0 Olivier Certner 2026-11-16 07:53:34

debug: classified in 01-style by '[tT]ypo'

Contrib code

Merge commit 80e8c0a59189 from llvm-project (by ShengYi Hung):
  [DebugInfo] Fill Column 0 if Line is not found (#227559)

  It is possible that user specified line 0 as the start of the line in C
  language (using `# 0`). However, it is rejected by the Lexer as we have
  no line but still carries column information. As a result, we fill
  column to 0 if we cannot find line.

  Assisted-by: Claude # Test
  Fixes: #56186

This fixes a fatal error when building the textproc/peg port.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264853
MFC after:      3 days
37c9eba1644b0f9e1b5d130ccff381122f48aebe Dimitry Andric 2026-10-01 12:31:42

debug: classified in 03-filenames_plain1 by 'contrib/'

[tests] lib/libc/gen:assert_test: undefine `NDEBUG`
In the event `NDEBUG` was defined, `assert` would become a no-op,
breaking some of the expectations in `assert_test` around `assert(..)`
failing generating a coredump.

This is a better approach than the previous one committed in 6f3445006a
as it continues to test the `assert(..)` function instead of just
skipping it if `NDEBUG` was defined.

Suggested by:   kevans
MFC after:      4 days
MFC with:       6f3445006a
Fixes:          https://cgit.freebsd.org/src/commit/?id=6f3445006a
Differential Revision: https://reviews.freebsd.org/D60253
9d5a33d9c294b01cead6ff65b0773b5b5ab85ccd Enji Cooper 2026-10-02 19:27:51

debug: classified in 03-filenames_plain1 by 'contrib/'

Merge commit c4ce37507537 from llvm-project (by ShengYi Hung):
  [Clang][Sema] Create LocalScope for Variable Template (#228280)

  A variable template should create its own LocalScope, as it should be
  opaque to other instantiations. This can occur when there are multiple
  instantiations in the same lexical scope. The correct behavior is that
  these instantiations should not be chained together.

  Assisted-by: Claude # Test ReleaseNote
  Fixes: #134148

This fixes an assertion while building the devel/glaze port.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276265
MFC after:      3 days
fe9c7137871ee0b5c48d4c38b87d80f72e73379e Dimitry Andric 2026-10-03 11:36:42

debug: classified in 03-filenames_plain1 by 'contrib/'

sem test: avoid ETIMEDOUT races in the EINTR test cases
timedwait and clockwait_absolute_intr_remaining arm a 50ms SIGALRM and then
wait until an absolute deadline only 100ms in the future.
On a loaded VM the signal can be delivered more than 50ms late, so the wait
times out first.

Approved by:    imp
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D60347
9af3990ba7940e85c31b5fc074e9510ee195465f Olivier Cochard 2026-10-07 00:00:58

debug: classified in 03-filenames_plain1 by 'contrib/'

contrib/expat: import expat 2.9.0
Changes: https://github.com/libexpat/libexpat/blob/R_2_9_0/expat/Changes

Security:       CVE-2026-102633
Security:       CVE-2026-77214
MFC after:      3 days
22c3edb31297a79ec3c7bf8f906be2df11b472d2 Philip Paeps 2026-10-06 07:05:31

debug: classified in 05-summary-prefix by 'contrib/'

Commit group #87: contrib/kyua: update to 0.15.0
contrib/kyua: update to 0.15.0

This new release contains multiple feature updates and bugfixes. Please
see the release notes mentioned in the merge commit for more details.

MFC after:      1 month
Merge commit '144afd05f8a2300361ec30c1c2020e4022ddd943'

Conflicts:
        contrib/kyua/cli/cmd_debug.cpp
        contrib/kyua/doc/kyua-debug.1.in
        contrib/kyua/doc/kyuafile.5.in
        contrib/kyua/engine/config.cpp
        contrib/kyua/engine/execenv/execenv.cpp
        contrib/kyua/engine/execenv/execenv.hpp
        contrib/kyua/engine/execenv/execenv_host.hpp
        contrib/kyua/engine/requirements.cpp
        contrib/kyua/engine/requirements.hpp
        contrib/kyua/engine/scheduler.cpp
        contrib/kyua/model/metadata.cpp
        contrib/kyua/os/freebsd/execenv_jail.hpp
        contrib/kyua/os/freebsd/execenv_jail_stub.cpp
        contrib/kyua/os/freebsd/main.cpp
        contrib/kyua/os/freebsd/reqs_checker_kmods.cpp
        contrib/kyua/os/freebsd/utils/jail.hpp
        contrib/kyua/utils/fs/directory.cpp
        contrib/kyua/utils/process/executor.cpp
eb8f69902f7de8012a31a85db2f88a54584f81af Enji Cooper 2026-10-07 17:50:26

debug: classified in 03-filenames_plain1 by 'contrib/'


contrib/kyua: commit Makefile changes for version update

This was accidentally missed in the version update.

MFC after:      1 month
Fixes: https://cgit.freebsd.org/src/commit/?id=eb8f69902 ("contrib/kyua: update to 0.15.0")
b836604e126d5b3d0d3dee5da6c4168d3ec43fea Enji Cooper 2026-10-07 17:55:21

debug: classified in 02-filenames_wildcards by '.*Makefile'


contrib/kyua: commit generated files

MFC after:      1 month
Fixes: https://cgit.freebsd.org/src/commit/?id=eb8f69902 ("contrib/kyua: update to 0.15.0")
26eb328b52c3ec0ff79c8914b1993dfad03a0a7d Enji Cooper 2026-10-07 18:04:21

debug: classified in 02-filenames_wildcards by '.*\.[1-9]'

debug: moved to contrib because 'Need to be grouped with eb8f69902f7de8012a31a85db2f88a54584f81af'

openssl: build libcrypto and libssl from upstream's source set
Compared the bmake source lists of libcrypto and libssl with upstream's
own build of 3.5.8 (configured with the options in
crypto/openssl/BSDmakefile), and fix the differences that are not
intentional.

libcrypto:
- aarch64: build bsaes-armv8.S and md5-aarch64.S, and define BSAES_ASM
  and MD5_ASM, as upstream does.  Both files have been generated into
  sys/crypto/openssl/aarch64 since the 3.5.1 import, but were never
  compiled.
- Stop compiling der_digests_gen.c, der_dsa_key.c and der_ec_key.c.
  Upstream keeps them in libcommon.a, but the linker does not extract
  them into libcrypto (checked with --why-extract) as nothing in
  libcrypto references them.

libssl:
- Fix the "SRSC" typo that left out ssl3_cbc.c and tls_pad.c.
- Build libssl's own copy of crypto/thread/arch*.c, as upstream does.
  Before this change, libssl got these functions from libcrypto, which
  exports them only for this purpose.  A planned later change removes
  those exports.

crypto/openssl:
- crypto/bio/bio_sock2.c: remove the local ktls_enable() call in
  BIO_socket() it does nothing on FreeBSD.  The file is now identical
  to upstream.
- Remove the empty file "patch", committed by mistake in f775385affef.

With this change, libssl no longer imports any libcrypto internals.

Reviewed by:    ngie, markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60395
ba9a5169d16556d682d03989e15574ed346db092 Gordon Tetlow 2026-10-08 18:25:57

debug: Commit manually moved from "unknown" to "contrib".

openssl: configure with --openssldir=/etc/ssl
BSDmakefile passed --openssldir=etc.  A relative openssldir is taken
relative to the prefix, so the generated files described /usr/etc.
FreeBSD has always used /etc/ssl (OPENSSLDIR in
secure/lib/libcrypto/Makefile.common), so configure with that.

Regenerate tools/c_rehash, the only committed generated file that
depends on openssldir.  It is not installed.  No compiled code changes.

Reviewed by:    ngie, markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60396
cb3d3e5bb0c6bbb1f6ef3efe67e7a6e71bc20f0b Gordon Tetlow 2026-10-08 18:27:59

debug: classified in 03-filenames_plain1 by 'crypto/openssl/'

ctf*: exit with error upon terminate()
The initial port of the CTF tools had a FreeBSD-specific patch to print
the termination message but exit with a 0 status, with a goal of getting
as much to build as possible and silently ignoring any issues.

We're now past the point where silently ignoring failures makes sense.
Any future issues need to be found and addressed.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276826
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276930 [exp-run]
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43743
e959f2a7d8a8ac942983328f91cd5c566e3f72cb Ed Maste 2024-02-04 21:47:50

debug: classified in 03-filenames_plain1 by 'cddl/contrib/'

zfs: drop duplicate `vfs.zfs.metaslab.condense_pct` sysctl
`metaslab.c` already registers this tunable via `ZFS_MODULE_PARAM`, so the
`SYSCTL_UINT` here is a second registration of the same leaf. This
resulted in messages like:

```
sysctl_register_oid: can't re-use a leaf (vfs.zfs.metaslab.condense_pct)
```

Remove the duplicate sysctl registration, as upstream (OpenZFS) did.

MFC after:      1 week
Signed-off-by:  Christos Longros <chris.longros@gmail.com>
Reviewed by:    imp, mm, ngie
Differential Revision:  https://reviews.freebsd.org/D57721
62e958df018a0af83252c4e8f63208be41fc14a8 Christos Longros 2026-10-10 07:11:03

debug: classified in 03-filenames_plain1 by 'sys/contrib'

tests/libc: use an allowlist for sbrk in NetBSD-derived tests
sbrk is obsolete and libc only provides it on amd64, arm, i386 and
powerpc.  Replace the growing exclusion lists in t_dir.c and t_mlock.c
with a single positive HAVE_SBRK definition per file, so architectures
without sbrk need not be enumerated as they are added.

Signed-off-by: Xiaoqiang Zhao <zhaoxiaoqiang007@gmail.com>
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D60358
d45f069002f211398fd7790509fbd25ec6d1c713 Xiaoqiang Zhao 2026-10-10 17:39:44

debug: classified in 03-filenames_plain1 by 'contrib/'

contrib/bc: remove vs sub-directory
Some of the files in the vs sub-directory are checked out with  CRLF
line breaks via .getattributes. This causes issues when checking out
the source tree with other tools that operate on Git repositories like
"got". Remove the vs sub-directory from the contrib tree, since it is
not required on FreeBSD.
94d4ba04a96f495d635bf246e4d5021eb1faab22 Stefan Eßer 2026-10-10 20:51:30

debug: classified in 03-filenames_plain1 by 'contrib/'

compiler-rt: enable use of .preinit_array after ef758b59a44e
After base ef758b59a44e6b5b2d2dc178b97c01cde1b34570 we can enable usage
of .preinit_array in compiler-rt's sanitizers. The comment that stated
"On FreeBSD, .preinit_array functions are called with rtld_bind_lock
writer lock held. It will lead to dead lock ..." can also be removed.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298943
MFC after:      1 week
000856156745f1a9a05705f8a499c0fd84f183ca Dimitry Andric 2026-10-10 21:41:52

debug: classified in 03-filenames_plain1 by 'contrib/'

Merge commit 681c2ee4dfbf from llvm-project (by Justin King):
  asan: refactor interceptor allocation/deallocation functions (#145087)

  Do some refactoring to allocation/deallocation interceptors. Expose
  explicit per-alloc_type functions and stop accepting explicit AllocType.
  This ensures we do not accidentally mix.

  NOTE: This change rejects attempts to call `operator new(<some_size>,
  static_cast<std::align_val_t>(0))`.

  For https://github.com/llvm/llvm-project/issues/144435

  Signed-off-by: Justin King <jcking@google.com>

This a prerequisite for adding sanitizer interceptors for free_sized(3)
and free_aligned_sized(3).

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298943
MFC after:      1 week
6b0f64133cd930fec8971aa85f4ef36a67b8334f Dimitry Andric 2026-10-10 21:44:49

debug: classified in 03-filenames_plain1 by 'contrib/'

Merge commit a5fa4dba6e2e from llvm-project (by PiJoules):
  [compiler-rt] Add interceptors for free_[aligned_]sized for asan+hwasan (#189109)

This avoids a jemalloc assertion when running sanitized applications
against glib, which uses free_sized(3).

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298943
MFC after:      1 week
a3fbf20c0558ee3c2b88adc0c944e66d074cab7b Dimitry Andric 2026-10-10 21:47:47

debug: classified in 03-filenames_plain1 by 'contrib/'

MFV: zlib: Fix buffer overflow bug in non-blocking gzwrite.
MFC after:    3 days
DIfferential revision:  https://reviews.freebsd.org/D60695
7fe1d8abad3f55f127634c1ada7718bc1982089e Xin LI 2026-10-13 05:49:35

debug: classified in 03-filenames_plain1 by 'sys/contrib'

auditdistd: Use fixed-length protocol names
All communication between auditdistd senders and receivers and
internally between auditdistd and its worker children passes through the
same pair of send / receive functions.  The receive function uses
recv(2) with the MSG_WAITALL flag, which in theory means we should never
get a short read.  However, when handing off a socket to a worker child,
we also pass a variable-length string identifying the type of socket
we're passing, and reading this string relies on a short read.  This
used to work because the arrival of the descriptor would interrupt the
recv(2) call, but this bug was fixed when the AF_UNIX code was rewritten
a while ago and auditdistd has been broken ever since.

Fixing the length of the protocol name to four characters including the
terminating null solves the short-read bug by never requiring a short
read (nothing else in auditdistd requires one).

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296107
MFC after:      1 week
Reviewed by:    js, kevans
Differential Revision:  https://reviews.freebsd.org/D59565
3ca4b8dd162afbecb8de70dc44f525d708726b07 Dag-Erling Smørgrav 2026-10-13 15:55:27

debug: classified in 03-filenames_plain1 by 'contrib/'

kyua: Fixes after vendor merge
Reviewed by:  ngie
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D60446
af238d55d313a4a99fe9a3492755eb152b17bca0 Igor Ostapenko 2026-10-18 17:22:55

debug: classified in 03-filenames_plain1 by 'contrib/'

Commit group #88: auditdistd: Use void pointers for opaque data
auditdistd: Use void pointers for opaque data

Use void, not char, for pointers to opaque data in our send and receive
functions.

Sponsored by:   Klara, Inc.
Sponsored by:   Qualys, Inc.
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D60728
4f19e4aca4f4b7a3058be5d3bfc5aed66668b00f Dag-Erling Smørgrav 2026-10-20 13:28:37

debug: classified in 03-filenames_plain1 by 'contrib/'


auditdistd: Fix build failure

Fixes:          https://cgit.freebsd.org/src/commit/?id=4f19e4aca4f4 ("auditdistd: Use void pointers for opaque data")
Reported by:    garga@
0ce9d6e240a14d5b7cd8eb45a83d0e429f4a3edf Dag-Erling Smørgrav 2026-10-20 14:59:46

debug: classified in 03-filenames_plain1 by 'contrib/'

unbound: Update to 1.26.2
Release notes at
    https://community.nlnetlabs.nl/t/unbound-1-26-2-released

Merge commit 'ce3304d97ba4861eabac759e538426a568aef0a5'

Security:       CVE-2026-35501
Security:       CVE-2026-50106
Security:       CVE-2026-96405
Security:       CVE-2026-97206
Security:       CVE-2026-109125
c6d7a2478c9eeb38ed1284e4ee1ff64c75ca8b09 Dag-Erling Smørgrav 2026-10-21 13:22:17

debug: classified in 05-summary-prefix by 'unbound:'

auditdistd: Avoid deprecated OpenSSL APIs
SSL_use_RSAPrivateKey_file() was deprecated in OpenSSL 3.0.  Use the
more generic SSL_use_PrivateKey_file() instead.

Sponsored by:   Klara, Inc.
Sponsored by:   Qualys, Inc.
Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D60899
8133230d7e944d12108f89a15d6f4e468764dff9 Dag-Erling Smørgrav 2026-10-22 15:12:57

debug: classified in 03-filenames_plain1 by 'contrib/'

Merge commit 4d7292e58078 from llvm-project (by Minsoo Choo):
  [libunwind] Unwind through AArch64 FreeBSD signal trampolines (#235065)

  Retried from https://reviews.llvm.org/D155066.

  Recognize signal trampolines using KERN_PROC_SIGTRAMP when unwind
  metadata is unavailable. Restore the interrupted PC, LR, SP, general
  registers, and valid floating-point registers.

  Add coverage for unwinding out of an interrupted leaf function on both
  regular and alternate signal stacks.

  Assisted-by: GPT

MFC after:      1 week
6a936d939b886fe3d777d33b0327987c3aa08f51 Dimitry Andric 2026-10-25 11:34:38

debug: classified in 03-filenames_plain1 by 'contrib/'

Merge commit fd4113508a64 from llvm-project (by Minsoo Choo):
  [libunwind] Support extended amd64 segment registers (#229176)

  Raise the amd64 DWARF register limit to 59 and add RFLAGS, all six
  segment selectors, FS.base, and GS.base to the register model. Capture
  the extended state and restore it when resuming, using sigreturn() on
  FreeBSD to restore selectors and bases together. Pack the state into the
  existing context buffers without changing their public sizes or the
  Windows XMM offsets.

  Add tests for register access, signal-frame CFI recovery, register
  bounds, and resume behavior.

  Assisted-by: GPT

MFC after:      1 week
28ec7cb8712fde61107126c8ff174578d0ccdf79 Dimitry Andric 2026-10-25 12:10:59

debug: classified in 03-filenames_plain1 by 'contrib/'

contrib/tzdata: import tzdata 2026f
5a2e900390155ca00ca321230e498f94d449eff5 Philip Paeps 2026-10-28 14:46:33

debug: classified in 03-filenames_plain1 by 'contrib/'

contrib/kyua: update to 0.15.1
This new release contains multiple bugfixes. Please see the release
notes mentioned in the merge commit for more details.

MFC after:      2 weeks
Merge commit '3e05143b80d1537cdd51a5dcf742da31f400507e'
b68969979d6b590247290b4fe26212d201c3ad96 Enji Cooper 2026-10-28 22:02:27

debug: classified in 03-filenames_plain1 by 'contrib/'

ena: Upgrade ena-com to freebsd v2.8.5
Merge commit 'c51345cf234c029abf8b5f1655f65f6c2ffaaec9'

Reviewed by: cperciva
MFC after: 3 days
Sponsored by: Amazon, Inc.
0f6f75189f5e55a5846e3b20eec18db93cfafa89 Arthur Kiyanovski 2026-10-29 02:53:22

debug: classified in 03-filenames_plain1 by 'sys/contrib'

bsnmp: zero-fill the destination on a short ASN.1 IpAddress
asn_get_ipaddress_raw() meant to pad the 4-byte buffer after a short
copy, but the loop bound was the already-reached len and never ran,
leaving addr[len..3] uninitialised.  Pad to 4.

This is harmless for the in-tree consumers (bsnmpd(1) and
libbsnmpclient) which zero the PDU before decoding it.

Reviewed by:    harti, maxim
Approved by:    harti
MFC after:      2 weeks

Differential Revision:  https://reviews.freebsd.org/D60923
b5e57452b62e7c185706ed8b2a86e9f8ac483357 Osvaldo Janeri Filho 2026-10-29 18:05:14

debug: classified in 03-filenames_plain1 by 'contrib/'

authpf: pass the privileged Netlink socket to pfctl
authpf opens its pf handle as root and drops privileges before it runs
pfctl to load the per-user ruleset. The child inherits the /dev/pf
descriptor through -p /dev/fd/N, but since pf's control path moved to
Netlink, pfctl opens a Netlink socket of its own, which carries the
unprivileged credentials, and the first privileged command on it fails:
every authpf login ends with "pfctl exited abnormally" on 15.x.

Pass the socket authpf already holds with the new -l flag, next to the
device. Clear FD_CLOEXEC on both descriptors before the exec so the
handoff does not depend on how libpfctl happened to open them.

The socket already reached the child: neither libpfctl nor snl opens
its descriptors close-on-exec and authpf closes nothing before the exec,
so since pf moved to Netlink the unprivileged pfctl has inherited it
unused. Passing its number makes the handoff deliberate. The socket
carries root's credentials for every generic Netlink family, so the
child could reach pflow, carp and the kernel RPC family through it, not
only pf; it already had full control of pf through /dev/pf.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291981
Signed-off-by:  Avinash Duduskar <avinash.duduskar@gmail.com>
Reviewed by:    kp
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2508
674932048a15203b9f45242be17b2ea10feb0d02 Avinash Duduskar 2026-10-26 14:38:11

debug: classified in 03-filenames_plain1 by 'contrib/'

authpf: deny tracing of the pfctl child
The child runs pfctl as the user with authpf's root-opened /dev/pf and
Netlink descriptors. Its real and effective ids match at the exec, so
the kernel clears P_SUGID and any other process of the user could attach
to it and take both descriptors. Deny tracing across the exec; root can
still attach, and core dumps are not affected.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291981
Signed-off-by:  Avinash Duduskar <avinash.duduskar@gmail.com>
Reviewed by:    kp
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2508
3d5bd2cf202cce4c98e227d8eacc4bb6f937477a Avinash Duduskar 2026-10-28 10:22:17

debug: classified in 03-filenames_plain1 by 'contrib/'

tzcode: Update to 2026f
MFC after:    1 week
Event:          Oslo Hackathon 2026
af58db5d6efd1770c53b22e7301a039db7e04213 Dag-Erling Smørgrav 2026-10-31 23:06:28

debug: classified in 03-filenames_plain1 by 'contrib/'

libarchive: merge from vendor branch
libarchive 3.8.11

ChangeLog:
https://github.com/libarchive/libarchive/compare/v3.8.10...v3.8.11

Obtained from:  libarchive
Vendor commit:  03036ffa409a2aa1c5bbad35be2202641a040fda
MFC after:      3 days
322d4227521380a61850b3d4f2ebd2b42343a254 Martin Matuska 2026-10-31 23:39:49

debug: classified in 03-filenames_plain1 by 'contrib/'

atf/FREEBSD-upgrade: update document/rewrite in Markdown
The document does not reflect current reality with how updates/releases
should be managed with contrib/atf . Update it to a state that better
reflects current practices with git, as well as information about where
the latest version of the project can be found, etc.

This change will be used as a template for adding instructions on how to
update contrib/kyua and contrib/lutok in future commits.

MFC after:      1 month
Reviewed by:    ziaee, carlavilla
Differential Revision:  https://reviews.freebsd.org/D59879
91fcc2d8b18c61b61a1fd5848acecc0adfb17403 Enji Cooper 2026-11-01 00:40:01

debug: classified in 03-filenames_plain1 by 'contrib/'

contrib/expat: import expat 2.10.0
Changes: https://github.com/libexpat/libexpat/blob/R_2_10_0/expat/Changes

Security:       CVE-2026-115506
Security:       CVE-2026-117610
Security:       CVE-2026-118370
MFC after:      3 days
765f30b9f3af67a1db9619ff18862dc74ac72674 Philip Paeps 2026-11-02 15:11:05

debug: classified in 03-filenames_plain1 by 'contrib/'

sqlite3: Vendor import of sqlite3 3.54.1
Release notes at https://sqlite.org/releaselog/3_54_1.html.

Obtained from:  https://www.sqlite.org/2026/sqlite-autoconf-3540100.tar.gz
Security:       84cd82e1-d49f-11f1-bae2-3497f65b111b
                CVE-2026-119371
                CVE-2026-119372
                CVE-2026-119373
                CVE-2026-119374
                CVE-2026-119375
                CVE-2026-119376
                CVE-2026-119377
                CVE-2026-119378
                CVE-2026-119379
                CVE-2026-119591
MFC after:      1 day

Merge commit '8fcea37c441fdc95cbfc8c34eeb0dcddbc02dca1'
71bb028fc165e51e6d04e509749da48f48f3aab4 Cy Schubert 2026-11-03 16:45:06

debug: classified in 03-filenames_plain1 by 'contrib/'

audit_warn: Avoid pointless fork and path search
While here, document what the script actually does, not what it once did
on a project branch somewhere that was never merged.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   Qualys, Inc.
Reviewed by:    allanjude
Differential Revision:  https://reviews.freebsd.org/D60171
173268f3d5ede5f55a25f684d4c8c4c43749fde7 Dag-Erling Smørgrav 2026-11-04 15:32:28

debug: classified in 03-filenames_plain1 by 'contrib/'

auditd: Support logging directly to syslog
Every tenth call to auditwarnlog(), check that the audit_warn(5) script
exists and is executable by us.  If it is, execute it as previously;
otherwise, fall back to calling syslog(3) directly.

Additionally, if we choose to use the script and fail, also log the
original message to syslogd, not just the fact that we failed to log.

We could record the result of trying to execute the script, but that
would require pausing while it runs (or at least until the execve(2)
call has completed).

Retesting every tenth call is a little clunky but avoids having to
restart or signal auditd(8) to force it to notice a change in
availability, or adding a command-line option and / or modifying the
audit_control(5) syntax to let the user express a preference.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   Qualys, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D60172
b18489dd60980e51093f196299eb8c38b12daa20 Dag-Erling Smørgrav 2026-11-04 15:32:33

debug: classified in 03-filenames_plain1 by 'contrib/'

pkgconf: vendor import of version 3.0.9
Merge commit 'fe9da42ef146a6f93ea15fcbcc14872d2e6788c3' into main

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60852
16eb1901dcb9b454b93bb289abd093b6ce794ae4 Pierre Pronchery 2026-11-04 18:04:14

debug: Commit manually moved from "unknown" to "contrib".

mandoc: Drop obsolete files
These were removed by upstream long ago. Nothing in the
tree uses them.  Remove them to reduce our diff to upstream.

Reviewed by:            carlavilla, wosch
Reported by:            Ingo Schwarze <schwarze@openbsd.org>
Differential Revision:  https://reviews.freebsd.org/D61198
a743c9527f8ef86083304c6ff68eb2768cbe5e7d Alexander Ziaee 2026-11-04 22:10:19

debug: classified in 03-filenames_plain1 by 'contrib/'

ctfconvert: Make the absence of debug info non-fatal
When compiled with gcc14, subr_ticks.o legitimately doesn't contain any
DWARF sections.  Just emit a warning in this case.  In general we still
want to run ctfconvert on asm files.

Reviewed by:    emaste, des
Fixes:          https://cgit.freebsd.org/src/commit/?id=e959f2a7d8a8 ("ctf*: exit with error upon terminate()")
Differential Revision:  https://reviews.freebsd.org/D61231
40371e514185247d7416d4e4e981d4c71c7b6ba1 Mark Johnston 2026-11-05 18:30:48

debug: classified in 03-filenames_plain1 by 'cddl/contrib/'

MFV: zlib 1.4
MFC after:    1 week
724bb39e83e369209d8e42a52370684b82e26350 Xin LI 2026-11-08 19:10:01

debug: classified in 03-filenames_plain1 by 'sys/contrib'

openssl: stop generating asm that nothing builds
Makefile.asm generated eight perlasm outputs that neither libcrypto nor
the kernel builds. Additionally, upstream does not build them for these
architectures with FreeBSD's configuration:

- aarch64: ecp_sm2p256-armv8, sm3-armv8, sm4-armv8, vpsm4-armv8 and
  vpsm4_ex-armv8.  SM2, SM3 and SM4 are disabled (disable-sm2/sm3/sm4).
- i386: cast-586 (upstream's x86 configuration uses the C CAST code)
  and rc5-586 (RC5 is disabled by default).
- powerpc: aes-gcm-ppc.  Upstream builds it only for 64-bit
  little-endian; libcrypto and ossl(4) use it only on powerpc64 and
  powerpc64le, whose copies stay.

Remove them from Makefile.asm and delete the generated files, so the
next vendor import does not regenerate them.  If one of these algorithms
is ever enabled, add its script back to Makefile.asm and run "make
buildasm".

Checked: no file outside crypto/openssl refers to any of them, and
libcrypto's source lists did not include them.  Built and checked via
tinderbox build.

Reviewed by:    ngie
Discussed with: jhb
MFC after:      2 weeks
MFC to:         stable/15
Event:          FreeBSD Vendor Summit 2026
Differential Revision:  https://reviews.freebsd.org/D61274
ea623d9235e610de16f53990189163f12006f7c6 Gordon Tetlow 2026-11-08 19:17:00

debug: Commit manually moved from "unknown" to "contrib".

libdwarf: standard DWARF 5 form names, DW_LANG_C17 and C23
7bb441c86678 added the fixed-size string and address index forms
0x25 to 0x2c as DW_FORM_ref_strx1..4 and DW_FORM_ref_addrx1..4; the
standard (DWARF 5, table 7.6) names them DW_FORM_strx1..4 and
DW_FORM_addrx1..4, with no "ref".  Rename them, keep the old spellings
as aliases since the header is installed, and update dwarf_dump.c's
form names accordingly.  Add DW_LANG_C17 (0x2c) and DW_LANG_C23 (0x3e),
which clang emits for -std=c17 and -std=c23 units.  ctfconv(1) needs
all of these; it carried them in a private header until now.

Reviewed by:    markj, emaste
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D61154
f22d65998fe15b6bed9c8c3a2eede25c706837e1 Xin LI 2026-11-02 01:41:07

debug: classified in 03-filenames_plain1 by 'contrib/'

OpenSSH: Update to 10.5p1
This release contains security fixes and small bugfixes.

Full release notes are available at
https://www.openssh.com/txt/release-10.5.

Selected items from the release notes:

Security
========

 * ssh-agent(1): fix an interaction between agent locking and the
   session-bind@openssh.com extension that is used to identify
   forwarded agents. These binding requests were refused when the
   agent was locked, with the result that operations that were
   intended to be limited to local use only could be performed
   remotely, including the ability to add PKCS#11 tokens and make
   use of keys that had destination restrictions applied.
   Reported by sn0x-sharma

 * ssh(1): avoid potential realloc use-after-free in the client if a
   remote forwarding is added via the local session multiplexing
   socket while a remote forwarding open request is pending with the
   server. Report and fix from Brian Mingus of Cognatory

 * sshd(8): make the authorized_keys "restrict" keyword apply
   correctly to tunnel forwarding too (which is administratively
   disabled by default). Reported by Erichen, Institute of Computing
   Technology, Chinese Academy of Sciences
    
New features
------------

 * ssh-keygen(1): add ability to set or clear the touch-required and
   verify-required flags on FIDO private keys when resetting a
   private key's passphrase.

 * ssh(1): tweak ordering of certificates tried during pubkey
    authentication to prefer FIDO keys that do not require user
    presence (touch) first, and FIDO keys that require user
    verification via PIN or biometrics last. This effectively tries
    low-friction authenticators before higher friction ones.

 * ssh(1): add a "ssh -Z user@host" mode that prints the keys that
   will be tried for public key authentication in the order that
   they will be used.
    
 * sshd(8) use setproctitle(3) to identify sshd-session when its
   acting as a post-authentication monitor.
    
Sponsored by:   The FreeBSD Foundation
bd9d7cdd142073d2a83d2748df8781ee552f2336 Ed Maste 2026-11-09 14:54:42

debug: classified in 05-summary-prefix by 'OpenSSH:'

mlock_test: use mmap/munmap for unmapped pointer
Instead of hoping that the page after sbrk(0) is unmapped, map a page
with mmap and then munmap it.  This won't work with CheriABI and heap
temporal safety, but it's an easy fix for now and works on all
architectures.

Reviewed by:    ngie
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D46954
74ec4ca76b970f80fe7a7c123c1f0ea628e6712c Brooks Davis 2026-11-09 16:02:55

debug: classified in 03-filenames_plain1 by 'contrib/'

libc: skip telldir_leak test
It uses sbrk to attempt to detect memory leaks in telldir, but we're not
going to export sbrk in the future and this is unreliable for mmap-based
mallocs.  It's also a regression test for a specific NetBSD bug.

Reviewed by:    ngie
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D46955
4a6091a88701a1f1767e58a255902579c3fbd8eb Brooks Davis 2026-11-09 16:03:07

debug: classified in 03-filenames_plain1 by 'contrib/'

libthr: libpthread/t_mutex.c tests should expect EDEADLK
to follow the POSIX specification.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61253
be90f23d4a6c70cd829366612c53755b47c2986d Konstantin Belousov 2026-11-09 19:17:20

debug: classified in 03-filenames_plain1 by 'contrib/'

Merge commit 72a20b8e2987 from llvm git (by Gabriel Baraldi):
  [SLPVectorizer] Check std::optional coming out of getPointersDiff (#175784)

  Fixes https://github.com/llvm/llvm-project/issues/175768
  There are other unchecked uses std::optional in this pass but I couldn't
  figure out a test that triggers them

This fixes a clang crash in the SLP vectorizer, hit when building
audio/csound on powerpc64le. The hardened libc++ traps on the disengaged
optional, so clang dies with exit code 133. The second hunk is adapted to
llvm 21, where analyzeConstantStrideCandidate() is still isStridedLoad().

Reviewed by:    dim
MFC after:      3 days

Differential Revision:  https://reviews.freebsd.org/D61354
e56090afb68b6c036d6b54c7b66d762d98bd96d0 Piotr Kubaj 2026-11-09 18:58:07

debug: classified in 03-filenames_plain1 by 'contrib/'

OpenSSH: Update to 10.6p1
This release contains security fixes and small bugfixes.

Full release notes are available at
https://www.openssh.com/txt/release-10.6 .

Selected items from the upstream release notes:

Security
========

 * ssh-agent(1): fix an interaction between agent locking and the
   session-bind@openssh.com extension that is used to identify
   forwarded agents. These binding requests were refused when the
   agent was locked, with the result that operations that were
   intended to be limited to local use only could be performed
   remotely, including the ability to add PKCS#11 tokens and make
   use of keys that had destination restrictions applied.
   Reported by sn0x-sharma

 * ssh(1): avoid potential realloc use-after-free in the client if a
   remote forwarding is added via the local session multiplexing
   socket while a remote forwarding open request is pending with the
   server. Report and fix from Brian Mingus of Cognatory

 * sshd(8): make the authorized_keys "restrict" keyword apply
   correctly to tunnel forwarding too (which is administratively
   disabled by default). Reported by Erichen, Institute of Computing
   Technology, Chinese Academy of Sciences

New features
------------

 * ssh-keygen(1): add ability to set or clear the touch-required and
   verify-required flags on FIDO private keys when resetting a
   private key's passphrase.

 * ssh(1): tweak ordering of certificates tried during pubkey
    authentication to prefer FIDO keys that do not require user
    presence (touch) first, and FIDO keys that require user
    verification via PIN or biometrics last. This effectively tries
    low-friction authenticators before higher friction ones.

 * ssh(1): add a "ssh -Z user@host" mode that prints the keys that
   will be tried for public key authentication in the order that
   they will be used.

 * sshd(8) use setproctitle(3) to identify sshd-session when its
   acting as a post-authentication monitor.

Sponsored by:   The FreeBSD Foundation
6dd16be872c631a4c011983107acd213a6fe619d Ed Maste 2026-11-10 14:08:18

debug: classified in 05-summary-prefix by 'OpenSSH:'

OpenSSH: Update to 10.6p2
Full release notes are available at
https://www.openssh.org/txt/release-10.6p2 .

Selected items from the upstream release notes:

Future deprecation notice
-------------------------

 * scp(1): begin deprecating the -R flag, which is used to perform a
   remote-to-remote copy by executing scp on a remote host. This
   option is a fragile optimisation that is difficult to use because
   it requires credentials on the remote host. It also creates
   security risks if the shell quoting rules on the remote system
   where the copy is performed differ from the client's expectations.

   From OpenSSH 10.6, this option will continue to work but will
   cause a deprecation warning to be emitted to standard error. In
   a future release, the option will be ignored and will leave in
   place the default remote-to-remote copy behaviour (copy via the
   host running scp).

Reviewed by:    jlduran
Sponsored by:   The FreeBSD Foundation
6fcdc18bdfb17c43eb05eb6289732e6adceb481a Ed Maste 2026-11-10 14:23:50

debug: classified in 05-summary-prefix by 'OpenSSH:'

atf-check: Add shortcut for not-exit:0
Allow the command to be preceded by an exclamation point, which changes
the default expected result to a clean exit with a non-zero exit code.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D58099
76797b9b6ed4f2fe4ebb08fede0f19a88f985494 Dag-Erling Smørgrav 2026-11-11 20:35:44

debug: classified in 03-filenames_plain1 by 'contrib/'

MFV: Import blocklist 2026-11-12 (590e95e)
Merge commit 'b0788c28c7bc6631129bc366bad491cf5698b2dc'

Changes:

https://github.com/zoulasc/blocklist/compare/10a907f...590e95e

MFC after:      3 days
ea9a38e03249e25e1be8bd8f3c64028f9ac1102f Jose Luis Duran 2026-11-13 13:39:12

debug: classified in 03-filenames_plain1 by 'contrib/'

clang: Fix warnings in ARM GCS ACLE header
Including <arm_acle.h> in C code compiled with -Wstrict-prototypes
results in warnings (or errors if -Werror is in effect) due to missing
parameter lists for __gcspr() and __gcspopm().

Submitted upstream as PR#242286.

MFC after:      1 week
Reported by:    Pete French <pete@twisted.org.uk>
Reviewed by:    dim
Differential Revision:  https://reviews.freebsd.org/D61503
74d72b3491e810068313e49629c3b8fe46f29318 Dag-Erling Smørgrav 2026-11-14 14:01:01

debug: classified in 03-filenames_plain1 by 'contrib/'

lua: Prune unused luaconf.h copies
Both stand and lib use luaconf.h from contrib and make local
customizations in their respective luaconf.local.h files since
8c784bb8cf36.

Reviewed by:    kevans, imp
Approved by:    kevans (mentor)
Fixes:          https://cgit.freebsd.org/src/commit/?id=8c784bb8cf36 ("lua: Update to 5.4.4")
MFC after:      3 days
MFC to:         stable/14, stable/15
Differential Revision:  https://reviews.freebsd.org/D61456
a6b57c401a61922c3d2311354000c8c8f12df654 Ryan Moeller 2026-11-13 07:11:15

debug: Commit manually moved from "unknown" to "contrib".

Merge OpenBSM 1.2-alpha6
Most of the changes already existed in FreeBSD.

Sponsored by:   Klara, Inc.
Sponsored by:   Qualys, Inc.
df6aeb413f5144617d3f001ab07feec2ba0417be Dag-Erling Smørgrav 2026-11-14 16:16:50

debug: classified in 05-summary-prefix by 'Merge '

Reverted commits

Commit & revert pair: linux: implement sched_getattr()
linux: implement sched_getattr()

This change adds the necessary glue to translate Linux scheduler policy
and priority from FreeBSD so this information is available to Linux
applications.

This unbreaks using the Linux version of Chromium on FreeBSD.

This change was originally submitted via [freebsd/freebsd-src#2370][github-pr].

MFC after:      2 weeks
PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297468
Co-Authored-By: Enji Cooper <ngie@FreeBSD.org>
Signed-off-by:  Joao Bonifacio <joaoboni017@gmail.com>

[github-pr]: https://github.com/freebsd/freebsd-src/pull/2370

Differential Revision:  https://reviews.freebsd.org/D60214
bb5f10e51bd53771f1a438f36f554256fcbd7d08 Enji Cooper 2026-10-05 22:48:22

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "linux: implement sched_getattr()"

The changes need to be reviewed further; revert until the issues have
been worked out.

Requested by:   markj
This reverts commit bb5f10e51bd53771f1a438f36f554256fcbd7d08.
32f5a9f3fb512908805901a1739383766417dd8d Enji Cooper 2026-10-06 04:49:15

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: linux: implement fchmodat2 syscall
linux: implement fchmodat2 syscall

The fchmodat2 syscall on Linux is effectively the same as the fchmodat
on FreeBSD, whereas fchmodat on Linux is fchmodat on FreeBSD, minus
the `flags` argument.

This change provides the necessary glue in order to call kern_fchmodat
properly via the Linuxulator.

NB: glibc transparently passes through the `flags` argument, so this is
[largely] a no-op for end-users, but it affects those who compiled
binaries specifically using the fchmodat2 syscall.

MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60394
c070ec923e2f49b6ecb5a60b584ba8f4376a6e80 Enji Cooper 2026-10-05 23:50:38

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "linux: implement fchmodat2 syscall"

This got accidentally committed when I was reverting another commit.

This reverts commit c070ec923e2f49b6ecb5a60b584ba8f4376a6e80.
4abfb452ea2d18c4710dffee7f3e65167d543041 Enji Cooper 2026-10-06 04:51:35

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

socket: Remove the divert(4) socket compat shim again
Python in the ports tree now handles PF_DIVERT sockets properly; see
ports commit 4d84480d7a68.  I no longer have any specific reason to keep
the shim and Gleb wants to remove it, so, let's remove it.

This reverts commit cb7009867ae6b33aa39cb6cb1453b69073144b44.

Requested by:   glebius
Reviewed by:    glebius
Differential Revision:  https://reviews.freebsd.org/D60390
5bf78497dc3ad24197e4940c91ab7c06230af86b Mark Johnston 2026-10-08 17:10:32

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: tests/libc: use an allowlist for sbrk in NetBSD-derived tests
tests/libc: use an allowlist for sbrk in NetBSD-derived tests

sbrk is obsolete and libc only provides it on amd64, arm, i386 and
powerpc.  Replace the growing exclusion lists in t_dir.c and t_mlock.c
with a single positive HAS_SBRK definition per file, so architectures
without sbrk need not be enumerated as they are added.

Signed-off-by: Xiaoqiang Zhao <zhaoxiaoqiang007@gmail.com>
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D60358
36b849b5c76406bb6d9341bfb1a7f16ae5c189c9 Xiaoqiang Zhao 2026-10-10 17:39:44

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "tests/libc: use an allowlist for sbrk in NetBSD-derived tests"

Need to update the commit message.

This reverts commit 36b849b5c76406bb6d9341bfb1a7f16ae5c189c9.
e8431fae655be5f3c5b95e091e72960ff713431f Enji Cooper 2026-10-10 17:43:00

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

mgb: Build module for all archs
It is not x86-specific.

This reverts commit e0a5aa37c1ef3a22e2dc8c311e0e32ea363f7ccf.
This reverts commit 2d935a1e93af4d552db1f7218ef97e01f058c084.

Reviewed by:    kbowling
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60615
b80af977f1b1ab72cb80fe6802228cdae0547efe Ed Maste 2026-10-11 14:34:15

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: umb: Update man page HISTORY
umb: Update man page HISTORY

It was merged to stable/14 prior to FreeBSD 14.4.
ed797306243f3bdbbfd5d8223ec8698b9d7fe319 Ed Maste 2025-10-24 17:02:40

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "umb: Update man page HISTORY"

Oops, pushed in error from a staging branch.

This reverts commit ed797306243f3bdbbfd5d8223ec8698b9d7fe319.
d5612784ab931782956d9b106cc0d1c7d4801002 Ed Maste 2026-10-15 17:58:47

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Revert LinuxKPI: LINUXKPI_DEBUG changes to allow drm-kmod to build
It has been almost a week with an open pull-requests and a follow-up
identified merge from master drm-kmod, as well as a patch supplied
in a PR for the ports to fix the the current build breakage in drm-kmod
and as a result also in nvidia-drm-* ports.

The problem there is that instead of using the kmod.mk supplied
definitions for LINUXKPI and despite using kmod.mk for the build,
the external components have hand-rolled solutions which can get
out of synch with src.git.

This was not discovered early on given that building drm-kmod with
LOCAL_MODULES_DIR= from git sources will not fail as the kernel
build will have provided the new opt_linuxkpi.h file.  In addition
drm-kmod master already had the -include for kconfig.h which the
src tree has had since 2024.

Give the pkgbase/kmod builds and users over the weekend a chance
to produce drm-kmod packages as the number of affected poeple is
rising.
These changes will hopefully be brought back next week once
drm-kmod and nvidia-drm-* ports are fixed.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299334
Bring back after:       3+ days

This reverts commit bbfd52dcbeb7b6e540220b3b24b664df6d200200.
This reverts commit 9820afb99e6fdc471cb820f321530c52ed2c31ac.
6866177454acf8fc5ac4295a0571fa791442ab52 Bjoern A. Zeeb 2026-10-17 01:38:06

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: sbuf(3): increase test coverage
sbuf(3): increase test coverage

This change adds additional explicit test coverage for the following
sbuf(3) APIs:
- sbuf_clear_flags
- sbuf_get_flags
- sbuf_set_flags

While here, add a missing `sbuf_delete` to `sbuf_drain_ret0_test`: while
it isn't strictly required (the library's state is cleaned up shortly
after the test process ends), tools such as Coverity and LSAN flag
issues with leaked memory. Adding the sbuf_delete(3) call to the test
quells that issue.

MFC after:      1 week
Reviewed-by:    ngie
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2367
760efcc775c304d175a360dddf499a7b0d5e3935 Joao Bonifacio 2026-08-09 22:43:26

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "sbuf(3): increase test coverage"

ghpr doesn't seem to do a `git status` prior to allowing someone to push
changes (bug pending). Revert the change so the properly tested one can
be pushed into the tree.

This reverts commit 760efcc775c304d175a360dddf499a7b0d5e3935.
23ab9a9d09f4b46d0b1334742f466526da3662c1 Enji Cooper 2026-10-18 18:09:37

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: inpcb: add single peer local port caching
inpcb: add single peer local port caching

A typical caching proxy problem is port allocation to backends.  We
usually have a few of them, with thousands connections to each.  Upon
creation of a new connection we need to find a new unique local port for
the peer:port.  This is achieved by linear search in in_pcb_lport_dest().
The closer we get to the port exhaustion the more expensive this loop is.
It needs to be executed tens thousands of times to find a port or fail.

Address the problem by adding advisory negative cache that is lazily
allocated upon first conflict.  Once the cache is in action we skip trying
those ports that are already marked in the cache.  During the search we
may encounter a cache allocated by other lookup.  In this case the caches
are merged into one.  The expectation is that under a stable heavy load we
are going to stabilize at a very low number of allocated caches, ideally
one per peer:port. The cache is a bitset of IPPORT_MAX, which makes it 8k.
Unfortunately metadata pushes allocation size to 16k UMA bucket.  However,
the expectation is that we are going to have a very few allocated, thus
current decision is to not create a separate UMA zone.

Differential Revision:  https://reviews.freebsd.org/D58290
289082428c764ed282623cc6f7ee9b7448fddad1 Gleb Smirnoff 2026-10-23 17:33:04

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "inpcb: add single peer local port caching"

This reverts commit 289082428c764ed282623cc6f7ee9b7448fddad1.

Requested by:   markj
91bff7d7ed461360bc992dcd411703db6cd6d2a1 Gleb Smirnoff 2026-10-23 18:56:06

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: bind_all_fibs: Disable bind_all_fibs by default
bind_all_fibs: Disable bind_all_fibs by default

net.inet.{tcp,udp,raw}.bind_all_fibs was set to 1 for backward
compatibility. Set to 0 by default to drop them all unless an inpcb
bound to the same FIB exists.

While here, Add an UPDATING entry for behaviour change.

Relnotes:       yes
Reviewed by:    markj
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/73
714433a6772b346723341735ef9547f672d9d2a3 Pouria Mousavizadeh Tehrani 2026-10-24 18:01:06

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "bind_all_fibs: Disable bind_all_fibs by default"

This reverts commit 714433a6772b346723341735ef9547f672d9d2a3.

There were issues reported by markj
I will hold this commit until those are fixed.
7b23b63edfe09d6509174ecd3aa2f32f143b7a8c Pouria Mousavizadeh Tehrani 2026-10-29 16:19:54

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: style.Makefile(5): update recommendations
style.Makefile(5): update recommendations

- Mention `CXXFLAGS` and `CXXSTD`, in addition to `CFLAGS` and `CSTD`.
- Mention `LIBADD`, in addition to the legacy (in-tree) variables,
  `DPADD` and `LDADD`.
- Mention the other option types, e.g., `MK_FOO`, `WITHOUT_FOO`, etc,
  added as part of `src.opts.mk` in the past couple releases.

Bump .Dd for the change.

MFC after:      1 week
68aebfa28a17189e1e697e612c0a1a2220b9fa2b Enji Cooper 2026-10-29 20:47:36

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "style.Makefile(5): update recommendations"

This has not been reviewed yet - revert the change so it can be reviewed
properly first.

This reverts commit 68aebfa28a17189e1e697e612c0a1a2220b9fa2b.
105c49eb4a4bd1bd2b2c0af08dccb37b9b2b2fef Enji Cooper 2026-10-29 23:33:51

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: git-arc: add initial non-FreeBSD and `$HOME` install support
git-arc: add initial non-FreeBSD and `$HOME` install support

Modify the existing code to permit setting a prefix via the `PREFIX`
make variable, similar to what `--prefix` provides in autotools-based
projects.

Add the required compatibility glue in order to function with vanilla
bmake, which enables installing the commands with Linux and macOS:
- vanilla bmake requires `scripts.mk` to install `SCRIPTS`.
- vanilla bmake does not tack `/man` on to the end of `MANDIR`, like
  with FreeBSD.

Adjust the sysctl calls to instead look for `arc` in `$PATH` using
`command -v` instead of hardcoding the path to the `arc` binary. This
allows the command to invoke `phorge` as well as the legacy `arcanist`
tool.

While here, update the origin for `arcanist` as the former is the
non-phorge fork is no longer supported (nor needed).

NOTE:
- regarding Linux support: this should now function out of the box with
  Linux as long as the host has access to an appropriate `arc` binary.
- regarding macOS support: the arcanist/phorge packages do not yet
  exist in Homebrew or MacPorts, but are being added soon.

MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60995
010e53f7c6908bee93d1bd32fb4b1658b0f19eef Enji Cooper 2026-10-29 20:59:38

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "git-arc: add initial non-FreeBSD and `$HOME` install support"

This was in review and should not have been committed.

This reverts commit 010e53f7c6908bee93d1bd32fb4b1658b0f19eef.
091492b83f8f96f9b9f700c1e9d40753243fb992 Enji Cooper 2026-10-29 23:34:42

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Revert "snd_hda: Identify AMD Audio Coprocessor"
Apparently this device might need a separate driver altogether.

This reverts commit 8dac0bdb4df0815e14db219e9a7fb5d0be5737b8.
7ef59ccfcc8a8f8d2623357f60d974ca6cfd45fb Christos Margiolis 2026-11-02 12:02:08

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: bhyve/riscv: correctly handle empty masks and broadcast in SBI IPI/RFNC
bhyve/riscv: correctly handle empty masks and broadcast in SBI IPI/RFNC

Bhyve treats an empty cpu set as an error which triggers MPASS panic in
the guest. As per the SBI spec, empty masks should return SBI_SUCCESS,
and a base of -1UL specifies a broadcast to all harts.  Fix both in
vmm_sbi.c, clear a1 on return, and skip the SBI ecall in
sbi_ipi_pic_ipi_send() if the mask is empty. Also add a NULL check in
riscv_send_ipi().

Signed-off-by: Doongar Singh <doonbsd@gmail.com>

Reviewed by:    br
Differential Revision:  https://reviews.freebsd.org/D61126
ada1f577cc291336cbb69782075dbbf9fe746872 Doongar Singh 2026-11-02 20:58:53

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "bhyve/riscv: correctly handle empty masks and broadcast in SBI IPI/RFNC"

This reverts commit ada1f577cc291336cbb69782075dbbf9fe746872.
89d52f02bf37ed3d9fdb464f38f0714aa979eb41 Ruslan Bukin 2026-11-02 21:33:57

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: iSCSI: Fast and per-session timeouts
iSCSI: Fast and per-session timeouts

Support per-session configurable ping (SCSI NOP) and login timeouts
similar to what is supported in the Linux iSCSI initiator configuration file.

Reduce iscsi timer granularity to 0.1 sec.
For backwards compatibility, when all timers are selected on integer numbers,
all status messages are unchanged. If the higher granularity is used, the
log messages include sub-second granularity.

The sysctl(3) interface has changed from pure int to string, in order to
support fractional seconds in a human-readable, dotted notation.

Reviewed By: #netapp, #manpages, jhb, pauamma_chezdork.com, siderop1_netapp.com
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D32540
6129bc4b65d8f00570bdcf2b2d36f3717e4b4741 Richard Scheffenegger 2026-11-06 21:13:23

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "iSCSI: Fast and per-session timeouts"

This reverts commit 6129bc4b65d8f00570bdcf2b2d36f3717e4b4741.
c3a05933b34f705077e88a7a2d1c4bad85e73e79 Richard Scheffenegger 2026-11-06 22:38:25

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: bstring.3: no cross reference to self
bstring.3: no cross reference to self
ef7d29b0df91d32c0b880796acd969a0a00ecf47 Wolfram Schneider 2026-11-08 11:44:13

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "bstring.3: no cross reference to self"

This reverts commit ef7d29b0df91d32c0b880796acd969a0a00ecf47.
1a65fd938737c4709c1fa4fb2914ffd4e317af57 Wolfram Schneider 2026-11-08 19:13:46

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: string.3: no cross reference to self
string.3: no cross reference to self
0448f4d0a4359670e8ad2ec72d0a826685517ae7 Wolfram Schneider 2026-11-08 11:47:06

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "string.3: no cross reference to self"

This reverts commit 0448f4d0a4359670e8ad2ec72d0a826685517ae7.
18eec80abcceb0035045d1b524311d79883542a3 Wolfram Schneider 2026-11-08 19:07:51

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: capsicum-test: make the code WARNS=6 clean
capsicum-test: make the code WARNS=6 clean

Make the code WARNS=6 clean by doing the following:
- Renaming variables (-Wshadow).
- Use memcpy instead of assigning the result of CMSG_DATA to a variable
  (-Wcast-align).
- Wrap some macros with do-while(0) to avoid variable collisions
  (-Wshadow).
- Push one of the TRACE statements up by 1 layer to avoid a collision
  between 2 calls of TRACE via the same overarching macro.

This was needed in order for the code to build properly with D61066,
since the code was not compiling with WARNS set to 3 at the testcase
level.

MFC after: 1 week

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D61080
5bae837f316ca96b69c61bae15bd61da76e7f3ea Enji Cooper 2026-11-10 01:29:25

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "capsicum-test: make the code WARNS=6 clean"

The wrong patch got committed somehow from one of my git clones. Revert the
change so I can reapply the correct patch >:(.

This reverts commit 5bae837f316ca96b69c61bae15bd61da76e7f3ea.
ab6a3f137c33d96d15f703bd451589adee067883 Enji Cooper 2026-11-10 01:50:09

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: tests/sys/capsicum: restore test coverage with root user
tests/sys/capsicum: restore test coverage with root user

This change builds capsicum_test and installs/runs it as an unprivileged
user ("tests" in vanilla FreeBSD) and root.

This required adjusting logic in the Makefile in order to build two
binaries with the same sources and running them as separate binaries.

Moreover, in order to restore coverage and ensure that some tests which
require `other_uid` (typically specified via `-u` on the CLI with the
test program) don't fail, become the "tests" user when run as root. This
technically doesn't honor unprivileged_user property in kyua.conf: the
property needs to be passed via a command-line parameter to the test
program.

MFC after:      1 week
Reported by:    markj
Fixes:          https://cgit.freebsd.org/src/commit/?id=3fb03fb35b20 ("[tests] switch GoogleTest tests ...")

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D61066
dda15b669d021346682009f38acc6db2639fb99f Enji Cooper 2026-11-10 01:32:45

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "tests/sys/capsicum: restore test coverage with root user"

The wrong patch was applied for D61080. Both changes must go.

This reverts commit dda15b669d021346682009f38acc6db2639fb99f.
83fc6f5bdf8133359ec5526b9e359fd7d35c12c8 Enji Cooper 2026-11-10 01:49:25

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: Remove {ATF,PLAIN}_REQUIRE_KERNEL_MODULE macros
Remove {ATF,PLAIN}_REQUIRE_KERNEL_MODULE macros

These macros predated the `require.kmod` (ATF) and `required_kmods`
(kyua) test metadata and are no longer needed.

Add a hint to freebsd_test_suite/macros.h about the `*FEATURE*` macros
going away soon. See [this kyua issue][kyua-issue] for more details.

MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D61082

[kyua-issue]: https://github.com/freebsd/kyua/issues/346
e34b159d4c64575aa45763968b6ad01dfd7c2337 Enji Cooper 2026-11-10 21:31:45

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "Remove {ATF,PLAIN}_REQUIRE_KERNEL_MODULE macros"

The change breaks the build of tests/sys/net/routing/test_rtsock_l3.c.

This reverts commit e34b159d4c64575aa45763968b6ad01dfd7c2337.
307e725acce22043d5961b0ad392ea0283e1d056 Mark Johnston 2026-11-10 22:12:50

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

Commit & revert pair: tcp bbr: improve retransmit timout calculation
tcp bbr: improve retransmit timout calculation

The retransmission timeout should the srtt + 4 * rttvar.
The srtt is using 5 bits of fractions and rttvar is using 4 bits of
fractions, some specific shifting is required.

Reviewed by:            Peter Lei
MFC after:              3 days
MFC to:                 stable/15
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61586
47ef696a769644e7ca1f2a3129818f39640b30a9 Michael Tuexen 2026-11-15 08:38:45

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'


Revert "tcp bbr: improve retransmit timout calculation"

This reverts commit 47ef696a769644e7ca1f2a3129818f39640b30a9.
I referenced the wrong review.
7659a4f98c6c8e9f38b8fffba43d17f67a56acd1 Michael Tuexen 2026-11-15 19:01:56

debug: classified in 00-reverts by 'This reverts commit \b([0-9a-fA-F]{40})\b'

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.21 at 2026-11-16 20:34:06+00:00.

This work is supported by Tarsnap Backup Inc.

Alternate version: 2026-10-01 (release)