FreeBSD/src 901aec0sys/compat/linuxkpi/common/include/linux sysfs.h

linuxkpi: Handle bin attributes in sysfs attribute groups

For instance, this is used by DRM drivers to declare the EDID property
of an GPU output connector:

    sysctl -b sys.device.drmn1.card0.card0-DP-1.edid | edid-decode

    ...
    Block 0, Base EDID:
      EDID Structure Version & Revision: 1.4
      Vendor & Product Identification:
        Manufacturer: SAM
        Model: 29814
        Serial Number: 810635354 (0x3051505a)
        Made in: week 15 of 2025
    ...

Reviewed by:    bz, emaste, wulf
Sponsored by:   The FreeBSD Foundation

    [3 lines not shown]
DeltaFile
+25-9sys/compat/linuxkpi/common/include/linux/sysfs.h
+25-91 files

FreeBSD/src 0f89380lib/libkvm kvm_proc.c, sys/compat/freebsd32 freebsd32.h

kern/proc: expose reaper PID and subtree root in struct kinfo_proc

Expose process reaper metadata through struct kinfo_proc so userland
can reconstruct reaper hierarchies from kern.proc.all without adding
a new procctl(2) operation.

Two pid_t fields are added by carving 8 bytes from ki_sparestrings
(46 -> 38), restoring KI_NSPARE_INT to 2 and keeping sizeof(struct
kinfo_proc) unchanged:

  ki_reaper: PID of the owning reaper process
  ki_reapsubtree: PID of the direct child of the reaper that roots
                  the subtree the process belongs to

fill_kinfo_proc_pgrp() populates both fields under proctree_lock.
kvm_proclist() is updated for crash dump consumers. The freebsd32
compat struct and freebsd32_kinfo_proc_out() are updated accordingly.

PR:     293871

    [3 lines not shown]
DeltaFile
+8-0lib/libkvm/kvm_proc.c
+3-1sys/compat/freebsd32/freebsd32.h
+4-0sys/kern/kern_proc.c
+3-1sys/sys/user.h
+18-24 files

FreeBSD/src 5c89d66usr.bin/kdump kdump.c Makefile

kdump: tweaks for the extended errors decoding

Format the message.
Convert category to the source name if known.

Still print the raw value for the category, and the values of the
EXTERROR() optional arguments.

Requested and reviewed by:      mckusick
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56542
DeltaFile
+20-3usr.bin/kdump/kdump.c
+1-0usr.bin/kdump/Makefile
+21-32 files

FreeBSD/src bbd20c0sys/compat/linuxkpi/common/include/linux slab.h, sys/compat/linuxkpi/common/src linux_slab.c

linuxkpi: Pass a `const void *` to `krealloc()`

This matches the API on Linux.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56451
DeltaFile
+3-3sys/compat/linuxkpi/common/src/linux_slab.c
+2-2sys/compat/linuxkpi/common/include/linux/slab.h
+5-52 files

FreeBSD/src 18c71d9sys/compat/linuxkpi/common/include/linux mod_devicetable.h

linuxkpi: Include <linux/uuid.h> from <linux/mod_devicetable.h>

The DRM generic code started to deppend on this indirect include of
<linux/uuid.h> in Linux 6.12.

Reviewed by:    bz, emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56449
DeltaFile
+1-0sys/compat/linuxkpi/common/include/linux/mod_devicetable.h
+1-01 files

FreeBSD/src 2434fcfsys/compat/linuxkpi/common/src linux_slab.c

linuxkpi: Passing a size of zero to `krealloc()` frees the pointer

This matches the API on Linux.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56452
DeltaFile
+5-0sys/compat/linuxkpi/common/src/linux_slab.c
+5-01 files

FreeBSD/src a5ae030sys/compat/linuxkpi/common/include/linux fs.h

linuxkpi: Add `fop_flags` to `struct file_operations`

... along with the `FOP_*` flag constants.

Note that this `fop_flags` field is not used on FreeBSD. It is added to
make the DRM drivers compile out of the box.

The DRM generic code and drivers started this in Linux 6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56450
DeltaFile
+11-0sys/compat/linuxkpi/common/include/linux/fs.h
+11-01 files

