FreeBSD/src 1db6e2c — sys/net/route nhgrp_ctl.c, sys/netlink/route nexthop.c

rtnetlink: Use default weight for unset weights in NHA_GROUP

newnhg() copied the weights of a nhgrp as is and a group
whose members all have a zero weight, which is what
userland sends when it leaves the weight unset, made
calc_min_mpath_slots_fast() divide by zero.

Therefore replace weight of zero with RT_DEFAULT_WEIGHT.

While here, return early from calc_min_mpath_slots_fast()
if all weights are zero.

MFC after:      3 days
Fixes:          7e5bf68495cc ("netlink: add netlink support")
DeltaFile
+1-1sys/netlink/route/nexthop.c
+1-1sys/net/route/nhgrp_ctl.c
+2-22 files

FreeBSD/src cb1627e — sys/conf kern.mk

kernel: Add -mindirect-branch-cs-prefix for WITH_KERNEL_RETPOLINE

-mindirect-branch-cs-prefix adds a CS segment-override prefix (0x2e)
to each call or jmp to a retpoline thunk.  The CPU ignores the prefix,
but it extends the instruction to six bytes instead of five.  This
leaves enough room for a future kernel change to patch all of the call
sites at boot time to disable retpoline if not required.

Support for this option arrived in GCC 12 and Clang/LLVM 16.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61514
DeltaFile
+1-1sys/conf/kern.mk
+1-11 files

FreeBSD/src 7fca909 — sys/net if_media.h

if_media: Add 100BASE-T1 and 1000BASE-T1 media types

100BASE-T1 (IEEE 802.3bw) and 1000BASE-T1 (IEEE 802.3bp) are Single-Pair
Ethernet (SPE) standards intended for use in automotive and industrial
applications.

Reviewed by:    kbowling
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60864

(cherry picked from commit f69099fc0fc55262741621451a52de50f164271a)
DeltaFile
+6-0sys/net/if_media.h
+6-01 files

FreeBSD/src d3b0211 — sys/netinet tcp_subr.c

tcp: count only the SACK blocks that fit in tcp_maxseg()

tcp_addoptions() sends only the SACK blocks that fit in TCP_MAXOLEN.
tcp_maxseg() counted every pending block and clamped the total, so
without timestamps and with five or more blocks pending it came out 4
bytes below the segment tcp_output() sends.  Limited transmit after an
RTO then sent one full segment and failed the "sent too much" KASSERT.

PR:             282605

Approved by:    adrian (mentor)
Signed-off-by:  Nick Price <nprice at FreeBSD.org>
Reviewed by:    tuexen, glebius, adrian
Differential Revision:  https://reviews.freebsd.org/D60460
DeltaFile
+6-3sys/netinet/tcp_subr.c
+6-31 files

FreeBSD/src 8a79b63 — sys/powerpc/powerpc exec_machdep.c

powerpc: don't drop FPU and VMX ownership in grab_mcontext()

grab_mcontext() saved the FP and vector registers with save_fpu() and
save_vec(), which drop ownership: PCPU(fputhread) becomes NULL while
PCB_FPU stays set and the thread keeps using the unit. A later
cpu_update_pcb(), at fork(2) or thr_new(2), then skipped the save,
since save_fpu_nodrop() only saves for the thread that owns the unit,
and the child got the registers as they were at the getcontext() or
signal rather than at the fork. Use the nodrop variants.

A child forked after getcontext() saw the parent's f14 as it was at
the getcontext(); it sees the current value now.

Reviewed by:    adrian, jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60837
DeltaFile
+2-2sys/powerpc/powerpc/exec_machdep.c
+2-21 files

FreeBSD/src 5a834ad — sys/compat/freebsd32 freebsd32_misc.c

procctl: Zero the output structure for the compat32 syscall

Otherwise the freebsd32 implementation of PROC_REAP_STATUS leaks
uninitialized kernel stack memory.

Reviewed by:    kib
Reported by:    Dennys Kaluzny Pereira <dennyskaluzny at gmail.com>
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61510
DeltaFile
+1-0sys/compat/freebsd32/freebsd32_misc.c
+1-01 files

FreeBSD/src 21c2318 — sys/netpfil/ipfilter/netinet ip_nat.c

ipfilter: Remove erroneous ntohs()

