FreeBSD/src 4e50611 — lib/libc/stdio printf-pos.c, lib/libc/tests/stdio swprintf_test.c snprintf_test.c

stdio: Fix positional %wN / %wfN conversion

MFC after:      1 week
Fixes:          bce0bef3c6ab ("libc: Implement N2680.")
Fixes:          12b1c1e3fb44 ("libc: Add test cases for N2680.")

(cherry picked from commit 5e809bf1c93fdc4c52fa46a7eb0e6f881b6c6140)
DeltaFile
+68-0lib/libc/stdio/printf-pos.c
+8-0lib/libc/tests/stdio/swprintf_test.c
+8-0lib/libc/tests/stdio/snprintf_test.c
+84-03 files

FreeBSD/src 658c3d5 — lib/libc/stdio printf-pos.c, lib/libc/tests/stdio swprintf_test.c snprintf_test.c

stdio: Fix error case for positional %wN / %wfN

In the case were N was not a valid bit width, we were taking the wrong
error path.

Fixes:          5e809bf1c93f ("stdio: Fix positional %wN / %wfN conversion")
(cherry picked from commit 0bf5d86620d047b4551d7414bf8011a328264b3d)
DeltaFile
+2-2lib/libc/stdio/printf-pos.c
+2-0lib/libc/tests/stdio/swprintf_test.c
+2-0lib/libc/tests/stdio/snprintf_test.c
+6-23 files

FreeBSD/src dd5393b — lib/libc/stdio printf-pos.c, lib/libc/tests/stdio swprintf_test.c snprintf_test.c

stdio: Fix positional %F conversion

When a format uses positional arguments, __find_arguments() walks it
first to learn the type of every argument, and lists the floating
point conversions as A a E e f G g.  F is missing, so a double that
is only referred to through %F never gets a type, its slot in the
argument table stays unset, and the conversion reads whatever is
there:

    printf("[%1$F]\n", -INFINITY);   [0.000000]
    printf("[%1$F]\n", 1.5);         [0.000000]
    printf("[%F]\n", 1.5);           [1.500000]

With a width taken from another argument, "%1$*2$F", vsnprintf(3)
returned lengths like 2103024 for a ten character result; abseil's
str_format test allocates that much and was killed for it on
FreeBSD.  The same format with %1$f, or with any other conversion of
the same argument, works because those give it a type.


    [9 lines not shown]
DeltaFile
+8-6lib/libc/stdio/printf-pos.c
+13-0lib/libc/tests/stdio/swprintf_test.c
+13-0lib/libc/tests/stdio/snprintf_test.c
+34-63 files

FreeBSD/src 4d9de0f — contrib/llvm-project/clang/lib/Headers arm_acle.h

clang: Fix warnings in ARM GCS ACLE header

Including <arm_acle.h> in C code compiled with -Wstrict-prototypes
results in warnings (or errors if -Werror is in effect) due to missing
parameter lists for __gcspr() and __gcspopm().

Submitted upstream as PR#242286.

MFC after:      1 week
Reported by:    Pete French <pete at twisted.org.uk>
Reviewed by:    dim
Differential Revision:  https://reviews.freebsd.org/D61503

(cherry picked from commit 74d72b3491e810068313e49629c3b8fe46f29318)
DeltaFile
+2-2contrib/llvm-project/clang/lib/Headers/arm_acle.h
+2-21 files

FreeBSD/src d298fd5 — lib/libc/stdio printf-pos.c, lib/libc/tests/stdio swprintf_test.c snprintf_test.c

stdio: Fix positional %B / %b conversion

MFC after:      1 week
Fixes:          d9dc1603d6e4 ("libc: Implement N2630.")
Fixes:          b9385720f34b ("libc: Add unit tests for N2630 and possible collateral damage.")

(cherry picked from commit 0e3fce268adeec8f4c87b99759dae6a592b3d365)
DeltaFile
+10-0lib/libc/stdio/printf-pos.c
+2-0lib/libc/tests/stdio/swprintf_test.c
+2-0lib/libc/tests/stdio/snprintf_test.c
+14-03 files

FreeBSD/src 1d8c4da — lib/libc/stdio printf-pos.c, lib/libc/tests/stdio swprintf_test.c snprintf_test.c

stdio: Fix positional %wN / %wfN conversion

MFC after:      1 week
Fixes:          bce0bef3c6ab ("libc: Implement N2680.")
Fixes:          12b1c1e3fb44 ("libc: Add test cases for N2680.")