FreeBSD/src ae1f695sys/compat/linuxkpi/common/include/linux kdev_t.h

linuxkpi: Define `MINORBITS`

We can't really define a proper value for this constant because minor
and major are encoded in a complex way on FreeBSD which cannot be
represented with a simple shift.

The DRM generic code started to use it in Linux 6.12.

In this context, `MINORBITS` is used to define an upper limit passed to
`xa_alloc()`. Therefore it is not used to encode or decode minors. It is
used as an arbitrary value. Therefore, we define the constant to 20,
like on Linux.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56447
DeltaFile
+15-0sys/compat/linuxkpi/common/include/linux/kdev_t.h
+15-01 files

FreeBSD/src 4dab15esys/compat/linuxkpi/common/include/linux sort.h

linuxkpi: Define `sort_r()`

Like Linux `sort()` and FreeBSD `qsort()`, `sort_r()` is a wrapper
around FreeBSD `qsort_r()`.

The i915 DRM driver started to use it in Linux 6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56437
DeltaFile
+5-0sys/compat/linuxkpi/common/include/linux/sort.h
+5-01 files

FreeBSD/src cefd0aesys/compat/linuxkpi/common/include/linux uuid.h, sys/compat/linuxkpi/common/src linux_compat.c

linuxkpi: Add several `guid_*()` functions

The DRM generic code and the amdgpu DRM driver started to use several of
these functions in Linux 6.12. Likewise for `UUID_SIZE`.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56448
DeltaFile
+27-0sys/compat/linuxkpi/common/include/linux/uuid.h
+3-0sys/compat/linuxkpi/common/src/linux_compat.c
+30-02 files

FreeBSD/src ad528a6sys/compat/linuxkpi/common/include/linux kernel.h wait.h

linuxkpi: Define diagnostic macros like `might_resched()` or `cant_sleep()`

They are no-ops on FreeBSD.

While here, move the already defined `might_sleep*()` macros from
<linux/wait.h> to <linux/kernel.h> where they belong.

The DRM generic code started to use `might_fault()` in Linux 6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56434
DeltaFile
+33-0sys/compat/linuxkpi/common/include/linux/kernel.h
+0-7sys/compat/linuxkpi/common/include/linux/wait.h
+33-72 files

FreeBSD/src 2357de8sys/compat/linuxkpi/common/include/linux device.h

linuxkpi: Define `dev_err_probe*()`

They differ from other `dev_*()` logging functions by returning the
passed error code. The error code is also used to determine if the
message should be logged in the first place and at which log level.

The DRM generic code started to use it in Linux 6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56435
DeltaFile
+24-0sys/compat/linuxkpi/common/include/linux/device.h
+24-01 files

FreeBSD/src 8f95998sys/compat/linuxkpi/common/include/linux gfp.h

linuxkpi: Define `__GFP_THISNODE`

It is used to force the NUMA node to allocate from. This flag is
unimplemented for now because we don't have an implementation of
`alloc_pages_node()` yet.

The DRM TTM code started to use this flag in Linux 6.12.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56436
DeltaFile
+2-1sys/compat/linuxkpi/common/include/linux/gfp.h
+2-11 files

FreeBSD/src e9d3512share/man/man4 ix.4, sys/dev/ixgbe ixgbe_e610.c ixgbe_fw_logging.c

ix(4): Add support for firmware logging for E610 adapters

This is part 3 of the support for the new Intel Ethernet E610
family of devices

The ix driver now enables firmware logging on Intel E610 devices
for debugging with Customer Support. Logs are enabled by default
and generated in binary format that requires decoding by support
teams. The collected data is firmware and hardware related for
debugging purposes only.

When the driver loads, it creates a fw_log sysctl node under the
debug section. Events are organized into categories (modules) for
targeted logging, and users can adjust verbosity levels as needed.

This adds sysctl support for the firmware logging feature and
updates the ix(4) manual page with documentation.

Signed-off-by: Yogesh Bhosale <yogesh.bhosale at intel.com>

    [8 lines not shown]
