This is a display of mostly-automatically-classified git commits from 2026-10-12 to 2026-10-18.
Table of contents and commits per category:
| (0) | Highlighted commits (these are copies, not in stats) | |
| 3 | 2.0% | Userland programs |
| 2 | 1.3% | Documentation |
| 45 | 29.8% | Hardware support |
| 24 | 15.9% | Networking |
| 15 | 9.9% | System administration |
| 6 | 4.0% | Libraries |
| 6 | 4.0% | Filesystems |
| 23 | 15.2% | Kernel |
| 4 | 2.6% | Build system |
| 6 | 4.0% | Internal organizational stuff |
| 7 | 4.6% | Testing |
| 1 | 0.7% | Style, typos, and comments |
| 3 | 2.0% | Contrib code |
| 6 | 4.0% | Reverted commits |
| 0 | 0.0% | Unclassified commits |
| 151 | 100% | total |
| Technical notes about this page |
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.
-- no commits in this category this week --
Commits about commands found in man section 1 (other than networking).
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
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
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
Man pages, release notes, etc.
Macho is a perfectly cromulent word, in both Merriam-Webster and OED. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D60713
Hardware drivers and architecture-specific code.
iwm: add lock assertion checks Add lock/unlock assertions to use in current and future code. Differential Revision: https://reviews.freebsd.org/D60400
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
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
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
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
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
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
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
MFC after: 3 days Approved by: adrian Reviewed by: kevans, adrian Differential Revision: https://reviews.freebsd.org/D60652
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
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
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
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
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
Reviewed by: emaste
Sponsored by: EPSRC ("UKRI3001: CHERI Research Centre")
Differential Revision: https://reviews.freebsd.org/D60705
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
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
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
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
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
It's practical to have this printed out proactively, at least while this is still very experimental. Sponsored by: The FreeBSD Foundation
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D49168
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
Network-related commands, library, and kernel.
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
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")
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")
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")
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
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
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")
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
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
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
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
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
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
No functional change.
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
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
While here get rid of the aesthetically unpleasing '== false' construct.
Sponsored by: Rubicon Communications, LLC ("Netgate")
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
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
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
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
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
Stuff in man section 8 (other than networking).
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
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
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'
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.
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.
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
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
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
* 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
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
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
tcpsso incorrectly referred to the optname instead of the level name/number. MFC after: 2 weeks
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
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
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
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
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
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
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
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
- 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
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
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
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
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
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
MFC after: 1 month Fixes: https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
Kernel stuff (other than networking, filesystems, and drivers).
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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")
Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D49166
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
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
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
Reviewed by: ziaee Discussed with: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60047
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
Stream-optimized VMDK support was merged to stable/15 with __FreeBSD_version 1501504. Sponsored by: Amazon
Reported by: glebius Fixes: https://cgit.freebsd.org/src/commit/?id=e478037df4f1 ("systm.h: Remove unused <sys/kpilite.h>") Sponsored by: The FreeBSD Foundation
Approved by: kevans (mentor)
And note the commit bit return date of my previous account, freqlabs@. Approved by: kevans (mentor)
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
These ones were unambiguous cases where the Foundation was the only listed copyright holder.
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
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
Workaround for kern.maxfiles limit exceeded. Workaround for SU disk full issue. Added some debug info, if umount(8) returns EBUSY.
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")
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
For those modules that don't have a manual page spell out full name of a loadable module.
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
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
These could go in other categories, but it's more clear if they're here instead.
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
MFC after: 3 days DIfferential revision: https://reviews.freebsd.org/D60695
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
Reviewed by: ngie MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D60446
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
umb: Update man page HISTORY It was merged to stable/14 prior to FreeBSD 14.4.
Revert "umb: Update man page HISTORY" Oops, pushed in error from a staging branch. This reverts commit ed797306243f3bdbbfd5d8223ec8698b9d7fe319.
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.
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
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.
Not classified automatically, and waiting for manual attention.
-- no commits in this category this week --
Dates:
cgit.freebsd.org/src. Git accurately records the
order of commits, but not their dates.Automatic grouping:
This reverts commit \\b([0-9a-fA-F]{40})\\b
and the hash was found in this week's commits.
Automatic categories:
Source code:
Generated with commits-periodical 0.21 at 2026-11-03 03:23:54+00:00.
This work is supported by Tarsnap Backup Inc.
Alternate version: 2026-10-12 (debug) (contains info about the classification)