The original commit was wrong.  ipf_nat_builddivertmp() builds the UDP
template with the length in host byte order

M_DUP() copies that value unchanged. The old code was therefore correct.
It added fin_plen in host order and then did a single htons().

The original patch was discussed with Co-Pilot, which pointed out the
original bug. claude-opus-5-5 discovered the ntohs() error that
co-pilot suggested.

Interestingly this code had been running here for a couple of months.

Reported by:    llm-postcr
Fixes:          72cc9e3766f4
(cherry picked from commit 86861520613f99c85b5fbdf92b5c955a13ed6624)
DeltaFile
+0-1sys/netpfil/ipfilter/netinet/ip_nat.c
+0-11 files

FreeBSD/src 10207d1 — sys/netpfil/ipfilter/netinet ip_nat.c

ipfilter: Only recalculate the UDP header when we have one

When ipf_nat_out processes NAT_DIVERTOUT (ipnat rdr statements)
it also fixes the checksum in the UDP header. Test for a UDP header
before adjusting its length.

While we are here, the length in the UDP header must be converted
from network byte order to host byte order. Add the missing ntohs().

PR:             296944

(cherry picked from commit 72cc9e3766f4222fa7fc462bc669dcf668e8b334)
DeltaFile
+6-3sys/netpfil/ipfilter/netinet/ip_nat.c
+6-31 files

FreeBSD/src e6ad9d6 — sys/netpfil/ipfilter/netinet ip_nat.c

ipfilter: Remove erroneous ntohs()

The original commit was wrong.  ipf_nat_builddivertmp() builds the UDP
template with the length in host byte order

M_DUP() copies that value unchanged. The old code was therefore correct.
It added fin_plen in host order and then did a single htons().

The original patch was discussed with Co-Pilot, which pointed out the
original bug. claude-opus-5-5 discovered the ntohs() error that
co-pilot suggested.

Interestingly this code had been running here for a couple of months.

Reported by:    llm-postcr
Fixes:          72cc9e3766f4
(cherry picked from commit 86861520613f99c85b5fbdf92b5c955a13ed6624)
DeltaFile
+0-1sys/netpfil/ipfilter/netinet/ip_nat.c
+0-11 files

FreeBSD/src dd72199 — sys/netpfil/ipfilter/netinet ip_nat.c

ipfilter: Only recalculate the UDP header when we have one

When ipf_nat_out processes NAT_DIVERTOUT (ipnat rdr statements)
it also fixes the checksum in the UDP header. Test for a UDP header
before adjusting its length.

While we are here, the length in the UDP header must be converted
from network byte order to host byte order. Add the missing ntohs().

PR:             296944

(cherry picked from commit 72cc9e3766f4222fa7fc462bc669dcf668e8b334)
DeltaFile
+6-3sys/netpfil/ipfilter/netinet/ip_nat.c
+6-31 files

FreeBSD/src e104c74 — crypto/krb5 README, crypto/krb5/src/lib/kadm5 kadm_rpc_xdr.c

krb5: Import MIT 1.22.3

Major changes in 1.22.3 (2026-11-09)
====================================

This is a bug fix release, with a focus on security issues discovered
with the aid of large language models.  See
https://web.mit.edu/kerberos/advisories/MITKRB5-SA-2026-001.txt for
information on the risks of continuing to use unpatched releases.

* Fix a logic error when checking PAC server checksums
   [CVE-2026-111423].

* Check for unkeyed checksums when validating CAMMAC verifiers
   [CVE-2026-71199].

* Fix a loophole in the KDC's client authdata filtering which could
   allow clients to include fake PAC and CAMMAC authdata values when
   requesting service tickets.  These fake values would be rejected by

    [50 lines not shown]
DeltaFile
+215-215crypto/krb5/src/po/mit-krb5.pot
+182-0crypto/krb5/README
+77-32crypto/krb5/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
+69-29crypto/krb5/src/lib/rpc/svc_auth_gss.c
+97-0crypto/krb5/src/lib/krb5/krb/t_init_creds_step.c
+59-34crypto/krb5/src/lib/kadm5/kadm_rpc_xdr.c
+699-310133 files not shown
+1,800-901139 files

FreeBSD/src 6db2770 — sys/dev/virtio/network if_vtnet.c

vtnet: honor the advertised MTU limit on attach