DeltaFile
+486-0sys/dev/ixgbe/ixgbe_e610.c
+467-0sys/dev/ixgbe/ixgbe_fw_logging.c
+36-0sys/dev/ixgbe/ixgbe_osdep.c
+33-1share/man/man4/ix.4
+18-4sys/dev/ixgbe/if_ix.c
+13-0sys/dev/ixgbe/ixgbe_e610.h
+1,053-56 files not shown
+1,066-512 files

FreeBSD/src b6dd9d3. CONTRIBUTING.md

CONTRIBUTING: fix typos in GitHub contribution guide

Signed-off-by: Roman <nnov.brody at gmail.com>
Pull-request: https://github.com/freebsd/freebsd-src/pull/2156
DeltaFile
+4-4CONTRIBUTING.md
+4-41 files

FreeBSD/src 69e8d8bsys/netinet tcp_hpts_test.c

tests/sys/netinet/tcp_hpts: Make a socket available in mock inpcbs

After commit 9b76228006d8, tcp_hptsi() dereferences inp_socket in order
to get the inpcb's VNET.  This means that mock inpcbs created by the
HPTS test fixture must set inp_socket.  Also set the current VNET there;
previously, it was NULL, and this was not noticed since VNET_DEBUG is
disabled even in debug kernels.

Fixes:  9b76228006d8 ("inpcb: retire inp_vnet")
DeltaFile
+8-0sys/netinet/tcp_hpts_test.c
+8-01 files

FreeBSD/src dce5659sys/kern kern_clocksource.c

epoch: Don't idle CPUs when there's pending epoch work

The epoch(9) subsystem implements per-CPU queues of object destructors
which get invoked once it is safe to do so.  These queues are polled via
hardclock().

When a CPU is about to go idle, we reduce the hardclock frequency to 1Hz
by default, to avoid unneeded wakeups.  This means that if there is any
garbage in these destructor queues, it won't be cleared for at least 1s
(and possibly longer) even if it would otherwise be safe to do so.

epoch_drain_callbacks() is used in some places to provide a barrier,
ensuring that all garbage present in the destructor queues is cleaned up
before returning.  It's implemented by adding a fake destructor in the
queues and blocking until it gets run on all CPUs.  The above-described
phenomenon means that it can take a long time for these calls to return,
even (especially) when some CPUs are idle.  This causes long delays when
destroying VNET jails, for instance, as epoch_drain_callbacks() is
invoked each time a network interface is destroyed.

    [11 lines not shown]
DeltaFile
+2-1sys/kern/kern_clocksource.c
+2-11 files

FreeBSD/src 30b7621tests/sys/net if_geneve.sh if_gif.sh

tests/sys/net: Set require.kmods where appropriate
DeltaFile
+14-85tests/sys/net/if_geneve.sh
+6-20tests/sys/net/if_gif.sh
+3-17tests/sys/net/if_stf.sh
+4-8tests/sys/net/if_wg.sh
+27-1304 files

FreeBSD/src 14a47a8sys/netinet in_pcb.c, sys/netinet6 in6_pcb.c

inpcb: remove always true condition in in_pcblookup_local()

We are searching through the hash that has only wildcard bindings.
This was missed by fdb987bebddf05e15a5af840379c7715a94aec1c.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D56488
DeltaFile
+1-2sys/netinet/in_pcb.c
+1-2sys/netinet6/in6_pcb.c
+2-42 files

FreeBSD/src 2862a33sys/kern tty.c, tests/sys/kern tiocnotty.c Makefile

tty: Avoid leaving dangling pointers in tty_drop_ctty()

The TIOCNOTTY handler detaches the calling process from its controlling
terminal.  It clears the link from the session to the tty, but not the
pointers from the tty to the session and process group.  This means that
sess_release() doesn't call tty_rel_sess(), and that pgdelete() doesn't
call tty_rel_pgrp(), so the pointers are left dangling.

Fix this by clearing pointers in tty_drop_ctty().  Add a standalone
regression test.

