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:

(3) Highlighted commits (these are copies, not in stats)
17 2.1% Userland programs
47 5.8% Documentation
266 32.8% Hardware support
94 11.6% Networking
84 10.4% System administration
38 4.7% Libraries
22 2.7% Filesystems
98 12.1% Kernel
39 4.8% Build system
13 1.6% Internal organizational stuff
21 2.6% Testing
11 1.4% Style, typos, and comments
36 4.4% Contrib code
24 3.0% Reverted commits
0 0.0% Unclassified commits
810 100% total
Technical notes about this page

debug: info about the automatic classification

num % num changed stage
24 3.0% 0 00-reverts
12 1.5% 0 01-style
76 9.4% 0 02-filenames_wildcards
18 2.2% 0 02b-filenames_wildcards2
488 60.2% 0 03-filenames_plain1
165 20.4% 0 04-filenames_plain2
10 1.2% 0 05-summary-prefix
17 2.1% 0 Manually-classified commits
0 0.0% 0 Unclassified commits

debug: more stats

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

debug: groups

20 2.5% num in revert
10 1.2% num in fixes
197 24.3% num in consecutive
227 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".

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/'

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 #1: 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]'

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 #2: 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 #3: 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/'

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 #4: 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 #5: 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 #6: 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 #7: 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 #8: 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 #9: 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 #10: 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 #11: 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 #12: 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 #13: 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 #14: 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 #15: 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 #16: 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 #17: 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 #18: 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 #19: 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 #20: 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 #21: 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 #22: 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 #23: 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 #24: 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 #25: 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/'

Networking

Network-related commands, library, and kernel.

Commit group #26: 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 #27: 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 #28: 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 #29: 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 #30: 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/'

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 #31: 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 #32: 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 #33: 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 #34: 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 #35: 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 #36: 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 #37: 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 #38: 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/'

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 #39: 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/'

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 #40: 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/'

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 #41: 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 #42: 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 #43: 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 #44: 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 #45: 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 #46: 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 #47: 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/'

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 #48: 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/'

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 #49: 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 #50: 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 #51: 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'

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/'

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\/.*'

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'

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 #52: 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 #53: 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/'

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'

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-03 03:24:04+00:00.

This work is supported by Tarsnap Backup Inc.

Alternate version: 2026-10-01 (release)