When VIRTIO_NET_F_MTU is negotiated, virtio_net_config.mtu specifies
the maximum MTU the driver may use. vtnet_ioctl_mtu() enforces this
limit for subsequent MTU changes, but ether_ifattach() unconditionally
initializes the interface MTU to ETHERMTU (1500).

So a device advertising a maximum below 1500 starts with an MTU above
its limit. So make sure to set the initial MTU no larger than
vtnet_max_mtu. That is, for vtnet_max_mtu less than 1500
interface MTU will be set to this value, otherwise the current behaviour
is preserved, MTU will be set to 1500.

Reviewed by:    kfv, tuexen
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60980

(cherry picked from commit 0974ef03b43f279f16289ad4d5be3a03923983ea)
DeltaFile
+2-0sys/dev/virtio/network/if_vtnet.c
+2-01 files

FreeBSD/src c914853 — sys/dev/nvme nvme_private.h nvme_qpair.c

nvme: enforce the Abort Command Limit

Each watchdog pass submitted an Abort for every timed-out command
with nothing counting them against the controller's ACL. A
controller may complete excess Aborts with Abort Command Limit
Exceeded status.

Reviewed by:    imp, adrian
Differential Revision:  https://reviews.freebsd.org/D59636
DeltaFile
+8-0sys/dev/nvme/nvme_qpair.c
+1-0sys/dev/nvme/nvme_private.h
+9-02 files

FreeBSD/src b35e921 — lib/libpmc/pmu-events/arch/x86 mapfile.csv

libpmc: add more alderlake models

According to [1], the CPU models 6-{b7,ba,bf} are also alderlake-family
models. This patch adds them to the mapfile.csv.

[1] https://github.com/torvalds/linux/blob/master/tools/perf/pmu-events/arch/x86/mapfile.csv#L2

Reviewed by:    mhorne
MFC after:      3 days
Sponsored by:   Stormshield
Differential Revision:  https://reviews.freebsd.org/D49126

(cherry picked from commit 601925180df4d165f4c2c4dc91a49da7b9f3438b)
DeltaFile
+3-0lib/libpmc/pmu-events/arch/x86/mapfile.csv
+3-01 files

FreeBSD/src fde4382 — sys/dev/acpica/Osd OsdSchedule.c

acpi: Tasks: Precisely report the maximum number of slots used

To this end, store the actual number of busy slots instead of the index
of the final slot selected (off by one), and fix races when updating
'acpi_tasks_hiwater'.

The race is that it could happen that a first thread enqueued a task at
a higher index than the current maximum, followed by a second one
enqueuing at some even higher index, with the first thread updating
'acpi_tasks_hiwater' while the second was exactly after the 'if (i >
acpi_tasks_hiwater)' but just before attempting the atomic_cmpset_int()
that updates 'acpi_task_hiwater', which then would fail silently (the
return value was ignored) leading to the real maximum not being
recorded.

Fix the race by simply testing the return value of atomic_cmpset_int()
and retrying.  Use an explicit atomic_load_int() for the guard (that
compiles to a regular load, so this change is cosmetic).


    [6 lines not shown]
DeltaFile
+6-3sys/dev/acpica/Osd/OsdSchedule.c
+6-31 files

FreeBSD/src 3bc37e2 — sys/dev/dwc if_dwc.h

dwc: fix DEBUG macro name

It conflicts with the general "DEBUG" macro defined as an option in LINT
builds. Since this is actually unused, just rename it to GMAC_DEBUG.

Reviewed by:    manu
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D44102

(cherry picked from commit fae39d8da9d5ddf4239fc2143522340c941f6612)
DeltaFile
+1-1sys/dev/dwc/if_dwc.h
+1-11 files

FreeBSD/src 25a9d3c — sys/dev/hwpmc hwpmc_amd.c

hwpmc_amd: simplify counter descriptor definitions

No functional change intended.

Reviewed by:    jkoshy
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D41273

(cherry picked from commit 75780146d627ff4be978191a142da4d67be5aaa6)
DeltaFile
+30-177sys/dev/hwpmc/hwpmc_amd.c
+30-1771 files

FreeBSD/src 45fb644 — sys/dev/hwpmc hwpmc_amd.c

hpwmc_amd.c: style improvements

 - Return style
 - Explicit value checks
 - Whitespace formatting
 - Comment formatting
 - Local variable declaration order
 - __unused annotations