(cherry picked from commit 5e809bf1c93fdc4c52fa46a7eb0e6f881b6c6140)
DeltaFile
+68-0lib/libc/stdio/printf-pos.c
+8-0lib/libc/tests/stdio/swprintf_test.c
+8-0lib/libc/tests/stdio/snprintf_test.c
+84-03 files

FreeBSD/src 902b9ce — lib/libgeom geom_ctl.c

libgeom: Open the control device read-write

Try to open the control device read-write first, and fall back to
read-only if that fails and the error is EACCES.  This prepares us for a
future in which GEOM requires write access to execute verbs that modify
the configuration.

MFC after:      1 week
Event:          EuroBSDCon 2026 DevSummit
Reviewed by:    imp, markj, emaste
Differential Revision:  https://reviews.freebsd.org/D59592

(cherry picked from commit 1e9e198b7f064322687746d26b283c3fcbad4579)
DeltaFile
+5-3lib/libgeom/geom_ctl.c
+5-31 files

FreeBSD/src 628422c — sys/geom geom_ctl.c, sys/sys priv.h

geom: Check file flags before handling control request

Pass fflag down to g_ctl_req() and:

* Refuse all requests unless fflag has the FREAD bit set

* Refuse all but getxml unless fflag also has the FWRITE bit set

This should allow us to restore read access to /dev/geom.ctl for group
operator; they will then be able to run `gpart list` or `gpart backup`
but not commands that actually modify the table.

For backward compatibility, we set the FWRITE bit if it is not already
set and the calling thread has the PRIV_GEOM privilege, which is
automatically granted to a jailed or unjailed superuser.  This should
cover the case of older binaries (which open /dev/geom.ctl read-only)
running as root on a newer kernel.  Since we intend to merge this to
stable/15, the compatibility code is conditional on COMPAT_FREEBSD14.


    [6 lines not shown]
DeltaFile
+38-8sys/geom/geom_ctl.c
+1-0sys/sys/priv.h
+39-82 files

FreeBSD/src 24a13dd — lib/libc/stdio printf-pos.c, lib/libc/tests/stdio swprintf_test.c snprintf_test.c

stdio: Fix error case for positional %wN / %wfN

In the case were N was not a valid bit width, we were taking the wrong
error path.

Fixes:          5e809bf1c93f ("stdio: Fix positional %wN / %wfN conversion")
(cherry picked from commit 0bf5d86620d047b4551d7414bf8011a328264b3d)
DeltaFile
+2-2lib/libc/stdio/printf-pos.c
+2-0lib/libc/tests/stdio/swprintf_test.c
+2-0lib/libc/tests/stdio/snprintf_test.c
+6-23 files

FreeBSD/src fe976f2 — contrib/llvm-project/clang/lib/Headers arm_acle.h

clang: Fix warnings in ARM GCS ACLE header

Including <arm_acle.h> in C code compiled with -Wstrict-prototypes
results in warnings (or errors if -Werror is in effect) due to missing
parameter lists for __gcspr() and __gcspopm().

Submitted upstream as PR#242286.

MFC after:      1 week
Reported by:    Pete French <pete at twisted.org.uk>
Reviewed by:    dim
Differential Revision:  https://reviews.freebsd.org/D61503

(cherry picked from commit 74d72b3491e810068313e49629c3b8fe46f29318)
DeltaFile
+2-2contrib/llvm-project/clang/lib/Headers/arm_acle.h
+2-21 files

FreeBSD/src 65ea18b — lib/libc/stdio printf-pos.c, lib/libc/tests/stdio swprintf_test.c snprintf_test.c

stdio: Fix positional %B / %b conversion

MFC after:      1 week
Fixes:          d9dc1603d6e4 ("libc: Implement N2630.")
Fixes:          b9385720f34b ("libc: Add unit tests for N2630 and possible collateral damage.")

(cherry picked from commit 0e3fce268adeec8f4c87b99759dae6a592b3d365)
DeltaFile
+10-0lib/libc/stdio/printf-pos.c
+2-0lib/libc/tests/stdio/swprintf_test.c
+2-0lib/libc/tests/stdio/snprintf_test.c
+14-03 files

FreeBSD/src c646af9 — lib/libc/stdio printf-pos.c, lib/libc/tests/stdio swprintf_test.c snprintf_test.c

stdio: Fix positional %F conversion

When a format uses positional arguments, __find_arguments() walks it
first to learn the type of every argument, and lists the floating
point conversions as A a E e f G g.  F is missing, so a double that
is only referred to through %F never gets a type, its slot in the
argument table stays unset, and the conversion reads whatever is
there:

    printf("[%1$F]\n", -INFINITY);   [0.000000]
    printf("[%1$F]\n", 1.5);         [0.000000]
    printf("[%F]\n", 1.5);           [1.500000]

