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 |
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.
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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: Commit manually moved from "unknown" to "build".
Bump new USB changes. Also, update RELNOTE and UPDATING. Sponsored by: The FreeBSD Foundation
debug: Commit manually moved from "unknown" to "build".
Commits about commands found in man section 1 (other than networking).
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
debug: classified in
04-filenames_plain2 by
'usr.bin/'
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
debug: classified in
04-filenames_plain2 by
'usr.bin/'
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
debug: classified in
04-filenames_plain2 by
'usr.bin/'
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
debug: classified in
04-filenames_plain2 by
'usr.bin/'
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
debug: classified in
04-filenames_plain2 by
'usr.bin/'
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
debug: classified in
04-filenames_plain2 by
'usr.bin/'
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
debug: classified in
04-filenames_plain2 by
'usr.bin/'
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
debug: Commit manually moved from "unknown" to "userland".
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
debug: classified in
04-filenames_plain2 by
'usr.bin/'
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
debug: classified in
04-filenames_plain2 by
'usr.bin/'
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")
debug: classified in
04-filenames_plain2 by
'usr.bin/'
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
debug: Commit manually moved from "unknown" to "userland".
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
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
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
debug: classified in
04-filenames_plain2 by
'usr.bin/'
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
debug: classified in
04-filenames_plain2 by
'usr.bin/'
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
debug: classified in
04-filenames_plain2 by
'usr.bin/'
Man pages, release notes, etc.
MFC after: 1 week
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
MFC after: 1 week
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
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
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Reviewed by: ziaee Co-authored-by: Claude Opus 5.5 MFC after: 2 weeks Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D60152
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Reported by: glebius@
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Reviewed by: olce MFC after: 1 week Sponsored by: fme AG Differential Revision: https://reviews.freebsd.org/D60443
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
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
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
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
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Macho is a perfectly cromulent word, in both Merriam-Webster and OED. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D60713
debug: Commit manually moved from "unknown" to "doc".
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
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
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
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
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
MFC after: 3 days Reported by: fuz Reviewed by: fuz Differential Revision: https://reviews.freebsd.org/D59730
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
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
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D60701
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Reviewed by: imp (earlier version) MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D60451
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
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
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Sponsored by: The FreeBSD Foundation MFC after: 3 days
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
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
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
manpages: Fix unusual Xr order
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
manpages: Fix unusual Xr order
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
manpages: Fix unusual Xr order
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
manpages: Fix unusual Xr order
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
manpages: Fix unusual Xr order
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
manpages: Fix unusual Xr order
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
manpages: Fix unusual Xr order
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
manpages: Fix unusual Xr order
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
manpages: Fix unusual Xr order
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
manpages: Fix unusual Xr order
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
manpages: Fix unusual Xr order
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
manpages: Fix unusual Xr order
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
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
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
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
debug: classified in
03-filenames_plain1 by
'usr.bin/man/'
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
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
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
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
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
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
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
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Hardware drivers and architecture-specific code.
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
debug: classified in
03-filenames_plain1 by '['sys/arm/',
'sys/arm64/', 'sys/powerpc/', 'sys/riscv/',
'sys/x86/']'
MFC after: 2 weeks Sponsored by: Chelsio Communications
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
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
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
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
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
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/powerpc/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
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
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
MFC after: 3 days Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
MFC after: 3 days Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/riscv/'
These diagnostics do not exist anymore. MFC after: 1 week
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'lib/libpmc/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Set si_iosize_max for namespace character devices matching the fix from commit 125ec0e30785bb0cbca7aa6c0b1a34b75e53078d. Sponsored by: Chelsio Communications
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
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
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
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
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
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
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
debug: moved to hardware
because 'Need to be grouped with
6bf6fe1d70e780786a07e759d75eeb256f247fcd'
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
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
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
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
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
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")
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/riscv/'
iwm: add lock assertion checks Add lock/unlock assertions to use in current and future code. Differential Revision: https://reviews.freebsd.org/D60400
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
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
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
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
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
MFC after: 3 days Approved by: adrian Reviewed by: kevans, adrian Differential Revision: https://reviews.freebsd.org/D60652
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
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
debug: classified in
03-filenames_plain1 by '['lib/libpmc/',
'sys/amd64/', 'sys/dev/', 'sys/x86/']'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
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
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
Reviewed by: emaste
Sponsored by: EPSRC ("UKRI3001: CHERI Research Centre")
Differential Revision: https://reviews.freebsd.org/D60705
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/powerpc/'
It's practical to have this printed out proactively, at least while this is still very experimental. Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
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
debug: classified in
03-filenames_plain1 by '['sys/arm/',
'sys/dev/']'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by '['sys/amd64/',
'sys/arm/', 'sys/arm64/', 'sys/powerpc/',
'sys/riscv/']'
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
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: Commit manually moved from "unknown" to "hardware".
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
debug: classified in
03-filenames_plain1 by
'sys/powerpc/'
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
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by '['sys/amd64/',
'sys/arm/', 'sys/arm64/', 'sys/i386/', 'sys/powerpc/',
'sys/riscv/']'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D49168
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/powerpc/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: Commit manually moved from "unknown" to "hardware".
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
debug: classified in
05-summary-prefix by 'sound
examples:'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
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.
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
- 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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/x86/'
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
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")
debug: classified in
03-filenames_plain1 by
'sys/x86/'
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
debug: classified in
03-filenames_plain1 by
'sys/powerpc/'
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
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Sponsored by: The FreeBSD Foundation MFC after: 1 week
debug: classified in
03-filenames_plain1 by
'sys/x86/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Krackan Point has the same quirks as the Phoenix SMU it would seem. Reported by: emaste Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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>
debug: classified in
03-filenames_plain1 by
'sys/riscv/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
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")
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Fixes: https://cgit.freebsd.org/src/commit/?id=6e93f5e4d693 ("amd64: FRED support") Sponsored by: The FreeBSD Foundation MFC after: 1 week
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
Fixes: https://cgit.freebsd.org/src/commit/?id=c6d7235ac15d ("amd64: handle #AC in kernel mode") Sponsored by: The FreeBSD Foundation MFC after: 1 week
debug: classified in
03-filenames_plain1 by
'sys/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
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
%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
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
amd64 FRED: mark trap frame as initialized for KASAN/KMSAN Sponsored by: The FreeBSD Foundation MFC after: 1 week
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
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
Sponsored by: The FreeBSD Foundation MFC after: 1 week
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
Sponsored by: The FreeBSD Foundation MFC after: 1 week
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
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
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
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.
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.
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.
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.
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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.
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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.
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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.
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
Sponsored by: The FreeBSD Foundation MFC after: 1 week
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
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
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
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
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
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
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
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
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")
debug: classified in
03-filenames_plain1 by
'sys/arm/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Reviewed by: adrian Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/sys/pmc.h'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
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
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
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
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
debug: classified in
03-filenames_plain1 by '['sys/arm/',
'sys/arm64/', 'sys/dev/', 'sys/riscv/']'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
`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
debug: Commit manually moved from "unknown" to "hardware".
Submitted by: Brian Poole <brian90013@gmail.com>
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Add the SuperSpeedPlus speed names. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57197
debug: classified in
03-filenames_plain1 by
'usr.sbin/usbdump/'
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
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
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
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
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
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/riscv/'
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
debug: classified in
03-filenames_plain1 by
'sys/riscv/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
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
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Network-related commands, library, and kernel.
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
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
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
debug: classified in
05-summary-prefix by 'pf:'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet6/'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
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
debug: classified in
03-filenames_plain1 by
'sys/net/'
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
debug: classified in
03-filenames_plain1 by
'sys/net/'
Requested by: glebius Reviewed by: pouria, glebius MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D60247
debug: classified in
03-filenames_plain1 by '['sys/netinet/',
'sys/netinet6/']'
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
debug: classified in
03-filenames_plain1 by
'sys/net/'
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
debug: classified in
03-filenames_plain1 by
'sys/net/'
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
debug: classified in
03-filenames_plain1 by
'usr.sbin/ctld/'
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
debug: classified in
03-filenames_plain1 by
'sys/netipsec/'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet6/'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
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
debug: classified in
03-filenames_plain1 by
'sys/net/'
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
debug: classified in
03-filenames_plain1 by
'sys/net/'
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
debug: classified in
03-filenames_plain1 by
'sys/netgraph/'
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
debug: classified in
03-filenames_plain1 by
'sys/netgraph/'
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")
debug: classified in
03-filenames_plain1 by
'sys/net/'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
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
debug: classified in
03-filenames_plain1 by
'sys/net80211/'
* 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
debug: classified in
03-filenames_plain1 by
'sys/net80211/'
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
debug: classified in
03-filenames_plain1 by
'sys/netlink/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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")
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")
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")
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
pf: convert DIOCXBEGIN, DIOCXROLLBACK, DIOCXCOMMIT to netlink
Sponsored by: Rubicon Communications, LLC ("Netgate")
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")
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")
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")
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")
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/net/'
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")
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
No functional change.
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
While here get rid of the aesthetically unpleasing '== false' construct.
Sponsored by: Rubicon Communications, LLC ("Netgate")
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
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
debug: classified in
03-filenames_plain1 by
'sys/net/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by '['sys/net/',
'sys/netinet/', 'sys/netinet6/']'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
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
debug: classified in
03-filenames_plain1 by
'sys/net/'
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
debug: classified in
03-filenames_plain1 by
'sys/netgraph/'
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
debug: classified in
03-filenames_plain1 by '['sys/net/',
'sys/net80211/', 'sys/netgraph/', 'sys/netinet/',
'sys/netinet6/', 'sys/netipsec/', 'sys/netpfil/']'
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.
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
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")
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
05-summary-prefix by 'pf:'
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
debug: classified in
03-filenames_plain1 by
'sys/net/'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
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
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")
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
Remove a level of indentation, improve line breaks, remove single use variables. No functional change.
debug: classified in
03-filenames_plain1 by
'sys/netinet6/'
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
debug: classified in
03-filenames_plain1 by
'sys/netinet6/'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
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")
debug: classified in
03-filenames_plain1 by
'sys/net/'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by '['sys/net/',
'sys/netpfil/']'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netlink/'
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
debug: classified in
03-filenames_plain1 by
'sys/netlink/'
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
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")
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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")
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")
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")
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet6/'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet6/'
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>
debug: Commit manually moved from "unknown" to "network".
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")
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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
debug: classified in
03-filenames_plain1 by
'sys/net/'
400GBase-FR4 is yet another 400G optical standard Differential Revision: https://reviews.freebsd.org/D61135 Reviewed by: kbowling Sponsored by: Netflix
debug: classified in
03-filenames_plain1 by
'sys/net/'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet6/'
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
debug: classified in
03-filenames_plain1 by
'sys/netinet6/'
Stuff in man section 8 (other than networking).
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
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
debug: classified in
03-filenames_plain1 by '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
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
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
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
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
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
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
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
debug: classified in
03-filenames_plain1 by 'stand/'
Tested by: adam.mizerski@ovhcloud.com Sponsored by: OVHcloud Pull Request: https://github.com/freebsd/freebsd-src/pull/2446
debug: classified in
03-filenames_plain1 by
'libexec/'
Sponsored by: Netflix
debug: classified in
03-filenames_plain1 by 'stand/'
debug: classified in
03-filenames_plain1 by 'sbin/'
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
debug: classified in
03-filenames_plain1 by
'libexec/'
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
debug: classified in
03-filenames_plain1 by 'stand/'
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
debug: classified in
03-filenames_plain1 by
'libexec/'
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
debug: classified in
03-filenames_plain1 by 'sbin/'
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
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
debug: classified in
03-filenames_plain1 by 'sbin/'
dhclient: export the Captive Portal URI to the script Differential Revision= https://reviews.freebsd.org/D60259
debug: classified in
03-filenames_plain1 by 'sbin/'
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
debug: classified in
03-filenames_plain1 by 'sbin/'
Reviewed by: dteske, olce Approved by: christos (mentor) MFC after: 1 week Sponsored by: fme AG Differential Revision: https://reviews.freebsd.org/D60408
debug: Commit manually moved from "unknown" to "admin".
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
debug: classified in
03-filenames_plain1 by
'libexec/'
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
debug: classified in
03-filenames_plain1 by 'stand/'
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
Sponsored by: The FreeBSD Foundation MFC after: 3 days
debug: classified in
03-filenames_plain1 by
'libexec/'
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
debug: classified in
03-filenames_plain1 by
'libexec/'
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
debug: classified in
03-filenames_plain1 by
'libexec/'
Get the log message right! Fix default allowed chars (untabify clobbered TAB) Add a couple more : messages to help debugging.
debug: classified in
03-filenames_plain1 by
'libexec/'
The description was out of sync wrt return values. 1. invalid var 2. invalid val 3. var not in allowed list
debug: classified in
03-filenames_plain1 by
'libexec/'
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")
debug: classified in
03-filenames_plain1 by 'sbin/'
Use options to set ssv_{allow,only,extra}
Improve the documentation.
Add a test harness for safe_set_var.
debug: classified in
03-filenames_plain1 by
'libexec/'
Also use $ssv_extra$ssv_only as the default for $ssv_only has '-' which must be last in the character class.
debug: classified in
03-filenames_plain1 by
'libexec/'
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
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
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
debug: moved to admin because
'Need to be grouped with
afe1dec7425c9f3bec1aafcfed15229a385894eb'
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'
debug: classified in
03-filenames_plain1 by
'libexec/'
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.
debug: classified in
03-filenames_plain1 by
'libexec/'
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.
debug: classified in
03-filenames_plain1 by
'libexec/'
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
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
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
* 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
debug: classified in
03-filenames_plain1 by 'sbin/'
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
debug: classified in
03-filenames_plain1 by
'libexec/'
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
debug: classified in
03-filenames_plain1 by 'sbin/'
tcpsso incorrectly referred to the optname instead of the level name/number. MFC after: 2 weeks
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
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
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
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
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
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.
debug: classified in
03-filenames_plain1 by 'sbin/'
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
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")
debug: classified in
03-filenames_plain1 by 'sbin/'
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")
debug: classified in
03-filenames_plain1 by 'sbin/'
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
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@
debug: classified in
03-filenames_plain1 by 'sbin/'
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
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")
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")
debug: classified in
03-filenames_plain1 by
'ObsoleteFiles.inc'
debug: moved to admin because
'Need to be grouped with
21ac4761428c60c48bb5c3a0367a04dae164c414'
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
Fixes: https://cgit.freebsd.org/src/commit/?id=1e370f038778 ("rtld: stop using unbound alloca()") Sponsored by: The FreeBSD Foundation MFC after: 1 week
debug: classified in
03-filenames_plain1 by
'libexec/'
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
debug: classified in
03-filenames_plain1 by
'libexec/'
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
debug: classified in
03-filenames_plain1 by
'libexec/'
debug: classified in
03-filenames_plain1 by
'libexec/'
debug: classified in
03-filenames_plain1 by
'libexec/'
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
debug: classified in
03-filenames_plain1 by 'sbin/'
rtld: extract donelist heap allocation into donelist_alloc() Sponsored by: The FreeBSD Foundation MFC after: 1 week
debug: classified in
03-filenames_plain1 by
'libexec/'
rtld: add RtldLockState initializer Sponsored by: The FreeBSD Foundation MFC after: 1 week
debug: classified in
03-filenames_plain1 by
'libexec/'
rtld: add lockstate_rlocked() Sponsored by: The FreeBSD Foundation MFC after: 1 week
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
debug: classified in
03-filenames_plain1 by
'libexec/'
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
debug: classified in
03-filenames_plain1 by 'sbin/'
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
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
libusb has one speed for all SSP links, so print "SUPER+ (>=10Gbps)". Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57196
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
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
debug: classified in
03-filenames_plain1 by 'sbin/'
Obtained from: OpenBSD, deraadt <deraadt@openbsd.org>, 3c04d8eee2
Sponsored by: Rubicon Communications, LLC ("Netgate")
debug: classified in
03-filenames_plain1 by 'sbin/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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.
debug: classified in
04-filenames_plain2 by 'lib/'
MFC after: 2 weeks
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
03-filenames_plain1 by
'secure/lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
- 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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
05-summary-prefix by 'lib.*:'
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
debug: classified in
04-filenames_plain2 by 'lib/'
Fixes: use of external filter programs, tests MFC after: together with 61c70dc16
debug: classified in
04-filenames_plain2 by 'lib/'
`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
debug: classified in
04-filenames_plain2 by 'lib/'
1. abstime calculation 2. rdlock flags judgement Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D60958
debug: classified in
04-filenames_plain2 by 'lib/'
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
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
debug: classified in
04-filenames_plain2 by 'lib/'
Reviewed by: aokblast, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60838
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
Reviewed by: aokblast, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60838
debug: classified in
05-summary-prefix by 'lib.*:'
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60838
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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)
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
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
debug: classified in
04-filenames_plain2 by 'lib/'
Update expat_config.h and the libbsdxml(3) manpage to reflect the most recent import. MFC after: 3 days MFC with: 765f30b9f3af
debug: classified in
04-filenames_plain2 by 'lib/'
zpool: Add zpool status -vv error ranges (#17864) Add necessery change to libzfs/Makefile (cherry picked from commit e903655c50fe2e710a4cdfe6e638454012ef6324)
debug: classified in
05-summary-prefix by 'zfs:'
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
debug: classified in
03-filenames_plain1 by
'sys/ufs/'
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
debug: classified in
03-filenames_plain1 by
'sys/fs/'
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
debug: classified in
03-filenames_plain1 by
'sys/ufs/'
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
debug: classified in
03-filenames_plain1 by
'sys/fs/'
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
debug: classified in
03-filenames_plain1 by
'sys/fs/'
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
debug: Commit manually moved from "unknown" to "filesystems".
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
debug: classified in
03-filenames_plain1 by
'sys/fs/'
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
debug: classified in
03-filenames_plain1 by
'sys/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
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
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
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
debug: classified in
03-filenames_plain1 by
'sys/ufs/'
MFC after: 1 month Fixes: https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
debug: classified in
03-filenames_plain1 by
'sys/fs/'
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
debug: classified in
03-filenames_plain1 by
'sys/fs/'
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")
debug: classified in
03-filenames_plain1 by
'sys/fs/'
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")
debug: classified in
03-filenames_plain1 by
'sys/fs/'
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
debug: classified in
03-filenames_plain1 by
'sys/fs/'
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
debug: classified in
03-filenames_plain1 by
'sys/fs/'
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
debug: classified in
03-filenames_plain1 by
'sys/fs/'
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
debug: classified in
03-filenames_plain1 by
'sys/fs/'
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
debug: classified in
03-filenames_plain1 by
'sys/fs/'
Kernel stuff (other than networking, filesystems, and drivers).
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
"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
debug: classified in
04-filenames_plain2 by 'sys/'
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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")
debug: classified in
04-filenames_plain2 by 'sys/'
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")
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
Reviewed by: wulf Differential Revision: https://reviews.freebsd.org/D60275
debug: classified in
04-filenames_plain2 by 'sys/'
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
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
debug: classified in
03-filenames_plain1 by
'sys/fs/'
debug: moved to kernel because
'Need to be grouped with
850d4562928ea9308dd9188d5014bcabe7049938'
Submitted by: Yuri Tkachenko <yura.tkachenko at gmail.com> MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D60392
debug: classified in
04-filenames_plain2 by 'sys/'
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")
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")
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
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
debug: classified in 01-style
by '[tT]ypo'
debug: moved to kernel because
'Need to be grouped with
42490d5cd29d7a6acd3c28dacfbdc527c2d39028'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D60350
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
See the manpage addition for rationale Reviewed by: ziaee, kib Approved by: ziaee, kib Differential Revision: https://reviews.freebsd.org/D59930
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
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
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
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
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
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
debug: classified in
03-filenames_plain1 by
'sys/net/'
debug: moved to kernel because
'Need to be grouped with
398254f9999eb1af5f0842570111d584aaf8d01a'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
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
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
debug: classified in
04-filenames_plain2 by 'sys/'
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")
debug: classified in
04-filenames_plain2 by 'sys/'
Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D49166
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
For better readability. No functional change (intended). MFC after: 3 days Sponsored by: The FreeBSD Foundation
debug: classified in
04-filenames_plain2 by 'sys/'
No functional change (intended). MFC after: 3 days Sponsored by: The FreeBSD Foundation
debug: classified in
04-filenames_plain2 by 'sys/'
No functional change (intended). MFC after: 3 days Sponsored by: The FreeBSD Foundation
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
MFC after: 1 week
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
They are ignored by clang.
No functional changes (nor .o changes).
Sponsored by: Rubicon Communications, LLC ("Netgate")
debug: classified in
04-filenames_plain2 by 'sys/'
Sorts out powerpc.QORIQ64 build failure.
Sponsored by: Rubicon Communications, LLC ("Netgate")
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
Sponsored by: The FreeBSD Foundation MFC after: 1 week
debug: classified in
04-filenames_plain2 by 'sys/'
The omitted ABI is compat32 on arm64, which lacks SV_ASLR. Sponsored by: The FreeBSD Foundation MFC after: 1 week
debug: classified in
04-filenames_plain2 by 'sys/'
Sponsored by: The FreeBSD Foundation MFC after: 1 week
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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/'
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
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
debug: classified in
03-filenames_plain1 by
'sys/dev/'
debug: moved to kernel because
'Need to be grouped with
2c38dc04d6f8bc84620bb3b67c8ccd9f910c4d03'
MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
04-filenames_plain2 by 'sys/'
min() truncates its parameters. MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
- 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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
04-filenames_plain2 by 'sys/'
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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: Commit manually moved from "unknown" to "build".
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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
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
debug: classified in
03-filenames_plain1 by
'share/mk/'
Don't complain about unaligned atomic operations on i386. This same approach is already used for libspl.
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: classified in
03-filenames_plain1 by
'share/mk/'
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
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
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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
Reviewed by: ziaee Discussed with: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60047
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: classified in
05-summary-prefix by 'build:'
Stream-optimized VMDK support was merged to stable/15 with __FreeBSD_version 1501504. Sponsored by: Amazon
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: classified in
02-filenames_wildcards by
'release/.*'
MFC after: 1 week Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D60453
debug: Commit manually moved from "unknown" to "build".
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
debug: classified in
02-filenames_wildcards by
'release/.*'
Reviewed by: jlduran, imp MFC after: 2 months Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D60455
debug: classified in
02-filenames_wildcards by
'release/.*'
"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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
This helps make the dependent Makefile (and the values contained within) easier to catch when upgrading atf in the future. MFC after: 1 week
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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")
debug: classified in
03-filenames_plain1 by
'share/mk/'
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 ...")
debug: classified in
02-filenames_wildcards by
'.*Makefile'
Reviewed by: aokblast, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60838
debug: classified in
02-filenames_wildcards by
'.*Makefile'
Event: Oslo Hackaton 2026 Differential Revision: https://reviews.freebsd.org/D61040
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: Commit manually moved from "unknown" to "build".
Differential Revision: https://reviews.freebsd.org/D60943
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: classified in
02-filenames_wildcards by '['.*Makefile',
'release/.*']'
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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
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
debug: Commit manually moved from "unknown" to "build".
Bump new USB changes. Also, update RELNOTE and UPDATING. Sponsored by: The FreeBSD Foundation
debug: Commit manually moved from "unknown" to "build".
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
debug: classified in
02-filenames_wildcards by
'.*Makefile'
debug: classified in
03-filenames_plain1 by
'ObsoleteFiles.inc'
Reviewed by: ae Approved by: ae (mentor)
debug: classified in
03-filenames_plain1 by '['.mailmap',
'share/misc/committers-src.dot',
'usr.bin/calendar/calendars/calendar.freebsd']'
Sponsored by: The FreeBSD Foundation MFC after: 3 days
debug: classified in
03-filenames_plain1 by
'.gitignore'
Reviewed by: jrm (mentor) Approved by: jrm (mentor) Differential Revision: https://reviews.freebsd.org/D60591
debug: classified in
03-filenames_plain1 by
'share/misc/committers-ports.dot'
Reported by: glebius Fixes: https://cgit.freebsd.org/src/commit/?id=e478037df4f1 ("systm.h: Remove unused <sys/kpilite.h>") Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'ObsoleteFiles.inc'
Approved by: kevans (mentor)
debug: classified in
03-filenames_plain1 by
'.mailmap'
And note the commit bit return date of my previous account, freqlabs@. Approved by: kevans (mentor)
debug: classified in
03-filenames_plain1 by
'share/misc/committers-src.dot'
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
debug: classified in
03-filenames_plain1 by
'share/misc/committers-ports.dot'
These ones were unambiguous cases where the Foundation was the only listed copyright holder.
debug: Commit manually moved from "unknown" to "internal".
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
debug: classified in
03-filenames_plain1 by
'.github/'
debug: classified in
03-filenames_plain1 by
'share/misc/bsd-family-tree'
Approved by: jrm (mentor) Differential Revision: https://reviews.freebsd.org/D60912
debug: classified in
03-filenames_plain1 by
'.mailmap'
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
debug: classified in
03-filenames_plain1 by
'tools/tools/git/'
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
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
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
debug: classified in
03-filenames_plain1 by
'tools/test/'
This is the 'stream-optimized' version of the VMDK format. MFC after: 2 weeks Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D60154
debug: classified in
02b-filenames_wildcards2 by
'usr.bin/.*/tests/.*'
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
debug: classified in
03-filenames_plain1 by
'tools/test/'
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
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299223 MFC after: 1 week
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
MFC after: 2 weeks Sponsored by: ConnectWise Pull Request: https://github.com/freebsd/freebsd-src/pull/2465 Reviewed by: imp
debug: classified in
02b-filenames_wildcards2 by
'usr.bin/.*/tests/.*'
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
debug: classified in
03-filenames_plain1 by
'tools/test/'
Workaround for kern.maxfiles limit exceeded. Workaround for SU disk full issue. Added some debug info, if umount(8) returns EBUSY.
debug: classified in
03-filenames_plain1 by
'tools/test/'
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")
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
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
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
For those modules that don't have a manual page spell out full name of a loadable module.
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
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
debug: classified in
02b-filenames_wildcards2 by
'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
debug: classified in
02b-filenames_wildcards2 by
'sbin/.*/tests/.*'
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
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
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
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
This fixes a [CI failure][0]. [0] https://ci.freebsd.org/job/FreeBSD-main-amd64-test/29813/testReport/sbin.dhclient.functional/py/__test_cases_list__/ PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299641 Reviewed by: markj, ngie MFC after: 3 days Sponsored by: The FreeBSD Foundation Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/83
debug: classified in
02b-filenames_wildcards2 by
'sbin/.*/tests/.*'
Fixes: https://cgit.freebsd.org/src/commit/?id=a143197801c6 ("dhclient: Add some regression tests")
debug: classified in
02b-filenames_wildcards2 by
'sbin/.*/tests/.*'
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
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
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")
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
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
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
These could go in other categories, but it's more clear if they're here instead.
MFC after: 3 days Sponsored by: The FreeBSD Foundation
debug: classified in 01-style
by '[wW]hitespace'
Fixes: https://cgit.freebsd.org/src/commit/?id=b9811d13572b ("https://cgit.freebsd.org/src/commit/?id=cd9660: merge level 1 and 2 filename conversion")
debug: classified in 01-style
by '[sS]tyle'
In advance of additional sound(4) work, remove EOL whitespace and mixed tab/space. Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D60442
debug: classified in 01-style
by '[wW]hitespace'
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
debug: classified in 01-style
by '[sS]tyle'
MFC after: 3 days Sponsored by: The FreeBSD Foundation
debug: classified in 01-style
by '[tT]ypo'
Reviewed by: ziaee
debug: classified in 01-style
by '[sS]tyle'
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
debug: classified in 01-style
by '[tT]ypo'
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299990 (typo part) MFC after: 1 week
debug: classified in 01-style
by '[tT]ypo'
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
debug: classified in 01-style
by '[tT]ypo'
'man 3 gethostbyaddr_r' was incorrectly showing 9 arguments.
debug: classified in 01-style
by '[tT]ypo'
debug: classified in 01-style
by '[sS]tyle'
[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
debug: classified in
03-filenames_plain1 by
'contrib/'
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
debug: classified in
03-filenames_plain1 by
'contrib/'
[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
debug: classified in
03-filenames_plain1 by
'contrib/'
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
debug: classified in
03-filenames_plain1 by
'contrib/'
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
debug: classified in
05-summary-prefix by 'contrib/'
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
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")
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")
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
debug: moved to contrib because
'Need to be grouped with
eb8f69902f7de8012a31a85db2f88a54584f81af'
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
debug: Commit manually moved from "unknown" to "contrib".
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
debug: classified in
03-filenames_plain1 by
'crypto/openssl/'
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
debug: classified in
03-filenames_plain1 by
'cddl/contrib/'
`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
debug: classified in
03-filenames_plain1 by
'sys/contrib'
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
debug: classified in
03-filenames_plain1 by
'contrib/'
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.
debug: classified in
03-filenames_plain1 by
'contrib/'
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
debug: classified in
03-filenames_plain1 by
'contrib/'
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
debug: classified in
03-filenames_plain1 by
'contrib/'
[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
debug: classified in
03-filenames_plain1 by
'contrib/'
MFC after: 3 days DIfferential revision: https://reviews.freebsd.org/D60695
debug: classified in
03-filenames_plain1 by
'sys/contrib'
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
debug: classified in
03-filenames_plain1 by
'contrib/'
Reviewed by: ngie MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D60446
debug: classified in
03-filenames_plain1 by
'contrib/'
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
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@
debug: classified in
03-filenames_plain1 by
'contrib/'
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
debug: classified in
05-summary-prefix by 'unbound:'
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
debug: classified in
03-filenames_plain1 by
'contrib/'
[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
debug: classified in
03-filenames_plain1 by
'contrib/'
[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
debug: classified in
03-filenames_plain1 by
'contrib/'
Changes: https://github.com/eggert/tz/blob/2026f/NEWS MFC after: 3 days
debug: classified in
03-filenames_plain1 by
'contrib/'
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'
debug: classified in
03-filenames_plain1 by
'contrib/'
Merge commit 'c51345cf234c029abf8b5f1655f65f6c2ffaaec9' Reviewed by: cperciva MFC after: 3 days Sponsored by: Amazon, Inc.
debug: classified in
03-filenames_plain1 by
'sys/contrib'
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
debug: classified in
03-filenames_plain1 by
'contrib/'
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
debug: classified in
03-filenames_plain1 by
'contrib/'
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
debug: classified in
03-filenames_plain1 by
'contrib/'
MFC after: 1 week Event: Oslo Hackathon 2026
debug: classified in
03-filenames_plain1 by
'contrib/'
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
debug: classified in
03-filenames_plain1 by
'contrib/'
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
debug: classified in
03-filenames_plain1 by
'contrib/'
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
debug: classified in
03-filenames_plain1 by
'contrib/'
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
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.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
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
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.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
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
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
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
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.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
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
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
umb: Update man page HISTORY It was merged to stable/14 prior to FreeBSD 14.4.
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.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
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.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
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
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.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
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
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
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
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
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.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
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
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.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
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
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.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
Apparently this device might need a separate driver altogether. This reverts commit 8dac0bdb4df0815e14db219e9a7fb5d0be5737b8.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
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
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.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
Not classified automatically, and waiting for manual attention.
-- no commits in this category this week --
Dates:
cgit.freebsd.org/src. Git accurately records the
order of commits, but not their dates.Automatic grouping:
This reverts commit \\b([0-9a-fA-F]{40})\\b
and the hash was found in this week's commits.
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)