Reviewed by:    jkoshy
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D41272

(cherry picked from commit d9e3fe3226624c391a80b623d844bb578888cec3)
DeltaFile
+117-165sys/dev/hwpmc/hwpmc_amd.c
+117-1651 files

FreeBSD/src ad4a0d6 — sys/dev/hwpmc hwpmc_uncore.c hwpmc_core.c

hwpmc: tidy pcd_finalize methods

Make them a little bit more consistent with one another in terms of what
is done:
 - Add/reduce assertions to what is most useful: a loop to ensure
   pcpu_fini freed everything
 - Add PMCDBG trace entries

The exception is the dmc620/cmn600 classes, which behave a little
differently, so leave them untouched.

Reviewed by:    jkoshy
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D41270

(cherry picked from commit 90a6ea5ca0b1b578e265d2479511bd04347f9510)
DeltaFile
+4-28sys/dev/hwpmc/hwpmc_amd.c
+2-8sys/dev/hwpmc/hwpmc_tsc.c
+2-7sys/dev/hwpmc/hwpmc_soft.c
+5-0sys/dev/hwpmc/hwpmc_powerpc.c
+4-0sys/dev/hwpmc/hwpmc_uncore.c
+4-0sys/dev/hwpmc/hwpmc_core.c
+21-432 files not shown
+29-438 files

FreeBSD/src 554b97e — sys/dev/mmc mmc_fdt_helpers.c

mmc_fdt: handle broken-cd property

The documented properties [1] for card-detection are one of:
 - cd-gpios
 - non-removable
 - broken-cd

In cd_setup() we handle the first two, but not the latter, resulting in
a silently undetected card on an affected system.

To work around this, force cd_disabled when broken-cd is specified, so
that the card detect helper function gets to run. A more complete
solution would implement some kind of polling mechanism to detect the
card's presence or removal.

Some variants of the Allwinner D1, such as the Lichee Rv, specify this
property in the mmc0 device node.

[1] sys/contrib/device-tree/Bindings/mmc/mmc-controller.yaml

    [9 lines not shown]
DeltaFile
+11-0sys/dev/mmc/mmc_fdt_helpers.c
+11-01 files

FreeBSD/src 2a868fd — usr.bin/time time.1

time.1: minor cleanup (alignment/macro/spdx)

+ shorter example filename to minimize line wrap
+ standards macro clarifying posix => posix.2
+ align options + tag spdx

Reviewed by:    mhorne
MFC after:      3 days
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/1315

(cherry picked from commit cb18ba9df52df247198c0f41979090686a0f8403)
DeltaFile
+8-4usr.bin/time/time.1
+8-41 files

FreeBSD/src 456bd1f — sys/dev/hwpmc hwpmc_core.h

hwpmc_core: remove two non-existent function prototypes

Reviewed by:    jkoshy
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D41271

(cherry picked from commit 440e7cb4aca9b6f5662ab492bd016d8ed0f85da0)
DeltaFile
+0-2sys/dev/hwpmc/hwpmc_core.h
+0-21 files

FreeBSD/src 00f021e — share/man/man9 kern_reboot.9

kern_reboot(9): belatedly bump .Dd

Fixes:  4e78a766f607 ("kern_reboot(): don't clear kdb_active")
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit ae9437671a1569bb90305996416d3a40e77c2f05)
DeltaFile
+1-1share/man/man9/kern_reboot.9
+1-11 files

FreeBSD/src 7b76697 — usr.bin/lock lock.1

lock.1: align options + tag spdx

Reviewed by:    imp, mhorne
MFC after:      3 days
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1522

(cherry picked from commit 3ef9e138dd8b70879ba91d84ac623baa0d4b6c91)
DeltaFile
+4-1usr.bin/lock/lock.1
+4-11 files

FreeBSD/src c9e6bc3 — lib/libc/sys mq_open.2

mq_open(2): document sysctl limit EINVAL and ENFILE conditions

Document two missing error conditions for mq_open(2):

- EINVAL: returned when mq_maxmsg exceeds kern.mqueue.maxmsg or
  mq_msgsize exceeds kern.mqueue.maxmsgsize.
- ENFILE: add kern.mqueue.maxmq sysctl name to the existing entry.