With a width taken from another argument, "%1$*2$F", vsnprintf(3)
returned lengths like 2103024 for a ten character result; abseil's
str_format test allocates that much and was killed for it on
FreeBSD.  The same format with %1$f, or with any other conversion of
the same argument, works because those give it a type.


    [9 lines not shown]
DeltaFile
+8-6lib/libc/stdio/printf-pos.c
+13-0lib/libc/tests/stdio/swprintf_test.c
+13-0lib/libc/tests/stdio/snprintf_test.c
+34-63 files

FreeBSD/src d6f99f6 — sys/vm swap_pager.c

swapoff: don't leak vnode pointer to device

After looking up the device path, we compare the vnode to the vnode of
each swap device.  Prior to this change we leaked a vnode reference to
the device we're trying to remove from the swap pool.

Effort:         CHERI upstreaming
Reviewed by:    kib, markj
Reported by:    llm-postcr
MFC after:      3 days
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D61464

(cherry picked from commit 9506d8e0b1788068cbd4c2cbc984cb6ee0dcb0ab)
DeltaFile
+1-0sys/vm/swap_pager.c
+1-01 files

FreeBSD/src 3f10dc8 — sys/vm swap_pager.c

swapoff: release vnode held since swapon

kern_swapon looks up the proposed swap path and aquires a vnode which is
held (unlocked) throughout the life of the swap device.  In the device
case (swapgeom) it was never released in the swapoff path.

Remove an incorrect comment about swapgeom_close being called from
biodone.  It is only called directly via swapoff(2) or at the end of the
shutdown path.

Reviewed by:    kib, markj
Reported by:    llm-postcr
MFC after:      3 days
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D61465

(cherry picked from commit 933f5f616a8a44b7af6cdccecf959ef1e8bab66e)
DeltaFile
+6-5sys/vm/swap_pager.c
+6-51 files

FreeBSD/src 132cc5c — sys/net/route nhop.h route_var.h

routing: Sort the nexthops of a group by metric

Sort the nexthops of a group by metric first and by index second,
and keep the metric of each nexthop in the unused storage field.

The nexthops with the lowest metric are the first ones in the array.

The group is sized and compiled from them without visiting every
nexthop for its metric, and the metric argument of these functions
goes away.

decompose_change_notification() walks two groups in their sort
order, so make it use the same comparison.

Reviewed by:    glebius
Differential Revision:  https://reviews.freebsd.org/D61637
DeltaFile
+49-44sys/net/route/nhgrp_ctl.c
+6-6sys/net/route/route_helpers.c
+1-1sys/net/route/nhop.h
+2-0sys/net/route/route_var.h
+58-514 files

FreeBSD/src b450c1d — sys/net/route nhgrp_ctl.c

routing: Fix the size of nexthop groups with mixed metrics

calc_min_mpath_slots_fast() selects the nexthops with the lowest
metric through wn[i].nh, but reads their weights from wn[i].storage,
a copy of the weights that is sorted independently of the nexthops.
In a group with more than one metric the weights of the wrong
nexthops are summed, and the weights of all nexthops take part in
the divisibility check, so the group gets a wrong number of slots
and a wrong traffic split.

Calculate the number of slots as the sum of the weights divided by
their greatest common divisor instead.  It needs no sorted copy of
the weights and is exact where the old code gave up and used
RIB_MAX_MPATH_WIDTH slots.

The storage field is part of the bytes that identify a group.  It is
no longer written by the calculation, so set it to zero.

Reviewed by:    glebius

    [2 lines not shown]
DeltaFile
+33-77sys/net/route/nhgrp_ctl.c
+33-771 files

FreeBSD/src bf362c1 — sys/sys kobj.h, sys/tools makeobjops.awk

kobj: convert KOBJOPLOOKUP() to returning pointer to function

This makes KOBJOPLOOKUP() rather more suitable for purposes outside the
macros generated by makeobjops.awk. Of note other callers can lookup
the function on their parent class and call that explicitly.

Reviewed by:    zlei
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D48408
DeltaFile
+10-10sys/sys/kobj.h
+3-3sys/tools/makeobjops.awk
+13-132 files

FreeBSD/src 5541489 — sys/dev/sound dummy.c

snd_dummy: Do not use dummy_chan_io() as mpu401's interrupt handler

dummy_chan_io() runs with sc->lock held, but mpu401 calls its handler
from a callout with no mutex associated with it, so writing to the MIDI
device node caused a panic.