Approved by:    so
Security:       FreeBSD-SA-26:10.tty
Security:       CVE-2026-5398
Reported by:    Nicholas Carlini <npc at anthropic.com>
Reviewed by:    kib, kevans
Fixes:          1b50b999f9b5 ("tty: implement TIOCNOTTY")
Differential Revision:  https://reviews.freebsd.org/D56046
DeltaFile
+82-0tests/sys/kern/tiocnotty.c
+4-0sys/kern/tty.c
+1-0tests/sys/kern/Makefile
+87-03 files

FreeBSD/src a2f6f2dlib/libc/x86/sys pkru.3, sys/amd64/amd64 sys_machdep.c pmap.c

pkru: Fix handling of 1GB largepage mappings

pmap_pkru_update_range() did not handle the case where a PDPE has PG_PS
set.  More generally, the SET_PKRU and CLEAR_PKRU sysarch
implementations did not check whether the request covers a "boundary" vm
map entry.  Fix this, add the missing PG_PS test, and add some tests.

Approved by:    so
Security:       FreeBSD-SA-26:11.amd64
Security:       CVE-2026-6386
Reported by:    Nicholas Carlini <npc at anthropic.com>
Reviewed by:    kib, alc
Differential Revision:  https://reviews.freebsd.org/D56184
DeltaFile
+187-0tests/sys/posixshm/posixshm_test.c
+34-9sys/amd64/amd64/sys_machdep.c
+32-0sys/vm/vm_map.c
+17-3sys/amd64/amd64/pmap.c
+3-0lib/libc/x86/sys/pkru.3
+1-0sys/vm/vm_map.h
+274-126 files

FreeBSD/src 6c36e5d. UPDATING, sys/conf newvers.sh

Add UPDATING entries and bump version

Approved by:    so
DeltaFile
+11-0UPDATING
+1-1sys/conf/newvers.sh
+12-12 files

FreeBSD/src 6c9dd75sys/vm vm_fault.c

vm_fault: Reset m_needs_zeroing properly

- When allocating a page, we should only consider the PG_ZERO flag when
  handling the top-level page.
- Unconditionally reset the flag when restarting the fault handler.
  Previously, vm_fault_busy_sleep() would fail to reset it.

Approved by:    so
Security:       FreeBSD-EN-26:05.vm
PR:             294039
Reviewed by:    kib
Tested by:      Peter Much <pmc at citylink.dinoex.sub.org>
MFC after:      3 days
Fixes:          cff67bc43df1 ("vm_fault: only rely on PG_ZERO when the page was newly allocated")
Differential Revision:  https://reviews.freebsd.org/D56234

(cherry picked from commit 04132e01004316ddd0e0cde6ef15b100b7b1844d)
(cherry picked from commit 50f7b62f0862f764215cee98547d5b8c0979ec26)
DeltaFile
+3-4sys/vm/vm_fault.c
+3-41 files

FreeBSD/src 979e645lib/libc/x86/sys pkru.3, sys/amd64/amd64 sys_machdep.c pmap.c

pkru: Fix handling of 1GB largepage mappings

pmap_pkru_update_range() did not handle the case where a PDPE has PG_PS
set.  More generally, the SET_PKRU and CLEAR_PKRU sysarch
implementations did not check whether the request covers a "boundary" vm
map entry.  Fix this, add the missing PG_PS test, and add some tests.

Approved by:    so
Security:       FreeBSD-SA-26:11.amd64
Security:       CVE-2026-6386
Reported by:    Nicholas Carlini <npc at anthropic.com>
Reviewed by:    kib, alc
Differential Revision:  https://reviews.freebsd.org/D56184
DeltaFile
+187-0tests/sys/posixshm/posixshm_test.c
+34-9sys/amd64/amd64/sys_machdep.c
+32-0sys/vm/vm_map.c
+17-3sys/amd64/amd64/pmap.c
+3-0lib/libc/x86/sys/pkru.3
+1-0sys/vm/vm_map.h
+274-126 files

FreeBSD/src f37c6e3sys/kern sys_timerfd.c

timerfd: Fix interval callout scheduling

When a timerfd interval callout misses its scheduled activation time, a
differential is calculated based on the actual activation time and the
scheduled activation time. This differential is divided by the timerfd's
interval time and the quotient is added to the timerfd's counter.