PR:             243209
Reviewed by:    mhorne
MFC after:      1 week
Signed-off-by:  Kit Dallege <xaum.io at gmail.com>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2098

(cherry picked from commit 3e9f4fd6fc50300d052d5619d82a14d3488483d5)
DeltaFile
+22-1lib/libc/sys/mq_open.2
+22-11 files

FreeBSD/src a4d5853 — sys/amd64/amd64 pmap.c

amd64: use pc_is_full() helper function

This seems to have been missed in a few places. No functional change
intended.

Reviewed by:    kib
MFC after:      1 week
Fixes:  4d90a5afc51b ("sys: Consolidate common implementation details...")
Differential Revision:  https://reviews.freebsd.org/D45920

(cherry picked from commit e7f849e25bbca9a74c9d3a5b633f9cd01ba95a55)
DeltaFile
+3-5sys/amd64/amd64/pmap.c
+3-51 files

FreeBSD/src 067161c — sys/dev/acpica/Osd OsdSchedule.c

acpi: Tasks: Ensure sane values for number of tasks and threads

Make sure that these are set to sane values even on silly tunables:
- There must be at least one thread to process the 'acpi_taskq'.
- Use the ACPI_MAX_TASKS default when a negative number of tasks was
  specified. This avoids common pilot errors causing a bogus huge memory
  allocation for acpi_tasks[].

Reviewed by:    obiwac (older version)
Differential Revision:  https://reviews.freebsd.org/D60373
DeltaFile
+10-0sys/dev/acpica/Osd/OsdSchedule.c
+10-01 files

FreeBSD/src ee417f9 — sys/dev/acpica/Osd OsdSchedule.c

acpi: Tasks: Use M_WAITOK to allocate the taskqueue

Memory failure at this point normally does not happen except if the
kernel is running on a machine with a too tiny amount of memory, in
which case it is likely to panic or to be unusable anyway.  However,
letting it panic here with a NULL pointer dereference is not very
helpful.  Instead, use M_WAITOK, hoping the memory allocator itself will
indicate the low memory condition if it cannot succeed (if it does not,
it should be changed to).

Reviewed by:    obiwac
Differential revision:  https://reviews.freebsd.org/D60379
DeltaFile
+1-1sys/dev/acpica/Osd/OsdSchedule.c
+1-11 files

FreeBSD/src 67f3eac — share/man/man9 callout.9, sys/kern kern_timeout.c

callout: optionally spread callouts to all CPUs

By default, if the caller has not used one of the _on() or _cpucpu()
variants of the callout API, the system assigns the callout to CPU0.

Having most callouts running on CPU0 can be problematic in terms of
the amount of CPU time spent executing callouts can have an unfair
impact to CPU0, and a critical callout (like lacp_tick) is certain
to land on the same CPU as everything else, so it is more likely
to be delayed.

This change introduces a change to callout_init* where if
kern.callout_spread is non-zero, callouts initialized after SMP startup
are distributed among CPUs.

This is left as disabled by default, as it may reveal any latent
synchronization bugs that were previously hidden, e.g., two callout handlers
which were always accidentally serialized against each other before may now
run concurrently.  It also may cause a slight increase in power consumption

    [6 lines not shown]
DeltaFile
+8-2share/man/man9/callout.9
+7-2sys/kern/kern_timeout.c
+15-42 files

FreeBSD/src d03e991 — sys/dev/virtio/network if_vtnet.c

vtnet: honor the advertised MTU limit on attach

When VIRTIO_NET_F_MTU is negotiated, virtio_net_config.mtu specifies
the maximum MTU the driver may use. vtnet_ioctl_mtu() enforces this
limit for subsequent MTU changes, but ether_ifattach() unconditionally
initializes the interface MTU to ETHERMTU (1500).

So a device advertising a maximum below 1500 starts with an MTU above
its limit. So make sure to set the initial MTU no larger than
vtnet_max_mtu. That is, for vtnet_max_mtu less than 1500
interface MTU will be set to this value, otherwise the current behaviour
is preserved, MTU will be set to 1500.

Reviewed by:    kfv, tuexen
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D60980

(cherry picked from commit 0974ef03b43f279f16289ad4d5be3a03923983ea)
DeltaFile
+2-0sys/dev/virtio/network/if_vtnet.c
+2-01 files