Give mpu401 its own handler, and leave MIDI to mpu401's timer instead of
the PCM callout.

Fixes:          e963472ef853 ("snd_dummy: Initial MIDI support")
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit c8d1c94741231d95964b91910880769019478854)
DeltaFile
+10-4sys/dev/sound/dummy.c
+10-41 files

FreeBSD/src 6f80968 — sys/dev/sound/usb uaudio.c

snd_uaudio: Fix the MIDI TX round-robin

Nothing advances curr_cable, so umidi_bulk_write_callback() only
services cable 0, which is a problem on MIDI devices with more than one
jack.

Fixes:          039477d3e7e7 ("snd_uaudio: Simplify chan->curr_cable calculation in uaudio_bulk_write_callback()")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 day

(cherry picked from commit f58613868b50dfd6c2adc7128ea60d7b276fdbf1)
DeltaFile
+2-1sys/dev/sound/usb/uaudio.c
+2-11 files

FreeBSD/src 682a775 — sys/dev/sound/usb uaudio.c

snd_uaudio: Do not touch mixer_lock when there is no mixer

Using the mixer lock unconditionally panics because the lock is
uninitialized on devices with no audio interfaces, for instance
MIDI-only keyboards.

Fixes:          9a00e0b8ca56 ("snd_uaudio: Do not use snd_mixer->lock as mixer_lock")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D61506

(cherry picked from commit dabd959b17597ad790327020a667ced9a05d7499)
DeltaFile
+7-2sys/dev/sound/usb/uaudio.c
+7-21 files

FreeBSD/src 0e64d19 — sys/dev/sound/pci emu10k1.c cmi.c

sound: Remove stale midi module dependencies

midi(4) stopped being a module in 45bb10e0ed5a ("sound: Stop building
midi as a module"), so snd_cmi(4) and snd_emu10k1(4) fail to load
because they still depend on it.

Fixes:          45bb10e0ed5a ("sound: Stop building midi as a module")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 day

(cherry picked from commit 563c2f27e0ffec96a0ddd77b68c7ca6614d704af)
DeltaFile
+0-1sys/dev/sound/pci/emu10k1.c
+0-1sys/dev/sound/pci/cmi.c
+0-22 files

FreeBSD/src 4588b63 — sys/cddl/dev/fbt/powerpc fbt_isa.c

fbt/powerpc: don't instrument the trap entry path

On powerpc an fbt probe is a program interrupt that goes through the
normal trap path, powerpc_interrupt() -> trap() -> dtrace_trap(). A
probe on trap() or powerpc_interrupt() fires again on the way to its
own handler, so it recurses until the kernel stack runs out, and
enabling fbt::trap:entry panics the machine right away.

Skip both functions, like aarch64 and riscv skip their exception
handlers.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D61660
DeltaFile
+7-0sys/cddl/dev/fbt/powerpc/fbt_isa.c
+7-01 files

FreeBSD/src 9a6e1be — usr.sbin/moused/msconvd msconvd.8

msconvd.8: remove double .El (end of list)
DeltaFile
+0-1usr.sbin/moused/msconvd/msconvd.8
+0-11 files

FreeBSD/src 0678edc — usr.sbin/moused/moused moused.8

moused.8: add forgotten end of list .El
DeltaFile
+1-1usr.sbin/moused/moused/moused.8
+1-11 files

FreeBSD/src 30e9c7e — share/man/man7 build.7

build.7: fix macro typo
DeltaFile
+2-2share/man/man7/build.7
+2-21 files

FreeBSD/src 1e2470b — share/man/man4 acpi_einj.4

acpi_einj.4: fix .El (end of list) order
DeltaFile
+1-1share/man/man4/acpi_einj.4
+1-11 files

FreeBSD/src e5c675d — share/man/man7 build.7

build.7: add forgotten end of list .El
DeltaFile
+1-0share/man/man7/build.7
+1-01 files

FreeBSD/src c1664fe — sbin/init init.8

init.8: fix .El (end of list) order

Approved by: kib
Differential Revision: https://reviews.freebsd.org/D61787
DeltaFile
+1-1sbin/init/init.8
+1-11 files

FreeBSD/src 26c14e4 — lib/libsys kexec_load.2

kexec_load.2: add forgotten end of list .El
DeltaFile
+1-0lib/libsys/kexec_load.2
+1-01 files

FreeBSD/src 8033a9e — lib/libsys pdfork.2

pdfork.2: add forgotten end of list .El
DeltaFile
+1-0lib/libsys/pdfork.2
+1-01 files