Before this change, the next callout was scheduled to activate at:
scheduled activation time + timerfd interval.

This change fixes the scheduling of the next callout to activate at:
actual activation time + timerfd interval - remainder.

Security:               FreeBSD-26:06.timerfd
Approved by:            so
Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D55790
MFC after:              2 weeks


    [2 lines not shown]
DeltaFile
+13-11sys/kern/sys_timerfd.c
+13-111 files

FreeBSD/src 0224acf. UPDATING, sys/conf newvers.sh

Add UPDATING entries and bump version

Approved by:    so
DeltaFile
+14-0UPDATING
+1-1sys/conf/newvers.sh
+15-12 files

FreeBSD/src 44077c0sys/kern tty.c, tests/sys/kern tiocnotty.c Makefile

tty: Avoid leaving dangling pointers in tty_drop_ctty()

The TIOCNOTTY handler detaches the calling process from its controlling
terminal.  It clears the link from the session to the tty, but not the
pointers from the tty to the session and process group.  This means that
sess_release() doesn't call tty_rel_sess(), and that pgdelete() doesn't
call tty_rel_pgrp(), so the pointers are left dangling.

Fix this by clearing pointers in tty_drop_ctty().  Add a standalone
regression test.

Approved by:    so
Security:       FreeBSD-SA-26:10.tty
Security:       CVE-2026-5398
Reported by:    Nicholas Carlini <npc at anthropic.com>
Reviewed by:    kib, kevans
Fixes:          1b50b999f9b5 ("tty: implement TIOCNOTTY")
Differential Revision:  https://reviews.freebsd.org/D56046
DeltaFile
+82-0tests/sys/kern/tiocnotty.c
+4-0sys/kern/tty.c
+1-0tests/sys/kern/Makefile
+87-03 files

FreeBSD/src 4d22b39sys/vm vm_fault.c

vm_fault: Reset m_needs_zeroing properly

- When allocating a page, we should only consider the PG_ZERO flag when
  handling the top-level page.
- Unconditionally reset the flag when restarting the fault handler.
  Previously, vm_fault_busy_sleep() would fail to reset it.

Approved by:    so
Security:       FreeBSD-EN-26:05.vm
PR:             294039
Reviewed by:    kib
Tested by:      Peter Much <pmc at citylink.dinoex.sub.org>
MFC after:      3 days
Fixes:          cff67bc43df1 ("vm_fault: only rely on PG_ZERO when the page was newly allocated")
Differential Revision:  https://reviews.freebsd.org/D56234

(cherry picked from commit 04132e01004316ddd0e0cde6ef15b100b7b1844d)
(cherry picked from commit 9b7c0f4f81f06424899094d4381dede79669b623)
DeltaFile
+3-4sys/vm/vm_fault.c
+3-41 files

FreeBSD/src 6dc9b78. UPDATING, sys/conf newvers.sh

Add UPDATING entries and bump version

Approved by:    so
DeltaFile
+14-0UPDATING
+1-1sys/conf/newvers.sh
+15-12 files

FreeBSD/src 5787df3lib/libc/x86/sys pkru.3, sys/amd64/amd64 sys_machdep.c pmap.c

pkru: Fix handling of 1GB largepage mappings

pmap_pkru_update_range() did not handle the case where a PDPE has PG_PS
set.  More generally, the SET_PKRU and CLEAR_PKRU sysarch
implementations did not check whether the request covers a "boundary" vm
map entry.  Fix this, add the missing PG_PS test, and add some tests.

Approved by:    so
Security:       FreeBSD-SA-26:11.amd64
Security:       CVE-2026-6386
Reported by:    Nicholas Carlini <npc at anthropic.com>
Reviewed by:    kib, alc
Differential Revision:  https://reviews.freebsd.org/D56184
DeltaFile
+187-0tests/sys/posixshm/posixshm_test.c
+34-9sys/amd64/amd64/sys_machdep.c
+32-0sys/vm/vm_map.c
+17-3sys/amd64/amd64/pmap.c
+3-0lib/libc/x86/sys/pkru.3
+1-0sys/vm/vm_map.h
+274-126 files