This is a display of mostly-automatically-classified git commits from 2026-10-01 to 2026-12-31.
This report is still in progress.
DEBUG: This version of the report is primarily for checking the classifiers, and therefore contains extra information (in this colour).
Table of contents and commits per category:
| (7) | Highlighted commits (these are copies, not in stats) | |
| 30 | 2.0% | Userland programs |
| 94 | 6.4% | Documentation |
| 508 | 34.7% | Hardware support |
| 134 | 9.1% | Networking |
| 136 | 9.3% | System administration |
| 76 | 5.2% | Libraries |
| 24 | 1.6% | Filesystems |
| 234 | 16.0% | Kernel |
| 51 | 3.5% | Build system |
| 17 | 1.2% | Internal organizational stuff |
| 43 | 2.9% | Testing |
| 22 | 1.5% | Style, typos, and comments |
| 57 | 3.9% | Contrib code |
| 39 | 2.7% | Reverted commits |
| 0 | 0.0% | Unclassified commits |
| 1465 | 100% | total |
| Technical notes about this page |
debug: info about the automatic classification
| num | % | num changed | stage |
|---|---|---|---|
| 40 | 2.7% | 0 | 00-reverts |
| 23 | 1.6% | 0 | 01-style |
| 131 | 8.9% | 0 | 02-filenames_wildcards |
| 42 | 2.9% | 0 | 02b-filenames_wildcards2 |
| 822 | 56.1% | 0 | 03-filenames_plain1 |
| 356 | 24.3% | 0 | 04-filenames_plain2 |
| 20 | 1.4% | 0 | 05-summary-prefix |
| 31 | 2.1% | 0 | Manually-classified commits |
| 0 | 0.0% | 0 | Unclassified commits |
debug: more stats
| num | % | stage |
|---|---|---|
| 0 | 0.0% | Misclassified commits |
| 1434 | 97.9% | Classified commits, no corrections |
debug: groups
| 36 | 2.5% | num in revert |
| 12 | 0.8% | num in fixes |
| 362 | 24.7% | num in consecutive |
| 410 | 28.0% | Commits in groups |
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".
The empty_output variable is normalized to YES or NO, but we were comparing it to TRUE, so the comparison always failed no matter what it was set to. Compare it to YES instead. This feature has been disabled since 2007, so flip the default to NO to preserve the current behavior. Adjust the documentation accordingly. Relnotes: yes PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300676 MFC after: 1 week Fixes: https://cgit.freebsd.org/src/commit/?id=68c35072f914 ("Add an option to make periodic(8) quiet when no output was generated.") Reviewed by: ivy, emaste Differential Revision: https://reviews.freebsd.org/D61435
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
Allow multiple gre tunnels between the same source and destination addresses, distinguished by their incoming gre key. Add greikey and greokey to ifconfig(8) to set the incoming and outgoing keys separately and grekey now sets both. Add a net.link.gre.key_fallback sysctl for backward compatibility and set it to true by default. Also write multikey tests for both IPv4 and IPv6 families. Relnotes: yes Reviewed by: adrian Discussed with: zlei Differential Revision: https://reviews.freebsd.org/D59849
debug: Commit manually moved from "unknown" to "network".
Use the EFI TCG2 protocol, or the legacy TCG protocol on TPM 1.2 firmware, to extend the loader PCRs and record EV_IPL events in the firmware event log. Extend PCR 8 with the final kernel environment and the type, name, and arguments of each loaded boot input. Prefix both record types with versioned, NUL-terminated domain strings. These make the records self-identifying and define an explicit measured policy encoding. Store the complete measured pre-images in the event data so attestation and diagnostic tools can audit the values without an out of band copy. Extend PCR 9 with the initialized contents of kernels, modules, and raw boot inputs, but record only descriptive labels rather than copying file contents into the event log. The Lua module table has no defined traversal order. Retain content ranges as loader-private metadata, then sort the final file list before extending either PCR. This produces repeatable values and excludes failed or subsequently unloaded files. Measure initialized loaded memory rather than source files. This covers zero initialized ELF data while excluding undefined gaps and debugging information. Do not measure entropy, timing data, or GELI key files. Exclude loader passwords and the GELI passphrase from the kernel environment measurement so low entropy secrets do not acquire a public event-log digest or appear in the event data. Measurement remains best effort. Warn and stop measuring after the first firmware or allocation error rather than preventing the system from booting. Validated with the EFI TCG protocol on a ThinkPad T430 TPM 1.2 using coreboot with a measured EDK2 payload. Replaying the loader events reproduced PCRs 8 and 9, and both PCRs repeated across clean boots. TPM 2.0 testing on a commercial AMI EFI firmware likewise produced stable PCRs across clean boots. A raw firmware-log dump decoded by tpm2_eventlog using tpm(4) changes that will come later confirmed the versioned PCR 8 pre-images and the descriptive PCR 9 event data. Reviewed by: imp MFC after: 2 weeks Relnotes: yes Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59141
debug: Commit manually moved from "unknown" to "hardware".
An existing master.passwd with a login name containing a now-disallowed charater will make pwd_mkdb(8) fail until the name is fixed, which blocks passwd(1), chpass(1) and pw(8). Warn users to audit their accounts befroe updating. Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D61507
debug: classified in
03-filenames_plain1 by
'UPDATING'
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/'
MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Qualys, Inc. Reviewed by: oshogbo Differential Revision: https://reviews.freebsd.org/D60170
debug: classified in
04-filenames_plain2 by
'usr.bin/'
sdiotool: Fix writes being issued as reads sdio_write_1() passed 0 as the write flag to sdio_rw_direct(), so every write was performed as a read and the value was never sent to the card. Pass 1 so that the data is actually written. Reviewed by: oh Differential Revision: https://reviews.freebsd.org/D61026
debug: classified in
04-filenames_plain2 by
'usr.bin/'
sdiotool: Use the system bool type linux_compat.h redefined bool as int8_t, overriding the _Bool definition provided by sys/types.h. This changes the size and semantics of bool and conflicts with headers that include stdbool.h, such as cam/cam.h. Rely on the system definition instead. Reviewed by: oh Differential Revision: https://reviews.freebsd.org/D61027
debug: classified in
04-filenames_plain2 by
'usr.bin/'
sdiotool: Remove the unused -f option The -f option was parsed but never used. Its argument handling was also broken: getopt(3) binds the argument to the last option letter, so "fu:" made -f take no argument at all. Remove it. Reviewed by: oh Differential Revision: https://reviews.freebsd.org/D61028
debug: classified in
04-filenames_plain2 by
'usr.bin/'
sdiotool: Use (void) for functions taking no arguments Use (void) instead of an empty parameter list, as required by style(9), and let the compiler diagnose calls with unexpected arguments. Reviewed by: oh Differential Revision: https://reviews.freebsd.org/D61029
debug: classified in
04-filenames_plain2 by
'usr.bin/'
sdiotool: Do not treat an unknown chip ID as fatal The tool is useful for probing any SDIO card, not only the BCM4330. Print the chip ID, report a failed backplane read, and only note when the ID is not the expected REPLY_MAGIC instead of exiting. Differential Revision: https://reviews.freebsd.org/D61030
debug: classified in
04-filenames_plain2 by
'usr.bin/'
top(1) already supports interactive command filtering using the '/' key. Support it also with a command line argument '-g' / '--grep'. Reviewed by: kib Obtained from: OpenBSD MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D61160
debug: classified in
04-filenames_plain2 by
'usr.bin/'
ok_to_export() (su.c) and export() (login.c) read s[n] before strncmp(s, *pp, n) confirms s is at least n bytes long, where n is the length of the blocked variable name. A PAM environment entry shorter than that name over-reads past its heap allocation. Check strncmp() first; it stops at s's NUL terminator and never reads past the boundary that guarded the s[n] access. MFC after: 1 week Sponsored by: Advanced Micro Devices, Inc. Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com> Reviewed by: des, markj Differential Revision: https://reviews.freebsd.org/D61420
debug: classified in
04-filenames_plain2 by
'usr.bin/'
Implement PID highlighting. This can be activated by pressing 'L' and entering a PID to highlight. Highlighting can be cleared by entering '+' as a PID to highlight. This feature is inspired by the OpenBSD top, which uses 'P' key for that. We have to use 'L' because 'P' is already used for toggling per-CPU statistics. Reviewed by: kib Obtained from: OpenBSD (partially) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D61090
debug: classified in
04-filenames_plain2 by
'usr.bin/'
There is a heap overflow for screenbuf originating from the top import to the tree. The i_process()/u_process() functions write a terminating NUL one byte past each screenbuf line slot when the line fills the slot, which is a 1-byte heap overflow on the last slot. The display_resize() function allocates screen_width bytes per line. i_process() and u_process() cut lines to screen_width characters and then stpcpy() them into the slot, which writes screen_width + 1 bytes. line_update() can do the same with *old = ch. For inner slots, the NUL lands in byte 0 of the next slot. This can corrupt the saved contents used when updating the next line. For the last slot, it writes one byte past the end of screenbuf. Fix by allocating (screen_width + 1) bytes per line and updating the line offsets to fit the terminating NUL. Reviewed by: kib Reported by: llm-postcr MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D61593
debug: classified in
04-filenames_plain2 by
'usr.bin/'
powerpc64 is getting the same PROC_LA_CTL interface as amd64, but calls the full address space la52 instead of la57. Take the mode name and the constants from whichever one machine/procctl.h defines. Reviewed by: kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D61331
debug: classified in
04-filenames_plain2 by
'usr.bin/'
The 0x40 feature bit is la57 on amd64 and la52 on powerpc64. Tag each feature with the machine it belongs to and only accept and show the names that match the file's e_machine, so la57 is only known for amd64 files and la52 only for powerpc64 ones. Reviewed by: kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D61331
debug: classified in
04-filenames_plain2 by
'usr.bin/'
Use copy_file_range(2) instead of our own inefficient and unreliable attempt at detecting holes. If copy_file_range(2) is not available, which in theory should be never, we fall back to a simple read(2) / write(2) loop which makes no attempt to copy holes. This should speed up pax copy mode and cpio passthrough mode significantly. This includes refactoring much of the existing I/O code to use the size_t and ssize_t instead of int where appropriate. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: obiwac Differential Revision: https://reviews.freebsd.org/D58470
debug: classified in
03-filenames_plain1 by '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]'
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60963
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60963
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
The avgfilesize description does not say what the unit is (sectors, blocks, bytes). Extend the description to mention that this parameter is in bytes. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298705 Event: Oslo Hackathon 2026 Differential Revision: https://reviews.freebsd.org/D61047
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Reviewed by: olce Differential Revision: https://reviews.freebsd.org/D61179
debug: classified in
03-filenames_plain1 by
'RELNOTES'
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
MFC after: 3 days Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D58476
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
make.conf(5) says make variables that are for the ports tree should be documented in ports(7). Add this from the porters handbook. MFC after: 3 days Reviewed by: alven Event: FreeBSD 2026 Vendor Summit Differential Revision: https://reviews.freebsd.org/D61272
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
On FreeBSD, the errno man page is in section 2, not section 3.
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]'
Requested by: wosch Sponsored by: The FreeBSD Foundation 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]'
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]'
Reported by: des (prev. commit)
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Signed-off-by: _ov4 <ov4@ov4.org> Reviewed-by: ngie Pull-Request: https://github.com/freebsd/freebsd-src/pull/2526
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
libsys/poll.2: bump .Dd for the prior change MFC after: 1 week MFC with: 72a80a4733b2
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
libsys/ppoll.2: fix .Dd modification to manpage Reported by: gcc 14 Fixes: https://cgit.freebsd.org/src/commit/?id=89d6ddee2028 ("libsys/poll.2: bump .Dd for the prior change")
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
+ Increase portability by never starting content lines with symbols + Improve search results by adding tunables to the variable database + Improve search result consistency by correcting description style MFC after: 3 days
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Crossreferences in titles are strongly discouraged and incompatible with our own tooling. This is a wontfix by most of manpages ecosystem because it is bad editorial style in the first place. MFC after: 3 days
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Crossreferences in titles are strongly discouraged and incompatible with our own tooling. This is a wontfix by most of manpages ecosystem because it is bad editorial style in the first place. MFC after: 3 days
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Crossreferences in titles are strongly discouraged and incompatible with our own tooling. This is a wontfix by most of manpages ecosystem because it is bad editorial style in the first place. MFC after: 3 days
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Align description with EuroBSD netgraph document descriptions rewrite. MFC after: 3 days
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Reported by: bjk
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
And remove the duplicated list from the description of the condition variable. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Mention the extended locale (_l) versions of strtol(3), strtoul(3), strtod(3), wcstol(3), and wcstod(3) and point to xlocale(3). While here, add missing serial commas in function lists and widen the strtol(3) RETURN VALUES table columns to fit INTMAX_MIN/INTMAX_MAX. Obtained from: https://github.com/apple-oss-distributions/libc (partially) Sponsored by: Klara, Inc.
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Fixes: https://cgit.freebsd.org/src/commit/?id=76edfabbecde ("libc: Document support for binary integers.") Sponsored by: Klara, Inc.
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
+ The old one renders broken because Xr is not correct/portable in Nd + Take this opportunity to explain it better using mlock description MFC after: 3 days Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D61334
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
MFC after: 3 days
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Oraganize SYNOPSIS into sysctls and tunables, and remove read-only MIB count. MFC after: 3 days
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
Normally I am against tabbing them over so far to align the list, but in these lists actually the page is 862 lines rendered aligned or using indent, so aligning it improves readability without scolling regression. MFC after: 3 days
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
MFC after: 3 days
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
An existing master.passwd with a login name containing a now-disallowed charater will make pwd_mkdb(8) fail until the name is fixed, which blocks passwd(1), chpass(1) and pw(8). Warn users to audit their accounts befroe updating. Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D61507
debug: classified in
03-filenames_plain1 by
'UPDATING'
This manual used imr_interface when describing the second field of struct ip_mreqn, but sys/netinet/in.h names that field imr_address. Note that ip_mreq below does have imr_interface which is unchanged. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300680 MFC after: 3 days Reviewed by: ziaee Closes: https://github.com/freebsd/freebsd-src/pull/2553
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
The SYNOPSIS .Bd and the FILES .Bl were both left open, producing two mandoc block-nesting errors. Reduce SYNOPSIS to the .Cd line man4 style calls for, and close the FILES list. MFC after: 3 days Reviewed by: ziaee, ngie Differential Revision: https://reviews.freebsd.org/D61486
debug: classified in
02-filenames_wildcards by
'.*\.[1-9]'
The default indent did not serve well. No content change. MFC after: 3 days
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/'
nvme: Byte-swap the nsid in the Get/Set Features command builders nvme_admin_get_feature_cmd() and nvme_admin_set_feature_cmd() stored the namespace ID in the command without converting it to little endian, unlike the other command building functions. Any caller passing a non-zero namespace ID would send the wrong namespace ID on big endian machines. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=7a9e4375316b MFC after: 1 week Sponsored by: Spectra Logic Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
debug: classified in
03-filenames_plain1 by
'sys/dev/'
nvme: Mask the fields in the Format NVM command builder
nvme_admin_format_cmd() did not mask any of the fields it composes
into cdw10, so an out of range value in one field would corrupt
neighboring fields. In particular, an LBA format index greater
than 15 would bleed into the metadata settings and protection
information fields. It also had no support for LBA format indexes
above 15, which NVMe 2.0 encodes via the separate LBAFU field.
Mask all of the fields, and encode bits 5:4 of the LBA format index
in the LBAFU field (cdw10 bits 13:12).
Also reject out of range LBA format indexes in camcontrol's
nvformat global (-G) mode, which has no namespace data to validate
against. The per-namespace mode already validates the index
against NLBAF.
sys/dev/nvme/nvme.h:
Mask the SES, PIL, PI, MSET and LBAF fields in
nvme_admin_format_cmd() and encode the upper two bits of
the LBA format index in LBAFU.
sbin/camcontrol/nvformat.c:
Reject LBA format indexes greater than 63 in -G mode.
Reported by: llm-postcr
Fixes: https://cgit.freebsd.org/src/commit/?id=7a9e4375316b
Fixes: https://cgit.freebsd.org/src/commit/?id=80f090111ae4
MFC after: 1 week
Sponsored by: Spectra Logic
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
debug: Commit manually moved from "unknown" to "hardware".
nvme: Fix the data length in the Reservation Report command builder nvme_ns_resv_report_cmd() put its length argument, which callers supply in bytes, directly into cdw10. The NUMD field is a 0's based count of dwords, so the command asked the controller to transfer nearly four times the size of the supplied data buffer. In practice controllers limit the transfer to the length described by the PRP entries, which is why this worked in testing, but the command was incorrect. Convert the byte count to a 0's based dword count in the builder. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=7a9e4375316b MFC after: 1 week Sponsored by: Spectra Logic Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
debug: classified in
03-filenames_plain1 by
'sys/dev/'
nvme: Restore the host memory buffer size calculation When the nvme_ctrlr_cmd_set_feature() call in nvme_ctrlr_hmb_enable() was rewritten for the widened Set Features API, the HSIZE calculation reverted to dividing by a hard coded 4096 instead of the controller page size, undoing commit 3740a8db13ba. The Host Memory Buffer Size field is in units of the current memory page size (CC.MPS), so the wrong size would be programmed on controllers configured with a page size other than 4KB. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=7a9e4375316b MFC after: 1 week Sponsored by: Spectra Logic Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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/'
`sys/kernel.h` must be included for all kernel drivers, per driver(9). `sys/kernel.h` provides defines for `SI_*`, which `EARLY_DRIVER_MODULE(..)` in `sys/bus.h` relies on and the latter header is not "self-standing". Found when running `make tinderbox`. Fixes: https://cgit.freebsd.org/src/commit/?id=83d0eed50106 ("lan867xphy: New driver for Microchip ...")
debug: classified in
03-filenames_plain1 by
'sys/dev/'
ufshci: detect completions with the completion notification register The single doorbell completion scan took a cleared doorbell bit as a completion. A bit that was never set reads the same, so a slot whose doorbell was not rung yet, or one that a reset wiped, looked complete and was finished with a stale descriptor. UFSHCI 3.0 added UTRLCNR, which the controller sets when it completes a request and the driver already clears afterwards. Use it to find completed slots on a 3.0 or later controller. Older controllers keep the doorbell check, and the task management list has no such register. Reviewed by: imp Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D61111
debug: classified in
03-filenames_plain1 by
'sys/dev/'
ufshci: add debug aids for driving the recovery path The reset and recovery paths only run when the hardware fails, so they never ran on an emulated controller. The failure path also took the controller offline without logging anything. Add the force_reset, drop_next_ios and drop_next_admins sysctls to drive these paths, and log when the controller fails. The aborts the watchdog sends must go out, so the task management queue is never dropped. Reviewed by: imp Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D61112
debug: classified in
03-filenames_plain1 by
'sys/dev/'
ufshci: claim a slot before completing it A request is completed with the queue lock dropped, because the completion callback may submit the next request and take that lock again. The completion scan checked a slot under the lock, dropped the lock, and only then completed the request, with the slot still marked scheduled. The failure path and the abort completion look for such slots under the same lock, so one of them could pick the same slot in that window. The request was then completed twice, freed twice, and its CCB went back to CAM twice. After a reset every in-flight slot reads as done at once, so the window was easy to hit. No existing state could mark that window. FREE would hand the slot to a new request while the old completion still reads it, RESERVED means a submit in progress, and NEED_ERROR_HANDLING is about to mean a request that a reset has claimed but nobody has completed yet. Add a completing state. Every path that completes a slot sets it under the lock before dropping the lock, and every path skips a slot in that state. The abort completion now takes only a slot that is still scheduled, where it used to take anything that was not free. Reviewed by: imp Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D61113
debug: classified in
03-filenames_plain1 by
'sys/dev/'
ufshci: keep a slot for admin requests The slot reserve step handed any free slot to whoever asked first, so I/O could fill the queue and leave no slot for the driver's own admin commands, which a reset sends through the same queue. A full queue was also reported to CAM as busy, and CAM used up its retries on that within microseconds. Keep the last slot for admin requests and give CAM one opening fewer, since letting CAM fill every I/O slot cut the throughput sharply. On a full queue, freeze the device queue and requeue the request. Remove the unused reserve_admin_slot hook. Reviewed by: imp Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D61114
debug: classified in
03-filenames_plain1 by
'sys/dev/'
ufshci: tear down the controller in a safe order Detach freed the request queues while the interrupt, the watchdog or a running reset could still use them. It also left the controller running, so a pending interrupt could hit the next attach before its queues existed. Tear down the interrupt, stop the watchdogs, free the task queue, disable the controller, and only then destroy the queues. A stopped watchdog stays stopped, so a reset still running cannot arm it again. A reset requested after the task queue is freed is ignored. Reviewed by: imp Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D61115
debug: classified in
03-filenames_plain1 by
'sys/dev/'
ufshci: reclaim in-flight requests across a reset in SDB mode A reset wipes the controller's request list, so a request that was in flight never completes. Its slot stayed scheduled, the watchdog timed it out again, and the next reset went round the same way. CAM never got the request back. Claim in-flight requests when the queue is disabled and return them as aborted once it is back. If the reset fails first, the failure path completes them instead. Reviewed by: imp Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D61116
debug: classified in
03-filenames_plain1 by
'sys/dev/'
ufshci: requeue requests that a reset aborted A request taken back by a reset was reported to CAM as an error, which used up a retry. A few resets in a row failed the I/O even though the device never saw it. Pass the overall command status to the completion callback and requeue aborted requests. The polled completion carries it too, so the passthrough ioctl reports it instead of a placeholder zero. The abort path now reports an invalid status instead of aborted, so a command that never finishes still uses up its retries. Reviewed by: imp Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D61117
debug: classified in
03-filenames_plain1 by
'sys/dev/'
ufshci: hold back I/O during a reset The disable path only claims what is in flight at that moment. An I/O submitted after a reset was requested rang a doorbell that the reset then wiped, so it was lost. An I/O sent as soon as the queue was back reached the device before the bring-up had initialized it, and the device answered NOT READY. Keep such an I/O on a list instead, without a slot, from the moment a reset is requested until the bring-up has finished, and send the list in order then. A request that a reset returned to CAM comes back while the list is still held, so it waits there too. A completion sends the next one when the slots have run out. If the controller fails first, the failure path completes the list with an error. Admin and task management requests still go out, because the reset task waits on its own commands and the watchdog sends the aborts. This is how nvme(4) holds requests while a queue is in recovery. Reviewed by: imp Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D61118
debug: classified in
03-filenames_plain1 by
'sys/dev/'
ufshci: fail the controller when a polled command never completes The reset task waits on its own polled bring-up commands. If one was lost, nothing could complete it, and the poll panicked after ten seconds. Fail the controller instead. The failure path completes every outstanding request, including the polled one, so the poll returns an error to its caller. A polled command is only sent while the controller is being brought up or by the passthrough ioctl, and a lost one means the controller is not usable anyway. Reviewed by: imp Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D61119
debug: classified in
03-filenames_plain1 by
'sys/dev/'
ufshci: tell CAM when the controller is gone for good When the controller failed for good, CAM was not told, so its disks stayed and every command to them failed. Post AC_LOST_DEVICE from the failure path so CAM removes them. Reviewed by: imp Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D61120
debug: classified in
03-filenames_plain1 by
'sys/dev/'
ufshci: try the link startup more than once A device that is still powering on may not answer the first DME_LINKSTARTUP, and the driver gave up after one try. Try up to three times. Both attach and reset use this path. Reviewed by: imp Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D61121
debug: classified in
03-filenames_plain1 by
'sys/dev/'
ufshci: report the SCSI status and sense to CAM A CHECK CONDITION was reported to CAM as a transport error without valid sense, so CAM retried blindly. After a reset the device answers NOT READY, and those retries ran out and detached the disk. Report the SCSI status and sense with CAM_AUTOSNS_VALID, and freeze the device queue on a SCSI status error. A GOOD status with a failed response is still an error. Stop logging every CHECK CONDITION. Reviewed by: imp Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D61122
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Check the requested baud rate in uchcom_pre_param() instead of working around it in uchcom_calc_baudrate(), where a rate of 0 caused a divide-by-zero. The pre_param callback is the proper place for this check. Reviewed by: aokblast Differential Revision: https://reviews.freebsd.org/D61127
debug: classified in
03-filenames_plain1 by
'sys/dev/'
- Add CLK_TYPE_GATED_FIXED with GPIO-based gate control. - Support optional vdd-supply regulator. - Delay clknode registration until parent clock and other dependencies are present (via new_pass). While I'm in, switch license header to the new SPDX format. MFC after: 2 weeks Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D58103
debug: classified in
03-filenames_plain1 by
'sys/dev/'
UMC counter register writes do not take effect while no counter in the channel is enabled. Reserve the last counter slot of each UMC channel and keep it enabled with EventSelect=0 so writes to the remaining slots take effect. Reserved slots are not exposed to MI code. UMC perfmon MSRs are package-scoped. A per-socket reference count arms the reserved slots on the first amd_pcpu_init() for a socket and disarms them on the last amd_pcpu_fini(). Reviewed by: mhorne Sponsored by: AMD Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com> Pull Request: https://github.com/freebsd/freebsd-src/pull/2422
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Support 400GBase-FR4 optics, allowing the driver to report "Ethernet autoselect (400GBase-FR4 <full-duplex>)" for FR4 media. Differential Revision: https://reviews.freebsd.org/D61135 Reviewed by: sumit.saxena_broadcom.com Sponsored by: Netflix
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Touchpads using sampling mode have a sampling task which is run at a certain polling rate. When the system is under load this task may not complete quickly which might stretch the time taken beyond what the polling rate should be, leading to dropped touchpad motion. On my laptop this causes the touchpad to be barely useable when the system is under heavy load, and it is really difficult to move the cursor since so many events are dropped. This change adjusts the sampling loop to schedule the next polling event to take place at a specific time in the future, based on the polling period. If servicing the poll takes longer due to load then the next sample will still be scheduled at its original time. Approved by: wulf, khng (mentor) Differential Revision: https://reviews.freebsd.org/D0914
debug: classified in
03-filenames_plain1 by
'sys/dev/'
- Support 400G-DR4 optics - Support 400G-CR8 and -SR8 with their types, rather than generic 400G-AUI8 - Use the generic 400G-AUI8 for 400G-SR4, rather than mislabeling it -DR4 (We probably should add a 400G-SR media type, but I don't have any to test ATM) - Add missing legacy PAM4 100G LR entry and matching media-selection cases. Reviewed by: sumit.saxena_broadcom.com Differential Revision: https://reviews.freebsd.org/D61162 Sponsored by: Netflix
debug: classified in
03-filenames_plain1 by
'sys/dev/'
bnxt_en driver version has not been updated for a while, updating the version now so it better reflects the current state of the driver. Sponsored by: Broadcom Inc
debug: classified in
03-filenames_plain1 by
'sys/dev/'
For what is worth, since i386 is going away soon and still does not compile. Fixes: https://cgit.freebsd.org/src/commit/?id=cd96657b6708 ("amdsmu: Print how long system spent in S0i3") Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Copy both the vendor and device IDs from the card common CIS if they are absent in a function. These are optional according to the spec. [1] [1] Part E1 SDIO Simplified Specification §16.6 MFC after: 3 days Reviewed by: kibab, imp, adrian Differential Revision: https://reviews.freebsd.org/D60988
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Fix the definition of ATTR_S2_MEMATTR_NC to 0x5, instead of the current 0xf which is the encoding for ATTR_S2_MEMATTR_WB. While at it, add remaining device memory attributes and define missing bitshifts for easier value extraction. Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com> Reviewed by: andrew Sponsored by: Arm Ltd Pull Request: https://github.com/freebsd/freebsd-src/pull/2476
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
PMXEVCNTR_EL0 writes PMEVCNTR<n>_EL0, selected by PMSELR_EL0.SEL. All the counter registers are saved and restored in their own block, so at best saving and restoring this register is pointless. Given that it comes right after writing PMSELR_EL0 with no barrier, at worst it could break things. Remove the register from the switcher code. Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com> Reviewed by: andrew Sponsored by: Arm Ltd Pull Request: https://github.com/freebsd/freebsd-src/pull/2481
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
vmm passes the FEAT_TLBIRANGE field of ID_AA64ISAR0_EL1 to the guest, but also
enables fine-grained traps in the range-based TLBI instructions. This didn't
cause a problem until commit 5549785
("arm64 pmap: use range-based TLBI instructions"); following this commit, the VM
will exit with VM_EXITCODE_REG_EMUL during boot if the host supports FEAT_FGT and
FEAT_TLBIRANGE.
This commit disables fine-grained trapping of these instructions.
Reviewed by: andrew
Sponsored by: Arm Ltd
Pull Request: https://reviews.freebsd.org/D60196
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
Reading Link Default Override uses the E610 Admin Command Interface, whose mutex is initialized only on E610. Calling it on other adapters can hang attach, as observed on X520. Skip the read on non-E610 devices, leaving the cached policy invalid so that the existing link-state guard also skips force-link commands. Reviewed by: kgalazka Fixes: https://cgit.freebsd.org/src/commit/?id=7868958f5c79 ("ix(4): Support Total Port Shutdown on E610") MFC after: 1 week Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D61144
debug: classified in
03-filenames_plain1 by
'sys/dev/'
When 5e6e4f752833 landed, it inadvertently allowed unsupported / unknown
phys with a valid link_info->sig_mode to use media_type uninitialized.
Fix this by returning from those cases that do not assign a media_type
so as to avoid using it uninitialized.
Reported by: imp (forwarding an llm's post-commit review of previous
changes to this file)
Fixes: https://cgit.freebsd.org/src/commit/?id=5e6e4f752833
Reviewed by: imp, kbowling, sumit.saxena_broadcom.com
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D61164
debug: classified in
03-filenames_plain1 by
'sys/dev/'
When vt(4) falls back to vt_vga, vga_init() passes vd_video_dev to vga_pci_repost(), which expects a vgapci(4) device. The framebuffer driver that set it need not provide one: drm-kmod's linux_fb passes the parent of the DRM parent device, which is vgapci for LinuxKPI PCI drivers but the PCI bus for virtio-gpu, whose DRM parent is the virtio PCI transport. On x86, vga_pci_repost() then calls pci_get_class() on the bus, which fails the accessor's KASSERT under INVARIANTS; without INVARIANTS the class reads as 0 and the repost is skipped. Repost only a vgapci device. Signed-off-by: Denis Borovikov <denis.borovikov@gmail.com> Reviewed by: wulf Differential Revision: https://reviews.freebsd.org/D60880
debug: classified in
03-filenames_plain1 by
'sys/dev/'
uart_cpu_getdev() lets hw.uart.console override the FDT, but uart_getenv() maps an "mm:" address with uart_bus_space_mem, which is only assigned after the FDT probe. On riscv and arm it is still NULL at that point, so bus_space_map() faults before there is a console. On riscv this happens on any EFI boot where the firmware provides an SPCR table, since the loader turns it into hw.uart.console. Initialize uart_bus_space_mem to fdtbus_bs_tag, as uart_cpu_arm64.c does with &memmap_bus (See also 0624eddcffefe). PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299089 Reviewed by: mhorne MFC after: 1 week Signed-off-by: Rick Richard <rick@sloservers.com>
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Reviewed by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D61134
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Family 19h processors with PerfMonV2 use the Family 1Ah DF encoding. Selecting it by family alone drops the upper unit mask bits, and most DF events count zero. Reviewed by: Ali Mashtizadeh <ali@mashtizadeh.com> Sponsored by: AMD MFC after: 1 week Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com> Differential Revision: https://reviews.freebsd.org/D60769
debug: classified in
03-filenames_plain1 by '['lib/libpmc/',
'sys/dev/']'
178d0b5b8da7 adapted the Zen 5 pattern matching from Linux perf. However, Linux prints CPU models with a single digit when under 0xF (allowing |[[:xdigit:]] to match 0h-Fh), whereas hwpmc/libpmc formats model numbers with two leading hex digits (00h-0Fh). Fix the pattern to explicitly cover two-digit hex models in the 00h-0Fh range, and add a test case verifying table selection across Zen 5 and Zen 6 cpuid strings. Reviewed by: Ali Mashtizadeh <ali@mashtizadeh.com> Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com> Fixes: https://cgit.freebsd.org/src/commit/?id=178d0b5b8da7 ("libpmc: Import AMD Zen 6 PMU events.") Sponsored by: Advanced Micro Devices, Inc. Differential Revision: https://reviews.freebsd.org/D60625
debug: classified in
03-filenames_plain1 by
'lib/libpmc/'
A USB error during an I2C transfer can leave `cp2112(4)` blocked indefinitely, preventing USB detach and even reboot from completing. `cp2112iic_check_req_status()` uses the status response without checking whether the exchange succeeded. A failed exchange can therefore reuse a stale busy response and retry indefinitely. The output callback also records an error without marking the transfer done, causing its waiter to sleep again. Check the exchange result before using the response, and mark failed output transfers complete. Use absolute deadlines based on `USB_DEFAULT_TIMEOUT` (five seconds) for output and input condition-variable waits, and stop repeated busy status responses after the status loop's own deadline. Clear pending input state when the paired output request fails. These are per-wait and status-loop bounds; they do not impose a single five-second limit on the entire I2C operation. Add `HQ_HID_IGNORE` entries for both VID/PID pairs matched by `cp2112`, so `usbhid` does not claim the interface ahead of the bridge driver. Define `LUMANATE` in `usbdevs` and use `USB_VENDOR_LUMANATE` for the existing `0x1009` entry in both device tables. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300017 Related hardware testing: https://reviews.freebsd.org/D60989, the RNG90 I2C slave driver. This controller fix applies independently of that driver. Reviewed by: wulf, adrian Differential Revision: https://reviews.freebsd.org/D61065 Event: NetApp/Vendor Summit Hackathon 202611
debug: classified in
03-filenames_plain1 by
'sys/dev/'
DH89xxCC shares the 82580 MAC type but reserves several of its memory error control and status registers. Accessing the full 82580 register set breaks normal RX/TX operation on affected adapters. Give DH89xxCC separate configuration, accounting, and recovery paths. Use its transmit packet-buffer ECC counter and DMA/LAN parity status with device-specific masks, avoiding the reserved receive-buffer ECC and PCIe error registers. Retain the port-reset sequence for fatal memory-error recovery without waiting for the absent STATUS.RST_DONE. Tested by: chuck2k (https://github.com/opnsense/src/issues/329) Fixes: https://cgit.freebsd.org/src/commit/?id=915c628c4f49 ("igb: Report 82580 memory ECC errors") MFC after: 1 day Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D61138
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Pluton's REPLY register indicates readiness for a new notification, not completion of the notification just sent. Wait for REPLY=1 before ringing the mailbox, then wait for START=0 when a synchronous state change needs acknowledgement. Use a separate command notification callback that waits for mailbox readiness but leaves command completion to the existing CRB_CTRL_START polling. Bound readiness waits by TPM_TIMEOUT_C, including asynchronous idle notifications, while retaining the command's execution timeout. This resolves reported command timeouts on a Framework AMD laptop. Tested by: olivier, tuexen MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D61128
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Include the command code in notification failures and the command code and execution timeout in completion failures. Capture CRB control registers on completion timeouts and Pluton mailbox readiness or acknowledgement timeouts, before cancellation or cleanup changes them. Include locality registers when present and mailbox registers for the Pluton start method. The dump contains transport state without command payloads or response data. Tested by: olivier, tuexen MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D61128
debug: classified in
03-filenames_plain1 by
'sys/dev/'
On the off chance that we discover more than one virtio-random device, the second one will deregister the global instance or trip an invariant when it fails to attach and calls vtrnd_detach(). We don't have that many resources to free, so just inline those. This is purely a hygiene thing, we haven't seen an instance of this in the wild (to my knowledge). Reviewed by: bnovkov, kfv Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D61050
debug: classified in
03-filenames_plain1 by
'sys/dev/'
If the device is hung, then polling will block the detach and hang us. Stop it and drain the queue instead. This fixes a hang on detach in some circumstances without the upcoming virtio_pci_modern fix. Reviewed by: bnovkov, kfv Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D61051
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Most of our drivers setup interrupt(s) and virtqueues are enabled at that time, but nothing will currently enable them for devices that we're only going to poll. This most notably affects virtio-random, and the problem can be observed with qemu's q35 emulation and a random device attached. The q35 implementation ignores the ring unless it's enabled, so vtrnd_harvest() will consistently EAGAIN rather than contribute anything of value, but with this patch it becomes functional. This can be reproduced with a qemu invocation like so: qemu-system-x86_64 -machine q35,accel=tcg -cpu max -smp 2 -m 2G \ -drive file=FreeBSD-16.0-CURRENT-amd64-ufs.qcow2,if=virtio \ -device pcie-root-port,id=rp1,bus=pcie.0,chassis=1 \ -object rng-random,id=rng0,filename=/dev/urandom \ -device virtio-rng-pci,rng=rng0,bus=rp1 \ -display curses Reviewed by: bnovkov, kfv Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D61052
debug: classified in
03-filenames_plain1 by
'sys/dev/'
In gve_verify_driver_compatibility(), the driver populates the gve_driver_info buffer for the device to read. Sync this buffer with BUS_DMASYNC_PREWRITE instead of BUS_DMASYNC_PREREAD before issuing the command. In gve_adminq_describe_device(), the device populates the gve_device_descriptor buffer for the driver to read. Sync this buffer with BUS_DMASYNC_PREREAD instead of BUS_DMASYNC_PREWRITE before issuing the command. In gve_adminq_get_ptype_map_dqo(), the device populates the gve_ptype_map buffer for the driver to read. Add the missing BUS_DMASYNC_PREREAD and BUS_DMASYNC_POSTREAD syncs around the command. In normal GCP environments this did not cause a functional failure because the underlying platforms are DMA cache-coherent and bus_dmamap_sync() inside gve_adminq_issue_cmd() still provided a memory barrier before ringing the AdminQ doorbell. However, if bounce buffers are used, the wrong or missing sync directions would cause the OS to skip copying between the driver buffer and the bounce buffer in the expected direction. Signed-off-by: Tim Hostetler <thostet@google.com> Reviewed by: markj, Jasper Tran O'Leary <jtranoleary@google.com> Fixes: https://cgit.freebsd.org/src/commit/?id=54dfc97b0bd9 ("Add gve, the driver for Google Virtual NIC (gVNIC)") Fixes: https://cgit.freebsd.org/src/commit/?id=d438b4ef0cfc ("gve: Add DQO RDA support") Differential Revision: https://reviews.freebsd.org/D61172
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Currently, gve_rx_alloc_ring_dqo() and gve_tx_alloc_ring_dqo() request CACHE_LINE_SIZE alignment when allocating DMA memory for the DQO TX/RX descriptor and completion rings. The device requires stronger alignment than cache line alignment, which was incidentally being met due to how the kernel allocates memory. Explicitly meet this requirement by requesting page aligned memory. Signed-off-by: Tim Hostetler <thostet@google.com> Reviewed by: markj, Jasper Tran O'Leary <jtranoleary@google.com> MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D61211
debug: classified in
03-filenames_plain1 by
'sys/dev/'
378e0c5c8967 reduced the number of playback channels from 5 to 1. This introduced a regression, because the global DMA buffer indexing was not adapted accordingly, which now results in kernel panics because of out-of-bounds reads into the buffer. Additionally, because of wrong indexing, recording channels ended up being serviced by the playback part of envy24ht_intr(). Register 1 recording channel instead of 2 + sc->adcn, as the recording DMA buffer only has room for 1 stereo stream. With 1 channel per direction, give each channel the first index of its direction (ENVY24HT_CHAN_PLAY_DAC1 and ENVY24HT_CHAN_REC_ADC1). While here, fix the buffer wrap in envy24ht_r16sl(). It has to be ch->size / ch->unit, but was copied verbatim from the 32-bit equivalent, whose samples are twice as large, so 16-bit recording wrapped halfway through the DMA buffer and never read the second half. Fixes: https://cgit.freebsd.org/src/commit/?id=378e0c5c8967 PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299952 MFC after: 1 week Sponsored by: The FreeBSD Foundation Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D61155
debug: classified in
03-filenames_plain1 by
'sys/dev/'
An Intel display-audio codec was observed to remain in D3 after monitor sleep on DragonFly BSD. Starting a new stream then produced no sound, and waking the codec alone left the output pin amplifier muted and other function configuration unrestored. Read the audio function power state at stream start. If its requested or actual state is not D0, use the existing power-up routine before configuring and starting the stream, then restore the function to a known state: Restore selectors, pins, EAPD, GPIO/GPO and direct codec patches, then replay the cached gain and mute values once the pins are configured. Split widget configuration out of hdaa_audio_commit() into hdaa_audio_widget_commit() so the wake path can reuse it without reinitializing the cached amplifier values. Preserve the existing volume, mute and forced-mute values. Re-enable unsolicited responses, refresh ELD, and run jack presence handling for playback pins. Skip the full presence handler for recording pins only: its recording path can drop the driver lock to update the recording source, which is not safe while starting a stream with the channel lock held. The playback path does not drop the driver lock, so it is safe to run here, and it is what matters for display audio, whose pins belong to playback associations. GET_POWER_STATE reports the actual state in ACT (bits 7:4) and the requested state in SET (bits 3:0). They can differ during a transition. Checking both avoids skipping the D0 request when the function is still actually in D0 but has been requested to power down, or when D0 has been requested but the actual state has not reached D0 yet. The observed post-sleep response on DragonFly was 0x233, with both fields reporting D3. Despite their names, HDAA_AMP_MUTE_DEFAULT (0xffffffff) and HDAA_AMP_VOL_DEFAULT (-1) are sentinels meaning "keep the cached setting" in hdaa_audio_ctl_amp_set(). Passing them leaves ctl->muted, ctl->left and ctl->right unchanged, then writes the cached values to the hardware while respecting ctl->forcemute. It does not select factory defaults or unconditionally unmute the output. Preserve the existing behavior when the power-state query returns HDA_INVALID or both fields already report D0, and leave the D0 fast path and invalid power-state query handling unchanged. The observed wake-only silence and amplifier recovery were seen on DragonFly BSD. This FreeBSD adaptation has not been validated on FreeBSD hardware. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299139 MFC after: 2 weeks Reviewed by: christos Pull-Request: https://github.com/freebsd/freebsd-src/pull/2464
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The PerfMonV2 start and stop methods set the core enable bit on UMC counters too, so UMC events never count. Use the UMC enable bit, as the legacy methods do. Reviewed by: mhorne, Ali Mashtizadeh <ali@mashtizadeh.com> Fixes: https://cgit.freebsd.org/src/commit/?id=9d3064010590 ("hwpmc_amd: add PerfMonV2 global-control path") Sponsored by: AMD Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com> Differential Revision: https://reviews.freebsd.org/D60770
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Allow HS200 tuning only above 100MHz timings, let the host driver keep a fixed maximum clock, and stop clearing max_clk in the generic FDT attach so that a controller driver can set it before attach. Differential Revision: https://reviews.freebsd.org/D60885
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Describe the SDMMC, SDIO, EMMC and their sample/drive phase clocks so that host drivers can tune them. Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D60887
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Add the tuning procedure (CMD21 with the standard JEDEC tuning block patterns), the 1.2V/1.8V/3.3V signaling voltage switch using voltage bands, a watchdog for stuck requests, controller recovery and DMA fixes needed to run HS200 reliably. For the Rockchip glue, implement the tuning hook by sweeping the sample clock phase over 360 degrees, picking the middle of the widest good window and restoring the previous phase on failure. The drive phase is set to 180 degrees. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D60888
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Pin the xin clock to 200MHz, use the generic UHS timing and tuning methods, parse the eMMC properties and the vqmmc supply from the device tree, and set the I/O voltage through the regulator framework instead of the S18 bit. Limit the RockPro64 to 100MHz. Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D60889
debug: classified in
03-filenames_plain1 by
'sys/dev/'
clk: rockchip: Add a mux flag to select the closest parent Add RK_CLK_MUX_ROUND_PARENT for muxes whose parents are fixed rate clocks that can be shared with other consumers. When a rate is requested, pick the parent with the rate that best fits the rounding flags and never change the rate of a parent. Without it the request is passed up to the shared parents, which refuse to change. Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D60890
debug: classified in
03-filenames_plain1 by
'sys/dev/'
clk: rockchip: rk3568: Select the sdmmc source clocks by rate The sdmmc clocks are muxes without a divider, whose parents provide the 750kHz clock for card identification and the 50MHz and 100MHz clocks for the bus. Use RK_CLK_MUX_ROUND_PARENT so that the host driver can change the card clock, which used to fail with EBUSY and left the SD cards at half speed. Differential Revision: https://reviews.freebsd.org/D60891
debug: classified in
03-filenames_plain1 by
'sys/dev/'
clk: rockchip: rk3568: Select the eMMC core clock by rate The eMMC core clock is a mux without a divider, whose parents provide the 375kHz clock for card identification and the 24MHz to 200MHz clocks for the other modes. Use RK_CLK_MUX_ROUND_PARENT so that the host driver can change the card clock, which could not be done before. Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D60892
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sdhci: rockchip: rk3568: Fix the eMMC card clock The divider of the controller is not functional on Rockchip, the card clock is the rate of the core clock. Request the core clock rounded down so that the closest available rate is selected and report a failure, which was ignored before. The eMMC was identified at the wrong clock and was never detected. Reviewed by: mmel Differential Revision: https://reviews.freebsd.org/D60893
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sdhci: Do not reprogram an unchanged clock sdhci_set_clock() compared the requested clock with slot->clock, which holds the rate that the host driver actually applied. Some drivers do not apply the requested rate: the RK3568 one maps the 400kHz identification frequency to 375kHz. The two values then never match and every update_ios call goes through SDHCI_SET_CLOCK() again, even when the clock did not change. That ends in clk_set_freq(), which takes a sleepable lock, from the done context of the mmc probe with the CAM locks held. With another thread holding the clock topology lock this panics with "sleeping thread holds CAM device lock". Remember the last requested clock in a new field and compare against it. Clear it wherever slot->clock is cleared so that a reset still forces an update. Tested on a Quartz64 Model A with an NVMe drive on the PCIe slot, where the panic was seen: 5 cold boots out of 5 attached everything. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D61012
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sdhci: Defer XPT_SET_TRAN_SETTINGS to the slot taskqueue Only XPT_MMC_SET_TRAN_SETTINGS was handed to the slot taskqueue. XPT_SET_TRAN_SETTINGS, which mmc_xpt.c issues too, still called sdhci_cam_settran_settings() directly from the CAM done thread with the CAM device lock held. Changing the bus clock can sleep (clk_set_freq() takes the clock topology sx lock), which panics with "sleeping thread holds CAM device lock". Handle both opcodes the same way and complete the request from the taskqueue. Differential Revision: https://reviews.freebsd.org/D61013
debug: classified in
03-filenames_plain1 by
'sys/dev/'
set_power() enabled the ext_clock on power-on and called clk_stop() on power-off. This was wrong in three ways: - clk_stop() is not the counterpart of clk_enable() (it KASSERTs enable_cnt == 0), so it panics once the clock has been enabled. - set_power() is driven by the MMC power_mode IOS and is called repeatedly for the same state during probing and tuning, so the enable/disable refcount over- or underflows and panics. - The ext_clock may be a shared PMIC output (e.g. rk808-clkout2 on the RockPro64, also feeding the companion Bluetooth controller), so gating it here disturbs the other consumers. The external clock is a free-running low-power oscillator the device needs for its whole lifetime, so enable it once at attach and leave it running. Only act on real power-mode transitions in set_power() and limit it to driving the reset line, which is what actually sequences the device. Tested on a RockPro64 (Broadcom BCM4359 SDIO Wi-Fi): the SDIO function now enumerates and the module is reachable from userspace. MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D61023
debug: classified in
03-filenames_plain1 by
'sys/dev/'
e6000sw_write_xmdio() loaded the Clause 45 register address into the SMI PHY data register a second time, where the value to write belongs, so every Clause 45 write stored the register address. Its only caller, e6000sw_serdes_power(), runs at attach for ports 9 and 10 of the 88E6190 and 88E6190X to power one SERDES interface up and the other down. It wrote 0x2000 to the SGMII control register and 0x1000 to the 10GBASE-R PCS control register instead, so neither interface was powered down and the rest of each register was overwritten. Fixes: https://cgit.freebsd.org/src/commit/?id=9aba06377d26 ("Add support for the Marvell https://cgit.freebsd.org/src/commit/?id=88E6190 11 ports switch.") Sponsored by: Rubicon Communications, LLC ("Netgate")
debug: classified in
03-filenames_plain1 by
'sys/dev/'
transmit only requested GO_IDLE and the locality release, so a back-to-back command could see stale state and fail with EIO. A post-send idle timeout no longer discards a completed response. Reviewed by: kbowling Approved by: kbowling Differential Revision: https://ron-dev.freebsd.org/FreeBSD/src/pulls/93
debug: classified in
03-filenames_plain1 by
'sys/dev/'
According to the virtio spec: > The driver MUST NOT send any buffer available notifications to the > device before setting DRIVER_OK. DRIVER_OK isn't set until after attach completes, so defer the first enqueue. We haven't found any problems as a result of this to the best of my knowledge: q35 and other devices that we *have* been used with will apparently check when we go DRIVER_OK. Tested with q35 virtio-random, which still works. Reported by: llm-postcr Reviewed by: kfv, markj Fixes: https://cgit.freebsd.org/src/commit/?id=f1c5a2e3a62505 ("virtio_random: Pipeline fetching the data") Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D61228
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The controller's Recommended Arbitration Burst was ignored; the specification advises matching the Arbitration feature's burst to it even under plain round robin. Some controllers report unusable values: programming the Apple S3X with its reported RAB wedged sustained I/O, so quirked controllers keep their default configuration. The hw.nvme.arb_burst tunable overrides the recommendation. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D59155
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The quirk's 8KB transfer clamp exposed raw character-device I/O to the oversized-mapping stall fixed earlier, and its single tracker turned a stranded request into a complete I/O stall. Without it an S3X controller runs 128 trackers at its MDTS-derived transfer size with no retries, failures, or timeouts, at about seven times the serialized throughput. Reviewed by: imp, adrian, ngie Approved by: ngie (co-mentor) Differential Revision: https://reviews.freebsd.org/D59156
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The setting is only read on exec(2), so it can be safely modified. This is useful to adapt the system to newly discovered buggy programs without reboot. Note that that running processes keep their mode until they exec again. Sponsored by: The FreeBSD Foundation MFC after: 3 days
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
A cpuctl(4) write that stops or reprograms IBS can clear the valid bit of a sample whose NMI is already raised. hwpmc then declines the NMI, no other handler claims it, and with the default machdep.panic_on_nmi the system panics. Have nmi_handle_intr() claim, after all handlers declined it, one NMI per cpuctl write to an IBS control MSR. Claiming last, rather than from a cpuctl NMI handler, cannot take an NMI away from hwpmc. cpuctl.ko now needs the new kernel symbols; an MFC has to update both. Reproduced on an EPYC 9654 by toggling IBS op through /dev/cpuctlN: about one unclaimed NMI per 2000 toggles. Reviewed by: kib MFC after: 2 weeks Sponsored by: AMD Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com> Differential Revision: https://reviews.freebsd.org/D60765
debug: classified in
03-filenames_plain1 by '['sys/dev/',
'sys/x86/']'
If copyout of the newly allocated PMC ID fails, the caller cannot use or release the PMC. Release it in the kernel. Reviewed by: mhorne MFC after: 3 days Sponsored by: Advanced Micro Devices, Inc. Differential Revision: https://reviews.freebsd.org/D60562
debug: classified in
03-filenames_plain1 by
'sys/dev/'
FEAT_TTL adds a Translation Table Level field for TLB maintenance intructions, to indicate the level holding the leaf address for the address being invalidated. This can reduce the cost of TLB invalidation. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D60090
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
The acpi IORT code incorrectly uses a u_int as the MSI xref type, while INTRNG expects an intptr_t. Switch to using intptr_t to help document this value is the xref for the MSI controller. Reviewed by: dsl Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D60653
debug: classified in
03-filenames_plain1 by '['sys/arm64/',
'sys/dev/']'
The v2 path writes AMD_PMC_GLOBAL_CTL whenever the PerfMonV2 CPUID bit is set. bhyve passes that bit through from the host but does not emulate the register, so loading hwpmc in a guest on a Family 19h or later host panics the kernel. amd_v2_hwcheck_cpu() already probes EVSEL MSRs, so probe GLOBAL_CTL there too, in order to reject the v2 path and fall back to the generic CPU class. Fixes: https://cgit.freebsd.org/src/commit/?id=9d3064010590 ("hwpmc_amd: add PerfMonV2 global-control path") Tested by: Osvaldo Janeri Filho <ojanerif@amd.com> MFC after: 1 week Sponsored by: The FreeBSD Foundation Reviewed by: mhorne, afscoelho@gmail.com Differential Revision: https://reviews.freebsd.org/D61133
debug: classified in
03-filenames_plain1 by
'sys/dev/'
vmm does not handle CPUID leaf 0x80000022, so a FreeBSD guest on a Family 19h or later host panics on "kldload hwpmc", which trusts the PerfMonV2 bit and writes AMD_PMC_GLOBAL_CTL. Tested by: Osvaldo Janeri Filho <ojanerif@amd.com> MFC after: 1 week Sponsored by: The FreeBSD Foundation Reviewed by: markj, kib Differential Revision: https://reviews.freebsd.org/D61141
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
iWARP handling code deals with TCP header processing outside of the normal TCP stack. Add validation checks to verify the internal integrity of the TCP headers. Reviewed By: tuexen, O11 Intel Networking group, #transport, bartosz.sobczak_intel.com Sponsored by: NetApp, Inc. MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D58323
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Add command (struct nvme_command) building functions for the four NVMe reservation opcodes (Report, Register, Acquire and Release), Format NVM, and Get Features / Set Features, along with the enumerations and data structures that go with them. These are shared between the kernel and userland, and are the underpinnings for new camcontrol(8) subcommands (nvres, nvformat, nvfeature) that will be added separately. The reservation type names are intentionally similar to the SCSI names for the same reservation types. sys/dev/nvme/nvme.h: Add NVMe command building functions for the four NVMe reservation opcodes: nvme_ns_resv_report_cmd(), nvme_ns_resv_register_cmd(), nvme_ns_resv_acquire_cmd() and nvme_ns_resv_release_cmd(). Add enumerated types for the various NVMe reservation subcommand actions (acquire, register, release), reservation types, and Change Persist Through Power Loss State values. Add struct nvme_resv_acq_data and struct nvme_resv_reg_data, the data payloads for reservation Acquire and Register. Add a new NVMe Format NVM command building function, nvme_admin_format_cmd(), and an enumeration for the Secure Erase Setting parameter for format. Add nvme_admin_get_feature_cmd() and nvme_admin_set_feature_cmd() functions to fill a struct nvme_command for Get Features / Set Features. Add macros for bitfields in the ctratt and mic dwords of the NVMe Identify Controller data structure. Add a prototype for nvme_hostid_sbuf(). Stop byte swapping the hostid fields in nvme_resv_status_swapbytes() and nvme_resv_status_ext_swapbytes(), and document the fields as little endian. The hostid is an opaque 8 or 16 byte value; keep it in the byte order the device returns it in instead of interpreting it at this level. Widen the nvme_ctrlr_cmd_get_feature() and nvme_ctrlr_cmd_set_feature() prototypes as described below. While here, fix the entry count clamp in the reservation status swapbytes functions to use sizeof(*s) rather than sizeof(s); using the pointer size made the clamp one entry too permissive. sys/dev/nvme/nvme_util.c: Add nvme_hostid_sbuf(), which formats an 8 or 16 byte hostid (from the Get Features hostid feature, in the little-endian byte order the device returns it in) into an sbuf as an integer value in base 16, most significant byte first. sbin/nvmecontrol/resv.c: Decode the now little-endian hostid fields explicitly when printing, and zero pad the printed 64-bit values. Previously the extended hostid printed in a different byte order on big and little endian machines, and without zero padding between the two halves. sys/dev/nvme/nvme_ctrlr_cmd.c: Refactor nvme_ctrlr_cmd_get_feature() and nvme_ctrlr_cmd_set_feature() to use the new command building functions from nvme.h and accept a namespace ID parameter. Refactor nvme_ctrlr_cmd_set_feature() to also accept the sv (save) parameter to persist a feature value across reset. sys/dev/nvme/nvme_ctrlr.c: Update the temperature threshold, autonomous power state transition and host memory buffer callers for the new nvme_ctrlr_cmd_get_feature() and nvme_ctrlr_cmd_set_feature() arguments. Co-authored-by: Reid Linnemann <reidl@spectralogic.com> Co-authored-by: Dave Baukus <daveb@spectralogic.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Reviewed by: imp MFC after: 1 week Sponsored by: Spectra Logic Differential Revision: https://reviews.freebsd.org/D59531
debug: Commit manually moved from "unknown" to "hardware".
If a lookup fails for a R_PPC_JMP_SLOT (PLT relocation) ignoring errors results in an address of 0 gets written into the jump slot, leading to a NULL pointer jump when attempting to call the function it points to. Fix this with proper error checking so that a module will fail to load instead of crashing later on.
debug: classified in
03-filenames_plain1 by
'sys/powerpc/'
All currently supported powerpc CPUs handle single-copy atomicity for any size up to the native word size, so load and store operations are guaranteed for sub-word size that are naturally aligned.
debug: classified in
03-filenames_plain1 by
'sys/powerpc/'
Nothing tells the SMC that a power off or restart was user requested, so the T2 keeps rebooting the machine thinking the system is wedged. Approved-by: ngie (co-mentor) Reviewed by: ngie, adrian Differential Revision: https://reviews.freebsd.org/D61260
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The Enhanced SuperSpeed meaning of the slot context parent hub slot ID and port number fields was introduced in xHCI 1.2. Controllers built to an earlier revision define them only for a Low- or Full-speed device behind a High-speed hub. A SuperSpeed device behind a USB 3.2 hub on an Intel Alpine Ridge controller, an xHCI 1.1 part, stops responding to Address Device and loops in uhub_reattach_port until the port is disabled. Fixes: https://cgit.freebsd.org/src/commit/?id=20b19982545e ("usb: support SSP and SSPx2 xHCI") Reviewed by: aokblast, ngie, adrian Differential Revision: https://reviews.freebsd.org/D61278
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Apple platform attach and detach functions are serialized with ordinary mutex and contain code that executes malloc() that leads to INVARIANTS warnings. Fix it through replacement of mutex with sx lock. Fixes: https://cgit.freebsd.org/src/commit/?id=d7d237ce731f ("acpi_apple: Apple platform ACPI driver") Reviewed by: seuros Differential Revision: https://reviews.freebsd.org/D61295
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Reviewed by: seuros Differential Revision: https://reviews.freebsd.org/D61298
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: factor out the PIO data port byte loops Reuse existing pattern and evict magic numbers No functional change: the port access sequence and the per-caller retry and error reporting behaviour are unchanged. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D61283
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: rebuild asmc_key_dump on the by-index helper asmc_key_dump() branched on the backend, but asmc_key_dump_by_index() already dispatches on it, so the PIO arm open-coded a transaction it could have called. Keep one printer for both. Output is unchanged. The PIO arm checked asmc_key_read()'s return value instead of printing a zeroed buffer; the merged printer keeps that. Its retry exhaustion message is gone, which asmc_dumpall() cannot observe. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D61284
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: share the getinfo and getbyindex PIO transactions asmc_key_getinfo() and asmc_key_dump_by_index() both ran the command 0x13 transaction, the latter after a command 0x12. Put each behind a helper that assumes the caller holds sc_mtx, and fold the shared response decode into asmc_keyinfo_decode(). The index bytes are now derived inside the helper, so they are recomputed per retry. Same value all the time. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D61285
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: collapse the per-fan speed sysctl handlers The five fan speed handlers differed only in which key they read and whether they wrote back. Select the key from a table through arg2, the way asmc_sensor_sysctl() already packs a type and an index, and keep one handler. A second table drives the seven registration calls. No functional change, Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D61286
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: collapse the SMS axis and light sensor sysctl handlers
asmc_mb_sysctl_sms_{x,y,z} differed only in which SMS key they read, and
asmc_mbp_sysctl_light_{left,right} only in which light key. One handler
each, selecting from a table through arg2.
No functional change.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D61287
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: table-drive the system state and board identity sysctls The dev.asmc.n.system subtree was seven copies of "probe the key, then register", and the auto_poweron/sil pair in asmc_init two more. Drive both from tables. No functional change. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D61288
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: scan every sensor range through one helper asmc_detect_sensors hand-rolled the temperature and light scans as copies of asmc_scan_sensor_range(). Give the helper a match predicate and route all five ranges through it. No functional change. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D61289
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: correct the copyright address in asmcmmio Use my FreeBSD address. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D61290
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: move the backlight control level into the softc light_control was a file-scope static shared by resume, the light.control sysctl and the backlight method. Per-device state belongs in the softc. No functional change. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D61291
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: make the raw key debug state unconditional The ASMC_DEBUG block was in mid-struct, so struct asmc_softc had a different layout in translation units that missed opt_asmc.h. No functional change. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D61292
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: move the sysctl registration loops next to their tables asmc_attach() and asmc_init() had 4 description tables inline, several hundred lines from the tables they index. Wrapped each loop in a function defined after its table. No functional change. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D61293
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: split the debug key access into asmc_debug.c Move the ASMC_DEBUG code out of asmc.c into a file compiled only when the option is set, gated in files.amd64 the way acpi_debug gates the ACPICA debugger sources. The module Makefile writes the define into opt_asmc.h so every translation unit sees it; the old CFLAGS.asmc.c form covered one. No functional change. MFC After: 1 Week Approved-by: ngie (co-mentor) Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D61294
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: split the PIO backend into asmcpio.c Moved the inline PIO transactions out of the key transport routines, which now only dispatch on sc_is_mmio, matching asmcmmio.c. getbyindex and getinfo stay fused: PIO needs both halves under one hold of sc_mtx. No functional change. MFC After: 1 Week Approved-by: ngie (co-mentor) Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D61296
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: split the sysctl layer into asmcsysctl.c Moved the dev.asmc.N tree out of asmc.c No functional change MFC After: 1 Week Approved-by: ngie (co-mentor) Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D61300
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: Use c99 initializers with for-loop counters to improve scoping declared loop indices in the for statement Index types are unchanged. No functional change. MFC After: 1 Week Approved-by: ngie (co-mentor) Reviewed by: ngie, imp Differential Revision: https://reviews.freebsd.org/D61301
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: include sys/kernel.h This is needed for the `MODULE*` macros. This include was accidentally removed in the linked commit. MFC after: 1 week Reported by: Ian Freislich <ianfreislich@gmail.com> Fixes: https://cgit.freebsd.org/src/commit/?id=c714cde179a4 ("asmc: split the sysctl layer into asmcsysctl.c")
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Support per-session configurable ping (SCSI NOP) and login timeouts similar to what is supported in the Linux iSCSI initiator configuration file. Reduce iscsi timer granularity to 0.1 sec. For backwards compatibility, when all timers are selected on integer numbers, all status messages are unchanged. If the higher granularity is used, the log messages include sub-second granularity. The sysctl(3) interface has changed from pure int to string, in order to support fractional seconds in a human-readable, dotted notation. Reviewed By: #netapp, #manpages, jhb, pauamma_chezdork.com, siderop1_netapp.com Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D32540
debug: Commit manually moved from "unknown" to "hardware".
After a device reset, resizable BARs return to their default sizes. Restore them to the sizes they had prior to reset. Reviewed by: imp, adrian Differential Revision: https://reviews.freebsd.org/D61110 Approved by: adrian (mentor) Signed-off-by: Nick Price <nprice@FreeBSD.org>
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Opcode 0x80 (group 1: r/m8, imm8) is in the decode table and emulate_cmp() handles 80 /7, but emulate_or() and emulate_and() only accept 0x81 and 0x83. An "or byte ptr [mem], imm8" or "and byte ptr [mem], imm8" on emulated memory therefore fails with EINVAL and bhyve stops the guest with "Failed to emulate instruction sequence [ 80 ... ]". Seen with macOS: VoodooHDA starts the HDA controller's CORB with "or byte [rax+0x4c], 2" (CORBCTL |= CORBRUN), and the guest died at the first sound. Accept 0x80 in both, with a one byte operand as emulate_cmp() does. The file is shared with bhyve(8), so the fix covers the in-kernel devices (HPET, local APIC without APICv, I/O APIC) and the user space device models alike. Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com> Reviewed by: markj MFC after: 1 week Sponsored by: keelos.dev Differential Revision: https://reviews.freebsd.org/D60997
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
The POWER9 does not do automatic state transitions when idling, so the 'MTL' field (Maximum Transition Level) is ignored. Thus, setting '0' for the 'RL' field (Requested Level) as was done means it doesn't transition to any power saving level. To fix this, set both the 'MTL' and the 'RL' fields to the same level. On a Talos II at idle this drops the reported temperatures by ~10-15%. MFC after: 3 days
debug: classified in
03-filenames_plain1 by
'sys/powerpc/'
The accessed bit may be set in only some of an L3C superpage's L3 PTEs. However, when pmap_mincore() found an L3C mapping, it reported the accessed state of the specified L3 PTE only, so mincore(2) could fail to report MINCORE_REFERENCED for an L3C superpage that had been accessed. When the accessed bit is not set in the specified entry, use pmap_load_l3c() to combine the accessed bits from all of the L3C superpage's L3 PTEs. Found by: Claude Code (Opus 5.5) MFC after: 1 week
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
In preparation for storing a non-user register rename the struct so and array so they are more obviously for sanitized registers. While here switch to a flag field and add a flag to record if the register is for userspace or just the kernel and check for this when reading the value for userspace. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D60742
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
Globally allocated per: https://github.com/riscv/riscv-isa-manual/blob/main/marchid.md MFC after: 3 days Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/riscv/'
No functional change. MFC After: 1 Week Approved-by: ngie (co-mentor) Reviewed by: ngie, adrian Differential Revision: https://reviews.freebsd.org/D61303
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The Get Features command for the host identifier always requested
the 64-bit form (cdw11 EXHID=0), but the decoding logic sized the
identifier from the controller's CTRATT extended host identifier
capability bit, or always treated it as 128 bits when -U was
given. On a controller supporting the extended host identifier,
the printed value did not match what was requested from the
controller.
Fetch the controller data before issuing the command, request the
extended form when the controller supports it, and decode the form
that was requested. Reject -U when the controller only supports
64-bit host identifiers, since an 8 byte value cannot be shown as
a UUID.
sys/cam/nvme/nvme_all.c,
sys/cam/nvme/nvme_all.h:
Add an exhid argument to nvme_get_feature_hostid(),
matching nvme_set_feature_hostid(), and set the EXHID bit
in cdw11 from it.
sbin/camcontrol/nvfeature.c:
Fetch the controller data and determine the host
identifier size before issuing the Get Features command,
request only as many bytes as the identifier holds, and
decode the identifier in the form it was requested.
Reject -U on controllers without extended host identifier
support.
Reported by: llm-postcr
Fixes: https://cgit.freebsd.org/src/commit/?id=9814633f631b
Fixes: https://cgit.freebsd.org/src/commit/?id=6eae951cd51b
MFC after: 1 week
Sponsored by: Spectra Logic
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
debug: Commit manually moved from "unknown" to "hardware".
Match the platform by CPU model and attach on acpi with PWRM at 0xfe000000; the PMC is not PCI-enumerable on these platforms. SLP_S0_RES offsets and granularities follow each generation's PCH Family Datasheet Volume 2. A mismatch between the LPIT residency counter address and SLP_S0_RES is reported on attach. Reviewed by: olce, adrian Differential Revision: https://reviews.freebsd.org/D59596
debug: classified in
03-filenames_plain1 by
'sys/dev/'
ixgbe_mdio_attach() ran from ixgbe_if_attach_post(), which iflib calls with the context lock held. Attaching the MDIO bus there also probes and attaches the devices on it, and their register accesses go through ixgbe_mdio_readreg_c22() and ixgbe_mdio_writereg_c22(), which take the same lock. A driver on the bus that was in the kernel or loaded by loader(8) therefore recursed on the non-recursive iflib sx lock as soon as it touched a register: INVARIANTS kernels panic in _sx_xlock_hard(), others recurse silently. Wrap iflib_device_attach() and attach the MDIO bus once it has returned, so the children take the context lock like any later MDIO access does. Reviewed by: kbowling Fixes: https://cgit.freebsd.org/src/commit/?id=cfec995c87f3 ("ixgbe: add MDIO bus support") Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D61199
debug: classified in
03-filenames_plain1 by
'sys/dev/'
twsi_control_set() and twsi_control_clear() read the control register, change some bits and write it back. On the controllers where the interrupt flag is cleared by writing a 1 to it (iflag_w1c), this clears it as the flag is read as set. In the polled mode this breaks the repeated start: START is set with the flag cleared by the write, the hardware sends the repeated start at once, and the flag is then cleared a second time, which loses the event and leaves the controller with the status of the previous transfer. Transfers with a repeated start fail with IIC_ESTATUS on an Allwinner H6 until the controller works with interrupts. Mask the flag out of the value that is written back, unless the caller asks for it. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The driver only took a write as two messages, the offset and then the data. A write on an I2C bus is a single message that starts with the register, which is how a driver that can be on I2C or on RSB, like axp81x, does it. Split such a message into the two the controller needs. Tested on: A64
debug: classified in
03-filenames_plain1 by
'sys/arm/'
axp81x: Move the sensors, sysctls and thresholds out of attach Add one function for each of them: axp8xx_add_sensors(), axp8xx_add_sysctls() and axp8xx_get_thresholds(). No functional change. This is a preparation to support PMUs without a battery, like the AXP805, with this driver.
debug: classified in
03-filenames_plain1 by
'sys/arm/'
axp81x: Move the interrupt setup out of attach Add axp8xx_setup_intr() which enables the interrupts and installs the handler. No functional change.
debug: classified in
03-filenames_plain1 by
'sys/arm/'
axp81x: Fix the register accesses The register pointer was written without IIC_M_NOSTOP, so the controller sends a STOP before the read message. On the Allwinner H6 (twsi) this makes the reads return garbage without any error. Set IIC_M_NOSTOP on it, and send the register and its value in a single write message, like the other PMIC drivers do. Tested on: A64, H6
debug: classified in
03-filenames_plain1 by
'sys/arm/'
axp81x: Serialize the register accesses The registers were accessed with iicbus_transfer(), which does not own the bus. The interrupt driven transfers of the Allwinner twsi controller drop their mutex while they sleep waiting for the interrupt, so two accesses can overlap, and the PMU shares its bus with other devices, an RTC for instance. Use iicbus_transfer_excl() so that the accesses are arbitrated. The regulators share the enable registers and the regulator framework only serializes the accesses to a single regulator. Protect the read-modify-write of these registers with a lock, so that regulators enabled at the same time cannot lose each other's update. No failure was seen without this, it is there for correctness. Tested on: A64, H6
debug: classified in
03-filenames_plain1 by
'sys/arm/'
axp81x: Check the errors of the register accesses axp8xx_regnode_enable() wrote back a value computed from a register it failed to read, which clears the enable bits of all the other regulators of that register. Return an error instead, and do the same in the other regnode methods, which used an uninitialised value when an access failed. Also initialise udelay in axp8xx_regnode_init(), as axp8xx_regnode_set_voltage() can now fail before setting it. Tested on: A64, H6
debug: classified in
03-filenames_plain1 by
'sys/arm/'
axp81x: Add a function to get the regulator definition Move the lookup of the regulator definitions out of axp8xx_attach(). This also fixes an off-by-one: the test was i <= nitems(common), so the first regulator of the per-chip table (dc1sw or dcdc7) was never registered and one entry past the end of the common table was read. Tested on: A64
debug: classified in
03-filenames_plain1 by
'sys/arm/'
axp81x: Get the voltage of the regulators with a single range axp8xx_regnode_get_voltage() failed when the regulator has no second step, which is the case of the ones with a single range. Only the first step is mandatory, as in axp8xx_regnode_set_voltage(). Tested on: A64, H6
debug: classified in
03-filenames_plain1 by
'sys/arm/'
axp81x: Do not change the voltage of a regulator in range axp8xx_regnode_init() set every regulator described in the FDT to its minimum voltage, even if the firmware had already set a voltage in the range. For a regulator that is in use, like the one of the CPU, this can make the system crash. Only set the voltage when the current one is out of the range. Tested on: A64, H6
debug: classified in
03-filenames_plain1 by
'sys/arm/'
axp81x: Skip the regulators that have no name in the FDT A regulator that is not used is described in the FDT by a node without regulator-name, and regulator_parse_ofw_stdparam() fails for it, which printed two errors at every boot. Skip these nodes, and only tell about it when booting verbose.
debug: classified in
03-filenames_plain1 by
'sys/arm/'
axp81x: Add support for the AXP805 and AXP806 The AXP805 and AXP806 are regulator only PMUs, with different registers than the AXP803 and AXP813, and without a battery, ADC sensors or GPIO. Add the regulators (voltage ranges from the datasheet and the Linux driver) and the interrupts: the power key short press powers the system off and the die temperature is sent to devd. The battery, sensors, thresholds, shutdown handler and GPIO bus are not set up for them. Tested on a Pine H64 (AXP805 on the R_I2C).
debug: classified in
03-filenames_plain1 by
'sys/arm/'
Upstream's mapfile.csv lists models without leading zeros, so entries for models below 10h had to be fixed up by hand on every import. Strip them before matching and use the entries as imported. Add tests to validate the functionality. Reviewed by: mhorne, Ali Mashtizadeh <ali@mashtizadeh.com> Sponsored by: Advanced Micro Devices, Inc. MFC after: 1 week Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com> Differential Revision: https://reviews.freebsd.org/D60790
debug: classified in
03-filenames_plain1 by
'lib/libpmc/'
The interrupt filter reads the PIO interrupt port, but sc_ioport is NULL under MMIO; the capability test only probed for keys, which says nothing about the backend. No MMIO-capable machine has a sudden motion sensor anyway. It existed to park the heads of spinning disks. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D61383
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The locality release wait times out on every command on a Framework 13 (Pluton start method), logging every 10 seconds. Reported by: emaste, tuexen Reviewed by: kbowling Approved by: kbowling Fixes: https://cgit.freebsd.org/src/commit/?id=bfe4be85a935 ("tpm_crb: wait for idle and locality release after each command")
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Reject tokens and option counts that exceed the fixed parser buffers, and fix the terminating NUL offset. Have the sysctl handlers propagate parser errors before applying settings. Handle SYSL_U32 options and reject failed numeric conversions instead of using an uninitialized value. Fix the duplex case falling through to an error, and initialize the link-setting strings for unexpected speeds. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D61339
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Return positive errno values from the FreeBSD sysctl handlers so that userland reports the proper error instead of "Unknown error: -22". Convert the negative phy_config_aneg() result at the sysctl boundary, matching axgbe_if_media_change(), and retain the PHY code's internal error convention. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D61400
debug: classified in
03-filenames_plain1 by
'sys/dev/'
vid_enum_outputs() only registers a child whose _ADR appears in the graphics controller's _DOD. _DOD is filled in from the graphics driver's ACPI opregion on some platforms, so with no such driver attached it can describe no device at all while the panel still implements _BCL, _BCM and _BQC. The match then fails for every child and the machine is left with no brightness control. Fall back to registering the first child that implements _BCL when _DOD matched nothing, so such a machine gets a working hw.acpi.video.lcd0.brightness and the brightness keys that ride on it. MFC after: 1 week Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D60826
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Register an acpi_lid_event consumer that saves the current _BQC level and drives _BCM to the lowest level _BCL offers when the lid closes, putting the saved level back when it opens. Only an output already classified as an internal panel is touched, and only a level this handler dimmed is restored, so a brightness change made while the lid was shut survives. Disabled by default; set hw.acpi.video.lid_blank=1 to enable. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D60827
debug: classified in
03-filenames_plain1 by
'sys/dev/'
lookup_fte_locked() scanned every FTE in a flow group with xa_next() and memcmp() on each one. A new RX TLS session always misses, so the whole group was walked under the group lock for every insertion. With tens of thousands of RX-offloaded sessions in the same IPv6 TCP group this costs milliseconds per call and grows linearly with the number of FTEs. Keep a hash table of the FTEs in each flow group, keyed by a jhash of the match value. The table is sized from the group size, capped at 16K buckets. It is updated in insert_fte() and del_sw_fte(), both of which hold the group write lock, and read in lookup_fte_locked() under the group read or write lock. The xarray is kept for index allocation. No lockless reads are introduced. Reported by: NetApp Reviewed by: kib Sponsored by: NVidia networking MFC after: 1 week
debug: classified in
03-filenames_plain1 by
'sys/dev/'
This had been introduced in 3331373ce733 ("Disable CPU idle states
during suspend and reenable them during resume.") to work around C-state
selection logic which would skip C-states which returned immediately,
considering them "broken".
This workaround is incompatible with suspend-to-idle however, which
requires CPUs to be in their idle states, and is no longer relevant
either way since b0baaaaecf1a ("Avoid comparing negative signed to
positive unsignad values.") removed the C-state skipping logic the
previous change was working around.
Reviewed by: olce
Sponsored by: The FreeBSD Foundation
Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/71
Differential Revision: https://reviews.freebsd.org/D60649
debug: classified in
03-filenames_plain1 by
'sys/dev/'
enable_idle(), which was called on resume before 427747fc16c9
("acpi_cpu: No longer disable idle during suspend"), also set BM_RLD.
This commit brings back just setting BM_RLD on resume because some
firmware might not be doing this itself on some machines.
Reviewed by: olce
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61431
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The ACPI entry describing the maintenance interrupt INTID is already available as "VgicInterrupt", but it is not exposed to the GIC driver. Check that the value is valid and consistent between CPUs, then publish it for the GIC driver to use under rid 0 if so. Print a warning if the maintenance interrupt is configured to be edge-sensitive in ACPI, as the GIC spec explicitly states "maintenance interrupts are level-sensitive". Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com> Reviewed by: andrew Sponsored by: Arm Ltd Pull Request: https://github.com/freebsd/freebsd-src/pull/2527
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
If one is available, register the maintenance IRQ so that vmm can receive and process guest exits when the maintenance IRQ is asserted. Since vmm and vgic can still operate without it, print a warning but attach the vgic regardless if the maintenance IRQ cannot be registered. Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com> Reviewed by: andrew Sponsored by: Arm Ltd Pull Request: https://github.com/freebsd/freebsd-src/pull/2530
debug: classified in
03-filenames_plain1 by
'sys/arm64/'
The amd64 and arm64 pmaps failed to decrement the count when tearing down a 1GB largepage mapping. The riscv pmap failed to decrement the count when unwiring a superpage mapping. Reported by: alc Reviewed by: bnovkov, alc, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D61414
debug: classified in
03-filenames_plain1 by '['sys/amd64/',
'sys/arm64/', 'sys/riscv/']'
CAP.TO is a 8b field and saturate at 127.5 seconds; a controller that needs longer reports the real worst case in CRTO.CRWMT. Waiting only CAP.TO can reset a controller that is still within its declared recovery time after e.g. an abrupt shutdown. Taking the larger of CRTO.CRWMT and CAP.TO when CAP.CRWMS show CRTO support. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D59631
debug: classified in
03-filenames_plain1 by
'sys/dev/'
X550EM_X KR devices do not support EEE and have no setup_eee operation. The shared-code update restored the capability removed by d61b6a41dd30, and the E610 EEE support subsequently added an unchecked call during attach. Together these changes allow a NULL function pointer call when attaching a KR device. Remove the incorrect EEE capability and use the NULL-safe ixgbe_setup_eee() wrapper when enabling EEE at attach. Removing the unsupported capability also stops exposing eee_state and the eee.tx_lpi_count and eee.rx_lpi_count sysctls on X550EM_X_KR devices. Fixes: https://cgit.freebsd.org/src/commit/?id=f72de14ea132 ("ixgbe: update if_ix and ixgbe api with ix-3.3.38 changes") Fixes: https://cgit.freebsd.org/src/commit/?id=13ee84c591f8 ("ix(4): Add EEE support for E610 adapters") MFC after: 1 week Sponsored by: BBOX.io
debug: classified in
03-filenames_plain1 by
'sys/dev/'
regnode_set_voltage_checked() called regnode_delay() with the delay returned by the driver even when REGNODE_SET_VOLTAGE() failed. A driver does not have to set it on error, so the delay could be a random value from the stack. Only wait when the voltage was set, like regnode_set_voltage() does. Reported by: llm-postcr Tested on: A64
debug: classified in
03-filenames_plain1 by
'sys/dev/'
axp81x: Always set the delay of the regulator methods axp8xx_regnode_set_voltage() and axp8xx_regnode_enable() only set the delay when they succeeded, so the callers could use an uninitialized value after an error. Set it first like the default methods do. Reported by: llm-postcr Tested on: A64
debug: classified in
03-filenames_plain1 by
'sys/arm/'
axp81x: Allow the interrupt handler to sleep The interrupt handler reads and writes the registers of the PMU, which can sleep: the I2C controller the AXP805 is on in the H6 waits for the end of the transfer, and taking the bus waits when it is busy. The handler runs in an interrupt thread, which cannot sleep unless the interrupt is marked as sleepable, so the first interrupt would panic a kernel with INVARIANTS. Mark it, the interrupt is not shared. Reported by: llm-postcr Tested on: A64, H6
debug: classified in
03-filenames_plain1 by
'sys/arm/'
axp81x: Set the maximum voltage of the AXP805 regulators AXP805_REG() did not set voltage_max, so a regulator without regulator-max-microvolt in the FDT got a maximum of 0 and its initialisation failed with ERANGE. Compute it from the minimum and the steps of the two ranges, like the value of the AXP813 DCDC7. Reported by: llm-postcr Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/arm/'
pmap_map() only works for memory the kernel already maps. A ram disk the loader places in reserved memory may lie outside the direct map, and some platforms have no direct map. Reviewed by: imp Approved by: imp Sponsored by: Netflix Differential Revision: https://ron-dev.freebsd.org/FreeBSD/src/pulls/101
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_clk: Initialize best in the nmm and np find_best functions aw_clk_nmm_find_best() and aw_clk_np_find_best() compared the first candidate to best before it was ever assigned, so the result of the search depended on whatever was on the stack. Initialize it to 0 like the nm and nkmp ones do.
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_clk: Use clk_freq_diff() to find the best factors The find_best functions of the nmm, np, m and frac clocks compared the candidates with abs() of the difference to the requested frequency. The frequencies are 64 bits and abs() takes an int, so the difference was truncated: for a PLL of 2.4GHz or more it can become negative or small and the wrong factors were chosen. Use clk_freq_diff() as the nm clock already does. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_clk: Take the first candidate in the nmm and np find_best functions The search starts with a best value of 0 and only takes a candidate that is closer to the requested frequency than the best one. When every candidate is more than twice the requested frequency, which happens for a clock that has a minimum for its N factor, none of them is closer than 0 and the search returns the factors 0. set_freq then writes them, which gives a wrong value to the register. Always take the first candidate, so that the result is the closest one that the clock can do. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The PLLs have a lock enable bit, bit 29, and the lock status bit, bit 28, is only updated when it is set. The firmware only sets it on the PLLs that it uses, which are the CPUX, DDR0 and PERIPH0 ones, so the other PLLs could never be seen as locked. Set it on all the PLLs when attaching, as Linux does. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_clk: Wait for the PLL to lock when enabling it The nm, nmm, np and nkmp clocks wait for the lock bit after their rate has been changed, but not when they are enabled. A PLL that was off could then be used by its children, or by the consumers of the clock, before it had locked. Add aw_clk_wait_for_lock() and use it when the clock is enabled, for the clocks that have a lock bit, and in place of the copies of the loop that waited for the lock after a rate change. Tell when the PLL does not lock, as the callers did not notice it. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h616: Set the lock enable bit of the PLLs The lock status bit of a PLL is only updated when its lock enable bit, bit 29, is set, and the firmware only sets it for the PLLs it uses. Enabling another PLL, or changing the rate of an enabled one, then waited for a lock that never came and ended after a second with an error. Set the bit on all the PLLs when attaching, like Linux does. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=92b59f3d010d ("aw_clk: Wait for the PLL to lock when enabling it")
debug: classified in
03-filenames_plain1 by
'sys/dev/'
A PLL that is disabled cannot lock. After a rate change the nm, nmm, np and nkmp clocks waited a full second for the lock bit and then, with the previous change, told that the PLL did not lock. Wait only if the clock has no gate or if its gate is on. The lock of a PLL that is enabled later is waited for when it is enabled. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The N factor of the PLLs is 8 bits wide, bits 15:8 of their register, and not 7 as it was defined. A PLL with N above 128 was read with a wrong rate, and the factor could not be set above this value. No PLL has such a rate today, so nothing changes for now. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The AW_CLK_FACTOR_MIN_VALUE flag had no effect on the nmm and np clocks as the minimum value of their factors was never copied when registering them, and they had no way to set it. Copy the minimum value of the N factor and add a _nmin argument to NMM_CLK() and NP_CLK() to set it. The existing clocks pass 0 as they do not use the flag, so nothing changes for them. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The minimum value of the N factor of all the PLLs of the H6 is 12, like the Linux driver does. Without it the search of the factors for a requested rate can choose a value that makes the PLL run below its minimum frequency. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Some factors have to be read from the register, as the firmware or the reset value can leave them set, but must not be changed when looking for a rate. AW_CLK_FACTOR_FIXED cannot be used as it does not read the register. Add AW_CLK_FACTOR_SEARCH_VALUE: the factor is decoded from the register as usual but the search only tries its value, so the factor is set to this value when the rate is changed. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Never use the output divider of the GPU PLL Linux found that using the output divider of the GPU PLL, bit 0 of its register, to scale the frequency of the GPU makes the system fail, so it clears it and does not model it. The H6 manual does not say so and has it in the rate of the PLL, 24MHz*N/M0/M1. It is set at reset, the PLL is at 432MHz with N=36, so it still has to be read to compute the rate. Search the rate with this divider at 1. It is read as before, and is cleared when the rate of the PLL is changed. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Fix the P factor of the CPUX PLL The P factor of the CPUX PLL was defined on the bits 1:0, which are the M factor that is only used for testing, instead of bits 17:16. It was also defined as one to four when it is a divider of 1, 2 or 4, as the H6 manual says. Read it from the correct bits as a power of two. It should only be used for frequencies lower than 288MHz, which the minimum of N does not allow, so always search the rate with it at 1 as Linux does. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Do not use the output divider of the video PLLs The bit 0 of the video PLLs is an output divider that is only used for testing. According to the H6 manual the rate of these PLLs is 24MHz*N/M with M the bit 1, and it is 1188MHz at reset, when this divider is set. It was used as a divider anyway, so the rates of the video PLLs were half of the real ones, 594MHz at reset. Do not use it. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Add the CPUX, AXI and CPUX_APB clocks Add the clocks of the CPU from the CPUX_AXI_CFG register: cpux, which selects between OSC24M, the 32kHz clock, the 16MHz RC oscillator and PLL_CPUX, and the AXI and APB clocks of the CPU, which are cpux divided by 1 to 4. The cpu nodes of the device tree use CLK_CPUX. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Add the DMA, MSGBOX, SPINLOCK, HSTIMER and DBGSYS clocks Add the bus gates and the resets of the DMA controller, the message box, the spinlock, the high speed timer and the debug system. They are on the PSI bus. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Add the PWM, IOMMU and THS clocks Add the bus gates and the resets of the PWM controller, the IOMMU and the thermal sensor. They are on the APB1 bus. The manual has no reset for the IOMMU but the binding has one and Linux uses the bit 16 of its register for it. This bit cannot be written, so this reset does nothing. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Add the AVS clock Add the gate of the AVS clock, which is the 24MHz oscillator. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Add the MBUS clock Add the MBUS clock, which selects between OSC24M, PLL_PERIPH0(2X), PLL_DDR0 and PLL_PERIPH0(4X) and has a divider from 1 to 8, with its reset, and the gates of the MBUS clock of the DMA, VE, CE, TS, NAND, CSI and DE interlace masters. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Add the DRAM clock Add the DRAM clock, which is PLL_DDR0 divided by 1 to 4, and the bus gate and the reset of the DRAM. The firmware sets up the DRAM, they are not meant to be changed. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Add the SPI, NAND, SCR, TS and CIR-TX clocks Add the module clocks of NAND0, NAND1, SPI0, SPI1, TS and CIR-TX, which are all a gate, a mux, a power of two N and a M. Also add the bus gates and resets of NAND, SCR, SPI, TS and CIR-TX. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Add the DE, DI, GPU, CE, VE, EMCE and VP9 clocks Add the module clocks, bus gates and resets of the display engine, the deinterlacer, the GPU, the crypto engine, the video engine, the EMCE and the VP9 decoder. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Add the HDMI, TCON and HDCP clocks Add the module clocks, bus gates and resets of HDMI, TCON LCD0, TCON TV0 and HDCP, and the HDMI slow clock. The TCON LCD clock has no divider. The HDMI CEC clock is not added, its second parent is PLL_PERI0(2X) divided by 36621, which needs a fixed pre-divider. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Add the PCIe clocks Add the 100MHz reference clock, which is PLL_PERIPH0(4X) divided by 24, its two gates, the MAXI and AUX clocks, and the bus gate and the two resets of PCIe. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Add the CSI clocks Add the CCI gate, the TOP and MCLK clocks, and the bus gate and reset of the CSI. The mux of the TOP clock has no parent for the value 1. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Add the IR, W1, RSB and RTC clocks of the R CCU Add the IR and 1-wire module clocks, which are a gate, a mux, a power of two N and a M, the RSB and RTC bus gates and the RSB reset. The manual does not document the registers of the R CCU, the offsets and the fields are the ones used by Linux. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Fix the id of PLL_DE and the names of the R_APB2 gates CLK_PLL_DE had the same id as CLK_PLL_VE, 14, so two clocks of the CCU shared an id. Use 15 as the Linux driver does. The gates of the R_APB2 UART and I2C were named r_apb1-uart and r_apb1-i2c, but their parent is r_apb2. Name them after it. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Document why the UART gates are not enabled Enabling the gates makes uart_snps get the clock rate from the CCU, it then detects a 256 bytes FIFO and the input of the console is delayed: a character is only seen when the next one is typed. Explain it in the comment instead of the old "weird behavior". Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Add the HDMI CEC clock Add the HDMI CEC clock, a mux and a gate. Its second parent is PLL_PERIPH0(2X) divided by a fixed 36621, which gives about 32.768kHz, so add this division as a fixed clock. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The PM0 to PM4 entries of the pad table of the R_PIO controller had port 0 and pin 0, copied from the PL ones, so no pin could be found for a <&r_pio 1 N> specifier. On the Pine H64 model B the reset GPIO of the SDIO WiFi power sequence is PM3, and the kernel panicked in mmc_pwrseq_attach() with "invalid pin" as the pin number was never set. Use port 1 and the real pin numbers, like the PL entries do with port 0. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/arm/'
aw_gpio_map_gpios() returned success without setting the pin when no entry of the pad table matched the bank and pin of the specifier, so the caller went on with whatever was in its variable. Return EINVAL. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/arm/'
The MMC clocks of the H6 have the doubled outputs of the PLL_PERIPH0 and PLL_PERIPH1 as inputs of their mux, followed by a fixed post divider of 2 that the driver does not know about. The rate it computed was twice the real one: on a Pine H64 the SD card requested at 50MHz and the eMMC at 52MHz ran at half of that, and transfers at about half the speed they should reach. U-Boot does the same compensation, as it pretends the parent is the 1x PLL. Name the 1x PLLs as parents, like the H3 driver does. The position in the mux is the same. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Some AMD firmware TPMs report StartMethod 2 and had no driver. They never acknowledge CTRL_REQ, so skip the idle and ready requests. Do not harvest entropy from these TPMs on AMD: on a Ryzen 7 7735HS each periodic TPM2_GetRandom froze every CPU, for up to 1.2 s (AMD PA-410). Reviewed by: kbowling Approved by: kbowling Differential Revision: https://ron-dev.freebsd.org/FreeBSD/src/pulls/103
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Unloading hwpmc while processes own PMCs frees state they still use. Return EBUSY instead. Use a try-lock on pmc_sx, since MOD_UNLOAD runs with kld_sx held. MOD_SHUTDOWN still always cleans up. Reviewed by: mhorne MFC after: 1 week Sponsored by: Advanced Micro Devices, Inc. Differential Revision: https://reviews.freebsd.org/D60561
debug: classified in
03-filenames_plain1 by
'sys/dev/'
dummy_chan_io() runs with sc->lock held, but mpu401 calls its handler from a callout with no mutex associated with it, so writing to the MIDI device node caused a panic. Give mpu401 its own handler, and leave MIDI to mpu401's timer instead of the PCM callout. Fixes: https://cgit.freebsd.org/src/commit/?id=e963472ef853 ("snd_dummy: Initial MIDI support") Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Replace MIDIQ with a simple byte queue MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Remove unused and dead code No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Do not return from midi_close() with the lock held This was already fixed in midi_open(). MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Do not duplicate MPU constants in snd_csa(4) No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Drain the mpu401 callout MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Fix inverted POLLOUT test in midi_poll() midi_queue_avail() returns the free space, so the test had it backwards. MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Clean up zero assignments No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Retire M_RXEN It was always set and cleared together with M_RX and never tested on its own, so it was redundant. The only thing that read it was midi_close()'s check for whether the flags had changed, which can be reduced to a plain FREAD test. No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Rename M_TXEN to M_TXPEND The flag means that there is data queued to transmit, not that transmission is enabled. No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Always notify the provider from midi_close() Be consistent with midi_open() which also invokes the callback unconditionally. MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Use size_t instead of int where appropriate Also switch the affected min() calls to ulmin(). No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Centralize snd_midi cleanup midi_init()'s error path leaked both unit numbers and duplicated existing code. While here, drop the locking in midi_init(), because nothing can reach m before make_dev() publishes it. MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Pair kobj_init() with kobj_delete() kobj_init() bumps the class refcount, so without a matching kobj_delete() it never drops to zero. MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Create the device node with make_dev_s() make_dev(9) publishes the node before si_drv1 is assigned, so an open(2) racing with midi_init() could dereference si_drv1 before it's set. Triggering a UAF is not currently an issue because all cdevsw methods check for NULL, but the fix makes it more robust in any case. MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
sound/midi: Pass the queue sizes as arguments to midi_init() There is no reason to have kobj methods for this. MFC after: 1 week Sponsored by: The FreeBSD Foundation
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Rev C2 requires special configuration for "optimal performance" per Microchip AN1699: LAN8670/1/2 Configuration Application Note. Add MMD (MDIO Manageable Device) read/write helpers and an indirect read function for Microchip's proprietary register access mechanism, and use them to implement the register writes documented in Microchip's application note. It appears rev C1 may warrant the same configuration, based on the Linux driver, but it is not mentioned in the application note and I have not included it here. Reviewed by: kbowling Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D61268
debug: classified in
03-filenames_plain1 by
'sys/dev/'
emulate_movs() asserts that it fails only with EFAULT, but a device read or write can fail with other errors, such as EINVAL from lapic_mmio_read() for an access whose 4-byte-aligned offset is not 16-byte aligned, or from lapic_mmio_write() for an unaligned or non-4-byte access. A guest could therefore panic a kernel with INVARIANTS using a MOVS from the local APIC. Return the error, as the other emulation functions do. Reviewed by: markj MFC after: 1 week Sponsored by: Alchemilla Ventures Private Limited
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
The interrupt handler reads and writes the registers of the PMU with IIC_INTRWAIT, which can sleep when the bus is busy, and the I2C controller the AXP209 is on in the A10 and A20 waits for the end of the transfer. The handler runs in an interrupt thread, which cannot sleep unless the interrupt is marked as sleepable, so an interrupt of the PMU would panic a kernel with INVARIANTS. Mark it, the interrupt is not shared, like it was done for the axp81x driver. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=30068a1de9e3 ("Add support for interrupts, sensors and GPIO for AXP209 PMIC")
debug: classified in
03-filenames_plain1 by
'sys/arm/'
The voltage of DCDC5 goes from 800mV to 1120mV in 10mV steps with the codes 0x00 to 0x20, then from 1140mV to 1840mV in 20mV steps with the codes 0x21 to 0x44. The first range has 32 steps and not 42, so every code above 32 was decoded and encoded wrongly: the driver read 1160mV for the 1.2V that the firmware sets for the DRAM, did not see it in the range of the FDT and wrote a code that is really 1280mV. The same happens for the other voltages, 1.36V is set to 1.46V and 1.5V to 1.6V. It also made the voltage reported for the regulator wrong. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=c175fd0fe8a3 ("axp81x: Add support for AXP803") Tested on: A64
debug: classified in
03-filenames_plain1 by
'sys/arm/'
aw_ccu: d1: Set the lock enable bit of the PLLs The lock status bit of a PLL is only updated when its lock enable bit, bit 29, is set, and the firmware only sets it for the PLLs it uses. Enabling another PLL, or changing the rate of an enabled one, then waited for a lock that never came and ended after a second with an error. Set the bit on all the PLLs when attaching, like Linux does. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=92b59f3d010d ("aw_clk: Wait for the PLL to lock when enabling it")
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_ccu: h6: Allow the IR and W1 clocks to change their parent The IR clock was defined without AW_CLK_REPARENT, so only the current parent was used to find a rate. The firmware leaves the mux on osc32k, from which the best rate is 32768Hz, and aw_cir asks for exactly 3MHz, which osc24M can give. The request failed and r_ir did not attach. Do the same as the main CCU for the CIR-TX clock and let the clock use the best parent, and do the same for the 1-wire clock which is the same. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=69919babdac7 ("aw_ccu: h6: Add the IR, W1, RSB and RTC clocks of the R CCU") Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/dev/'
aw_gpio_pic_map_intr() returned success without setting the interrupt source when aw_gpio_pic_map_gpio() failed, which happens for a pin that has no interrupt function or for an unsupported mode. The caller then went on with an uninitialized pointer. Return the error. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=0fe5379c6a99 ("arm: allwinner: Add GPIO Interrupt support")
debug: classified in
03-filenames_plain1 by
'sys/arm/'
allwinner: h616: Put the PI pins in bank 8 The PI0 to PI16 entries of the pad table had port 9 and interrupt bank 9 but the PI bank is the ninth one, bank 8, at offset 0x120. Bank 9 is a bank that does not exist, so the configuration, data, drive and pull of these pins, and their interrupt registers, were accessed at the wrong place and a <&pio 8 N> specifier, like the one of the card detect GPIO of some boards, did not find its pin. Use 8 for the port and the interrupt bank, like the other entries do with the position of their letter. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=e506af08bb52 ("aw_gpio: Add support for H616")
debug: classified in
03-filenames_plain1 by
'sys/arm/'
allwinner: a31s: Fix the pin number of PH28 The PH28 entry of the pad table of the A31s had the pin number 27, the one of PH27, so the pinctrl of PH28 configured PH27 and a <&pio 7 28> specifier could not be mapped. This was fixed for the A31 in 222947a74223 but not in the copy for the A31s. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=ccf8caad1413 ("Add the Allwinner A31 and A31s padconf support. It's currently unused, but")
debug: classified in
03-filenames_plain1 by
'sys/arm/'
allwinner: a33: Fix the pin number of PE17 The PE17 entry of the pad table of the A33 had the pin number 16, the one of PE16, so the pinctrl of PE17 configured PE16 and a <&pio 4 17> specifier could not be mapped. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=cf72965fbf02 ("Allwinner: Add A33 support")
debug: classified in
03-filenames_plain1 by
'sys/arm/'
sound/midi: Drain the mpu401 callout before device teardown midi_uninit() frees the snd_midi that mpu401_intr() reaches through midi_in() and midi_out(), but the callout that calls it was drained afterwards. Drain it first, and clear M_TXPEND so that a firing handler does not re-arm itself. Fixes: https://cgit.freebsd.org/src/commit/?id=f960b33d35da ("sound/midi: Drain the mpu401 callout") MFC with: f960b33d35da Sponsored by: The FreeBSD Foundation
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
Revert "sound/midi: Drain the mpu401 callout before device teardown" This was committed to main by accident, but was also buggy. This reverts commit 91539591d7f8dd8ca24ced875bd16c3ba3c7d201.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
axp8xx_regnode_enable() always reported a delay of 0, so the regulator-enable-ramp-delay property of the FDT was ignored. On the Pine H64 model B the Ethernet PHY is supplied by ALDO2, which has a delay of 100ms, and awg(4) resets the controller right after enabling it, before the PHY is ready: the soft reset timed out and the interface did not attach. Return the delay when enabling a regulator, like the fixed regulator driver does. Fixes: https://cgit.freebsd.org/src/commit/?id=c175fd0fe8a3 ("axp81x: Add support for AXP803") Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/arm/'
The firmware gives the MAC address of the controller in the FDT, in the mac-address or local-mac-address property. awg(4) only used the address in the registers, which is set when the firmware used the controller, and the one created from the SID. On the Pine H64 the firmware does not initialise the Ethernet and the SID driver does not support the H6, so a random address was created and it changed at every boot. Use fdt_ether_get_addr(), it takes the address of the FDT and keeps the current one when there is none. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/arm/'
Add the SID of the H6. The efuse starts at 0x200 like on the other 64 bits SoCs and starts with the 16 bytes of the chip ID, which awg(4) uses to create a MAC address when the firmware did not give it one. The thermal sensor calibration data is not added, there is no driver for the thermal sensors of the H6. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/arm/'
Apply hardware revision D0 configuration from Microchip AN1699 (Revision G). The LSCTL (0x0012) write is deferred until link state reporting is implemented. Sponsored by: The FreeBSD Foundation Sponsored by: Microchip (Hardware) Differential Revision: https://reviews.freebsd.org/D61269
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Most ure(4) devices use mii; 8156 and 8156B do not and have special cases throughout the driver. ifmedia_ioctl() sets ifmr->ifm_active to ifm_cur->ifm_media before calling the status callback. The 8156 case in ure_ifmedia_sts ORs in the subtype and duplex flags to the existing value, which may result in garbage values. Instead, start by setting ifm_active to just IFM_ETHER before ORing in other bits. Reported by: llm-postcr Reviewed by: kbowling, pouria Fixes: https://cgit.freebsd.org/src/commit/?id=d4cf41a99b40 ("Add support for RTL8153B, RTL8156 and RTL8156B to if_ure(4).") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D61158
debug: classified in
03-filenames_plain1 by
'sys/dev/'
emulate_movs() uses the memread and memwrite callbacks selected from the faulting GPA for both operands of an MMIO-to-MMIO MOVS. A guest can therefore make the local APIC handler write to a GPA outside the APIC page, which trips the offset assertion in vlapic_write() on INVARIANTS kernels. Dispatch each MMIO read and write according to its GPA. This allows MOVS between in-kernel devices. During in-kernel emulation, return EINVAL if an MMIO operand lies outside those devices' ranges. Reported by: llm-postcr Reviewed by: markj MFC after: 1 week Sponsored by: Alchemilla Ventures Private Limited Differential Revision: https://reviews.freebsd.org/D61495
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
acpi: Tasks: Use M_WAITOK to allocate the taskqueue Memory failure at this point normally does not happen except if the kernel is running on a machine with a too tiny amount of memory, in which case it is likely to panic or to be unusable anyway. However, letting it panic here with a NULL pointer dereference is not very helpful. Instead, use M_WAITOK, hoping the memory allocator itself will indicate the low memory condition if it cannot succeed (if it does not, it should be changed to). Reviewed by: obiwac Differential revision: https://reviews.freebsd.org/D60379
debug: classified in
03-filenames_plain1 by
'sys/dev/'
acpi: Tasks: Ensure sane values for number of tasks and threads Make sure that these are set to sane values even on silly tunables: - There must be at least one thread to process the 'acpi_taskq'. - Use the ACPI_MAX_TASKS default when a negative number of tasks was specified. This avoids common pilot errors causing a bogus huge memory allocation for acpi_tasks[]. Reviewed by: obiwac (older version) Differential Revision: https://reviews.freebsd.org/D60373
debug: classified in
03-filenames_plain1 by
'sys/dev/'
acpi: Tasks: Precisely report the maximum number of slots used To this end, store the actual number of busy slots instead of the index of the final slot selected (off by one), and fix races when updating 'acpi_tasks_hiwater'. The race is that it could happen that a first thread enqueued a task at a higher index than the current maximum, followed by a second one enqueuing at some even higher index, with the first thread updating 'acpi_tasks_hiwater' while the second was exactly after the 'if (i > acpi_tasks_hiwater)' but just before attempting the atomic_cmpset_int() that updates 'acpi_task_hiwater', which then would fail silently (the return value was ignored) leading to the real maximum not being recorded. Fix the race by simply testing the return value of atomic_cmpset_int() and retrying. Use an explicit atomic_load_int() for the guard (that compiles to a regular load, so this change is cosmetic). Note that the atomic_cmpset_int() loop can at most be executed a number of times equal to the reported 'acpi_tasks_hiwater', which appears to be low in practice (~#CPUS). Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D60375
debug: classified in
03-filenames_plain1 by
'sys/dev/'
Each watchdog pass submitted an Abort for every timed-out command with nothing counting them against the controller's ACL. A controller may complete excess Aborts with Abort Command Limit Exceeded status. Reviewed by: imp, adrian Differential Revision: https://reviews.freebsd.org/D59636
debug: classified in
03-filenames_plain1 by
'sys/dev/'
grab_mcontext() saved the FP and vector registers with save_fpu() and save_vec(), which drop ownership: PCPU(fputhread) becomes NULL while PCB_FPU stays set and the thread keeps using the unit. A later cpu_update_pcb(), at fork(2) or thr_new(2), then skipped the save, since save_fpu_nodrop() only saves for the thread that owns the unit, and the child got the registers as they were at the getcontext() or signal rather than at the fork. Use the nodrop variants. A child forked after getcontext() saw the parent's f14 as it was at the getcontext(); it sees the current value now. Reviewed by: adrian, jhibbits MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D60837
debug: classified in
03-filenames_plain1 by
'sys/powerpc/'
A 64-bit signal frame is 1552 bytes; rounded up and with the 512 byte red zone added it needs 2096 bytes, more than MINSIGSTKSZ (2048), so a handler on a minimum size alternate stack had its frame start 48 bytes below the stack. The red zone only exists below the interrupted code's stack pointer, so skip it only when the frame goes on that stack. A handler on a MINSIGSTKSZ alternate stack overwrote the 48 bytes below it; the frame stays within the stack now. Reviewed by: jhibbits MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D61519
debug: classified in
03-filenames_plain1 by
'sys/powerpc/'
Use the EFI TCG2 protocol, or the legacy TCG protocol on TPM 1.2 firmware, to extend the loader PCRs and record EV_IPL events in the firmware event log. Extend PCR 8 with the final kernel environment and the type, name, and arguments of each loaded boot input. Prefix both record types with versioned, NUL-terminated domain strings. These make the records self-identifying and define an explicit measured policy encoding. Store the complete measured pre-images in the event data so attestation and diagnostic tools can audit the values without an out of band copy. Extend PCR 9 with the initialized contents of kernels, modules, and raw boot inputs, but record only descriptive labels rather than copying file contents into the event log. The Lua module table has no defined traversal order. Retain content ranges as loader-private metadata, then sort the final file list before extending either PCR. This produces repeatable values and excludes failed or subsequently unloaded files. Measure initialized loaded memory rather than source files. This covers zero initialized ELF data while excluding undefined gaps and debugging information. Do not measure entropy, timing data, or GELI key files. Exclude loader passwords and the GELI passphrase from the kernel environment measurement so low entropy secrets do not acquire a public event-log digest or appear in the event data. Measurement remains best effort. Warn and stop measuring after the first firmware or allocation error rather than preventing the system from booting. Validated with the EFI TCG protocol on a ThinkPad T430 TPM 1.2 using coreboot with a measured EDK2 payload. Replaying the loader events reproduced PCRs 8 and 9, and both PCRs repeated across clean boots. TPM 2.0 testing on a commercial AMI EFI firmware likewise produced stable PCRs across clean boots. A raw firmware-log dump decoded by tpm2_eventlog using tpm(4) changes that will come later confirmed the versioned PCR 8 pre-images and the descriptive PCR 9 event data. Reviewed by: imp MFC after: 2 weeks Relnotes: yes Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59141
debug: Commit manually moved from "unknown" to "hardware".
On the Pine H64 model B the PHY is supplied by a regulator of the AXP805, which keeps its state over a reset of the SoC. After a reboot the PHY is still powered and U-Boot finds it, while after a power cycle it does not. When U-Boot finds the PHY the kernel hangs or panics at a random place very early, before any driver is attached, most of the time. When it does not, the boot is fine. The reason is not known, the Ethernet controller of the SoC being left running by U-Boot is one possibility. Stop the controller and disable the PHY supply when shutting down, so that the next boot starts like after a power cycle. This is a workaround, the problem should be fixed in U-Boot. Tested on: H6
debug: classified in
03-filenames_plain1 by
'sys/arm/'
Using the mixer lock unconditionally panics because the lock is uninitialized on devices with no audio interfaces, for instance MIDI-only keyboards. Fixes: https://cgit.freebsd.org/src/commit/?id=9a00e0b8ca56 ("snd_uaudio: Do not use snd_mixer->lock as mixer_lock") MFC after: 3 days Sponsored by: The FreeBSD Foundation Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D61506
debug: classified in
03-filenames_plain1 by
'sys/dev/'
VSCR was saved and restored through stvewx/lvewx at byte 12 of a 16 byte slot. Which element those instructions move at a given address depends on the byte order, so on little-endian kernels they touched VR bits 0-31 instead of the 96-127 where mfvscr/mtvscr keep VSCR: every context switch and signal reset VSCR to 0, losing NJ and SAT. Replicate the word into all four elements first so that the element choice no longer matters. VSCR[NJ] set with mtvscr read back as 0 after a usleep on a little-endian kernel; it is preserved now. Reviewed by: adrian, jhibbits MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D61525
debug: classified in
03-filenames_plain1 by
'sys/powerpc/'
Missed packets should be counted as drops, not as both drops and errors. Errors should be reserved for things like link level crc errors. Reviewed by: kbowling Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D61523
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The generic netmap TX pool always allocates standard clusters (zone_clust), even though the buffer size may be larger. INVARIANTS kernels panic in nm_os_get_mbuf() on first transmit through a non-native NIC (e.g. re or epair) using netmap with jumbo frames configured. Release kernels silently truncate frames in nm_os_generic_xmit_frame(). Implement cluster zone selection based on the requested size. Catch oversized requests in nm_os_catch_tx() and return EINVAL. Add a KASSERT before the truncation fallback in xmit. Make nm_os_get_mbuf() take a uint32_t size, matching the type of the value passed to it. Tested using epair, pkt-gen, and tcpdump on release (15.1) and INVARIANTS (main) kernels at buffer sizes 2048/4096/9216/16384. Reviewed by: vmaffione, kevans, markj Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D61281
debug: classified in
03-filenames_plain1 by
'sys/dev/'
acpi_pci_link: Ignore tunables with negative values IRQ values are unsigned and negative values do not make sense. The invalid IRQ value (255) is already ignored, so ignoring other invalid values is consistent with that behavior. Reported by: cperciva
debug: classified in
03-filenames_plain1 by
'sys/dev/'
acpi_pci_link: Remove a helper variable from _PRS parsing Tested by: cperciva
debug: classified in
03-filenames_plain1 by
'sys/dev/'
acpi_pci_link: Factor out some duplicated code into a single copy Tested by: cperciva
debug: classified in
03-filenames_plain1 by
'sys/dev/'
acpi_pci_link: Handle IRQ values > 255 Some systems use a stub PCI link device for hardwired interrupts instead of static _PRT entries. These link devices can use an IRQ > 255. The current driver was designed to handle PCI link devices on x86 used for legacy INTx IRQs which were < 255. These changes handle larger IRQ values while making a few tradeoffs. - Expand most IRQ fields from 8 bits to 32-bits. The BIOS IRQ (read from the PCIR_INTLINE config register which is an 8-bit register) remains 8 bits. - Add a wrapper API for managing interrupt weights and avoid tracking weights for IRQs > 255 and instead report a constant weight of 0 for IRQs > 255. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300476 Reported by: Aviv Bakal <avivb@amazon.com> Tested by: cperciva
debug: classified in
03-filenames_plain1 by
'sys/dev/'
In xhci_check_transfer, we tried to iterate through STREAM * NUM_SLOTS and find the correct stream. However, stream is rear nowadaya both on FreeBSD and Linux. In which means that such STREAM * NUM_SLOTS array is sparse. As a result, we use a bit map to map stream id to slot. For a xhci_mask[stream_id], it contains the slot_id bitmap over which slot has been occupied. Differential Revision: https://reviews.freebsd.org/D61247
debug: classified in
03-filenames_plain1 by
'sys/dev/'
We enlarge the total number of queued transfer. Also, to make controller always busy. We enqueue the xfer as much as possible to the ring in multiple enter code. Differential Revision: https://reviews.freebsd.org/D61246
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The TX clock delay of the YT8511 is split in two registers. The delay used in gigabit mode is in the clock gating page and was already set from the RGMII mode, but the one used in the 10/100 modes is in the next page and was left at its reset value of 2ns. With a phy-mode that does not ask for a TX delay in the PHY, the MAC provides it and the PHY adds another 2ns in the 10/100 modes. Set it like the gigabit one, like Linux does. Tested on a Quartz64 Model A, gigabit and 100Mbit links. Reviewed by: oh Differential Revision: https://reviews.freebsd.org/D61015
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The root port reports in LNKCAP the highest link speed the core was synthesized for, which can be more than the PHY behind it supports. On the RK3568 pcie2x1 the root port advertises 8GT/s while the PHY only does 5GT/s. The link stays at 2.5GT/s after the directed speed change. Read max-link-speed from the device tree and write it to the Max Link Speed field of LNKCAP and to the Target Link Speed field of LNKCTL2 before requesting the speed change. Nothing changes when the property is absent. Tested on a Quartz64 Model A with a Samsung 970 EVO Plus NVMe drive: the link now trains at 5GT/s and the sequential throughput goes from 200MB/s to 400MB/s. Differential Revision: https://reviews.freebsd.org/D61014
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: restore SMC state across suspend/resume Reinit the SMS interrupt mask, motion thresholds, and shock window on resume. Guard the backlight rewrite on sc_has_light. Add device_suspend to release manual fan control before sleep and restore it on resume. MFC after: 3 days Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D61478
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: print the last field of the SMC revision correctly Use be16dec() at the correct offset instead of an unaligned, off-by-two-bytes read through a cast pointer. MFC after: 3 days Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D61479
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: add MODULE_VERSION Advertise the module's ABI version. MFC after: 3 days Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D61480
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: remove the unused sc_dev softc field It was never assigned or read. legacy code. MFC after: 3 days Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D61481
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: do not drop shutdown notification when the system node fails asmc_attach() registered the MBSS shutdown-cause handler (EVENTHANDLER_REGISTER(shutdown_pre_sync, asmc_shutdown, ...)) after attempting to add the dev.asmc.N.system sysctl subtree. If that subtree registration failed, the error path took goto nosms, jumping clean over the shutdown-handler registration. On T2 Macs this silently drops the only thing standing between a clean shutdown and bridgeOS's watchdog power-cycling the machine. MFC after: 3 days Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D61482
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: clear the sensor counts in detach The key arrays are freed but the counts were left set, leaving the softc describing freed memory. Reachable via the attach error path, which calls detach directly. MFC after: 3 days Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D61483
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: register the fan id sysctl with a string format Every fan sysctl was registered with a hardcoded "I" format, but id is CTLTYPE_STRING. Carry the format in the table instead. MFC after: 3 days Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D61484
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: propagate sysctl read and write errors Several handlers discarded the key transport's result: fan speed, SMS and ambient light handlers published a value regardless of read success; a rejected fan speed or keyboard backlight write reported success; fan id returned EPERM on an unreadable key instead of ENXIO. asmc_fan_getvalue()/asmc_fan_setvalue() now return the error and pass the speed out by reference instead of returning -1 for failure. MFC after: 3 days Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D61485
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: report temperatures in deciKelvin The handler returned the raw key's high byte, dropping the sign and fraction of the sp78 encoding, and published -1 on a failed read. Read through asmc_sensor_read() instead, convert to deciKelvin, and register the leaves as "IK". Changes the unit of dev.asmc.N.temp.*. MFC after: 3 days Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D61487
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: wrap the lines that exceed 80 columns Remove linter noise. No functional change. MFC after: 3 days Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D61488
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: do not report absent sensors as a temperature A key can exist for a sensor the model was never built with; the SMC answers those with a fixed sentinel instead of an error. Return ENXIO for the sentinel instead of publishing it as a reading. MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D61489
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: make asmc_sysctl_add_system() void Its only caller already discarded the return value with (void). Match the other sysctl subtree builders. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D61537
debug: classified in
03-filenames_plain1 by
'sys/dev/'
asmc: rename asmcmmio.{c,h} to asmc_mmio.{c,h}
No functional change.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D61538
debug: classified in
03-filenames_plain1 by
'sys/dev/'
If the mps/mpr(4) device has corrupted or missing firmware then it will fail to attach. Add an interface to use firmware(9) to load the firmware at boot. Loosely based on https://github.com/marcan/lsirec/ Assisted-by: Claude Code (Opus 5) Reviewed by: imp Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D59854
debug: classified in
03-filenames_plain1 by
'sys/dev/'
midi(4) stopped being a module in 45bb10e0ed5a ("sound: Stop building
midi as a module"), so snd_cmi(4) and snd_emu10k1(4) fail to load
because they still depend on it.
Fixes: https://cgit.freebsd.org/src/commit/?id=45bb10e0ed5a ("sound: Stop building midi as a module")
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
debug: classified in
03-filenames_plain1 by
'sys/dev/'
The error path of the SNAPSHOT_*_OR_LEAVE() macros jumped past VRTC_UNLOCK() and returned with the vrtc lock held. Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com> Reviewed by: bnovkov, markj, jhb Sponsored by: keelos.dev Differential Revision: https://reviews.freebsd.org/D60232
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
The callout of the periodic interrupt was rearmed from its handler with a timeout of one period from the time the handler ran. Each period was longer than programmed by the latency of the callout, so the interrupt came at a lower rate than the guest asked for. A guest that counts these interrupts to keep its time runs slow. Give the callout absolute deadlines one period apart, as vatpit does. If a deadline has already passed when it is computed, for instance after the VM was paused, start again from the current time. Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com> Reviewed by: jhb Sponsored by: keelos.dev Differential Revision: https://reviews.freebsd.org/D60233
debug: classified in
03-filenames_plain1 by
'sys/amd64/'
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/'
Note that the FreeBSD Foundation manages the current value associated with `OUI_FREEBSD_BASE`. Trim trailing whitespace in comments in the change while here. MFC after: 1 week Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/82
debug: classified in
03-filenames_plain1 by
'sys/net/'
The recently added code to rack to help minimize reordering issues had a KASSERT for protection of its counting field. This was consistently. Triggered in broadcom's testing lab. They came up with a partial solution.. but one of their fixes was also incorrect causing the counter to increase incorrectly as well. I worked with them to give them an updated patch (the one attached in this review). They have tested that in their same repro environment and confirm this fixes the issue. Reviewed by:tuexen, nickbanks_netflix.com Differential Revision: <https://reviews.freebsd.org/D61136>
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
In preparation for removing mp_ring, enable simple_tx by default.
Users encountering bugs are still able to set the tunable:
net.iflib.prefer_mpring="1"
at boot, but are encouraged to report any regressions so they
can be fixed.
My plan is to remove mp_ring assuming no major bugs are found in
simple_tx after a month or two.
Reviewed by: kbowling, netchild, rcm
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D61166
debug: classified in
03-filenames_plain1 by
'sys/net/'
devctl_notify() can be called with a mutex held. If the event system is not listed in devctl_systems[], sysevent_get_group() calls sysevent_new_group(), which calls strdup() with M_WAITOK, and we may end up sleeping while holding a non-sleepable mutex. Add the missing systems. While here, remove the nonexistent KERNEL system. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299272 MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D61161
debug: classified in
03-filenames_plain1 by
'sys/netlink/'
When spitting an RSM containing the SYN and data, honor the sequence number used by the SYN flag when computing the offset in the socket buffer. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297006 Reviewed by: rrs, Peter Lei MFC after: 3 days MFC to: stable/15 Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D61149
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
Mark's Claude code properly points out an interesting bug case where if a new block is
created from a sack aka
rsm |--------|
sackblk |--------->
Then when the new block is created rack_check_reorder_ack() is called and then called again when
the block is actually ack'ed. Proper thing is to *not* in this case call the function and only call
it at the processing to ACK. You leave the hookery side however since that is just transfering
the existing block pointers.
Differential Revision:https://reviews.freebsd.org/D61159
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
Fix accounting in the sequence space for a FIN bit potentially piggy bagged during SACK loss recovery triggered transmissions. Reviewed By: #transport, tuexen Sponsored by: NetApp, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D61312
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
key_updateaddresses() gives the clone of an SA a new SAH reference when
the SA index comes from key_newsah() or key_getsah(), but nothing
releases the reference of the old SA: key_delsav() leaves the SAH alone,
because key_unlinksav() normally releases it, and an SA that is replaced
never goes through that. The SAH then stays allocated for good, after
its SAs are flushed and after the vnet is destroyed, as an SADB_UPDATE
with a new address does each time an IKE daemon moves an SA.
The old SA cannot release the reference when it is replaced, since a
sender that still holds it reads its SAH. Release it in key_delsav()
instead. When only the NAT-T config changes, the clone used to take over
the reference of the old SA; take a new one in that case as well, so that
every SA holds its own.
Reviewed by: kib, markj
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D61101
debug: classified in
03-filenames_plain1 by
'sys/netipsec/'
ipfilter: Only recalculate the UDP header when we have one When ipf_nat_out processes NAT_DIVERTOUT (ipnat rdr statements) it also fixes the checksum in the UDP header. Test for a UDP header before adjusting its length. While we are here, the length in the UDP header must be converted from network byte order to host byte order. Add the missing ntohs(). PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296944 MFC after: 3 days
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
ipfilter: Remove erroneous ntohs() The original commit was wrong. ipf_nat_builddivertmp() builds the UDP template with the length in host byte order M_DUP() copies that value unchanged. The old code was therefore correct. It added fin_plen in host order and then did a single htons(). The original patch was discussed with Co-Pilot, which pointed out the original bug. claude-opus-5-5 discovered the ntohs() error that co-pilot suggested. Interestingly this code had been running here for a couple of months. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=72cc9e3766f4
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
The error paths of ah_input_cb(), ah_output_cb(), ipcomp_input_cb() and ipcomp_output_cb() called CURVNET_RESTORE() before key_freesav() and key_freesp(). When the callback runs on a crypto return thread, no vnet is set after the restore, and key_freesav() panics with "vnet is not set" on INVARIANTS kernels. Without INVARIANTS, the last reference would be released without a vnet. Restore the vnet last, as the ESP callbacks do. Reviewed by: mjg Fixes: https://cgit.freebsd.org/src/commit/?id=8a9269edd71a ("ipsec: sprinkle CURVNET_ASSERT_SET") MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D61386
debug: classified in
03-filenames_plain1 by
'sys/netipsec/'
Simply the TXQ_AVAIL() macro to avoid using get_inuse(txq->ift_size, txq->ift_cidx, txq->ift_pidx, txq->ift_gen) and instead define it in terms of txq->ift_in_use. Note that in_use is equivalent, because it is updated at the same time as cidx/pidx and gen, and under the same serialization. The advantage is that its cheaper due to using one read and no branches, and safer, since unlocked reads get an atomic snapshot of availability, but an unlocked read of multiple counters can produce inconsistent results. Reviewed by: kbowling, kgalazka Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D61279
debug: classified in
03-filenames_plain1 by
'sys/net/'
When simple_tx gives up & return ENOBUFS because the tx ring is full, we were doing a GROUPTASK_ENQUEUE(&txq->ift_task) each time. On a tx ring that has overflowed and is being hammered on by a fast UDP sender, this can result in a massive increase in context switches (I've seen over 30M ctxw/sec due to this, and the ctxsw codepath taking roughly 50% CPU). This change removes the GROUPTASK_ENQUEUE() and replaces it with a call to a callout which drains the tx ring. The callout time is determined based on the link speed, estimating how long it would take for a large fraction of of a ring containing full-MTU packets to drain. This removes the 30M ctxsw / sec in my test case and reduces it to roughly a doubling of ctxsws. Reviewed by: kbowling Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D61313
debug: classified in
03-filenames_plain1 by
'sys/net/'
Major changes in 1.22.3 (2026-11-09) ==================================== This is a bug fix release, with a focus on security issues discovered with the aid of large language models. See https://web.mit.edu/kerberos/advisories/MITKRB5-SA-2026-001.txt for information on the risks of continuing to use unpatched releases. * Fix a logic error when checking PAC server checksums [CVE-2026-111423]. * Check for unkeyed checksums when validating CAMMAC verifiers [CVE-2026-71199]. * Fix a loophole in the KDC's client authdata filtering which could allow clients to include fake PAC and CAMMAC authdata values when requesting service tickets. These fake values would be rejected by application servers, were it not for the two bugs noted above. * Check for the lockdown_keys attribute when processing password change protocol requests in kadmind [CVE-2026-107884]. * In libgssrpc, when processing RPC messages using the RPCSEC_GSS flavor, use the verified service type included in the RPC request to determine how to unwrap arguments and wrap return values, instead of the unverified service type included during authentication [CVE-2026-118380]. * In libgssrpc, disable the AUTH_GSSAPI server auth flavor unless the "GSSRPC_ALLOW_AUTH_GSSAPI" environment variable is set. AUTH_GSSAPI is only needed for very old (pre-1.4) clients [CVE-2026-112322] [CVE-2026-112323]. * Fix numerous null pointer deferences, read overruns, unbounded memory allocations, and memory leaks that could be used as denial of service attacks against the KDC, kadmind, application servers, or client programs [CVE-2026-40355] [CVE-2026-40356] [CVE-2026-71200] [CVE-2026-107364] [CVE-2026-107708] [CVE-2026-107778] [CVE-2026-112314] [CVE-2026-112315] [CVE-2026-112316] [CVE-2026-112317] [CVE-2026-112318] [CVE-2026-112319] [CVE-2026-112320] [CVE-2026-112321] [CVE-2026-112323] [CVE-2026-119079]. * Fix a client crash when a KKDCP proxy daemon closes the TLS session without supplying any response data. * Shut down kpropd gracefully when a termination signal is received, when operating in incremental propagation mode. * Detect when an incremental propagation update is applied to a nonexistent principal; when this happens, force a full resync instead of crashing. * Fix a KDC crash when the LDAP KDB module loses its connection to the LDAP server. * Avoid a crash on macOS when the native API ccache type is used before and after forking a process. * When an application accepts a GSS context without asking for delegated credentials, discard any credentials sent by the initiator without parsing them first. Security: https://web.mit.edu/kerberos/advisories/MITKRB5-SA-2026-001.txt MFC after: 3 days Merge commit '5f11ec7e8ab9647977a56fca934c40951e051779' into krb5-1.22.3
debug: classified in
05-summary-prefix by 'krb5:'
183513d15f22 made the AH, ESP and IPComp input callbacks hold the sahtree read lock, but only esp_input_cb() drops it before resubmitting a request that the crypto framework completed with EAGAIN. ah_input_cb() and ipcomp_input_cb() return with the lock still held. crypto_invoke() completes requests with EAGAIN while their driver detaches. Detaching ossl(4) under inbound AH traffic then hangs the next rmlock writer, and the system panics with "spin lock held too long" in smp_rendezvous_cpus() called from _rm_wlock(). Release the lock as esp_input_cb() does. Reported by: llm-postcr Reviewed by: kib Fixes: https://cgit.freebsd.org/src/commit/?id=183513d15f22 ("sys/netipsec: ensure sah stability during input callback processing") MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D61399
debug: classified in
03-filenames_plain1 by
'sys/netipsec/'
carp_nl_get() tested ifp->if_carp for NULL before taking carp_sx and walked the softc list afterwards. When the last vhid on the interface is removed in between, carp_free_if() clears if_carp and the walk dereferences a NULL pointer. A reader that passes the check while the removal holds carp_sx always hits this. The check was done with the lock held until the ioctl(2) API was retired. Do it under the lock again. Reported by: Marcos Mendoza <mmendoza@netgate.com> Fixes: https://cgit.freebsd.org/src/commit/?id=72472e52e310 ("carp: retire ioctl(2) API") Sponsored by: Rubicon Communications, LLC ("Netgate")
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
esp_input() and esp_output() allocated a cryptop from the crypto layer,
then malloc'ed the xform_data the callback needs, and with ESN a third
buffer for the separate AAD. The callback freed all three. That is
two or three allocation pairs for every packet.
Put the three in one structure, allocated once per packet from a
dedicated UMA zone. The crypto layer provides crypto_initreq() and
crypto_destroyreq() for an embedded cryptop, as wg(4) and ktls use.
The AAD buffer is sized for the ESP header, the longest IV and the
high-order half of the sequence number, which is all the separate AAD
can hold.
No functional change intended.
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D61395
debug: classified in
03-filenames_plain1 by
'sys/netipsec/'
merge_nhgrps() sized its temporary nexthop array as twice the existing group instead of the sum of both groups. Fixes: https://cgit.freebsd.org/src/commit/?id=dd945c6ba4ff ("routing: Implement merge of nhgrp in new multipath route")
debug: classified in
03-filenames_plain1 by
'sys/net/'
When no security policy matches a packet, ipsec[46]_getpolicy() returns
the default policy with a new reference, and the caller drops it right
after looking at the policy type. Once any security policy is
configured, every forwarded packet goes through ip_forward() and
ipsec4_forward(), which checks the inbound and the outbound policy.
That is four atomic operations per packet on one reference count that
all CPUs write.
The default policy is allocated with its vnet and freed only when the
vnet goes away, and the sysctl limits it to NONE or DISCARD. A packet
without a PCB has no policy cache to keep it in. In that case, check
the policy type directly and take no reference, for NONE as well as for
DISCARD. Packets with a PCB still take the reference, because the PCB
caches the policy.
No functional change intended. DISCARD still drops the packet, and the
policy violation counters are incremented as before.
Reviewed by: kib
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D61384
debug: classified in
03-filenames_plain1 by
'sys/netipsec/'
This is the same fix as in commit 9c8be6518e2e5f396055ecdab8098ce19c4b2218 just applied to another method that also accepts namespace IDs. The original commit handled configuration statements assigning a named LUN to a namespace. This change handles anonymous namespaces configured within a controller context. Fixes: https://cgit.freebsd.org/src/commit/?id=66b5296f1b29 ("ctld: Add support for NVMe over Fabrics") Sponsored by: Chelsio Communications
debug: classified in
03-filenames_plain1 by
'usr.sbin/ctld/'
Sponsored by: Chelsio Communications
debug: classified in
03-filenames_plain1 by
'usr.sbin/ctld/'
Allow multiple gre tunnels between the same source and destination addresses, distinguished by their incoming gre key. Add greikey and greokey to ifconfig(8) to set the incoming and outgoing keys separately and grekey now sets both. Add a net.link.gre.key_fallback sysctl for backward compatibility and set it to true by default. Also write multikey tests for both IPv4 and IPv6 families. Relnotes: yes Reviewed by: adrian Discussed with: zlei Differential Revision: https://reviews.freebsd.org/D59849
debug: Commit manually moved from "unknown" to "network".
add_route_flags() consumes the nexthop reference on every failure path, so nhop_free() in rib_copy_route() releases it for the second time. This is reachable when growing net.fibs while two existing fibs hold the same pinned prefix. MFC after: 3 days Fixes: https://cgit.freebsd.org/src/commit/?id=40503b792f7e ("routing: populate fibs with interface...")
debug: classified in
03-filenames_plain1 by
'sys/net/'
geneve_optlen is a 6-bit bitfield within a single byte, so it has no byte order. Applying ntohs() to it on little-endian machines turned an option length of 1 into 256, causing every received packet carrying options to dropped. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300453 Reviewed by: pouria Fixes: https://cgit.freebsd.org/src/commit/?id=e44d2e941e8e ("if_geneve: Add Support for Geneve (RFC8926)")
debug: classified in
03-filenames_plain1 by
'sys/net/'
RFC 8926 section 3.4 requires the reserved fields of geneve header to be ignored on receipt. While here, remove the needless htons() from the version check, as geneve_ver is a 2-bit bitfield with no byte order. Fixes: https://cgit.freebsd.org/src/commit/?id=e44d2e941e8e ("if_geneve: Add Support for Geneve (RFC8926)")
debug: classified in
03-filenames_plain1 by
'sys/net/'
The offset passed to geneve_udp_input() points at the UDP header, which for IPv6 comes after any extension headers. The outer header is always at the start of the mbuf. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=e44d2e941e8e ("if_geneve: Add Support for Geneve (RFC8926)")
debug: classified in
03-filenames_plain1 by
'sys/net/'
ip6_forward() keeps a copy of the start of the packet in case it has to send an ICMPv6 error. Every exit must either pass the copy to icmp6_error() or icmp6_redirect_output(), or free it. Three exits did neither and leaked the copy: - the destination scope check, when a packet would leave the zone of its destination address; - a packet that a pfil hook redirected to a local address, which is queued for local input; - a packet whose checksum has to be computed here and whose last header offset is not valid. Free the copy in these three cases. Reviewed by: tuexen, pouria Fixes: https://cgit.freebsd.org/src/commit/?id=8a006adb2441 ("Add support for IPv6 to ipfw fwd...") Fixes: https://cgit.freebsd.org/src/commit/?id=bcb298fa9e23 ("sctp, tcp, udp: improve deferred computation...") MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D61509
debug: classified in
03-filenames_plain1 by
'sys/netinet6/'
tcp_addoptions() sends only the SACK blocks that fit in TCP_MAXOLEN. tcp_maxseg() counted every pending block and clamped the total, so without timestamps and with five or more blocks pending it came out 4 bytes below the segment tcp_output() sends. Limited transmit after an RTO then sent one full segment and failed the "sent too much" KASSERT. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282605 Approved by: adrian (mentor) Signed-off-by: Nick Price <nprice@FreeBSD.org> Reviewed by: tuexen, glebius, adrian Differential Revision: https://reviews.freebsd.org/D60460
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
newnhg() copied the weights of a nhgrp as is and a group whose members all have a zero weight, which is what userland sends when it leaves the weight unset, made calc_min_mpath_slots_fast() divide by zero. Therefore replace weight of zero with RT_DEFAULT_WEIGHT. While here, return early from calc_min_mpath_slots_fast() if all weights are zero. MFC after: 3 days Fixes: https://cgit.freebsd.org/src/commit/?id=7e5bf68495cc ("netlink: add netlink support")
debug: classified in
03-filenames_plain1 by '['sys/net/',
'sys/netlink/']'
No functional change intended. MFC after: 3 days MFC to: stable/14 MFC to: stable/15 Sponsored by: Netflix, Inc.
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
A unicast frame for the bridge is handed to the stack with rcvif set to the bridge, but it kept the FIB of the member it arrived on. With the bridge in another FIB, replies were looked up in the wrong routing table and dropped. Set the FIB of the bridge on such frames. If member_ifaddrs is enabled and the bridge inherited its MAC address from a member, keep the old behaviour, since the frame may be for an address configured on that member. Reviewed by: zlei Differential Revision: https://reviews.freebsd.org/D61517
debug: classified in
03-filenames_plain1 by
'sys/net/'
Invalidate the rtt based on t_rxtshift instead of resetting t_srtt to 0, because using the latter also affects the retransmission timeout. Reviewed by: Peter Lei MFC after: Netflix, Inc. MFC to: stable/15 Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D61585
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
The retransmission timeout should the srtt + 4 * rttvar. The srtt is using 5 bits of fractions and rttvar is using 4 bits of fractions, some specific shifting is required. Reviewed by: Peter Lei MFC after: 3 days MFC to: stable/15 Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D61581
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
t_srtt and t_rttvar use different lengths of fractions, therefore use the appropriate shift value. Reviewed by: Peter Lei MFC after: 3 days MFC to: stable/15 Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D61600
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
When performing a timer based retransmission, clear the BBR_RWND_COLLAPSED flag. If it sticks, t_rxtshift is never incremented resulting in unlimited retransmissions in the LAST-ACK state. Reported by: Illia Vynohradov Reviewed by: Peter Lei MFC after: 3 days MFC to: stable/15 Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D61586
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
Outbound IPsec packets retain the flow ID of the inner traffic. Multi-queue
interfaces use this ID to select a transmit queue (iflib's QIDX()) or a member
port (lagg(4) with use_flowid). Consequently, packets belonging to the same
security association (SA) can be distributed across independently draining
queues.
ESP and AH sequence numbers are assigned before encryption, but the packets
can be transmitted out of order when different queues drain at different
rates. This can cause legitimate packets to fall outside the receiver's
anti-replay window and be dropped as possible replays. RFC 4303, Section
3.4.3, makes 32 packets the smallest window a receiver must support, and
strongSwan installs that minimum by default.
Assign each SA a flow ID derived from a Jenkins hash of its SPI, computed once
when the SA is created, from the SPI in host byte order so that the value is
the same on every architecture. Set this ID on outbound packets in
ipsec{4,6}_perform_request(), with M_HASHTYPE_OPAQUE_HASH, once the SA is
known and before ipsec_accel_output(): it then applies whether the SA is
processed in software (ESP, AH, and IPCOMP) or by a network interface that
implements it, since the offload path keeps the packet header and hands the
packet to the interface's own transmit queue selection, and in a bundle the
last SA decides. Whether the flow ID selects the queue is up to the consumer:
a driver with its own selection (iflib's isc_txq_select) may ignore it.
Hashing the SPI distributes SAs across transmit queues regardless of whether
the queue-selection mechanism uses low-order bits (iflib) or shifted
high-order bits (lagg(4) with flowid_shift). It also avoids the poor
distribution that consecutive manually assigned SPIs would produce if used
directly.
All packets belonging to an SA now select the same transmit queue,
eliminating reordering caused by independently draining queues. Reordering
before enqueue, including skew in asynchronous crypto completion, remains
possible and is addressed separately.
Binding an SA to one transmit queue also binds it to one port or path when
using lagg(4) with use_flowid or flow-ID-based multipath routing. This trades
parallelism within an SA for packet ordering. Scaling a tunnel across
multiple queues is instead possible with multiple SAs, each with its own
sequence-number space, as supported by RFC 9611's per-resource Child SAs or
by separate policies or interfaces.
The net.inet.ipsec.sa_flowid sysctl restores the previous inner-flow-based
selection.
Reviewed by: kib, ae
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D61194
debug: classified in
03-filenames_plain1 by
'sys/netipsec/'
ipsec4_perform_request() maps unmapped (M_EXTPG) mbufs before the software transforms run. mb_unmapped_to_ext() frees the chain when it fails, and the error return then kept both the SA reference taken by ipsec4_allocsa() and the SP reference that this function must release. The SA, its crypto session and the SP were never freed after they were deleted. The conversion fails with ENOMEM when an mbuf allocation fails, for example for sendfile(2) data sent through a software IPv4 SA, and with EINVAL for every packet of a NIC kTLS connection that matches an IPsec policy. Take the common error path instead; it skips m_freem() when the mbuf pointer is NULL. IPv6 is not affected: ipsec6_perform_request() does not call mb_unmapped_to_ext(). Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=0ff2d00d2aa3 ("ipsec: allow it to work with unmapped mbufs") MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate")
debug: classified in
03-filenames_plain1 by
'sys/netipsec/'
When checking for a full sized segment, take all TCP options that will be included into account. This fixes a bug which can trigger the "sent too much" KASSERT related to limited transmit. Reported by: olivier Reviewed by: rscheff, Peter Lei MFC after: 3 days MFC to: stable/15 MFC to: stable/14 Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D61605
debug: classified in
03-filenames_plain1 by
'sys/netinet/'
When a crypto driver unregisters, a request on one of its sessions completes with EAGAIN. The ESP, AH and IPComp callbacks then move the SA to the new session and pass the same request to crypto_dispatch() again, with crp_etype still set to EAGAIN. crypto_dispatch() requires a request without an error. A kernel with INVARIANTS panics there with "incoming crp with error". The other consumers that dispatch a request again after EAGAIN clear the field first. The six callbacks prepare the request for the retry with the same code. Move that code to a new function, ipsec_crypto_retry(), and clear the error there. ipsec_updateid() has no other callers and becomes static. The callbacks still dispatch the request themselves, because the input callbacks have to release the sahtree lock first. Reviewed by: markj, kib Fixes: https://cgit.freebsd.org/src/commit/?id=c03414326909 ("Refactor driver and consumer...") MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D61515
debug: classified in
03-filenames_plain1 by
'sys/netipsec/'
nat44_get_log() compared the user buffer length against the request
header plus another ipfw_obj_header instead of the request header plus
the log buffer. A buffer that passed this check but was shorter than
the full reply left too little room in the sockopt window, so
ipfw_get_sopt_space() returned NULL and the following memcpy() of the
log wrote through a NULL pointer, panicking the kernel.
The handler was cloned from nat44_get_cfg() in the commit below, under
the convention of that time where ucfg->size held the payload only and
the ipfw_obj_header was added back in the length check. 9f925e8a920e
("Fix IP_FW_NAT44_LIST_NAT size calculation.") later switched
nat44_get_cfg() to count the header in ucfg->size and reduced its check
to "valsize < size", but nat44_get_log() was not updated. It kept the
stale idiom, whose check counts the header twice, and by coincidence of
the struct sizes that never leaves room for the log.
Compare against the full reply length and check the result of
ipfw_get_sopt_space(). Also report the full reply length, including
the ipfw_obj_header, in the size field returned with ENOMEM, as
nat44_get_cfg() now does: ipfw(8) retries with that value, and the old
one was itself too short to pass the check.
Add tests:
getlog_short_buffer - every buffer shorter than the reply gets ENOMEM
and the reply length; the reply length works.
getlog_retry - a retry with the length reported along with
ENOMEM succeeds.
Without the fix, getlog_short_buffer panics the kernel and getlog_retry
fails.
Reviewed by: ae
Fixes: https://cgit.freebsd.org/src/commit/?id=d6164b77f8b7 ("Make ipfw_nat module use IP_FW3 codes.")
Co-Authored-By: Claude Opus 4.8
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D61587
debug: classified in
03-filenames_plain1 by
'sys/netpfil/'
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/'
Normally, hastd will use the hostname, hostuuid, or hostid as node name. Allow overriding this with a new -n command-line option. The argument is treated as a replacement for the hostname, but also disables the hostuuid and hostid logic. This allows running multiple nodes on the same system, which is useful for testing. Differential Revision: https://reviews.freebsd.org/D59675
debug: classified in
03-filenames_plain1 by 'sbin/'
_vq_record() stored the result of paddr_guest2host() without checking for NULL. A guest descriptor with an invalid address causes a NULL dereference in every virtio driver. Return early on failure; the caller sees zero descriptors and discards the chain. The indirect path already performs this check (line 357). Reviewed by: bnovkov Differential Revision: https://reviews.freebsd.org/D60870 MFC after: 1 week
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
A restore set the addresses in the BARs and the command register to those of the snapshot, but left the regions registered where pci_emul_alloc_bar() had put them when bhyve started. That is only right for a guest that kept bhyve's addresses. The UEFI firmware moves 64-bit BARs above 4 GB, and after a restore every access to such a BAR went nowhere: Emulating access to non-existent address to 0x800001014 Before the devices are restored, unregister the regions of all of them; when a device is restored, register its regions at the restored addresses, if the restored command register enables them. All devices go first because a restored BAR may be where another device's BAR is before the restore. Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com> Sponsored by: keelos.dev Reviewed by: bnovkov Differential Revision: https://reviews.freebsd.org/D60235 MFC after: 2 weeks Tested by: bnovkov
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
When VBE is unavailable, vbe_init() frees the controller information buffer and sets vbe to NULL. Console initialization still calls vbe_default_mode(), which reaches an unguarded memset() in vbe_find_mode_xydm(). Under BTX, the null write can overwrite the loader's own code and cause a later protection fault. Guard vbe_default_mode() with vbe_check(), as the other public functions in vbe.c already do, and return 0 to indicate that no graphics mode is available. This allows console initialization to continue on headless systems. Reviewed by: rmoeller, imp MFC ater: 2 weeks Differential Revision: https://reviews.freebsd.org/D61145
debug: classified in
03-filenames_plain1 by 'stand/'
cmd_pmc_stat allocated the event descriptor with malloc and then set only some of its fields, so the rest held whatever was on the heap. Use calloc() instead. Reviewed by: mhorne MFC after: 3 days Sponsored by: AMD Signed-off-by: Andre Silva <andasilv@amd.com> Differential Revision: https://reviews.freebsd.org/D59364
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
Toggle IBS op and fetch through /dev/cpuctl0 with hwpmc loaded and check that every NMI hwpmc declined was claimed. Without the fix both cases fail on an EPYC 9654. Reviewed by: kib MFC after: 2 weeks Sponsored by: AMD Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com> Differential Revision: https://reviews.freebsd.org/D60766
debug: classified in
03-filenames_plain1 by 'etc/'
Move print_namespace() from identify.c to identify_ext.c and rename
it to nvme_print_namespace(), to match nvme_print_controller().
This allows other consumers (notably camcontrol(8)) to print NVMe
namespace Identify data.
No functional changes intended.
sbin/nvmecontrol/identify.c:
Remove print_namespace(), and call nvme_print_namespace()
instead.
sbin/nvmecontrol/identify_ext.c:
Add nvme_print_namespace(), moved here from identify.c.
sbin/nvmecontrol/nvmecontrol.h:
Remove the print_namespace() prototype.
sbin/nvmecontrol/nvmecontrol_ext.h:
Add the nvme_print_namespace() prototype.
sbin/nvmecontrol/ns.c:
Include nvmecontrol_ext.h, and rename print_namespace() calls
to nvme_print_namespace().
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed by: imp
MFC after: 1 week
Sponsored by: Spectra Logic
Differential Revision: https://reviews.freebsd.org/D59530
debug: classified in
03-filenames_plain1 by 'sbin/'
camcontrol: Add support for NVMe namespace Identify
Add a -N argument to camcontrol identify. This will fetch and
display namespace Identify data for NVMe drives, using
nvme_print_namespace() from nvmecontrol(8).
This gets the namespace Identify data via XPT_DEV_ADVINFO (i.e.
data cached in the kernel) like the standard NVMe identify command
does, and so works even on NVMe devices that do not support NVMe
Namespace Management.
sbin/camcontrol/camcontrol.c:
Add a -N argument to camcontrol identify.
Rename nvme_get_cdata() to nvme_get_data(), and give it the
ability to fetch controller or namespace Identify data.
While here, improve its error reporting with
cam_error_print(), and only look at the CAM status bits of
the returned CCB.
Change identify(), ataidentify(), and nvmeidentify() to
handle the extra arguments.
Give nvmeidentify() the ability to fetch and print NVMe
namespace data, using nvme_print_namespace() from
nvmecontrol(8).
sbin/camcontrol/camcontrol.h:
Add the nvme_get_data() prototype, for use by future NVMe
subcommands living outside camcontrol.c.
sbin/camcontrol/camcontrol.8:
Document camcontrol identify -N. Make it clear that the
NVMe data is from data cached in the kernel. Add a cross
reference to nvmecontrol(8).
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed by: imp
MFC after: 1 week
Sponsored by: Spectra Logic
Differential Revision: https://reviews.freebsd.org/D59533
debug: classified in
03-filenames_plain1 by 'sbin/'
camcontrol: Support NVMe reservations via the persist subcommand The NVMe reservation model is closely patterned after SCSI Persistent Reservations, so support NVMe devices through the existing persist subcommand rather than adding a transport-specific subcommand. The persist subcommand now dispatches on the device protocol, in the same way the identify subcommand does. The SCSI syntax is unchanged. For NVMe devices, the -i modes all map to the Reservation Report command (read_full_status requests the extended data structure, which contains 128-bit Host Identifiers), and the -o service actions map to the corresponding NVMe reservation operations: register, register_ignore, reserve, preempt, preempt_abort, release and clear, plus two NVMe-only actions, unregister and replace. The reservation type names for -T are shared between SCSI and NVMe. A new -c option gives explicit control over the NVMe Persist Through Power Loss State; -p is equivalent to -c enable. SCSI-only options return an error for NVMe devices. Tested against a PASCARI X200 series SSD (reservation capabilities: WR_EX, PTPL, IEKEY13): register, reserve, release, replace, unregister, -c enable/disable (Persist Through Power Loss State change verified in the report output), reservation report, and the error paths. register_ignore is rejected by drives that implement NVMe 1.3 IEKEY semantics, as expected. SCSI persist against a da(4) device is unchanged. sbin/camcontrol/nvres.c: New file, the NVMe reservation backend for the persist subcommand. sbin/camcontrol/camcontrol.c: Dispatch the persist subcommand to scsipersist() or nvmepersist() based on the device protocol. sbin/camcontrol/camcontrol.h: Add the nvmepersist() prototype. sbin/camcontrol/Makefile: Add nvres.c to the build. sbin/camcontrol/camcontrol.8: Document NVMe support in the persist subcommand section, and note the differences from SCSI where they occur. Co-authored-by: Reid Linnemann <reidl@spectralogic.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Reviewed by: imp MFC after: 1 week Sponsored by: Spectra Logic Differential Revision: https://reviews.freebsd.org/D59534
debug: classified in
03-filenames_plain1 by 'sbin/'
camcontrol: Support NVMe namespace formatting via the format subcommand Support formatting NVMe namespaces through the existing format subcommand. The format subcommand now dispatches on the device protocol, in the same way the identify and persist subcommands do, and issues the NVMe FORMAT NVM command for NVMe devices. The SCSI syntax and behavior are unchanged. The NVMe-specific options are -e (secure erase setting), -G (format all namespaces), -f (LBA format), -l (protection information location), -m (metadata setting) and -p (protection information type). The -q and -y options work for both protocols; NVMe formats gain the same confirmation question that SCSI formats have always had. The -r and -w options are SCSI only; -r returns an error for NVMe devices and -w has no effect, since the NVMe format command does not complete until the format is finished. The default timeout for NVMe is 30 seconds for a cryptographic erase and 30 minutes otherwise; the generic -t option overrides it. sbin/camcontrol/nvformat.c: New file, the NVMe format backend for the format subcommand. sbin/camcontrol/camcontrol.c: Dispatch the format subcommand to scsiformat() or nvmeformat() based on the device protocol. sbin/camcontrol/camcontrol.h: Add the nvmeformat() prototype. sbin/camcontrol/Makefile: Add nvformat.c to the build. sbin/camcontrol/camcontrol.8: Document NVMe support in the format subcommand section, and note the differences from SCSI where they occur. Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Reviewed by: imp MFC after: 1 week Sponsored by: Spectra Logic Differential Revision: https://reviews.freebsd.org/D59535
debug: classified in
03-filenames_plain1 by 'sbin/'
camcontrol: Add a feature subcommand for NVMe Get/Set Features
Add a feature subcommand for the NVMe Get Features and Set Features
commands:
camcontrol feature ndaX -a <get|set> -f feature [-d data]
[-s num] [-U]
There is no transport-specific prefix in the name: SCSI has no
feature command (the closest equivalents are mode pages), and the
ATA SET FEATURES subcommands are already exposed through dedicated
camcontrol subcommands (apm, aam, epc and the power commands), so
the name is unclaimed. The subcommand returns an error for
non-NVMe devices.
Currently, only the hostid feature is fully implemented. The
hostid value for set is specified with -d as a UUID or an integer
in decimal, hex, or octal, and -U outputs the hostid as a UUID on
get.
The -s argument exposes the feature select / save fields from the
NVMe specification. If bit 4 of the Optional NVM Command Support
(ONCS) field of the Identify Controller data is set, each feature
has a default, saved and current value, plus a capabilities mask:
- For get, -s selects which to display: 0 (current),
1 (default), 2 (saved) or 3 (capabilities).
- For set, -s is the save flag; a value of 1 sets the saved
value as well as the current value, so the feature
persists across an NVMe reset. Setting the save flag only
works if the feature's capability mask includes saveable.
sbin/camcontrol/nvfeature.c:
New file, the camcontrol(8) feature subcommand for getting
and setting NVMe features.
sbin/camcontrol/camcontrol.c:
Add the feature subcommand, dispatched only to NVMe devices.
sbin/camcontrol/camcontrol.h:
Add the nvmefeature() prototype.
sbin/camcontrol/Makefile:
Add nvfeature.c to the build.
sbin/camcontrol/camcontrol.8:
Document the feature subcommand.
Co-authored-by: Reid Linnemann <reidl@spectralogic.com>
Co-authored-by: Dave Baukus <daveb@spectralogic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed by: imp
MFC after: 1 week
Sponsored by: Spectra Logic
Differential Revision: https://reviews.freebsd.org/D59536
debug: classified in
03-filenames_plain1 by 'sbin/'
camcontrol: Fix -Wcast-align errors in the NVMe reservation report Casting the byte buffer that holds the Reservation Report payload to the status structures trips -Wcast-align on strict-alignment architectures, which broke the CI builds there. Put the buffer in a union with the two status structures instead, so it is properly aligned and no casts are needed. Reported by: FreeBSD CI Fixes: https://cgit.freebsd.org/src/commit/?id=ba75cf05727e ("camcontrol: Support NVMe reservations via the persist subcommand") Co-authored-by: Claude Fable 5 <noreply@anthropic.com> MFC after: 1 week Sponsored by: Spectra Logic
debug: classified in
03-filenames_plain1 by 'sbin/'
The reader can hand off its first buffer before the writer sets CAMDD_DEV_FLAG_ACTIVE. camdd_queue_peer_buf() then mistakes the writer for an exited peer and releases the buffer instead of queueing it. This can make a copy fail with bytes read but nothing written, without an error message. Mark both devices active before creating either worker, leaving the workers to clear the flag on exit. The work queues and EVFILT_USER events are already initialized, so queued buffers and their notification can wait for the writer to start without a startup barrier. Treat pthread_create() failure as fatal. Returning through the normal cleanup path can free devices that an already-started worker is still using, and an unstarted peer cannot consume any queued buffers. Reviewed by: imp, markj, ken MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D61277
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
fsm_readopt() advanced the decode cursor by the option length without checking it against the end of the packet. A crafted LCP/CCP/IPCP option could then make the Config-Reject/Nak echo copy past the received packet into adjacent heap, disclosing heap bytes to the peer before authentication. Check the option framing once in fsm_Input() and drop the packet before decoding per RFC1661 Reviewed by: adrian, markj Differential Revision: https://reviews.freebsd.org/D61008 Approved by: adrian (mentor) Signed-off-by: Nick Price <nprice@FreeBSD.org>
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
Pred1Input() decompressed CCP data into a MAX_MRU+2 mbuf with no limit on the output, so a peer could expand a short compressed frame (up to 8:1) past the buffer and overflow adjacent heap. An input length below 4 also drove decompress() with a negative length. Reject out-of-range input lengths and stop decompression at the destination buffer size. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D61011 Approved by: adrian (mentor) Signed-off-by: Nick Price <nprice@FreeBSD.org>
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
The stack buffer in fs_list() can be overflowed if a file name is too long. Reported by: Yudi Yang <yudi.yang@rice.edu> MFC after: 1 week
debug: classified in
03-filenames_plain1 by 'stand/'
Add sanity checks for corrupt UFS directory blocks. Don't allow bad data to cause buffer overflows or infinite loops. Reviewed by: dab, imp (previous version) Differential Revision: https://reviews.freebsd.org/D59378
debug: classified in
03-filenames_plain1 by 'stand/'
Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D59379
debug: classified in
03-filenames_plain1 by 'stand/'
When no -p or -l arguments are given, the nvformat subcommand fills in the protection information type and location from the namespace's current settings. The two were swapped: pi was taken from the DPS metadata location bit and pil from the protection information type field. Formatting a namespace with protection information enabled would therefore silently change its PI settings, and before the Format NVM command builder masked its fields, a namespace with PI type 2 enabled would set bit 9 of cdw10, turning the format into a user data erase. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=80f090111ae4 MFC after: 1 week Sponsored by: Spectra Logic Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
debug: classified in
03-filenames_plain1 by 'sbin/'
res_type was initialized to 0, but the checks that enforce the -T argument for the reserve, preempt and release reservation actions compare it against -1, so they could never fire and camcontrol silently sent a reservation type of 0, which is invalid. Initialize res_type to -1 so the checks work, and default the reservation type to 0 for the release action's clear variant, which does not take -T and ignores the field. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=ba75cf05727e MFC after: 1 week Sponsored by: Spectra Logic Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
debug: classified in
03-filenames_plain1 by 'sbin/'
nvme_get_data() closed the supplied CAM device on every error path, but its callers either pass the device that main() opened and closes, or close the device themselves, so an error resulted in a double cam_close_device() and a double free. Move the error path close into print_dev_nvme(), the one caller that opens its own device, and leave the device alone in nvme_get_data(). This predates the recent camcontrol NVMe additions, but they added more callers. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=6ee13c54dad0 MFC after: 1 week Sponsored by: Spectra Logic Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
debug: classified in
03-filenames_plain1 by 'sbin/'
pw_checkname() already refuses $ ( ) and freinds, but backtick and single quote slipped thru, so `pw useradd 'foo`id`'` went in just fine. Thats command substitution in any unquoted context. Add both to badchars, plus a test. Reported by: Harry Sintonen (Reversec) Sponsored by: Entersekt MFC after: 2 weeks Approved by: bapt Differential Revision: https://reviews.freebsd.org/D61392
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
Add to the suite of ATF tests for hwpmc(4). Vendor-neutral tests go in
tests/sys/pmc; tests that depend on AMD hardware interfaces go in
tests/sys/pmc/amd, which is only built on amd64.
tests/sys/pmc:
pmc_pidtrack_test process-mode PMCs follow their PID: a live
self-read counts the process' own work, an idle
process sharing the CPU with a busy one does not
pick up its work, and the count survives a
context switch
pmc_callchain_ur_test pmcstat -U collects user callchains through the
PMC_UR ring; regression test for the KASSERTs
fixed in rGaf3929c5152b and rG66118c3f1011
pmc_cli_test pmc(8): missing log, list-events, record/info
round trip with the "instructions" alias
pmcstat_tsc_test (amd64) tsc_freq in the initlog record, TSC
column of pmcstat -R, tsc in pmc filter -j,
pmcstat -G callgraph
pmc_rapl_test (amd64) RAPL class: 64-bit counters, system
mode only, PKG and CORES energy increase under
load
tests/sys/pmc/amd:
pmu_detect_test K8 class with 48-bit counters, at least six core
counters, TSC class alongside it
pmu_event_test pmu-events lookup and EventSelect/UnitMask/OS/USR
encoding checked against the amdzen1..amdzen6
tables; ex_ret_instr counts a known loop
pmu_event_neg_test raw PMCALLOCATE rejects an otherwise valid config
word with HOST, GUEST, HOST|GUEST, reserved bit
44 or PRECISERETIRE without PMC_CAP_PRECISE
(pmc_exterr_test covers an all-ones config word)
pmu_mux_test every core counter that CPUID reports can be
held at once, one more is refused, a released
one is reusable
rapl_domains_test AMD RAPL has at most PKG and CORES rows and no
DRAM domain
pmc_frontend_test pmc(8) frontend study on IBS fetch samples
amd_pmc_test_common.h CPUID-based Zen generation detection and helpers
Reviewed by: mhorne
Discussed with: netchild
MFC after: 1 month
Sponsored by: Advanced Micro Devices, Inc.
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>
Differential Revision: https://reviews.freebsd.org/D59549
debug: classified in
03-filenames_plain1 by 'etc/'
vipw(8) never looked at names, it just hands the file to pwd_mkdb, and pwd_mkdb only cared abuot the field layout. So something like `user1$(id$IFS-A)` in master.passwd went straight into the db. Do the same check pw(8) does, in scan(), so vipw, chpass and hand edits all hit it. NIS +/- entries get checked after the prefix. Bail out rather then warn; a file with junk names wont rebuild anymore, whcih is kinda the point. Add tests while here. Reported by: Harry Sintonen (Reversec) Sponsored by: Entersekt Approved by: bapt MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D61405
debug: Commit manually moved from "unknown" to "admin".
The FreeBSD-base repository (aka "pkgbase") is now created using 'pkg repo -l' in order to make 'pkg rwhich' work. Unfortunately this makes the data.pkg file considerably larger, and FreeBSD 15.2-BETA1 fails to install using a remote repository since the installer has a small /tmp (20 MB). Run pkg commands with 'env TMPDIR=<chrootdir>/tmp' since the /tmp in the system being installed is considerably larger than the tmpfs which the installer runs with. Create <chrootdir>/tmp first so we can ensure it has 1777 permissions. Reviewed by: bapt MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D61380
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
nvmecontrol: Mask the fields in the Format NVM command The format command composed cdw10 by hand without masking any of the fields and with no support for the LBAFU field. Since commit 2c41f7d8a034 the LBA format index defaulted from FLBAS can exceed 15 on an NVMe 2.0 namespace using FIDXU, and such an index would bleed into the MSET and PI fields. An out of range index supplied with -f for a whole-controller format was not caught either. Build the command with nvme_admin_format_cmd(), which masks all of the fields and encodes LBA format indexes above 15 in LBAFU, and reject LBA format indexes greater than 63 for whole-controller formats. Per-namespace formats already validate the index against NLBAF. This is the same problem that llm-postcr reported in camcontrol's copy of this code, fixed in 3892a6453fc6; the unmasked composition originated here (635c517ae9ca). Reported by: llm-postcr Reviewed by: imp Fixes: https://cgit.freebsd.org/src/commit/?id=2c41f7d8a034 MFC after: 1 week Sponsored by: Spectra Logic Assisted-by: Claude Fable 5 <noreply@anthropic.com> Differential Revision: https://reviews.freebsd.org/D61356
debug: classified in
03-filenames_plain1 by 'sbin/'
nvmecontrol: Range-check the format command's field values The format command accepted any 32-bit value for -m, -p, -l and --ses and passed it into the Format NVM command. Before eae727676169 an out-of-range value spilled into the adjacent cdw10 fields, which usually drew an error from the controller; after it, the value is masked to the field width, so a mistyped value is silently accepted with a different meaning. Most seriously, --ses 8 masked to SES=0 and performed a plain format with no erase at all, exiting 0. A value like --ses 10 masked to a cryptographic erase while bypassing the FNA cryptographic erase capability check, which compares the unmasked value. Reject values outside the ranges nvmecontrol.8 documents, which are the values the spec defines: 0-1 for -m and -l, 0-3 for -p, and 0-2 for --ses. The checks run at option validation time, before the device is opened, and the capability check now only ever sees valid values. While here, document --ses in nvmecontrol.8; it was missing from the format subcommand's option list. Reported by: llm-postcr Reviewed by: imp Fixes: https://cgit.freebsd.org/src/commit/?id=eae727676169 MFC after: 1 week Sponsored by: Spectra Logic Assisted-by: Claude Fable 5 <noreply@anthropic.com> Differential Revision: https://reviews.freebsd.org/D61406
debug: classified in
03-filenames_plain1 by 'sbin/'
`ipcp_ValidateReq()` appended `IP-Address ack/nak/reject` records to the fixed `fsm_decode` buffers without a bound check. A `Config-Request` with ~17 or more `IP-Address` options overran a buffer into its own end pointer, so later writes could go wherever the peer chose. Emit the option through `fsm_ack()/fsm_nak()/fsm_rej()` like the other options. Reviewed by: markj Approved by: adrian (mentor) Signed-off-by: Nick Price <nprice@FreeBSD.org> Differential Revision: https://reviews.freebsd.org/D61326
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
Commit bd9d7cdd1420 ("OpenSSH: Update to 10.5p1") introduced support for
ML-DSA44/Ed25519 host keys.
Generate these keys by default when the sshd service is first started.
Reported by: Herbert J. Skuhra
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D61433
debug: classified in
03-filenames_plain1 by
'libexec/'
Adds support for specifying an explicit UID when creating users through nuageinit. Both numeric and string UID values are supported. Invalid or negative UIDs are rejected. The new uid option is documented in nuageinit(7). Existing automatic UID allocation remains unchanged when no UID is specified. A UID already in use or out of range is left to pw(8) to reject. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293716 Reported by: Einar Bjarni Halldórsson <einar@isnic.is> Reviewed by: dtxdf, bapt Signed-off-by: Kushagra Chauhan <zenzesama@gmail.com> Differential Revision: https://reviews.freebsd.org/D61174
debug: classified in
03-filenames_plain1 by
'libexec/'
rfb_init()'s error path tests pixfmt_mtx against NULL, which only compiles where pthread_mutex_t is a pointer, and destroys it. Every jump to that label is before the mutex is initialized, so there is nothing to destroy. The test and the destroy came in with the SetPixelFormat support (D46402). Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com> Fixes: https://cgit.freebsd.org/src/commit/?id=dda0f9837b1c ("bhyve: support noVNC SetPixelFormat request") Reviewed by: markj MFC after: 1 week Sponsored by: keelos.dev Differential Revision: https://reviews.freebsd.org/D61425
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
aen_cond is used with pthread_cond_wait() and pthread_cond_signal() but never initialized. That works where a zeroed pthread_cond_t is initialized on first use; elsewhere pthread_cond_wait() fails at once and aen_thr() spins with aen_mtx held. Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com> Reviewed by: markj MFC after: 1 week Sponsored by: keelos.dev Differential Revision: https://reviews.freebsd.org/D61424
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
The empty_output variable is normalized to YES or NO, but we were comparing it to TRUE, so the comparison always failed no matter what it was set to. Compare it to YES instead. This feature has been disabled since 2007, so flip the default to NO to preserve the current behavior. Adjust the documentation accordingly. Relnotes: yes PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300676 MFC after: 1 week Fixes: https://cgit.freebsd.org/src/commit/?id=68c35072f914 ("Add an option to make periodic(8) quiet when no output was generated.") Reviewed by: ivy, emaste Differential Revision: https://reviews.freebsd.org/D61435
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
tftpd: Fix off-by-one in get_field() Due to a logic error, get_field() would behave as if the passed-in size was one greater than it actually is. Fix it so it always fails if no terminating NUL is found within the buffer, instead of succeeding if the first byte past the end is a NUL. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D61032
debug: classified in
03-filenames_plain1 by
'libexec/'
tftpd: Keep proper track of header length When parsing a header, keep track of the length of the unparsed portion and pass that to get_field() instead of the length of the entire header. Reported by: n0ps1ed MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D60902
debug: classified in
03-filenames_plain1 by
'libexec/'
tftpd: Keep proper track of option length When parsing options, keep track of the length of the unparsed portion and pass that to get_field() instead of the length of the entire header. While here, switch both make_options() and parse_options() to using size_t for sizes and lengths. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D61048
debug: classified in
03-filenames_plain1 by
'libexec/'
The kernel adds EfiLoaderData ranges to physmap and reuses the pages, so a memdisk=root is overwritten while the system runs. The kernel skips EfiReservedMemoryType, which ACPI requires for a registered RAM disk. Fixes: https://cgit.freebsd.org/src/commit/?id=85fb40bad584 Reviewed by: imp Approved by: imp Sponsored by: Netflix Differential Revision: https://ron-dev.freebsd.org/FreeBSD/src/pulls/96
debug: classified in
03-filenames_plain1 by 'stand/'
disk_parsedev() only accepted names starting with "disk" or "vdisk", so other DEVT_DISK devices using disk_fmtdev() could print a name they could not parse back, e.g. "md0s2a:". Skip any alphabetic prefix instead; devparse() has already matched it to the devsw. Reviewed by: imp Approved by: imp Sponsored by: Netflix Differential Revision: https://ron-dev.freebsd.org/FreeBSD/src/pulls/97
debug: classified in
03-filenames_plain1 by 'stand/'
probe_md_currdev() named md through set_currdev_devsw(), which builds a plain struct devdesc. Once md uses disk_fmtdev(), that reads d_slice and d_partition past the end of the struct, and currdev becomes a name built from stack garbage. Use a struct disk_devdesc instead, and open the device first so the name shows the slice and partition actually found. When the image has no partition table, fall back to the whole image, as before. Add md_get_size() and move MD_BLOCK_SIZE to bootstrap.h so main.c can open the device. Reviewed by: imp Approved by: imp Sponsored by: Netflix Differential Revision: https://ron-dev.freebsd.org/FreeBSD/src/pulls/98
debug: classified in
03-filenames_plain1 by 'stand/'
md is a DEVT_DISK device but never called disk_open(), so reads always started at offset 0 of the image. A partitioned image, such as a memstick image booted memdisk=, has its partition table there, not a filesystem, and the loader stops with "MD not present". Reviewed by: imp Approved by: imp Sponsored by: Netflix Differential Revision: https://ron-dev.freebsd.org/FreeBSD/src/pulls/99
debug: classified in
03-filenames_plain1 by 'stand/'
The buffer is sized from a guess, 4x the compressed size for most formats, so free the pages past the image once it is complete. Reviewed by: imp Sponsored by: Netflix Differential Revision: https://ron-dev.freebsd.org/FreeBSD/src/pulls/100
debug: classified in
03-filenames_plain1 by 'stand/'
snmp_hostres(3): strengthen work on the devd(8) socket Use the SOCK_SEQPACKET version of the socket. This guarantees that messages read won't be glued together. Use sufficient buffer size to read any message. Close socket on any kind of error or a short read. This also fixes a bug when a SOCK_STREAM socket containing exactly multiple of 512 bytes would block the daemon in read(2) until some other devd(8) event. Thank to David for catching and analyzing it. Reported by: David Pfitzner <dpfitzner@netflix.com> Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D61146
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
snmp_hostres(3): check if sysconf(3) fails While here inline single time use function. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=4edbd4e35c4e0fb7cf10ed5e9b12a2b76bef2cec
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
In bhyve arm64, each PCIe interrupt-map entry spans 10 cells because the ARM GIC specifies #interrupt-cells = 3. On RISC-V, the APLIC uses #interrupt-cells = 2, so each entry spans only 9 cells. When the PCIe FDT code was originally adapted from arm64, the property allocation size and cell assignments were reduced to 9 cells per entry, but the loop multiplier retained the 10-cell stride. This caused the interrupt-map array to be packed incorrectly with gaps, breaking PCI interrupt routing in guest operating systems and overflowing the allocation by 16 cells. Correct the loop stride to 9 cells so the interrupt map is properly formed. Reviewed by: jrtc27 Fixes: https://cgit.freebsd.org/src/commit/?id=7ab1a32cd43c ("bhyve/riscv: Initial import") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D61473
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
Previously we would still try to add SSH keys after a failed adduser, which would result in an uncaught Lua error, causing the remainder of the setup to be skipped. Reported by: llm-postcr Reviewed by: dtxdf, bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D61441
debug: classified in
03-filenames_plain1 by
'libexec/'
ucl reads and rewrites Universal Configuration Language files with libucl(3), the private library pkg(8) links, so what sysconf reads is what pkg reads. Each file is parsed on its own and every scalar is addressed by its dotted path (FreeBSD-ports.enabled); the last file to define a path is authoritative. A write changes only the one statement, in the file's own separator, terminator, quoting, and boolean style, then re-parses the result with libucl and refuses the write unless the parsed contents differ in exactly the requested key. Removing the last key of an object removes the object. Arrays are leaves, read back as compact JSON. name+=word and name-=word on an array add and strike elements. Under an array a path component is an index, as uclcmd(1) spells it: name.i reaches one element (name.i=value sets it, name.i+=word edits it, -x name.i strikes it), name.i.j reaches into a nested array, and name.# is the count (name.#=value appends). A negative index counts from the end. Under an object the same component is a key, so a key named 404 or # or * is addressed as written. A key the library cannot take bare is written quoted; a file that leaves such a key bare, as uclcmd(1) may, is still read. An element is added or taken out on its own line in the style of its neighbours, a trailing comment going with a struck line as a sysrc(8) removal would take it. pkg is ucl over the files pkg(8) reads: /etc/pkg/*.conf, /usr/local/etc/pkg.conf, and /usr/local/etc/pkg/repos/*.conf. Files under /etc/pkg are read-only; a repository key found there is overridden in /usr/local/etc/pkg/repos/FreeBSD.conf, created in the base file's style, and a global key goes to pkg.conf. `pkg config` only reads, and `pkg repositories` enable/disable records a side file under the package database, so neither covers `sysconf pkg` ability. The pkg keyword makes `p' ambiguous with poudriere; pk and po select them. Co-authored-by: Devin Teske <dteske@FreeBSD.org> Reviewed by: dteske Approved by: dteske (mentor) Differential Revision: https://reviews.freebsd.org/D61064
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
do_download_ramdisk() calls decomp_fini() a second time to free the buffer when it gives up after a finished download, so zstd freed its strem twice and libsa libsa panicked. Clear the pointer like xz_fini(). Reported by: llm-postcr Reviewed by: imp Approved by: imp Fixes: https://cgit.freebsd.org/src/commit/?id=afee781523e4 ("loader.efi: Recognize new memdisk=<url> and memcd=<url> options") Sponsored by: Netflix
debug: classified in
03-filenames_plain1 by 'stand/'
p - 4 is one byte before the string for 3-letter types, so whether loaderdev=mmc0p2 parsed depended on that byte. disk_parsedev() now skips any name prefix itself. Reported by: llm-postcr Reviewed by: imp Approved by: imp Fixes: https://cgit.freebsd.org/src/commit/?id=d18ed8e19c3c ("stand: Try to parse vdisk correctly") Sponsored by: Netfix Differential Revision: https://ron-dev.freebsd.org/FreeBSD/src/pulls/105
debug: classified in
03-filenames_plain1 by 'stand/'
Commit d9fa6016011e ("nuageinit; Skip SSH keys and doas/sudo if adduser
fails") handled nil return from a failing adduser when adding secondary
users, but the same issue also existed in the default user handling.
Reported by: llm-postcr
Reviewed by: dtxdf
Supported by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61511
debug: classified in
03-filenames_plain1 by
'libexec/'
Prepare for future OpenSSL API changes. OpenSSL 4.1 deprecates ASN1_STRING_set. Move to ASN1_STRING_set0 which requires the DER buffer to be allocated with OPENSSL_zalloc so ownership can be assumed by the string. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D61532
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
A write to IMC only cleared the bits in the mask. If the device was asserting INTx for a cause that the write masked, the line stayed up until the guest cleared the cause in ICR. The hardware deasserts INTx as soon as no unmasked cause is left, and a guest may rely on that: Windows masks all causes and unloads its driver when it shuts down, and then spends its time in the handlers of whatever shares the interrupt. Do what the comment in the code asked for. Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com> Reviewed by: jhb Sponsored by: keelos.dev Differential Revision: https://reviews.freebsd.org/D60230
debug: classified in
04-filenames_plain2 by
'usr.sbin/'
Add a test too. Reviewed by: ae Fixes: https://cgit.freebsd.org/src/commit/?id=d6164b77f8b7 ("Make ipfw_nat module use IP_FW3 codes.") Found with: Claude Opus 4.8 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D61588
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/'
Reviewed by: kib, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D60959
debug: classified in
04-filenames_plain2 by 'lib/'
_citrus_iconv_std_iconv_convert can return EILSEQ without setting invlen. As a result, we should check EILSEQ in the return value or it will incorrectly return -2 Reviewed by: kevans Fixes: https://cgit.freebsd.org/src/commit/?id=e2030ca246a7 ("libc: fix c*rtomb/mbrtoc*") MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D61151
debug: classified in
04-filenames_plain2 by 'lib/'
For 2027 we need to support new, stronger signatures and hashes. Re-work Makefile.inc and local.trust.mk to define VE_SIGN_URL_LIST or VE_SIGNATURE_LIST (can be derrived from VE_SIGN_URL_LIST) containing tuples of sig/method/hash/flags and for VE_SIGN_URL_LIST the same plus /url. From VE_SIGNATURE_LIST we derrive VE_SIGNATURE_EXT_LIST used to populate signature_ext_list which defines the order in which we look for signatures for a manifest. We also populate signature_info_list which maps a signature ext to the needed hash and flags to indicate whether that hash needs to be repeated. verify_sig will lookup signature_info_list, no match means not supported. For asc we just call verify_asc() otherwise we call verify_ec() or verify_rsa() depending on the key type found in the certificate chain, we pass the signature_info entry to these so they know which hash to use and whether to repeat it. The need to repeat the hash is a consequence of sending a hash to a server using signature methods that insiste on hashing their input. To-date only our original ECDSA signatures use this. A FakeHash class added in 2012 avoids that wrinkle. This is a much more flexible arrangement and should be more readily usable by others. Sponsored by: Hewlett Packard Enterprise Development LP. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D61007
debug: classified in
04-filenames_plain2 by 'lib/'
For a pshare key, we can actually cache the last one as a fast path instead of trapping into kernel directly. It makes sense as a lock and unlock should be a pair on the same key and at the same time. For example, lock(A) -> unlock(A) -> lock(B) -> unlock(B). Each unlock is a hit and refresh later (50% hit). For a single pshare lock, it is evne a 100% hit as the key never changed. For nested lock lock(A) -> lock(B) -> lock(C) -> unlock(C) -> unlock(B) -> unlock(A). It only cache the last one. However, we should really think about rewritting this logic as it is a pshare lock shared by many processes and nested should be uncommon. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D60957
debug: classified in
04-filenames_plain2 by 'lib/'
_thr_check_init() is called on hot paths such as pthread_once(), and the uninitialized case can only happen once. Mark it with __predict_false so the compiler lays out the initialized case as the fall-through path. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D61213
debug: classified in
04-filenames_plain2 by 'lib/'
libthr: Create landing pad in thr_once in C++ exception In _thr_once, if init_routine fails with exception, the stack allocate __cup will become invalid when unwinder walk back and free the stack of thr_once. This cause cleanup linked list be dangling. In here, we give the cleanup function a landing pad so that we td can correctly point to previous cleanup function. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D61212
debug: classified in
04-filenames_plain2 by 'lib/'
libthr: require both _Unwind_ForcedUnwind and _Unwind_GetCFA for !PIC Static linking must bring in both symbols for the unwind to work. The landing pads added by 2734bbbcba3c reference _Unwind_Resume and __gcc_personality_v0. In a static link, these pull UnwindLevel1.o from libgcc_eh.a, which also defines _Unwind_ForcedUnwind, but not UnwindLevel1-gcc-ext.o, which defines _Unwind_GetCFA. Unless something else pulls that object in, as libcxxrt does for C++ programs, thread_unwind_stop() calls a NULL _Unwind_GetCFA on every thread exit. Reported and tested by: dch Fixes: https://cgit.freebsd.org/src/commit/?id=2734bbbcba3c ("libthr: Create landing pad in thr_once in C++ exception") Sponsored by: The FreeBSD Foundation
debug: classified in
04-filenames_plain2 by 'lib/'
timespec_getres() has been declared in <time.h> and built into libc, but never listed in a symbol map. It is therefore local to libc.so, and dynamically linked callers fail to link. Reviewed by: ziaee, fuz, des Approved by: fuz (mentor) Fixes: https://cgit.freebsd.org/src/commit/?id=9b5d724cad10 ("libc: Add timespec_getres(3) as per C23.") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D60799
debug: classified in
04-filenames_plain2 by 'lib/'
If site.trust.mk does not set VE_SIGNATURE_LIST initialize it based on content of VE_SIGNATURE_EXT_LIST which is in turn initialized from TRUST_ANCHORS. Sponsored by: Hewlett Packard Enterprise Development LP Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D61245
debug: classified in
04-filenames_plain2 by 'lib/'
MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D61225
debug: classified in
04-filenames_plain2 by 'lib/'
- Build with libcrypto's compile flags: modules/Makefile.inc now
includes libcrypto's Makefile.inc, which brings in Makefile.common
(NDEBUG, the asm dispatch defines, OPENSSL_PIC, the directory
defines). Before this change, assertions were enabled in legacy.so.
- Use upstream's per-architecture source list: the provider's own CPU
capability code (cpuid asm and armcap.c/ppccap.c, or mem_clr.c
without asm), and the MD5, RC4 and DES asm where upstream uses it.
The provider no longer uses libcrypto's exported RC4, SHA1 and
CRYPTO_*128 functions.
- Drop the objects that upstream's linker leaves out of legacy.so
(fcrypt_b.c, md5_one.c, md5_sha1.c, provider_err.c and
ciphercommon_{ccm,gcm}*.c / ciphercommon_hw.c). Without them,
params_idx.c is not needed either.
- Add a version script, a copy of upstream's providers/legacy.ld, so
that only OSSL_provider_init is exported. Around 209 symbols were
exported before.
Reviewed by: ngie
MFC after: 2 weeks
MFC to: stable/15
Event: FreeBSD Vendor Summit 2026
Differential Revision: https://reviews.freebsd.org/D60398
debug: classified in
03-filenames_plain1 by
'secure/lib/'
c01c0a27cb82 (D60397) stopped exporting 52 names from libcrypto.so.35 that upstream does not export. Binaries and libraries linked against the earlier libcrypto.so.35 can still import them; the libssl.so.35 from 15.0 and 15.1 imports 15 of them, so it fails to load with the new libcrypto. Provide all 52 again as non-default (compat) versions, in the version nodes they had before: OPENSSL_cpuid_setup@OPENSSL_3_0_9, the others @OPENSSL_3_5_0. Existing consumers resolve them; new links cannot bind to them. The default exports do not change and still match upstream. The wrappers live in a new FreeBSD-only file, compat.c. Remove it at the next SHLIB_MAJOR bump. Reviewed by: ngie Fixes: https://cgit.freebsd.org/src/commit/?id=c01c0a27cb82 ("openssl: make libcrypto export the same symbols as upstream") MFC after: 2 weeks MFC to: stable/15 Event: FreeBSD Vendor Summit 2026 Differential Revision: https://reviews.freebsd.org/D61229
debug: classified in
03-filenames_plain1 by
'secure/lib/'
Upstream links every dynamic engine with a version script, engines/<name>.ld, that exports bind_engine and v_check and makes everything else local. FreeBSD's engines had no version script, so they exported every global symbol, including _init and _fini. loader_attic.so compiles its own copy of crypto/pem/pvkfmt.c and so also exported 21 of its functions; 14 of them (b2i_*, i2b_*) have the same names as public libcrypto functions. Add one Version.map for all engines, the same as upstream's, and use it from engines/Makefile.inc. The engines are loaded only with dlopen(), and libcrypto looks up only bind_engine and v_check, so hiding the other symbols does not affect any consumer. Tested via tinderbox: capi.so, devcrypto.so and loader_attic.so link with --no-undefined-version and export only bind_engine and v_check. devcrypto lists the same ciphers as before, and loader_attic loads and reads a PVK RSA key through "openssl storeutl -engine loader_attic". Reviewed by: ngie MFC after: 1 week MFC to: stable/15 Event: FreeBSD Vendor Summit 2026 Differential Revision: https://reviews.freebsd.org/D61273
debug: classified in
03-filenames_plain1 by
'secure/lib/'
libcasper: Use pdfork() for the zygote Use pdfork(2) rather than fork(2) to fork the zygote, and close the descriptor when the main loop terminates. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Qualys, Inc. Reviewed by: oshogbo Differential Revision: https://reviews.freebsd.org/D60176
debug: classified in
04-filenames_plain2 by 'lib/'
libcasper: Use casper_pdfork() Fixes: https://cgit.freebsd.org/src/commit/?id=425e4c102f8a ("libcasper: Use pdfork() for the zygote")
debug: classified in
04-filenames_plain2 by 'lib/'
__thr_pshared_offpage() is used by pthread functions that must not be cancellation points according to POSIX. Use direct __sys_close() instead of interposed close() there. Fixes: https://cgit.freebsd.org/src/commit/?id=1bdbd705993e ("Implement process-shared locks support ...") Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61343
debug: classified in
04-filenames_plain2 by 'lib/'
Reviewed by: markj, aokblast Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61343
debug: classified in
04-filenames_plain2 by 'lib/'
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253
debug: classified in
04-filenames_plain2 by 'lib/'
Otherwise they are rejected by kernel in do_wait(), reached through _thr_sleep()/UMTX_OP_WAIT_UINT_PRIVATE on the user-mode path. Then, since cond_wait_user() only leaves its loop on a wakeup, a cancellation or ETIMEDOUT, the EINVAL from do_wait() results in a loop. If hit, this indicates a bug in user code, but the system library must be resilient to such misuse. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253
debug: classified in
04-filenames_plain2 by 'lib/'
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253
debug: classified in
04-filenames_plain2 by 'lib/'
for ERRORCHECK and ADAPTIVE_NP mutexes, instead of ETIMEDOUT. This is explicitly specified by POSIX. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253
debug: classified in
04-filenames_plain2 by 'lib/'
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253
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/D61253
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/D61253
debug: classified in
04-filenames_plain2 by 'lib/'
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253
debug: classified in
04-filenames_plain2 by 'lib/'
Relocking an owned NORMAL mutex with an absolute timeout has two issues: - nanosleep(2) is never restarted, so any caught signal causes an early ETIMEDOUT. - If CLOCK_REALTIME or CLOCK_TAI are stepped backward during the sleep, the call also returns ETIMEDOUT before the clock reaches the deadline. The kernel already polls CPU-time clocks and handles realtime steps. Use _thr_umtx_timedwait_uint() in a loop to handle both issues. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61381
debug: classified in
04-filenames_plain2 by 'lib/'
* Always use libmd's MD5 since it's deprecated in OpenSSL. * Use ASN1_STRING_get_length() instead of ASN1_STRING_length().
debug: classified in
05-summary-prefix by 'lib.*:'
No functional change. Keeping it sorted reduces chance of a collision. Reviewed by: kfv, imp Differential Revision: https://reviews.freebsd.org/D61345
debug: classified in
03-filenames_plain1 by
'include/'
Tested by: ivy Approved by: bapt, ivy Differential Revision: https://reviews.freebsd.org/D61099
debug: classified in
05-summary-prefix by 'lib.*:'
Our popen(3) accepts more than the historical "r" and "w" types. Define the appropriate macro to provide a custom mode check accepting all valid pipe types. Reviewed by: kevans Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D61175
debug: classified in
04-filenames_plain2 by 'lib/'
This fixes Lua 5.5 compat in the .c template, where the first loop variable '_' becomes const in Lua 5.5. Use select() to discard inside the loop instead. While here, fix a mismatched variable name in the corresponding header template. Reported by: Austin Horstman <khaneliman12@gmail.com> Reviewed by: kevans Approved by: kevans (mentor) Closes: https://github.com/freebsd/freebsd-src/pull/2473 Differential Revision: https://reviews.freebsd.org/D61455
debug: classified in
04-filenames_plain2 by 'lib/'
Extend hexdump(3) to write to a given stream. Reviewed by: kevans Approved by: kevans (mentor) Differential Revision: https://reviews.freebsd.org/D61177
debug: classified in
04-filenames_plain2 by 'lib/'
When a format uses positional arguments, __find_arguments() walks it
first to learn the type of every argument, and lists the floating
point conversions as A a E e f G g. F is missing, so a double that
is only referred to through %F never gets a type, its slot in the
argument table stays unset, and the conversion reads whatever is
there:
printf("[%1$F]\n", -INFINITY); [0.000000]
printf("[%1$F]\n", 1.5); [0.000000]
printf("[%F]\n", 1.5); [1.500000]
With a width taken from another argument, "%1$*2$F", vsnprintf(3)
returned lengths like 2103024 for a ten character result; abseil's
str_format test allocates that much and was killed for it on
FreeBSD. The same format with %1$f, or with any other conversion of
the same argument, works because those give it a type.
Add F ahead of f in both __find_arguments() and __find_warguments(),
and test %F, plain and positional, in snprintf_test and
swprintf_test.
MFC after: 1 week
Signed-off-by: Showta Ishizaki <zakinko@snowrabbit.org>
Pull Request: https://github.com/freebsd/freebsd-src/pull/2420
debug: classified in
04-filenames_plain2 by 'lib/'
Try to open the control device read-write first, and fall back to read-only if that fails and the error is EACCES. This prepares us for a future in which GEOM requires write access to execute verbs that modify the configuration. MFC after: 1 week Event: EuroBSDCon 2026 DevSummit Reviewed by: imp, markj, emaste Differential Revision: https://reviews.freebsd.org/D59592
debug: classified in
04-filenames_plain2 by 'lib/'
MFC after: 1 week Fixes: https://cgit.freebsd.org/src/commit/?id=d9dc1603d6e4 ("libc: Implement N2630.") Fixes: https://cgit.freebsd.org/src/commit/?id=b9385720f34b ("libc: Add unit tests for N2630 and possible collateral damage.")
debug: classified in
04-filenames_plain2 by 'lib/'
MFC after: 1 week Fixes: https://cgit.freebsd.org/src/commit/?id=bce0bef3c6ab ("libc: Implement N2680.") Fixes: https://cgit.freebsd.org/src/commit/?id=12b1c1e3fb44 ("libc: Add test cases for N2680.")
debug: classified in
04-filenames_plain2 by 'lib/'
C23 adds iseqsig(), the signaling counterpart of ==, which raises FE_INVALID on any NaN rather than only on signaling ones (as per §7.12.17.7). The helpers raise it explicitly instead of relying on relational operators, which the compiler may emit as quiet comparisons, and the macro dispatches on float_t so that wider-evaluated arguments are not narrowed (§F.10.14.1). Reviewed by: kargl, fuz Approved by: fuz (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D60642
debug: classified in
04-filenames_plain2 by 'lib/'
In the case were N was not a valid bit width, we were taking the wrong error path. Fixes: https://cgit.freebsd.org/src/commit/?id=5e809bf1c93f ("stdio: Fix positional %wN / %wfN conversion")
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/'
When returning NFSERR_BADSEQID, the server should not have incremented the sequence ID, yet the call to nfsrv_checkseqid() a few lines above does precisely that. Instead, check for a legitimate retransmission of the original successful request, and reject otherwise, before the ticket is used and sequence ID incremented. MFC after: 1 week Fixes: https://cgit.freebsd.org/src/commit/?id=ff45b9fc1a8c ("Bjorn reported a problem...") Sponsored by: Klara, Inc. Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D61156
debug: classified in
03-filenames_plain1 by
'sys/fs/'
Notable upstream pull request merges:
#17567 816804dfd Add support for anyraid vdevsG
#18826 -multiple FDT: don't extend dedup across RAIDZ expansion
#18861 1ff8fc14a Fix out-of-bound access when resizing in receive_spill
#19026 518021947 Add alloc factor logic
#19091 e056f4df3 don't send spill or oversized blocks as WRITE_EMBEDDED
#19125 6d5d3f635 Wait for the txg-time database write before setting
spa_final_txg
#19170 b060bcb1d zio: drop a queued scan read only when its block is freed
#19171 3db7dde41 dsl_scan: resume a scan which suspends at the origin
snapshot
#19178 497f28f07 vdev_raidz: keep unverified dRAID rebuild repairs
speculative
#19188 5f1957a15 spa: number new txgs above every uberblock on disk
#19190 495d09b51 Export zpool_valid_proplist from libzfs
#19191 ed07ad74e zdb: Lower eviction timeouts on prefetched data
#19192 86b3fb1f4 Build the pool stats config without the namespace lock
#19198 a9418818b vdev_rebuild: wait for the syncing txg before rebuilding
a metaslab
#19204 a8ea85249 userspace: remove makedev detection and cleanup headers
#19206 -multiple spl: remove unused headers
#19208 f239ea947 Walk snapshot names without holding the objset in
list-next ioctl
#19211 7e556b324 dmu_send: don't send uncompressed ARC data as compressed
#19212 79b0e2126 zpool: don't print a huge duration when a scan ends
before it started
#19213 d72c45490 libzutil: fix the udev_device_get_is_initialized() config
check
#19216 c97a5a4c2 Clone sparse files in time proportional to their data
#19217 5e35770b3 Allow cloning a file's tail block past the destination's
EOF
#19218 -multiple Do not hang on a suspended pool in four more waits
#19222 -multiple vdev_prop_get: report real vdev fragmentation
#19223 000b4c46d ddt: prune only entries unchanged since the prune walk
#19227 -multiple libzfs: support refreservation=auto in zfs_create()
#19228 7f838b8fb libzfs: fix a double free of the btree leaf cache
#19229 88da095a2 Fix a deadlock between zvol first open and pool export
#19231 -multiple zfs_file: hide zfs_file_t internals
#19234 f1f96f5e7 dbuf: restore BP_IS_HOLE() recheck after
dnode_block_freed()
#19236 954472f2d dsl_crypt: say when change-key finds a key it cannot
unwrap
#19250 -multiple Remove userspace umem shim; use kmem_* everywhere
#19253 e9e24ce2c ZIL: avoid deadlock in xattr owner check
#19261 7d3e648d5 Allow quota to be changed even when over quota
#19264 7391add65 ddt: don't prune every unique entry for a target below
one entry
#19267 64c061e33 Zero the last page past EOF when extending a file
#19268 269d147bb FreeBSD: do not clear dirty bits outside a sub-block
write
#19271 e61fe2571 Open only the named pool when zpool checks a pool name
#19272 5f68a22f0 Skip the second duplicate search when adding to an nvlist
#19274 c0688a275 ZIL replay of an indirect write leaks later writes in the
#19278 -multiple vdev_removal: don't remove a mirror with a child still
resilvering
#19279 100f0e001 raidz: refuse too small replacements during expansion
#19281 a99330d3e dmu_recv: fix corrective recv of zstd compressed blocks
#19288 21a89645f zpool: compare special and dedup vdevs only with normal
vdevs
#19292 c7921a82b libzfs: reject malformed numeric ids in userquota props
#19293 7d534ee08 zpool: fix 'zpool status' error count and list output
#19297 44efa5044 zoned_uid: print as integer, reject out-of-range uidS
#19298 23cef4390 zfs: reject 'bookmark -r' to a dataset other than the
source's
#19301 186bf8c93 ddt: fix NULL bp dereference in ddt_repair_entry_done()
#19304 183ab72c3 spa: make the normal class the last allocation fallback
#19308 -multiple libzfs: don't abort when a recv target's origin is
outside the tree
#19309 b3e4cf0c8 libzfs: don't require keylocation when receiving an
encryption root
#19310 7eae9e89c dsl_crypt: only expect an IVset guid on snapshots
#19312 a78337a9d metaslab: use the physical birth to decide checkpointed frees
#19314 f61e0291a zio: find large gang headers while the pool is loading
#19315 23feecbbc zfs_ioctl: allow read-only channel programs on read-only
pools
#19316 8b11b983c libzutil: prefer devices of the same pool when fixing up
paths
#19319 -multiple zvol: leave alone a minor that is being removed
#19320 -multiple ZIL: zero the header bp in zil_crash() only if lwbs own
it
#19322 ae4deb34b Exempt the usage ZAPs from FREE_RANGE_VERIFY() in syncing
context
#19323 f7c15333a dmu_recv: keep rrd->abd current in do_corrective_recv()
#19325 -multiple metaslab: don't modify ms_weight when verifying it
#19326 -multiple zap: don't use a stale ptrtbl shift in zap_shrink()
#19329 9699602a0 ZIL: Sync the txg that a suspended commit waits for
#19332 -multiple vdev_removal: don't hold ms_lock while loading a space map
#19337 0080dc9c4 Don't hold spa_errlist_lock while resolving errors
#19343 9d6e2cc70 Do not refill a plain ARC buf when authenticating it
#19346 602c474a2 Report EIO when no vdev can take a Direct I/O write
#19351 9e8e7a964 metaslab: don't gang every block on a degraded
single-disk vdev
#19353 1a0a83b03 spa: don't self-heal while loading an older txg
#19355 0606e0dcc Build the vdev config in place instead of copying it
#19356 7c3d85aaf ZIL replay can apply part of a split WR_NEED_COPY write
#19365 7c546ef8e raidz: refuse expansions that the boot area cannot holD
#19376 5d7c42cfd Add zfs rewrite -W to skip blocks already at their
current size
#19381 daab47652 zio: Remove the priority match assertion when joining
a batch
#19391 22013c391 zio: free the gang header ABD when its read fails
#19395 21df1e4f7 raidz: resilver every child a block born before an
expansion spans
#19398 b31984ce4 Find the dataset of a renamed volume by its object number
#19399 b1f55c3ef vdev_mirror: scrub every copy of a gang block in a sorted
scrub
#19400 83f7e0e8d Translate initialize and TRIM ranges under the config lock
#19402 cd1b094b2 Accept the dedup NOP of zfs rewrite -P in arc_write_done()
#19403 15f2b6042 Do not let scrub skip a dedup block its DDT entry does
not describe
#19406 a6fc6209e spl: avoid reclaim for speculative physical allocations
#19411 48f048c0b icp: record the accelerated GCM hash-table allocation size
#19414 a6ed3cf31 libspl: split usleep_range() into seconds and nanoseconds
#19430 b509a677f zvol: remove minors in parallel
#19433 -multiple raidz: fix scrub repairs during a raidz expansion
#19440 1e9b428dc raidz: write the scratch uberblocks on non-debug builds
#19451 -multiple libzpool: fix zfs_file_off() and three zfs_file_* error
paths
#19429 -multiple nvpair: performance optimisations
#19495 74215dc63 Let zfs rewrite -W skip only blocks that a rewrite would
keep
#19496 e117a84db libzutil: keep the latest label when two vdevs claim one
id
#19503 df0d1bb22 Fix dbuf dirty record traversal locking
#19506 04586b11f raidz: compute the aggregate copy offset before adding it
#19508 -multiple libspl/thread: rewrite for kthread semantics and to hide
pthread
#19511 1ad9b782c vdev: atomically account checkpoint space during parallel
load
#19515 4733b98c2 dsl_deadlist_open(): clean up on error
#19516 dedf1fb18 Fix user accounting after incremental receives into
encrypted datasets
#19518 -multiple libspl: cleanup atomics
#19520 061dd8a13 zoned_uid: check rename destination permissions
#19521 5135029ce zoned_uid: preserve global-only zoning property checksG
#19538 1ccce6d52 Do not copy stale data from a mirror child in a rebuild
#19549 7bfe0418f ddt: do not prune an entry that a copies=2 write may have
extended
#19550 c8534b99c raidz: don't lose the expansion wakeup when a resilver
ends early
#19554 dce3650fa recv: check the temporary clone name length
#19556 dc66d8489 Release the upgrade hold before clearing os_upgrade_id
#19578 df744acc4 vdev: avoid null member access in statistics updates
#19588 71563e5e1 Wait for dataset evictions when exporting a read-only pool
#19590 -multiple raidz: keep the scratch copy when import recovery fails
#19594 1547ff6bc Return ENODEV from vdev_prop_get/set for a missing vdev
#19601 9c606af17 Include zfs rewrite -P blocks in raw encrypted sends
#19602 ba46f0833 Keep the logical birth of dedup blocks in zfs rewrite -P
#19604 03840dd33 Keep the indirect mapping lookup from wrapping below
entry 0
#19628 66184a0dc L2ARC: Do not stop writing when l2arc_headroom is 0
#19630 6b84a198e zio: initialize all props of gang children
#19631 cc0d3dc4e L2ARC: Do not write encrypted buffers whose MAC differs
#19633 924b8c89c Fix direct reads of blocks pending free
#19634 cea524bd5 zio_reexecute() keeps the old allocation trace
#19656 af9553c59 Release the new znode when its ZIL commit fails
#19698 984e7c165 zpool: reject a dRAID children count of zero
#19679 -multiple FreeBSD: move SPL stuff out of zfs_context_os.h
#19693 70cba4665 zap: Fix zap_trunc() to account next ptrtbl blocks
#19705 c9e0d4c89 raidz: take the reflow range lock when spa_ubsync advances
#19708 8ad60bab5 zpool: reject empty dRAID failure groups and stray
devices
#19709 fbc758d36 Drop spa_namespace_lock while spa_vdev_exit() waits on a
suspended pool
#19713 ef35f1441 Decrypt when holding an unmounted filesystem's objset
#19716 7704a886e spa_stats: add "misc" pool stats with suspended & resumed
counters
#19728 -multiple anyraid: write the tile map at the vdev's ashift
#19743 -multiple Fix some small ZPL nits
#19744 -multiple ZPL: Wrap various error origins with SET_ERROR()
#19769 -multiple Aarch64 SIMD build fixes
#19782 ed3001e94 arc: fix use-after-free in synchronous L2ARC read retry
#19789 -multiple kstat: fix up some sketchy uses of ks_data
(incl use-after-free)
#19793 -multiple Fix FreeBSD build issues
Obtained from: OpenZFS
OpenZFS commit: 013c77e66e37bc2ac54d8e0725e548d90e53d4b6
debug: classified in
05-summary-prefix by 'zfs:'
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/'
linuxkpi: Fix sysfs_remove_group() for groups without a name sysfs_create_group() handles a group with a NULL name by creating its attributes directly under the object node, but sysfs_remove_group() passed the NULL name to sysctl_remove_name(), which then panics in strcmp(). Mirror the creation path: for an unnamed group, remove each attribute and binary attribute individually. This was not hit before because the devres actions of a PCI device (e.g. the one registered by devm_device_add_group()) were not run when the driver was detached. Sponsored by: Beckhoff Automation Gmbh & Co. KG
debug: classified in
04-filenames_plain2 by 'sys/'
linuxkpi: Release devres on PCI driver detach
linux_pci_detach_device() called the driver remove method and then only
dropped its reference on the device, expecting the devres list to be
released from lkpi_pci_dev_release() once the last reference is gone.
That never happens when a devres action itself holds a reference on the
device. The typical case is devm_drm_dev_alloc(): the drm_device takes a
reference on its parent and the matching drm_dev_put() is a devres
action. The device is thus never released, drm_dev_release() is never
called and the DRM device and everything it owns is leaked, which makes
unloading drm-kmod drivers fail ("failed due to N other pending
references on the LinuxKPI device") and leaves the module unloadable or
crashing.
Linux releases the devres resources when a driver is unbound, so do the
same: call lkpi_devres_release_free_list() right after the remove method.
The list is empty when lkpi_pci_dev_release() runs later.
Reviewed by: bz
Sponsored by: Beckhoff Automation GmbH & Co. KG
debug: classified in
04-filenames_plain2 by 'sys/'
linuxkpi: Fix lkpi_i2c_del_adapter() leaving the devices behind lkpi_i2c_del_adapter() looked for the lkpi_iic or lkpi_iicbb device to delete with device_find_child() on increasing unit numbers, and stopped at the first unit that does not exist. Units are allocated globally per devclass, so as soon as one adapter was removed (leaving a hole) or when the units of a parent do not start at 0, the adapter was not found and its device was never deleted. The i2c devices of a driver such as i915 then accumulate, with a new set of unit numbers, each time it is loaded. Walk the children of the parent instead and match on the adapter. Sponsored by: Beckhoff Automation GmbH & Co. KG
debug: classified in
04-filenames_plain2 by 'sys/'
linuxkpi: Do not wait for a disabled tasklet in tasklet_unlock_wait() tasklet_unlock_wait() waited for the tasklet state to become idle. Linux only waits for TASKLET_STATE_RUN, i.e. for a tasklet that is currently executing. A tasklet which is scheduled but disabled does not run until it is enabled again, so in LinuxKPI it stays in the BUSY (queued) state and the waiter never returns. This is what happens when unloading i915: execlists_reset_prepare() disables the engine tasklet with __tasklet_disable_sync_once() while the tasklet is queued and kldunload loops forever in pause(). Do not wait if the tasklet is only queued and disabled. Reviewed by: bz Sponsored by: Beckhoff Automation GmbH & Co. KG
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/'
Once we have the thread lock, we are in a spinlock section and thus will not be preempted, which ensures stability of 'td_owepreempt'. Check it again for the improbable case where we were already preempted before entering that section (after 'td_critnest' reached 0 in critical_exit() but before clearing 'td_owepreempt', because of an IPI_PREEMPT received in the meantime or any interrupt whose handler uses critical sections), in which case there is no need to switch to another thread. It is however still necessary to temporarily raise 'td_critnest' around the thread_lock() call, and that is not an optimization contrary to what the old comment stated. As explained in the new comment, thread_lock() can lead to entering and exiting a spinlock section multiple times, which would cause recursion with critical_exit_preempt() in some circumstances. Reviewed by: kib, markj MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D60860
debug: classified in
04-filenames_plain2 by 'sys/'
sched: Automatically namespace schedulers' implementation functions
This renames back scheduler implementation functions to their old names,
i.e., the same name as the interface functions, in the source code,
while providing the infrastructure to still produce from them C symbols
namespaced by the scheduler implementation, in order to avoid symbol
collisions with interface dispatching functions and other scheduler
implementations when multiple ones are compiled in. In a nutshell, the
implementation consists in re-routing interface names to implementation
names via the C preprocessor.
The main reasons for this change are that different implementation names:
1. Break navigating code with ctags-like tools like in-tree ctags,
Global and Universal Ctags.
2. Spoils inlining opportunities in internal scheduler code if not
careful. This alternatively could be regained by changing call
points to use scheduler-specific names, but that does not prevent
people from inadvertently adding more calls to interface functions.
Also, having to namespace calls with the implementation name in the
implementation itself can be seen as code clutter.
3. Introduces avoidable cognitive burden, for example in the form of
having to ask oneself whether internal scheduler functions should be
namespaced or not, and then when calling them which their actual
names are.
However, C symbol collisions create difficulties with debugging and ELF
manipulation tools, including when printing backtraces (which scheduler
implementation is in use?). For example, as of this writing,
'disassemble' in GDB will choose one of the existing functions and
disassemble it without mentioning the existing others; our ddb(4) will
set a breakpoint on one of these functions only (which should be
improved); etc. So keeping namespaced symbol names was desirable, which
is why symbol re-routing via the C preprocessor was chosen.
People wanting to extract information from ELF files will have to use
full symbol names instead of source code names. This is certainly
a drawback, but we expect that people will spend by far more time on the
code rather than trying to disassemble some particular implementation
function, so the inconvenience will barely occur in practice. Also,
DWARF information matching machine code to source code location stays
undisturbed and gdb will continue to display matching source code
correctly. ctags-like tool are likely to never implement macro
substitution when definitions are in other files, or if they do to never
enable it by default, as this would considerably slow down source
parsing (Universal Ctags reports a 2x slowdown just by enabling
expansions for definitions that are in the *same* file). LSPs have not
been tested; we however expect this change will cause nothing but minor
annoyances when using them. Writing new calls to scheduler functions
should work as usual in terms of help/completion (including in
implementations, as corresponding implementation and interface functions
have same signature). Even automatically producing implementation
function signatures when adding a new definition is expected to work.
Please report if not the case.
The implementation of the machinery to substitute interface names by
implementation names has two parts.
First, a new generated per-implementation-specific header has to be
included in each implementation ("sched_<NAME>_ns.h"). It contains
simple C preprocessor substitutions, such as, taking the example of ULE:
#define sched_clock sched_ule_clock
#define sched_switch sched_ule_switch
allowing to use the interface names in place of the implementation names
in the implementation itself. It also checks that an implementation
actually defined SCHED_IMPLEMENTATION and to the same value that was
used to produce it.
These headers are generated from the pattern header
'sys/kern/sched_ns.h' through directives in 'sys/conf/files', via the
C preprocessor using the already existing X macros and some light
post-processing by the new 'sys/tools/sched_impl_ns.awk' script.
Second, <sys/sched.h> declares all implementation functions when
included from an implementation, so that out-of-order references within
the implementation do not cause problems, as it was before multiple
schedulers could coexist.
Implementations must define SCHED_IMPLEMENTATION to their name used as
the namespacing symbol part (e.g., ule or 4bsd), which used to be the
name passed as the first argument to DECLARE_SCHEDULER(). This argument
is now redundant and has been removed. That same macro with same value
has to be defined in the directives from 'sys/conf/files' for each
implementation's namespacing header to be produced properly.
For added safety, <sys/sched.h> does not provide interface functions'
declarations when SCHED_IMPLEMENTATION is defined anymore, so that
implementations can never inadvertently call these functions.
Reviewed by: mchoo
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60644
debug: classified in
04-filenames_plain2 by 'sys/'
sched: Fix building kernel independently of world
Regular '-I' directives must be passed to ${CPP} so that when
pre-processed, 'sched_ns.h' can find the files it includes in the proper
places, instead of relying on what is in ${WORLDTMP}, i.e., nothing if
'_includes' was not executed, which happens, e.g., when using 'make
kernel-toolchain' and then 'make buildkernel' without having executed
a 'make buildworld', or possibly some outdated copy not matching an
updated source.
Reported by: Claude Opus 5.5, imp
Fixes: https://cgit.freebsd.org/src/commit/?id=510331fa3763 ("sched: Automatically namespace schedulers' implementation functions")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61167
debug: classified in
04-filenames_plain2 by 'sys/'
No functional change (intended). Fixes: https://cgit.freebsd.org/src/commit/?id=f4b3640475ce ("inline atomics and allow tied modules to inline locks") Sponsored by: The FreeBSD Foundation
debug: classified in
04-filenames_plain2 by 'sys/'
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60963
debug: classified in
04-filenames_plain2 by 'sys/'
The pd_refcount field counts both sharing processes and the transient pdhold() references taken by sysctls and mountcheckdirs(), so it cannot answer "is this pwddesc shared". As a result pdunshare() made needless copies while the pwddesc was held, and a copy made while mountcheckdirs() held it lost the cwd/root update. Add pd_sharecount, counting only processes using the pwddesc, and use it for the sharing decision. Existing pd_refcount still manages the lifetime. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60963
debug: classified in
04-filenames_plain2 by 'sys/'
Unprivileged chroot(2), fchroot(2), chaltroot(2), and fchaltroot(2) rely on PROC_NO_NEW_PRIVS to make set-ID images harmless under the new root. But the pwddesc can be shared by rfork(2) without RFFDG with a process that has not enabled PROC_NO_NEW_PRIVS, and the change of the root affects that process as well. It can then execute a set-ID image whose ELF interpreter is resolved under the root controlled by the caller. Refuse the unprivileged operations when the pwddesc is shared. Processes that start sharing it later are created by the caller and inherit PROC_NO_NEW_PRIVS. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60963
debug: classified in
04-filenames_plain2 by 'sys/'
- single-thread the process Make cap_enter() a serialization point, ensuring that no threads are executing with old credentials cached after the syscall returned. - disallow entering capability mode if the file descriptor table or pwd are shared. They are shared after rfork(2), and allowing it lets another process grant additional privileges to the process in capability mode. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60963
debug: classified in
04-filenames_plain2 by 'sys/'
drmn driver is attached to PCI bus via intermediate vgapci driver. Check for it presence in device tree branch too to handle drm-kmod cases. MFC after: 2 month Reviewed by: emaste (LGTM) Differential Revision: https://reviews.freebsd.org/D60138
debug: classified in
04-filenames_plain2 by 'sys/'
This was missed when commit cf907074674206b1825f79c6864c4c4a32089ecc landed. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300341 Fixes: https://cgit.freebsd.org/src/commit/?id=cf907074674206b1825f79c6864c4c4a32089ecc Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D61060
debug: classified in
04-filenames_plain2 by 'sys/'
Prior to change 477c594d9063, the struct kobj_class has six members but
the DEFINE_CLASS_[0..3] only initialize the first four of them. The
change 477c594d9063 intends to initialize the two new members but
actually acts on the wrong ones.
```
error: initialization of pointer of type 'kobj_ops_t' (aka 'struct kobj_ops *') to null from a
constant boolean expression [-Werror,-Wbool-conversion]
```
Fix by initializing the two new members implicitly.
Reported by: clang (-std=gnu23 -Wbool-conversion)
Reviewed by: mmel, kib
Fixes: https://cgit.freebsd.org/src/commit/?id=477c594d9063 kobj: allow multiple inheritance with per-class softc
MFC with: 477c594d9063
Differential Revision: https://reviews.freebsd.org/D61173
debug: classified in
04-filenames_plain2 by 'sys/'
So that `sysctl -T` can report it correctly. Reviewed by: olce, kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D61178
debug: classified in
04-filenames_plain2 by 'sys/'
The write reduction code was broken in a few ways: - It didn't handle non-zero b_dirtyoff. - It didn't advance the uiop fields such that they could be backed up for a retry. - It didn't handle the rare retry case with a partially written buffer. This patch fixes the above and now write reduction seems to be working ok. MFC after: 1 month Fixes: https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
debug: classified in
04-filenames_plain2 by 'sys/'
Linux drivers find their MSI and MSI-X registers through pdev->msi_cap and pdev->msix_cap, which hold where those capabilities start in PCI config space. LinuxKPI never set them, so they stayed 0, and every access meant for the MSI registers went to the start of config space instead. Drivers using these fields, e.g. ath11k and amdgpu, are affected. Fill in both fields from the capability offsets that the native PCI code already records. Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D61125 Event: NetApp/Vendor Summit Hackathon 202611
debug: classified in
04-filenames_plain2 by 'sys/'
Sprinkle it in various drivers which hard-coded the command layout. No functional change intended. Reviewed by: dumbbell, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D61045
debug: classified in
04-filenames_plain2 by 'sys/'
Switch eMMC cards to HS200 when both the card and the host support it, falling back to high speed on failure. Bus settings changes now wait for the SIM to complete, which runs from its own taskqueue. Also fix a race where a new request could be lost when the SIM task cleared the current request after completing it, and fail bios queued for a partition whose switch failed. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D60884
debug: classified in
04-filenames_plain2 by 'sys/'
XPT_MMC_IO maps two nested buffers: cmd.data, then cmd.data->data whose
address is derived from cmd.data. cam_periph_unmapmem() restored them in
forward order, so it put cmd.data back to its userspace value and then
dereferenced that pointer to reach cmd.data->data from kernel context,
panicking in vm_fault_lookup().
Unmap in reverse order, mirroring how the mappings were created. This is
a no-op for single-buffer func_codes and for the other two-buffer cases
(XPT_DEV_MATCH, XPT_SMP_IO), whose buffers are independent.
The bug is only reachable via the pass(4) userspace path, which maps and
unmaps CCB buffers; in-kernel MMCCAM consumers never call
cam_periph_{map,unmap}mem(). Triggered by a userspace SDIO CMD53
transfer from sdiotool(8) through pass(4).
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D61021
debug: classified in
04-filenames_plain2 by 'sys/'
cam_periph_mapmem() and cam_periph_unmapmem() map the user-provided struct mmc_data for XPT_MMC_IO CCBs, but use sizeof(struct mmc_data *) instead of sizeof(struct mmc_data) as the length. Only the pages covering a pointer are mapped, so accessing a field past the first pointer-sized region (for instance cmd->data->flags) faults if the structure happens to straddle a page boundary and the following page is not mapped. The failure is intermittent because it depends on where the caller places the struct mmc_data. Issuing a CMD53 CCB through pass(4) to an MMCCAM SDIO card whose struct mmc_data lands at the end of a page panics with "data abort in critical section or under mutex" in the host driver. Map the whole structure in both the map and unmap paths. MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D61022
debug: classified in
04-filenames_plain2 by 'sys/'
The mmc(4) stack waits after powering up a card: mmc_power_up() waits 1 ms after the supplies are on and 2 ms after the clock is running, before the first command is sent. The MMCCAM probe had no such wait: it went from the power_up request to the power_on request to CMD0 without any delay. Some devices do not answer the first commands if they are sent too early and then never enumerate, with no error. On a RockPro64 the Broadcom SDIO Wi-Fi (BCM4359) was not detected on any of 8 boots without a delay. It was detected on 8 out of 8 with the same waits as mmc_power_up() added to the probe. Add the same two waits, once the power_up request and once the power_on request are done. This replaces the delay that was in mmc_fdt_set_power(), which was a fixed 10 ms for FDT hosts only; the waits of the legacy stack are enough and apply to every MMCCAM host. MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D61077
debug: classified in
04-filenames_plain2 by 'sys/'
The need for a separate map for TSO and non-TSO seems to have arisen from a misunderstanding about the DMA requirements for Intel drivers like ice/ixl/iavf. Specifically, this Intel hardware has a quirk where no more than N (=8) segs can be DMA'ed per packet on the wire. This limit was enforced using a DMA map with a low segment limit for non-TSO and a driver specific check for TSO. This led to a *lot* of complexity in iflib (~80 extra lines of code that this change removes) when the limit can simply be enforced via the existing EFBIG mechanisms. This change adds a new flag, IFLIB_SPARSE_TX, that drivers for hardware with this quirk must set. When set, it causes non-TSO sends that exceed isc_tx_nsegment to be treated as if bus_dmamap_load_mbuf_sg() had returned EFBIG. Due to the API/KABI change, I've bumped the FreeBSD version as well. Note kgalazka suggested the flag, rather than a more awkward mechanism that I had in my initial patch. Reviewed by: kbowling Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D60175
debug: classified in
04-filenames_plain2 by 'sys/'
The xdrmbuf_getlong() function failed to check for the return value from xdrmbuf_getbytes(). This could have resulted in a failure during NFS RPC message processing. Reviewed by: rmacklem MFC after: 2 weeks Sponsored by: VersatusHPC
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK PR: https://github.com/freebsd/freebsd-src/pull/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=2284
debug: classified in
04-filenames_plain2 by 'sys/'
Add NVMe CCB (union ccb / struct ccb_nvmeio) building functions for
the four NVMe reservation opcodes, Format NVM, and Get Features /
Set Features. These use the nvme_command building blocks added to
sys/dev/nvme/nvme.h, and are used by the new camcontrol(8) nvres,
nvformat and nvfeature subcommands that will be added separately.
sys/cam/nvme/nvme_all.c:
Add NVMe CCB building functions for the four NVMe reservation
opcodes: nvme_resv_report(), nvme_resv_register(),
nvme_resv_acquire() and nvme_resv_release(). Data direction
is set internally (CAM_DIR_IN or CAM_DIR_OUT as appropriate),
so no flags parameter is needed.
Add a new nvme_format() CCB building function.
Add nvme_get_feature() and nvme_set_feature() CCB building
functions, along with nvme_get_feature_hostid() and
nvme_set_feature_hostid() convenience wrappers for the hostid
feature. nvme_set_feature_hostid() takes an sv argument so
the caller can request that the hostid persist across reset.
sys/cam/nvme/nvme_all.h:
Add prototypes for the above. Wrap the declarations in
__BEGIN_DECLS / __END_DECLS so C++ compilers don't mangle the
names of the C symbols.
Co-authored-by: Reid Linnemann <reidl@spectralogic.com>
Co-authored-by: Dave Baukus <daveb@spectralogic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed by: imp
MFC after: 1 week
Sponsored by: Spectra Logic
Differential Revision: https://reviews.freebsd.org/D59532
debug: classified in
04-filenames_plain2 by 'sys/'
Where the kern_ interfaces map trivially to the syscall interface, follow the syscall name even if awkward (e.g., sys___mac* -> kern___mac*). Otherwise use shorter names. Effort: CHERI upstreaming Sponsored by: DARPA, AFRL Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
So that it is less error prone when adding new struct members or refactoring in future. No functional change intended. Reviewed by: kib, imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D61276
debug: classified in
04-filenames_plain2 by 'sys/'
The previous commit (re)introduced the possibility that a malicious or corrupt message can cause the receiver to allocate a very large amount of memory before realizing that the message is much shorter than claimed. Revert the change to xdr_wrapstring() to avoid this. Fixes: https://cgit.freebsd.org/src/commit/?id=d2018cedb414 ("xdr: Fix xdr_string") Reported by: bjk@ Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D60898
debug: Commit manually moved from "unknown" to "kernel".
listxattr() sized its buffer with min(), which truncates the 64-bit size to 32 bits, so a size of 2^32 + k allocated k bytes while the copy-out guard used the full size. The walk then read record lengths past the buffer and copied kernel heap out to the caller, and could panic the kernel. Any user can reach it through a user.* attribute on a file it owns. Use MIN(), and fail with EIO if a record runs past the data returned. Reviewed by: adrian, markj Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D61006 Signed-off-by: Nick Price <nprice@FreeBSD.org>
debug: classified in
04-filenames_plain2 by 'sys/'
Required to build drm-kmod om powerpc64. GHPR: https://github.com/freebsd/drm-kmod/pull/529 Reported by: pkubaj Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D61299
debug: classified in
04-filenames_plain2 by 'sys/'
sh_info is used to index the section header array without checking it against e_shnum, so a malformed object can make the linker read out of bounds. Reject such a file with ENOEXEC in both the preload and kldload paths. MFC after: 1 week Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D60937
debug: classified in
04-filenames_plain2 by 'sys/'
link_elf_unload_file() frees the per-section relocation tables by iterating ef->nreltab / ef->nrelatab, but dereferences ef->reltab / ef->relatab unconditionally. The counts are set while scanning the section headers, before the tables are allocated, so an error on the load path reaches it with a non-zero count and a NULL table, faulting on ef->relatab[0].rela. Reachable from link_elf_load_file() once a valid relocation section has been counted, e.g. a later section with sh_info >= e_shnum (D60937). Guard the loops with the table pointer, as is already done for ef->progtab above. MFC after: 1 week Reviewed by: markj, kib Differential Revision: https://reviews.freebsd.org/D61140
debug: classified in
04-filenames_plain2 by 'sys/'
link_elf_load_file() checks the symbol table's sh_link against e_shnum with ">" instead of ">=", so a malformed object whose sh_link equals e_shnum makes the linker read one entry past the section header array before the sh_type check rejects it. Use ">=", as link_elf_link_preload() already does. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D61055
debug: classified in
04-filenames_plain2 by 'sys/'
The /dev/crypto cipher and MAC keys are copied from userland and released with free(), leaving the key bytes in freed kernel memory. Use zfree() so the key material is cleared on session teardown and on the setup error path. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D61324
debug: classified in
04-filenames_plain2 by 'sys/'
linux_getdents() and linux_getdents64() round their native read size up to DEV_BSIZE before converting entries. For an unaligned caller buffer, the native batch can contain more entries than fit in the Linux buffer. Conversion then returns EINVAL even after copying complete entries, and the native read has already advanced the directory position. For counts of at least DEV_BSIZE, use min(args->count, MAXBSIZE) instead. A 768-byte request, such as rustix's initial directory read, now uses a 768-byte native buffer rather than 1024. The converted Linux dirent and dirent64 records are no larger than their native counterparts, so the whole translated batch fits. Returning a short batch is allowed, and consuming the whole native batch avoids needing to rewind the directory position. Keep the existing sizing for counts below DEV_BSIZE. This fixes the oversized-batch case in both getdents interfaces, including legacy getdents for 32-bit and 64-bit callers. The remaining small-buffer, copyout-failure and old single-entry readdir problems are outside the scope of this change. Fixes: https://cgit.freebsd.org/src/commit/?id=110f2567cb51 ("linux_file.c: Fix handling of NFS [...]") MFC after: 3 days Sponsored by: Alchemilla Ventures Private Limited Reviewed by: kevans, markj Differential Revision: https://reviews.freebsd.org/D60760
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
sys_wait6 is a little more complicated than typical as compat layers need to translate siginfo_t. Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
kldsym(2) is more complex than typical because it requires translation of struct kld_sym_lookup which is a weird in/out structure. Out of paranoia we avoid copying out the symname pointer in the capability version to eliminate the possiblity of leaking a capability (but not invalidating a pointer userspace might be using via copyout()). Effort: CHERI upstreaming Sponsored by: DARPA, AFRL, Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: DARPA, AFRL, Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Linux allows connect() with destination port 0, but FreeBSD returns EADDRNOTAVAIL in in_pcbconnect() and in6_pcbladdr(). Some Linux programs (e.g. the new Android CLI tool) rely on this for routability checks, however. Add an SV_CONN_PORT0 flag to sv_flags which is set in the Linux sysvecs, allowing the port 0 guard in the connect paths to be bypassed. Reviewed by: glebius, kib Differential Revision: https://reviews.freebsd.org/D60659
debug: classified in
04-filenames_plain2 by 'sys/'
e_shstrndx is used to index the section header array after only being checked against zero, so a malformed object can make the linker read up to about 64K entries past the end of shdr[]. Reject such a file with ENOEXEC, as link_elf_link_preload() already does. Reported by: llm-postcr Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D61321
debug: classified in
04-filenames_plain2 by 'sys/'
A symbol name offset (st_name) indexes the string table in several places without being checked against ddbstrcnt, so a corrupt object causes an out-of-bounds read. Check that the string table is NUL-terminated and that every st_name lies within it, in both the preload and file paths, and reject the object with ENOEXEC. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D61322
debug: classified in
04-filenames_plain2 by 'sys/'
parse_dynamic() builds the symbol hash table at ef->address + d_ptr without checking that d_ptr lies within the mapped image, so a crafted DT_HASH entry causes an out-of-bounds read of the hash header. Reject the object with ENOEXEC when the header does not fit in the image. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D61323
debug: classified in
04-filenames_plain2 by 'sys/'
A section name offset (sh_name) indexes the section name string table without being checked against shstrcnt, and the result is passed to strcmp(), so a corrupt object causes an out-of-bounds read. Check that the table is NUL-terminated and that every sh_name lies within it, in both the preload and file paths, and reject the object with ENOEXEC. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D61338
debug: classified in
04-filenames_plain2 by 'sys/'
namei() might restart for altroot or for ERESTART from nameicap_tracker_add(). vfs_lookup() consumes the reference on ni_startdir and clears it, so a restarted NDINIT_ATVP() lookup started from the current directory instead of the vnode passed by the caller. Save the starting vnode in a local variable, hold it while the lookup can be restarted, and reference it before the restarted pass. Do not assert NAMEI_DBG_HADSTARTDIR on the internal restart. Noted and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61315
debug: classified in
04-filenames_plain2 by 'sys/'
NDINIT_ATVP() initializes dirfd to AT_FDCWD, which is denied for a process already in cap mode. Since NDINIT_ATVP() is a special lookup operation performed by the kernel, it should be allowed to proceed for the paths beneath vp. Fabricate a pseudo dirfd value that is an unused placeholder, which fails the AT_FDCWD comparison and allows the lookup to proceed in cap mode. Note that failed cap-mode NDINIT_ATVP lookup returned ECAPMODE without releasing the caller reference on ni_startdir, which is fixed by this change. Reported by: ivy Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61315
debug: classified in
04-filenames_plain2 by 'sys/'
Only allow clocks that make sense for the umtx_sleep(). While there, do not ignore errors from kern_clock_gettime(). The invalid clock ids are filtered, but if the clock can't be read (CLOCK_TAI before the TAI-UTC offset is known), the functions operate on uninitialized memory. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253
debug: classified in
04-filenames_plain2 by 'sys/'
For msleep(), zero sbt means no timeout. If the timeout was specified as
absolute {0, 0} on MONOTONIC/UPTIME clocks, consider the call timed out
immediately, instead of sleeping until a signal is delivered.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D61253
debug: classified in
04-filenames_plain2 by 'sys/'
Sponsored by: DARPA, AFRL, Innovate UK Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D61342
debug: classified in
04-filenames_plain2 by 'sys/'
debug: classified in
04-filenames_plain2 by 'sys/'
In the case of modstat(2) use a cast to access the name member of the old struct version so the compiler see the right array size. This addresses a sub-object bounds bug. Effort: CHERI upstreaming Sponsored by: DARPA, AFRL, Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
The containers (arrays) will not be modified during runtime. Reviewed by: kib, imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D61297
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
The flags argument will be used by compat impelementations. Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Expose user_clock_nanosleep globally. Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
namei() leaks the caller's ni_startdir reference on the empty-path ENOENT return and on namei_getpath() failure. On ZFS with the default zfs_xattr_compat=1, an empty user-namespace extattr name on a file that has an xattr directory leaks one reference on that directory per call. Reported by: llm-postcr Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61366
debug: classified in
04-filenames_plain2 by 'sys/'
vn_open_cred() returns EINVAL before calling namei() for O_CREAT|O_EXCL|O_DIRECTORY and for O_CREAT|O_EMPTY_PATH. That leaks an NDINIT_ATVP() start directory. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61366
debug: classified in
04-filenames_plain2 by 'sys/'
Reviewed by: bcr, jhb, olce Approved by: jhb, olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D60002
debug: classified in
04-filenames_plain2 by 'sys/'
Reviewed by: bcr, jhb, olce Approved by: jhb, olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D60002
debug: classified in
04-filenames_plain2 by 'sys/'
modstat: avoid copying from freed memory If a module is unloaded after the module is looked up in kern_modstat, but before one of the copyout's occurs, then the memory being copied might be freed and reused leading to an information disclosure. The LLM was particularly concerned about a TOCTOU issue in the length of the name, but it seems likely that there are issues with all the copyout's. As such, hold the shared lock throughout. Reviewed by: markj Reported by: llm-postcr MFC after: 3 days Sponsored by: Innovate UK Fixes: https://cgit.freebsd.org/src/commit/?id=9b3851e9e3b1 ("- Lock down the ``module'' structure...") Differential Revision: https://reviews.freebsd.org/D61398
debug: classified in
04-filenames_plain2 by 'sys/'
modstat: don't copyout while holding a lock If a user arranges for a page fault to never be filled (e.g., via a FUSE file system), this can hold the shared lock forever. To make this all work, refactor kern_modstat and freebsd32_modstat to malloc a temporary buffer and fill it before copying it out rather than doing a bunch of copies. Add COMPAT_* ifdefs around compat code. The module_stat_v1 code is really for a.out binaries in practice and thus a bit questionable. Reviewed by: markj Reported by: llm-postcr Sponsored by: Innovate UK Fixes: https://cgit.freebsd.org/src/commit/?id=7f8c2056db1e ("modstat: avoid copying from freed memory") Differential Revision: https://reviews.freebsd.org/D61432
debug: classified in
04-filenames_plain2 by 'sys/'
modstat: allow compat support to fail in tests v1 and v2 versions of stuct module_stat are now gated by COMPAT_ ifdefs so allow the otherwise valid query to fail with EINVAL. Effort: CHERI upstreaming Reviewed by: markj Reported by: llm-postcr Sponsored by: Innovate UK Fixes: https://cgit.freebsd.org/src/commit/?id=1ebf46ecb627 ("modstat: don't copyout while holding a lock") Differential Revision: https://reviews.freebsd.org/D61460
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
modstat: check errno before calling feature_present feature_present will overwrite errno if COMPAT_FREEBSD13 is not present. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=ef726c645300 ("modstat: allow compat support to fail in tests")
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
debug: moved to kernel because
'Need to be grouped with
ef726c645300870b6bdf3573079b1f89f3b45c74'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate, UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Rename accept1 and sendit to user_accept and user_sendit. Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
In the CAMIOQUEUE ioctl, a queued CCB completes through passdone(), which moves it to the done queue and calls selwakeuppri() and KNOTE_LOCKED() so that a consumer blocked in select(2), poll(2) or kevent(2) wakes up and collects the CCB with CAMIOGET. An immediate CCB (e.g. XPT_DEV_ADVINFO or XPT_DEV_MATCH) is instead executed synchronously in the ioctl and moved to the done queue directly, with no notification, so a consumer sleeping while waiting for its completion never wakes up until some other queued I/O completes. Send the same notification that passdone() sends. The peripheral lock is held at this point and backs the knlist, so KNOTE_LOCKED() is the correct variant. A version of this fix has been in production use at Spectra Logic since 2024. Co-authored-by: Dave Baukus <daveb@spectralogic.com> Reviewed by: imp MFC after: 1 week Sponsored by: Spectra Logic Assisted-by: Claude Fable 5 <noreply@anthropic.com> Differential Revision: https://reviews.freebsd.org/D61416
debug: classified in
04-filenames_plain2 by 'sys/'
passpoll() checked the done queue while holding the peripheral lock, dropped the lock, and only then called selrecord(). A CCB completing in the window between the unlock and the selrecord() call sent its selwakeuppri() before the polling thread was on the selinfo list, so the wakeup was lost and select(2) or poll(2) slept until another completion arrived or the timeout expired. Call selrecord() before dropping the lock. This lock order is already established: passdone() calls selwakeuppri(), which takes the selinfo lock, while holding the peripheral lock. kqueue is not affected, since the knlist is backed by the peripheral mutex. Reported by: llm-postcr Fixes: https://cgit.freebsd.org/src/commit/?id=a9934668aa13 MFC after: 1 week Sponsored by: Spectra Logic Assisted-by: Claude Fable 5 <noreply@anthropic.com>
debug: classified in
04-filenames_plain2 by 'sys/'
In the original adaptation of connect/connectat to use user_connectat in CheriBSD, I failed to pass the fd through in the connectat case and always passed AT_FDCWD. This did trigger failures in the unix_connectat test which I somehow missed in prior test runs. Reported by: llm-postcr
debug: classified in
04-filenames_plain2 by 'sys/'
The sched_* syscalls can operate either on the calling process (by setting pid = 0) or by specifying a pid. They are allowed in capability mode, but previously were not scoped to only operating on the calling process. Reviewed by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57346
debug: classified in
04-filenames_plain2 by 'sys/'
Leaking this pointer isn't harmful, but other places take care to clear it, so handle this in SEM_STAT too. Reviewed by: imp, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D61396
debug: classified in
04-filenames_plain2 by 'sys/'
The SysV message queue code has the same problem that we fixed in the semaphore code in SA-26:54.sysvsem and SA-26:64.sysvsem. That is, kern_msgrcv() and kern_msgsnd() are susceptible to TOCTOU races when they sleep waiting for messages and queue space, respectively. Unlike the semaphore code, however, the message queue array is never resized and there is no notion of message queue sets, so such races do not open up any memory safety bugs. Fix the races, following the pattern from the SysV semaphore changes: use a global sequence number array with wide counters, to avoid changing the KBI which is embedded in userspace tools. Fix kern_msgsnd(), which did not validate the sequence number at all after sleeping. Use a msgvalid() helper to factor out some duplicated checks. Convert a couple of local flag variables to bools. Reported by: Apex Security Research Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D61397
debug: classified in
04-filenames_plain2 by 'sys/'
link_elf: bounds-check the dynamic section's tables parse_dynamic() only checks the DT_HASH header. nbuckets, nchains and the other DT_* tables come from the module unchecked. Check them against the mapping, and reject a size without its table. Reported by: llm-postcr MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D61387
debug: classified in
04-filenames_plain2 by 'sys/'
link_elf: validate symbol name offsets st_name isn't checked against the string table size, for any of the symbol tables used here. Do what link_elf_obj.c does since 4e2c2842e. Reported by: llm-postcr MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D61388
debug: classified in
04-filenames_plain2 by 'sys/'
link_elf: validate the section headers in link_elf_load_file() e_shentsize isn't checked, and e_shstrndx, sh_link and sh_name are used unchecked. Do what link_elf_obj.c does. MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D61389
debug: classified in
04-filenames_plain2 by 'sys/'
This corrects a accidentialy introduced definition of kern___getcwd. Effort: CHERI upstreaming Fixes: https://cgit.freebsd.org/src/commit/?id=d718de812fe1 ("Introduce kern_mmap_req().") Sponsored by: DARPA, AFRL, Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI UK Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
vfs_syscalls.c: add kern_ and user_ implementations Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
kern_undelete: remove unused pathseg argument I'd failed to pass it down to NDINIT, but nothing calls kern_uninit with a path argument in sys space here or in CheriBSD so just drop it. Effort: CHERI upstreaming Reported by: llm-postcr Sponsored by: Innovate UK Fixes: https://cgit.freebsd.org/src/commit/?id=7273d80ba18c ("vfs_syscalls.c: add kern_ and user_ implementations")
debug: classified in
04-filenames_plain2 by 'sys/'
kern_revoke: remove always UIO_USERSPACE pathseg argument In FreeBSD and CheriBSD pathseg was always UIO_USERSPACE and when I extracted the patch for FreeBSD, I failed to propogate it to NAMEI. Since it's always the same, remove it as needless generality. Reported by: netchild Sponsored by: Innovate UK Fixes: https://cgit.freebsd.org/src/commit/?id=7273d80ba18c ("vfs_syscalls.c: add kern_ and user_ implementations")
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Sponsored by: Rubicon Communications, LLC ("Netgate")
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
This is the opposite of most kern_ cases, but SysV IP is designed to be loaded as a module and freebsd32 support lives inside the main implementation file. Arguably it should be in a seperate module with a dependency, but that's a refactor for another day. Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: DARPA, AFRL Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: DARPA, AFRL Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: DARPA, AFRL Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
debug: classified in
04-filenames_plain2 by 'sys/'
These syscalls are allowed in capability mode but accept an arbitrary pid or lwpid. Restrict them to the calling process in capability mode. In capability mode rtprio_thread(2) only looks up threads of the calling process, and returns ECAPMODE for any other lwpid, including one that does not exist. Sponsored by: Advanced Micro Devices, Inc. Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com> Reviewed by: olce
debug: classified in
04-filenames_plain2 by 'sys/'
Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57385
debug: classified in
04-filenames_plain2 by 'sys/'
Sponsored by: Chelsio Communications
debug: classified in
04-filenames_plain2 by 'sys/'
Sweep through consumers and use the define. Reviewed by: kfv, imp Differential Revision: https://reviews.freebsd.org/D61344
debug: Commit manually moved from "unknown" to "kernel".
Use UMA allocation size that holds the buffer. The buffer is actually slightly smaller. Document the latter so that clients don't need to use +1 if they later want to NUL-terminate a message. Reviewed by: mjg, imp Differential Revision: https://reviews.freebsd.org/D61346
debug: Commit manually moved from "unknown" to "kernel".
Apply a layered defence: - Reject nbytes > IOSIZE_MAX in user_extattr_list_fd and user_extattr_list_path. - In extattr_list_vp require auiop->uio_resid to be non-negative. Effort: CHERI upstreaming Reviewed by: markj Reported by: llm-postcr MFC after: 3 days Sponsored by: Innovate UK Fixes: https://cgit.freebsd.org/src/commit/?id=6453d4240f6b ("vfs: Export exattr methods to reuse by Linuxulator") Differential Revision: https://reviews.freebsd.org/D61461
debug: classified in
04-filenames_plain2 by 'sys/'
After looking up the device path, we compare the vnode to the vnode of each swap device. Prior to this change we leaked a vnode reference to the device we're trying to remove from the swap pool. Effort: CHERI upstreaming Reviewed by: kib, markj Reported by: llm-postcr MFC after: 3 days Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D61464
debug: classified in
04-filenames_plain2 by 'sys/'
Effort: CHERI upstreaming Sponsored by: DARPA, AFRL, Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284
debug: classified in
04-filenames_plain2 by 'sys/'
A new thread starts in fork_exit(), not mi_switch(), so its PMCs are not loaded until its next context switch. Call the switch-in hook there. Reviewed by: kib, Osvaldo Janeri Filho <ojanerif@amd.com>, mhorne MFC after: 1 week Sponsored by: Advanced Micro Devices, Inc. Differential Revision: https://reviews.freebsd.org/D60565
debug: classified in
04-filenames_plain2 by 'sys/'
clock_gettime is permitted in capability mode, and it calls get_cputime if clock_id is negative. get_cputime did not check the target pid in capability mode. Reported by: llm-postcr Reviewed by: markj, Osvaldo Janeri Filho <ojanerif@amd.com> Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D61469
debug: classified in
04-filenames_plain2 by 'sys/'
By default, if the caller has not used one of the _on() or _cpucpu()
variants of the callout API, the system assigns the callout to CPU0.
Having most callouts running on CPU0 can be problematic in terms of
the amount of CPU time spent executing callouts can have an unfair
impact to CPU0, and a critical callout (like lacp_tick) is certain
to land on the same CPU as everything else, so it is more likely
to be delayed.
This change introduces a change to callout_init* where if
kern.callout_spread is non-zero, callouts initialized after SMP startup
are distributed among CPUs.
This is left as disabled by default, as it may reveal any latent
synchronization bugs that were previously hidden, e.g., two callout handlers
which were always accidentally serialized against each other before may now
run concurrently. It also may cause a slight increase in power consumption
for mobile users.
Reviewed by: markj, (+ mjg who reviewed the first version and suggested
the simpler mechanism used in this commit)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D61361
debug: classified in
04-filenames_plain2 by 'sys/'
Otherwise the freebsd32 implementation of PROC_REAP_STATUS leaks uninitialized kernel stack memory. Reviewed by: kib Reported by: Dennys Kaluzny Pereira <dennyskaluzny@gmail.com> MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D61510
debug: classified in
04-filenames_plain2 by 'sys/'
-mindirect-branch-cs-prefix adds a CS segment-override prefix (0x2e) to each call or jmp to a retpoline thunk. The CPU ignores the prefix, but it extends the instruction to six bytes instead of five. This leaves enough room for a future kernel change to patch all of the call sites at boot time to disable retpoline if not required. Support for this option arrived in GCC 12 and Clang/LLVM 16. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D61514
debug: classified in
04-filenames_plain2 by 'sys/'
Pass fflag down to g_ctl_req() and: * Refuse all requests unless fflag has the FREAD bit set * Refuse all but getxml unless fflag also has the FWRITE bit set This should allow us to restore read access to /dev/geom.ctl for group operator; they will then be able to run `gpart list` or `gpart backup` but not commands that actually modify the table. For backward compatibility, we set the FWRITE bit if it is not already set and the calling thread has the PRIV_GEOM privilege, which is automatically granted to a jailed or unjailed superuser. This should cover the case of older binaries (which open /dev/geom.ctl read-only) running as root on a newer kernel. Since we intend to merge this to stable/15, the compatibility code is conditional on COMPAT_FREEBSD14. MFC after: 1 week Event: EuroBSDCon 2026 DevSummit Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D59591
debug: classified in
04-filenames_plain2 by 'sys/'
sched_ule: Document fields of 'struct runq_steal_pred_data' While here, re-order them to have inputs before outputs. No functional change. MFC after: 3 days Sponsored by: The FreeBSD Foundation
debug: classified in
04-filenames_plain2 by 'sys/'
sched_ule: tdq_add(): INVARIANTS: Add check, fix name in assertion strings Change the assertion on the to-add thread's lock so that it also fails if the thread's lock is not that of the 'tdq' (the checks that it is lock-unblocked and locked remain). It is tempting to add another check that the thread's 'ts_cpu' corresponds to the passed runqueue (in other words, that it has been set correctly), but that requires to add a call to thread_lock_block_wait() which should not be present in non-debug code, and that may prevent some races from happening on INVARIANTS, so I gave up on it. Fix the function name in assertion strings, as sched_add() is not the only (direct or indirect) caller of tdq_add(). MFC after: 3 days Sponsored by: The FreeBSD Foundation
debug: classified in
04-filenames_plain2 by 'sys/'
sched_ule: sched_rem(): Use THREAD_LOCKPTR_ASSERT() instead of MPASS() This gives a better message. While here, add some empty lines to make INVARIANTS-only statements stand out for better readability. No functional change. MFC after: 3 days Sponsored by: The FreeBSD Foundation
debug: classified in
04-filenames_plain2 by 'sys/'
Also matches the implementation order in 'kern_mutex.c'. No functional change. MFC after: 3 days Sponsored by: The FreeBSD Foundation
debug: classified in
04-filenames_plain2 by 'sys/'
That the lock of the stolen thread is the same as the source runqueue is already checked by sched_rem(). MFC after: 3 days Sponsored by: The FreeBSD Foundation
debug: classified in
04-filenames_plain2 by 'sys/'
Thread stealing ultimately happens in tdq_move() which, while holding
the locks of the source and destination runqueues, has to wait for the
stolen thread to be lock-unblocked. If it is indeed lock-blocked, the
corresponding sched_switch_migrate() needs to re-acquire the lock of the
runqueue of the CPU it is running on before being able to lock-unblock
it. This amounts to adding a "hidden" and variable additional
lock-ordering dependency between the 'struct tdq' locks held by
tdq_move() and that of an arbitray third 'struct tdq', possibly
violating the ordering established by tdq_lock_pair(). In that case,
other steals occurring in parallel and involving the same queues can
deadlock the scheduler.
Fix that by having sched_switch_migrate() hold its current CPU's
runqueue's lock in addition to the remote CPU's before the migrated
thread can appear on the remote runqueue, so that it does not have to
re-acquire the former, removing the "hidden" lock-ordering dependency.
Thanks to avg@ who reported such a currently extremely rare
(explanations below) deadlock occurrence and analyzed it pretty
thoroughly from the crash dump, as well as doing some code archeology
(see the thread "ULE: run queue lock deadlock in sched_switch_migrate()
+ tdq_move()" in the FreeBSD-current mailing list). For another,
similar occurrence described in concise steps, please see commit
435068aab79b ("Fix sched_switch_migrate(): (...)").
Below is a thorough explanation of the deadlocks that could occur, an
history of such deadlocks, a description and explanation of avg@'s
occurrence, details on the fix's implementation and why that fix was
chosen.
******
Threads are ultimately stolen via tdq_move(), which finds the highest
priority thread that can be migrated to the destination CPU. tdq_move()
waits for the stolen thread to become lock-unblocked before assigning it
to the destination CPU's runqueue, because that action requires changing
the thread's lock to the destination runqueue's lock (the blocked lock
is a temporary placeholder for later replacement by the source CPU's
runqueue's lock). It does so with both the source and destination CPUs'
runqueues locked.
Consider the situation where a CPU steals a thread that is indeed
lock-blocked. This implies that some sched_switch() is executing on
another CPU, evicting the stolen thread (as a thread lock-blocked by
sched_add()/sched_pickcpu() or sched_throw() cannot be seen on
a runqueue). That CPU must be at a point where the stolen thread's
runqueue just before the concurrent steal (=source runqueue) was
unlocked, and there are two distinct such cases. The first is that the
evicted thread gets added to sched_switch()'s current runqueue/CPU, and
we are past sched_switch()'s tdq_unlock(), but before cpu_switch() which
lock-unblocks the thread. In that case, the cpu_switch() thread does
not block and eventually will execute cpu_switch(). The second case is
that the evicted thread gets migrated to a remote CPU which is
necessarily tdq_move()'s source CPU of the steal with our assumptions.
We are then in sched_switch_migrate() after the thread got added to the
remote CPU's runqueue, the remote CPU possibly signaled (according to
priorities) and after its runqueue was unlocked. We may however be
before re-locking the current CPU's runqueue. Then, sched_switch()
depends on that re-locking to happen to finally lock-unblock the thread.
As we have seen above, tdq_move() itself depends on observing the
lock-unblock before it will release the source and destination
runqueues.
The problem is that there exists cases where sched_switch()'s re-locking
of the current runqueue depends on the steal releasing its runqueues,
creating a deadlock. For example, the steal could happen between the
same CPUs involved in sched_switch() with source and destination
inverted, if sched_switch() migrates the thread prompted by the
long-term load-balancer but the load imbalance suddenly changes and the
latter makes the reverse decision. In the current long-term
load-balancer, this precise case cannot arise, but it could some years
ago (see below).
The practical case reported by avg@, which prompted this analysis and
commit, is more involved. There, sched_switch() initiates a migration
as requested by the long-term load-balancer (TDF_PICKCPU is set on the
thread and it is pre-empted, leading to sched_switch() being called).
In parallel, some idle CPU wants to steal a thread from sched_switch()'s
remote CPU, and we end up with a situation as described in the previous
paragraphs. Finally, the long-term load balancer locks the
sched_switch()'s current CPU's runqueue (before sched_switch() can grab
it again), wanting to migrate a thread from there to the steal's
destination CPU (which was idle) (that runqueue is locked first because
the corresponding CPU's 'struct tdq''s address happens to be smaller
numerically, see tdq_lock_pair()). That establishes a dependency from
locking the steal's destination CPU to releasing the sched_switch()'s
current CPU, closing a loop in the dependency graph, i.e., a deadlock.
As avg@ points out, the same kind of deadlocks had been reported and
fixed in 2009, as indicated by commit 435068aab79b ("Fix
sched_switch_migrate(): (...)"), but the deadlock was re-introduced by
commit 686bcb5c14ab ("schedlock 4/4") in 2019. However, it appeared to
be much more frequent back then. That is most probably because the
long-term load balancer was more aggressive, allowing thread ping-pong,
whereas it now will only try to steal once from a given CPU per run,
giving ample time between two runs for a migrated thread to become
lock-unblocked before the next migration. avg@ experienced the problem
on a VM with 24 vCPUs "only once in many years on a fleet of thousands
of systems", and we are not aware of any other report of such
a deadlock, including on physical machines. It probably occurred there
because of an overloaded machine/hypervisor that for some reason would
not execute some vCPU for an unusually long period of time at a bad
moment.
The fix is similar in spirit to what was done in commit 435068aab79b
("Fix sched_switch_migrate(): (...)"). It consists in
sched_switch_migrate() locking both the current and remote runqueues
before migrating the thread. That way, sched_switch() never needs to
reacquire any locks in order to finally unblock the migrated thread, so
the migrated thread is eventually unlocked, as well as the runqueues
lock by tdq_move().
Contrary to the situation of 2009's fix, however, sched_switch_migrate()
is now called with the current runqueue locked. So we augment
tdq_lock_pair() with a boolean to indicate that the first queue is
already locked, and optimize it for that property: It will directly lock
the second lock if that follows the (arbitrarily) established lock
order, else it first tries to lock the second one opportunistically, and
if that fails, unlocks the first before locking both in order (second
then first).
Our initial solution consisted in simply not considering a thread that
is still lock-blocked when stealing, so that tdq_move() does not have to
wait for it to become unblocked, which removes the lock dependency
mentioned in the first paragraph. It is marginally more efficient in
the sense that it does not need to lock both runqueues in
sched_switch_migrate(), which sometimes requires dropping the current
runqueue's lock and then re-acquiring it, and allows to steal another
thread more quickly (no need to wait for the stolen one to unblock), but
it risked proving noticeably pessimistic in the case of a single thread
to steal that is lock-blocked (a context switch has just occurred, and
another thread is now run), as tdq_idled() and tdq_trysteal() are not
prepare to handle this case, causing a missed steal opportunity and
leaving two threads sharing the sched_switch()'s core even if other
cores are free, until the next time the load balancer kicks in.
Ideally, stealing should not require to lock two runqueues at the same
time for increased steal parallelism, but such a change is much more
involved so will be considered at a later time.
Reported by: avg
Reviewed by: mchoo, avg (before last tdq_lock_pair() optimization)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61448
debug: classified in
04-filenames_plain2 by 'sys/'
kern_swapon looks up the proposed swap path and aquires a vnode which is held (unlocked) throughout the life of the swap device. In the device case (swapgeom) it was never released in the swapoff path. Remove an incorrect comment about swapgeom_close being called from biodone. It is only called directly via swapoff(2) or at the end of the shutdown path. Reviewed by: kib, markj Reported by: llm-postcr MFC after: 3 days Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D61465
debug: classified in
04-filenames_plain2 by 'sys/'
Since ASLR got enabled for ELFv2, the random bases for the heap, the dynamic linker and PIE binaries can land anywhere in the 52-bit address space radix gives us. A lot of userland doesn't like that: SpiderMonkey, JavaScriptCore, QV4 and friends pack pointers into 47 or 48 bits and crash on startup (gjs, cjs, qml, ...). Do what amd64 does on LA57 hardware: keep the full range in the kernel and give processes a smaller map by default through a second set of sysvecs. The default is 48 bits (256 TiB), the same as arm64. One caveat for 48 bits: SpiderMonkey's GC allocator has no fallback there and relies on mmap(2) hints staying 1 MiB-aligned, which ASLR on FreeBSD breaks (hinted mappings move in 4 KiB steps, 64 KiB on arm64). The versions in ports need Mozilla's bug 1876632 (MAP_ALIGNED on FreeBSD, in Firefox 143) to be reliable; with it gjs runs clean. The full 52 bits stay available per process through the la52 feature control note (elfctl(1)) and PROC_LA_CTL (proccontrol(1)), and vm.pmap.prefer_uva_la48 flips the default. la52 is the powerpc64 name for the note bit amd64 calls la57, the procctl(2) values are the same. Fixes: https://cgit.freebsd.org/src/commit/?id=30ed27ff2556 ("sys/powerpc/powerpc/elf64_machdep.c: enable ASLR on ELFv2") Reviewed by: kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D61331
debug: classified in
04-filenames_plain2 by 'sys/'
In mac_get_prison(), mac.m_string points to a user address; the string is copied in by mac_label_copyin_string(). If an error occurs before that copyin, we end up freeing a user-controlled pointer. In mac_set_prison_prepare(), the string is leaked. Fix both problems. While here, make free_copied_label() a bit more robust to bugs in callers. Fixes: https://cgit.freebsd.org/src/commit/?id=bd55cbb50c58 ("kern: add a mac.label jail parameter") Reviewed by: olce, kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D61596
debug: classified in
04-filenames_plain2 by 'sys/'
linux_clone_thread() and kthread_add() did not call the PMC_FN_THR_CREATE hook. Their new threads had no hwpmc thread descriptor. If the process had a sampling PMC, the first switch-in of such a thread hit KASSERT(pt != NULL) in pmc_process_csw_in(). An unprivileged user could panic an INVARIANTS kernel with "pmcstat -P" on a threaded Linux program. Call the hook in both functions, as thread_create() does. kern_kthread.c did not include opt_hwpmc_hooks.h, so its hwpmc code never compiled. Include it, and use newtd in kthread_add1(). Remove the exit log call from kthread_exit(), because thread_exit() already logs the exit. Reported by: llm-postcr Reviewed by: kib, mhorne Fixes: https://cgit.freebsd.org/src/commit/?id=6161b98c9935 ("hwpmc: Implement per-thread counters for PMC sampling") Differential Revision: https://reviews.freebsd.org/D61524
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'
The '$' characters inside awk commands need to be $$ when appearing inside a Makefile. Without this, we generate empty src and src-sys packages. Reported by: Stefan Grundmann Fixes: https://cgit.freebsd.org/src/commit/?id=a8be89928930 ("build: Support got") MFC after: 1 day
debug: classified in
02-filenames_wildcards by
'.*Makefile'
Before this change, directories needed when MK_DTRACE_TESTS != no and MK_ZFS_TESTS != no but not MK_TESTS != no, were being created via `BSD.tests.dist` as part of the standard build/install process with the top-level `hierarchy` target. This behavior resulted in `make check-old` flagging a lot of issues after 30c20ca26e105c, even after `make delete-old` was run and the directories were removed. Remove the logic which pruned these empty directories; this "fixes" the issue with `make check-old`, et al and allows a proper technical solution to `OptionalObsoleteFiles.inc` to be implemented by pkgbase in an unimpeded manner without introducing additional complexity. See the review for more details. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299650 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D60928
debug: classified in
03-filenames_plain1 by
'tools/build/'
Removed ABS_SET, BSS_SET, and SET_ENTRY. They were initially introduced in v1.1 to be used with a.out file. After the migration to ELFs they are equivalent to TEXT_SET and DATA_SET. Furthermore, these macros are never used in the src tree. Event: Oslo Hackathon 2026 Reviewed by: des, jhb Differential Revision: https://reviews.freebsd.org/D61035
debug: Commit manually moved from "unknown" to "build".
Two engine Makefiles define different macros from upstream's engines/build.info: - padlock: engines/e_padlock.c builds the engine only when PADLOCK_ASM is defined. Upstream defines it on x86 and x86_64, but our Makefile never did, so padlock.so has been a stub whose bind_engine() returns 0 and the e_padlock-x86*.S code it links was never called. Define PADLOCK_ASM on amd64 and i386, where that asm is built. - loader_attic: upstream defines OPENSSL_NO_PROVIDER_CODE; the Makefile had OPENSSL_NO_PROVIDER_CORE. No source tests either name, so the build does not change; this only follows upstream. Found by comparing per-file compile flags against an upstream 3.5.9 build. Checked by preprocessing e_padlock.c for amd64 and i386: COMPILE_PADLOCKENG is now defined. Reviewed by: ngie MFC after: 1 week MFC to: stable/15 Event: FreeBSD Vendor Summit 2026 Differential Revision: https://reviews.freebsd.org/D61271
debug: classified in
02-filenames_wildcards by
'.*Makefile'
Obtained from: CheriBSD Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D60723
debug: classified in
02-filenames_wildcards by
'.*Makefile'
This has the curious effect of placing libsys before libc in the link order even though libc links against libsys. While this happens to work currently, it is fragile and fails to link properly in some edge cases. Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D60724
debug: classified in
02-filenames_wildcards by
'.*Makefile'
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253
debug: classified in
02-filenames_wildcards by
'.*Makefile'
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253
debug: classified in
02-filenames_wildcards by
'.*Makefile'
Reviewed by: bcr, jhb, olce Approved by: jhb, olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D60002
debug: classified in
02-filenames_wildcards by
'.*Makefile'
auditdistd, bhyve: drop OPENSSL_API_COMPAT Neither uses any OpenSSL function deprecated in 3.0 or later. Both build with no deprecation warnings against OpenSSL 3.5 and 4.1 without it.
debug: classified in
02-filenames_wildcards by
'.*Makefile'
bhyve: Restore OPENSSL_API_COMPAT It's still needed by the VNC code for now. Fixes: https://cgit.freebsd.org/src/commit/?id=12a57b078972 ("auditdistd, bhyve: drop OPENSSL_API_COMPAT")
debug: classified in
02-filenames_wildcards by
'.*Makefile'
Reviewed by: ivy, bdrewery, lwhsu Differential Revision: https://reviews.freebsd.org/D60440
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/'
debug: classified in
03-filenames_plain1 by
'share/misc/bsd-family-tree'
version 4 raises warnings when run as the runners force it to use Node 24 instead of Node 20. version 5 defaults to Node 24, but version 7 is the current version. Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/2477
debug: classified in
03-filenames_plain1 by
'.github/'
The project under the .../ghpr subdirectory is an earlier version of the tool. A newer/supported iteration of the tool can be found on [GitHub][ghpr-repo]. `ghpr` can be installed via `pkg`, e.g., `pkg install py312-ghpr-5`. Please see the [README.md][readme] for further details. MFC after: 1 month [ghpr-repo]: https://github.com/bsdimp/ghpr/ [readme]: https://github.com/bsdimp/ghpr/blob/main/README.md Reviewed by: dteske Differential Revision: https://reviews.freebsd.org/D61086
debug: classified in
03-filenames_plain1 by
'tools/tools/git/'
This too has been superseded by `git-arc`, located in the same directory as `arcgit`. Differential Revision: https://reviews.freebsd.org/D61379
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\/.*'
The SPDX ID makes the script's licensing more explicit. MFC after: 1 week Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D60908
debug: classified in
02b-filenames_wildcards2 by
'usr.bin/.*/tests/.*'
Add a test case that creates and starts two nodes, has one assume the primary role and the other the secondary role, writes to the device, verifies that the data is synced to both nodes, then switches the roles, and finally shuts both nodes down and compares their backing stores. Differential Revision: https://reviews.freebsd.org/D59676
debug: classified in
02b-filenames_wildcards2 by
'sbin/.*/tests/.*'
pimd 3.0.0 and later refuse an RP in 127.0.0.0/8. Reported by: markj Approved by: markj Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/92
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
Sometimes ICMP echo packets get lost, so send more than one during the sanity check. This should resolve the intermittent failure of the return.py:TestReturn::test_tcp test. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300511 Sponsored by: Rubicon Communications, LLC ("Netgate")
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
capsicum-test: make the code WARNS=6 clean Make the code WARNS=6 clean by doing the following: - Renaming variables (-Wshadow). - Use memcpy instead of assigning the result of CMSG_DATA to a variable (-Wcast-align). - Wrap some macros with do-while(0) to avoid variable collisions (-Wshadow). - Push one of the TRACE statements up by 1 layer to avoid a collision between 2 calls of TRACE via the same overarching macro. This was needed in order for the code to build properly with D61066, since the code was not compiling with WARNS set to 3 at the testcase level. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D61080
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
capsicum-test: Disable `HAVE_SEND_RECV_MMSG` again 04c4b2084eb9 accidentally added some changes from another WIP commit into that diff. Instead of wholesale reverting the change, just revert the part that's currently broken (`HAVE_SEND_RECV_MMSG`). While some of the related tests pass, one of the testcases (`capmode.cc:AllowedMmsgSendRecv`) doesn't currently pass. Revert the change to make the CI run more green again. MFC after: 1 week Fixes: https://cgit.freebsd.org/src/commit/?id=04c4b2084eb9 ("capsicum-test: make the code WARNS=6 clean")
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
tests/sys/capsicum: Fix -Wshadow issue with `fd_set` `fd_set` is defined in `sys/select.h`, and prior to this change, was in fcntl.cc as well. This change renames `fd_set` to `fd_set_` to avoid the name collision. MFC after: 1 week Reported by: gcc 14 Fixes: https://cgit.freebsd.org/src/commit/?id=04c4b2084eb9 ("capsicum-test: make the code WARNS=6 clean")
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
This change builds capsicum_test and installs/runs it as an unprivileged
user ("tests" in vanilla FreeBSD) and root.
This required adjusting logic in the Makefile in order to build two
binaries with the same sources and running them as separate binaries.
Moreover, in order to restore coverage and ensure that some tests which
require `other_uid` (typically specified via `-u` on the CLI with the
test program) don't fail, become the "tests" user when run as root. This
technically doesn't honor unprivileged_user property in kyua.conf: the
property needs to be passed via a command-line parameter to the test
program.
MFC after: 1 week
Reported by: markj
Fixes: https://cgit.freebsd.org/src/commit/?id=3fb03fb35b20 ("[tests] switch GoogleTest tests ...")
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D61066
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
This testcase has been failing reliably for 5+ months now. Mark it as an expected failure to make the standard Jenkins run a bit more green. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289240 MFC after: 1 week
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
This testcase has been failing reliably in CI since it was introduced in 2e16d37e275f. Mark the testcase XFAIL when run via CI to make the overall test run a bit more green. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300696 MFC after: 1 week
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
The `:witness` "test" has been failing reliably in CI for over 2 months now. Mark the test XFAIL so the overall CI run is more green. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300697 MFC after: 1 week
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
These tests pass for more than 200+ runs consecutively. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292993 MFC after: 3 days Sponsored by: The FreeBSD Foundation
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
These tests pass after 23b326728778. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297426 Reviewed by: dteske MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D61434
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
tests/sys/kern/ssl_sendfile: :eagain_vs_eof: improve failure messaging Convert many raw `ATF_REQUIRE(..)` macro calls to `ATF_REQUIRE_MSG(..)` and output the sbytes attached to the context in provide meaningful information with failure messages. While here, fix a typo in a comment and some indentation in another testcase (:random). PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299447 MFC after: 1 week
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
Correct some nits in the prior commit (de6328af0c8c) - Remove unnecessary casts. - Use the right printf qualifier (%z is for *`size_t`; %j is for *`maxint_t`). I was mixing up `off_t` in my head. MFC after: 1 week Noted by: des (IRC) Fixes: https://cgit.freebsd.org/src/commit/?id=de6328af0c8c ("tests/sys/kern/ssl_sendfile: :eagain_vs_eof: ...")
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
tests: Add test for vn_io_fault1 bug This bug was fixed in b487aca48535, but I did not have a regression test ready for it at the time. The test allocates a large buffer, faults part of it in and leaves the rest unmapped, then tries to read a 3 GiB file into it. If the bug is present, the read succeeds, but the return value exceeds the requested amount by exactly one page less than the amount that was prefaulted. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298159 MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D61475
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
tests: Improve vn_io_fault1 test * Declare that the test needs 4 GB of memory so it can be automatically skipped on systems with low memory. * Switch back to mmap() as in my initial prototype. Using malloc() is simpler, but on systems with malloc debugging enabled, malloc() will prefault the entire buffer, resulting in a false positive. Using mmap() also guarantees that the buffer is page-aligned, which renders the test determinstic: we now only need to prefault exactly 2 GB, and the difference between ret and len will be exactly the amount that we prefaulted. * To prefault the buffer, instead of a simple loop that writes zeroes to it, which a compiler might recognize as dead stores and eliminate, read the first INT_MAX bytes from the file into it. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298159 Fixes: https://cgit.freebsd.org/src/commit/?id=ba02bbbe86ae ("tests: Add test for vn_io_fault1 bug") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D61508
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
The :grow and :truncate testcases fail semi-regularly in CI with timeouts. Double the timeout to reduce false positives with the tests. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300699 MFC after: 1 week Reviewed by: siva Differential Revision: https://reviews.freebsd.org/D61444
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
Commit 70d08c69f4d0 ("p1003_1b: Add capability mode checks") added
missing capability mode checks to sched_* syscalls, and commit
9b6ea599c955 ("rtprio*: Add capability mode checks") added them to
rtprio*.
Reviewed by: olce, emaste
Sponsored by: Advanced Micro Devices, Inc.
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>
Differential Revision: https://reviews.freebsd.org/D61412
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
Add tests exercising pax copy mode, cpio passthrough mode, the ability to extract pax, cpio, and tar archives, and the ability to parse pax, cpio, and tar command lines. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: obiwac Differential Revision: https://reviews.freebsd.org/D58469
debug: classified in
02b-filenames_wildcards2 by
'bin/.*/tests/.*'
debug: classified in
02b-filenames_wildcards2 by
'tests\/.*'
- pmc_perf_test: the pmc.perf(3) class (MPERF, APERF, IRPERF). - pmc_rdpmc_test: pmc_get_msr() and RDPMC. - pmc_row_test: row disposition per mode; system sampling needs a log. - pmc_ss_test: system sampling into a log, and its interrupt accounting. - pmc_unload_test: unloading hwpmc.ko leaks no memory. Reviewed by: mhorne Sponsored by: Advanced Micro Devices, Inc. Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com> Signed-off-by: Davi C.A <davi.chavesazevedo@amd.com> Differential Revision: https://reviews.freebsd.org/D61062
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'
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 01-style
by '[tT]ypo'
Remove trailing whitespace and replace space indentation with a tab. No functional change.
debug: classified in 01-style
by '[wW]hitespace'
.Sh RETURN VALUE instead of RETURN VALUES
debug: classified in 01-style
by '[tT]ypo'
debug: classified in 01-style
by '[tT]ypo'
fix operator and comma spacing and three long lines MFC After: 1 Week Approved-by: ngie (co-mentor) Reviewed by: ngie, imp Differential Revision: https://reviews.freebsd.org/D61302
debug: classified in 01-style
by '[sS]tyle'
Use similar spacing on adjacent lines, for readability. No functional change.
debug: classified in 01-style
by '[wW]hitespace'
MFC after: 3 days
debug: classified in 01-style
by '[tT]ypo'
- Sort headers.
- Put `{` on new line after function definition header.
Add `sys/types.h` include while here per API contract for `socket(..)`,
et al.
MFC after: 1 week
debug: classified in 01-style
by '[sS]tyle'
Sponsored by: Chelsio Communications
debug: classified in 01-style
by '[tT]ypo'
At least INADDR_ANY and IP_MULTICAST_IF are definitely Dv's. MFC after: 3 days
debug: classified in 01-style
by '[tT]ypo'
Reported by: kib Fixes: https://cgit.freebsd.org/src/commit/?id=538c48bf6247 ("sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread") Sponsored by: The FreeBSD Foundation
debug: classified in 01-style
by '[tT]ypo'
[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/'
Release notes at https://sqlite.org/releaselog/3_54_1.html. Obtained from: https://www.sqlite.org/2026/sqlite-autoconf-3540100.tar.gz Security: 84cd82e1-d49f-11f1-bae2-3497f65b111b CVE-2026-119371 CVE-2026-119372 CVE-2026-119373 CVE-2026-119374 CVE-2026-119375 CVE-2026-119376 CVE-2026-119377 CVE-2026-119378 CVE-2026-119379 CVE-2026-119591 MFC after: 1 day Merge commit '8fcea37c441fdc95cbfc8c34eeb0dcddbc02dca1'
debug: classified in
03-filenames_plain1 by
'contrib/'
While here, document what the script actually does, not what it once did on a project branch somewhere that was never merged. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Qualys, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D60171
debug: classified in
03-filenames_plain1 by
'contrib/'
Every tenth call to auditwarnlog(), check that the audit_warn(5) script exists and is executable by us. If it is, execute it as previously; otherwise, fall back to calling syslog(3) directly. Additionally, if we choose to use the script and fail, also log the original message to syslogd, not just the fact that we failed to log. We could record the result of trying to execute the script, but that would require pausing while it runs (or at least until the execve(2) call has completed). Retesting every tenth call is a little clunky but avoids having to restart or signal auditd(8) to force it to notice a change in availability, or adding a command-line option and / or modifying the audit_control(5) syntax to let the user express a preference. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Qualys, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D60172
debug: classified in
03-filenames_plain1 by
'contrib/'
Merge commit 'fe9da42ef146a6f93ea15fcbcc14872d2e6788c3' into main Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D60852
debug: Commit manually moved from "unknown" to "contrib".
These were removed by upstream long ago. Nothing in the tree uses them. Remove them to reduce our diff to upstream. Reviewed by: carlavilla, wosch Reported by: Ingo Schwarze <schwarze@openbsd.org> Differential Revision: https://reviews.freebsd.org/D61198
debug: classified in
03-filenames_plain1 by
'contrib/'
When compiled with gcc14, subr_ticks.o legitimately doesn't contain any DWARF sections. Just emit a warning in this case. In general we still want to run ctfconvert on asm files. Reviewed by: emaste, des Fixes: https://cgit.freebsd.org/src/commit/?id=e959f2a7d8a8 ("ctf*: exit with error upon terminate()") Differential Revision: https://reviews.freebsd.org/D61231
debug: classified in
03-filenames_plain1 by
'cddl/contrib/'
MFC after: 1 week
debug: classified in
03-filenames_plain1 by
'sys/contrib'
Makefile.asm generated eight perlasm outputs that neither libcrypto nor the kernel builds. Additionally, upstream does not build them for these architectures with FreeBSD's configuration: - aarch64: ecp_sm2p256-armv8, sm3-armv8, sm4-armv8, vpsm4-armv8 and vpsm4_ex-armv8. SM2, SM3 and SM4 are disabled (disable-sm2/sm3/sm4). - i386: cast-586 (upstream's x86 configuration uses the C CAST code) and rc5-586 (RC5 is disabled by default). - powerpc: aes-gcm-ppc. Upstream builds it only for 64-bit little-endian; libcrypto and ossl(4) use it only on powerpc64 and powerpc64le, whose copies stay. Remove them from Makefile.asm and delete the generated files, so the next vendor import does not regenerate them. If one of these algorithms is ever enabled, add its script back to Makefile.asm and run "make buildasm". Checked: no file outside crypto/openssl refers to any of them, and libcrypto's source lists did not include them. Built and checked via tinderbox build. Reviewed by: ngie Discussed with: jhb MFC after: 2 weeks MFC to: stable/15 Event: FreeBSD Vendor Summit 2026 Differential Revision: https://reviews.freebsd.org/D61274
debug: Commit manually moved from "unknown" to "contrib".
7bb441c86678 added the fixed-size string and address index forms 0x25 to 0x2c as DW_FORM_ref_strx1..4 and DW_FORM_ref_addrx1..4; the standard (DWARF 5, table 7.6) names them DW_FORM_strx1..4 and DW_FORM_addrx1..4, with no "ref". Rename them, keep the old spellings as aliases since the header is installed, and update dwarf_dump.c's form names accordingly. Add DW_LANG_C17 (0x2c) and DW_LANG_C23 (0x3e), which clang emits for -std=c17 and -std=c23 units. ctfconv(1) needs all of these; it carried them in a private header until now. Reviewed by: markj, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D61154
debug: classified in
03-filenames_plain1 by
'contrib/'
This release contains security fixes and small bugfixes. Full release notes are available at https://www.openssh.com/txt/release-10.5. Selected items from the release notes: Security ======== * ssh-agent(1): fix an interaction between agent locking and the session-bind@openssh.com extension that is used to identify forwarded agents. These binding requests were refused when the agent was locked, with the result that operations that were intended to be limited to local use only could be performed remotely, including the ability to add PKCS#11 tokens and make use of keys that had destination restrictions applied. Reported by sn0x-sharma * ssh(1): avoid potential realloc use-after-free in the client if a remote forwarding is added via the local session multiplexing socket while a remote forwarding open request is pending with the server. Report and fix from Brian Mingus of Cognatory * sshd(8): make the authorized_keys "restrict" keyword apply correctly to tunnel forwarding too (which is administratively disabled by default). Reported by Erichen, Institute of Computing Technology, Chinese Academy of Sciences New features ------------ * ssh-keygen(1): add ability to set or clear the touch-required and verify-required flags on FIDO private keys when resetting a private key's passphrase. * ssh(1): tweak ordering of certificates tried during pubkey authentication to prefer FIDO keys that do not require user presence (touch) first, and FIDO keys that require user verification via PIN or biometrics last. This effectively tries low-friction authenticators before higher friction ones. * ssh(1): add a "ssh -Z user@host" mode that prints the keys that will be tried for public key authentication in the order that they will be used. * sshd(8) use setproctitle(3) to identify sshd-session when its acting as a post-authentication monitor. Sponsored by: The FreeBSD Foundation
debug: classified in
05-summary-prefix by 'OpenSSH:'
Instead of hoping that the page after sbrk(0) is unmapped, map a page with mmap and then munmap it. This won't work with CheriABI and heap temporal safety, but it's an easy fix for now and works on all architectures. Reviewed by: ngie Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D46954
debug: classified in
03-filenames_plain1 by
'contrib/'
It uses sbrk to attempt to detect memory leaks in telldir, but we're not going to export sbrk in the future and this is unreliable for mmap-based mallocs. It's also a regression test for a specific NetBSD bug. Reviewed by: ngie Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D46955
debug: classified in
03-filenames_plain1 by
'contrib/'
to follow the POSIX specification. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253
debug: classified in
03-filenames_plain1 by
'contrib/'
[SLPVectorizer] Check std::optional coming out of getPointersDiff (#175784) Fixes https://github.com/llvm/llvm-project/issues/175768 There are other unchecked uses std::optional in this pass but I couldn't figure out a test that triggers them This fixes a clang crash in the SLP vectorizer, hit when building audio/csound on powerpc64le. The hardened libc++ traps on the disengaged optional, so clang dies with exit code 133. The second hunk is adapted to llvm 21, where analyzeConstantStrideCandidate() is still isStridedLoad(). Reviewed by: dim MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D61354
debug: classified in
03-filenames_plain1 by
'contrib/'
This release contains security fixes and small bugfixes. Full release notes are available at https://www.openssh.com/txt/release-10.6 . Selected items from the upstream release notes: Security ======== * ssh-agent(1): fix an interaction between agent locking and the session-bind@openssh.com extension that is used to identify forwarded agents. These binding requests were refused when the agent was locked, with the result that operations that were intended to be limited to local use only could be performed remotely, including the ability to add PKCS#11 tokens and make use of keys that had destination restrictions applied. Reported by sn0x-sharma * ssh(1): avoid potential realloc use-after-free in the client if a remote forwarding is added via the local session multiplexing socket while a remote forwarding open request is pending with the server. Report and fix from Brian Mingus of Cognatory * sshd(8): make the authorized_keys "restrict" keyword apply correctly to tunnel forwarding too (which is administratively disabled by default). Reported by Erichen, Institute of Computing Technology, Chinese Academy of Sciences New features ------------ * ssh-keygen(1): add ability to set or clear the touch-required and verify-required flags on FIDO private keys when resetting a private key's passphrase. * ssh(1): tweak ordering of certificates tried during pubkey authentication to prefer FIDO keys that do not require user presence (touch) first, and FIDO keys that require user verification via PIN or biometrics last. This effectively tries low-friction authenticators before higher friction ones. * ssh(1): add a "ssh -Z user@host" mode that prints the keys that will be tried for public key authentication in the order that they will be used. * sshd(8) use setproctitle(3) to identify sshd-session when its acting as a post-authentication monitor. Sponsored by: The FreeBSD Foundation
debug: classified in
05-summary-prefix by 'OpenSSH:'
Full release notes are available at https://www.openssh.org/txt/release-10.6p2 . Selected items from the upstream release notes: Future deprecation notice ------------------------- * scp(1): begin deprecating the -R flag, which is used to perform a remote-to-remote copy by executing scp on a remote host. This option is a fragile optimisation that is difficult to use because it requires credentials on the remote host. It also creates security risks if the shell quoting rules on the remote system where the copy is performed differ from the client's expectations. From OpenSSH 10.6, this option will continue to work but will cause a deprecation warning to be emitted to standard error. In a future release, the option will be ignored and will leave in place the default remote-to-remote copy behaviour (copy via the host running scp). Reviewed by: jlduran Sponsored by: The FreeBSD Foundation
debug: classified in
05-summary-prefix by 'OpenSSH:'
Allow the command to be preceded by an exclamation point, which changes the default expected result to a clean exit with a non-zero exit code. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D58099
debug: classified in
03-filenames_plain1 by
'contrib/'
Merge commit 'b0788c28c7bc6631129bc366bad491cf5698b2dc' Changes: https://github.com/zoulasc/blocklist/compare/10a907f...590e95e MFC after: 3 days
debug: classified in
03-filenames_plain1 by
'contrib/'
Including <arm_acle.h> in C code compiled with -Wstrict-prototypes results in warnings (or errors if -Werror is in effect) due to missing parameter lists for __gcspr() and __gcspopm(). Submitted upstream as PR#242286. MFC after: 1 week Reported by: Pete French <pete@twisted.org.uk> Reviewed by: dim Differential Revision: https://reviews.freebsd.org/D61503
debug: classified in
03-filenames_plain1 by
'contrib/'
Both stand and lib use luaconf.h from contrib and make local customizations in their respective luaconf.local.h files since 8c784bb8cf36. Reviewed by: kevans, imp Approved by: kevans (mentor) Fixes: https://cgit.freebsd.org/src/commit/?id=8c784bb8cf36 ("lua: Update to 5.4.4") MFC after: 3 days MFC to: stable/14, stable/15 Differential Revision: https://reviews.freebsd.org/D61456
debug: Commit manually moved from "unknown" to "contrib".
Most of the changes already existed in FreeBSD. Sponsored by: Klara, Inc. Sponsored by: Qualys, Inc.
debug: classified in
05-summary-prefix by 'Merge '
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'
iSCSI: Fast and per-session timeouts Support per-session configurable ping (SCSI NOP) and login timeouts similar to what is supported in the Linux iSCSI initiator configuration file. Reduce iscsi timer granularity to 0.1 sec. For backwards compatibility, when all timers are selected on integer numbers, all status messages are unchanged. If the higher granularity is used, the log messages include sub-second granularity. The sysctl(3) interface has changed from pure int to string, in order to support fractional seconds in a human-readable, dotted notation. Reviewed By: #netapp, #manpages, jhb, pauamma_chezdork.com, siderop1_netapp.com Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D32540
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
Revert "iSCSI: Fast and per-session timeouts" This reverts commit 6129bc4b65d8f00570bdcf2b2d36f3717e4b4741.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
bstring.3: no cross reference to self
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
Revert "bstring.3: no cross reference to self" This reverts commit ef7d29b0df91d32c0b880796acd969a0a00ecf47.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
string.3: no cross reference to self
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
Revert "string.3: no cross reference to self" This reverts commit 0448f4d0a4359670e8ad2ec72d0a826685517ae7.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
capsicum-test: make the code WARNS=6 clean Make the code WARNS=6 clean by doing the following: - Renaming variables (-Wshadow). - Use memcpy instead of assigning the result of CMSG_DATA to a variable (-Wcast-align). - Wrap some macros with do-while(0) to avoid variable collisions (-Wshadow). - Push one of the TRACE statements up by 1 layer to avoid a collision between 2 calls of TRACE via the same overarching macro. This was needed in order for the code to build properly with D61066, since the code was not compiling with WARNS set to 3 at the testcase level. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D61080
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
Revert "capsicum-test: make the code WARNS=6 clean" The wrong patch got committed somehow from one of my git clones. Revert the change so I can reapply the correct patch >:(. This reverts commit 5bae837f316ca96b69c61bae15bd61da76e7f3ea.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
tests/sys/capsicum: restore test coverage with root user
This change builds capsicum_test and installs/runs it as an unprivileged
user ("tests" in vanilla FreeBSD) and root.
This required adjusting logic in the Makefile in order to build two
binaries with the same sources and running them as separate binaries.
Moreover, in order to restore coverage and ensure that some tests which
require `other_uid` (typically specified via `-u` on the CLI with the
test program) don't fail, become the "tests" user when run as root. This
technically doesn't honor unprivileged_user property in kyua.conf: the
property needs to be passed via a command-line parameter to the test
program.
MFC after: 1 week
Reported by: markj
Fixes: https://cgit.freebsd.org/src/commit/?id=3fb03fb35b20 ("[tests] switch GoogleTest tests ...")
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D61066
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
Revert "tests/sys/capsicum: restore test coverage with root user" The wrong patch was applied for D61080. Both changes must go. This reverts commit dda15b669d021346682009f38acc6db2639fb99f.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
Remove {ATF,PLAIN}_REQUIRE_KERNEL_MODULE macros
These macros predated the `require.kmod` (ATF) and `required_kmods`
(kyua) test metadata and are no longer needed.
Add a hint to freebsd_test_suite/macros.h about the `*FEATURE*` macros
going away soon. See [this kyua issue][kyua-issue] for more details.
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D61082
[kyua-issue]: https://github.com/freebsd/kyua/issues/346
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
Revert "Remove {ATF,PLAIN}_REQUIRE_KERNEL_MODULE macros"
The change breaks the build of tests/sys/net/routing/test_rtsock_l3.c.
This reverts commit e34b159d4c64575aa45763968b6ad01dfd7c2337.
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
tcp bbr: improve retransmit timout calculation The retransmission timeout should the srtt + 4 * rttvar. The srtt is using 5 bits of fractions and rttvar is using 4 bits of fractions, some specific shifting is required. Reviewed by: Peter Lei MFC after: 3 days MFC to: stable/15 Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D61586
debug: classified in 00-reverts
by 'This reverts commit
\b([0-9a-fA-F]{40})\b'
Revert "tcp bbr: improve retransmit timout calculation" This reverts commit 47ef696a769644e7ca1f2a3129818f39640b30a9. I referenced the wrong review.
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-16 20:34:06+00:00.
This work is supported by Tarsnap Backup Inc.
Alternate version: 2026-10-01 (release)