FreeBSD/src b197af2 — libexec/rtld-elf/powerpc rtld_start.S, libexec/rtld-elf/powerpc64 rtld_start.S

rtld: add .cfi_undefined lr to rtld_start.S on powerpc*

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

(cherry picked from commit c4fde87a3236b500246d4fce76dbca2a3d64f73a)
(cherry picked from commit aaa1abfc0ba6b366ef7fe48f70040f3a5b3e6b0c)
DeltaFile
+1-0libexec/rtld-elf/powerpc64/rtld_start.S
+1-0libexec/rtld-elf/powerpc/rtld_start.S
+2-02 files

FreeBSD/src a283b70 — sys/powerpc/aim locore64.S trap_subr64.S, sys/powerpc/include pcpu.h

powerpc64: give each CPU its own KDB trap stack

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


    [2 lines not shown]
DeltaFile
+27-0sys/powerpc/aim/aim_machdep.c
+0-7sys/powerpc/aim/locore64.S
+3-4sys/powerpc/aim/trap_subr64.S
+2-1sys/powerpc/include/pcpu.h
+1-0sys/powerpc/powerpc/genassym.c
+33-125 files

FreeBSD/src b1b2b22 — tests/sys/kern Makefile sigreturn_fpregs_ppc64.S

tests/sys/kern: stress FP registers across sigreturn on powerpc64

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

(cherry picked from commit 35a226dded9934c6beb5945a982a705712454be1)
(cherry picked from commit 8d3658947030aedf037e2f7b48c313049eddc7ff)
DeltaFile
+233-0tests/sys/kern/sigreturn_fpregs.c
+175-0tests/sys/kern/sigreturn_fpregs_ppc64.S
+6-0tests/sys/kern/Makefile
+414-03 files

FreeBSD/src ad0f866 — usr.bin/find find.1

find.1: rewrite the -s flag section for clarity

Restructure the description of -s flag:
1. what the option does
2. why it is useful (deterministic order, streaming output)
3. how its results can differ from `find | sort'

Reviewed by: ziaee
MFC after: 3 days
DeltaFile
+31-10usr.bin/find/find.1
+31-101 files

FreeBSD/src 268e7c2 — sys/powerpc/aim locore64.S trap_subr64.S, sys/powerpc/include pcpu.h

powerpc64: give each CPU its own KDB trap stack

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

(cherry picked from commit eaaf838e33042ed3f282a5cdf8e1260e78d4989b)
DeltaFile
+27-0sys/powerpc/aim/aim_machdep.c
+0-7sys/powerpc/aim/locore64.S
+3-4sys/powerpc/aim/trap_subr64.S
+2-1sys/powerpc/include/pcpu.h
+1-0sys/powerpc/powerpc/genassym.c
+33-125 files

FreeBSD/src aaa1abf — libexec/rtld-elf/powerpc rtld_start.S, libexec/rtld-elf/powerpc64 rtld_start.S

rtld: add .cfi_undefined lr to rtld_start.S on powerpc*

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

(cherry picked from commit c4fde87a3236b500246d4fce76dbca2a3d64f73a)
DeltaFile
+1-0libexec/rtld-elf/powerpc64/rtld_start.S
+1-0libexec/rtld-elf/powerpc/rtld_start.S
+2-02 files

FreeBSD/src 8d36589 — tests/sys/kern Makefile sigreturn_fpregs_ppc64.S

tests/sys/kern: stress FP registers across sigreturn on powerpc64

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

(cherry picked from commit 35a226dded9934c6beb5945a982a705712454be1)
DeltaFile
+233-0tests/sys/kern/sigreturn_fpregs.c
+175-0tests/sys/kern/sigreturn_fpregs_ppc64.S
+6-0tests/sys/kern/Makefile
+414-03 files

FreeBSD/src 9c67d6e — sys/netinet6 in6_pcb.c

inpcb: inp_next() never returns a freed inpcb
DeltaFile
+0-2sys/netinet6/in6_pcb.c
+0-21 files

FreeBSD/src 49548ea — sys/netinet udp_usrreq.c

udp: in_pcblookup() never returns a freed inpcb
DeltaFile
+1-2sys/netinet/udp_usrreq.c
+1-21 files

FreeBSD/src abb8b02 — sys/netinet6 icmp6.c

icmp6: make icmp6_notify_error() more readable

Remove a level of indentation, improve line breaks, remove single use
variables.  No functional change.
DeltaFile
+146-159sys/netinet6/icmp6.c
+146-1591 files

FreeBSD/src 331333b — sys/netpfil/ipfw ip_fw_dynamic.c

ipfw: hold sleepable "upper half lock" for periodic state expiry

The state expiration may lead to freeing rules, which requires this lock.
Since the lock is sleepable, move the expiry routine from callout context
to a taskqueue.  This also should have a positive effect of not running
expensive function as a callout.

Fixes:  e3caa360d5d0a73af0de1d293d5b8ff6e900ceb4

Reviewed by:            pouria
Differential Revision:  https://reviews.freebsd.org/D60869
DeltaFile
+12-9sys/netpfil/ipfw/ip_fw_dynamic.c
+12-91 files

FreeBSD/src 7146ad0 — sys/netinet in_kdtrace.h in_kdtrace.c, sys/netinet/tcp_stacks bbr.c rack.c

tcp: refactor tcp_autosndbuf() and associated sysctls

Rename tcp_sndbuf_autoscale() to tcp_autosndbuf().  This matches
complementary tcp_autorcvbuf() that was factored out as a separate
function a few months before tcp_sndbuf_autoscale() was.  Move the large
comment to the header of the function.  Use unsigned types for all sizing
sysctls and variables and use bool for the switching sysctl.  Add a
comment above net.inet.tcp.sendbuf_auto_lowat (default to off) providing a
reference to its origins.  Add DTrace probe tcp::send-autoresize,
complementary to the existing tcp::receive-autoresize.

Rack has its own function, just enable the DTrace probe there.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D60732
DeltaFile
+69-71sys/netinet/tcp_output.c
+5-5sys/netinet/tcp_var.h
+4-1sys/netinet/tcp_stacks/rack.c
+4-0sys/netinet/in_kdtrace.c
+1-1sys/netinet/tcp_stacks/bbr.c
+1-0sys/netinet/in_kdtrace.h
+84-786 files

FreeBSD/src 04cd9bc — sys/netinet tcp_usrreq.c in_kdtrace.c, sys/netinet/tcp_stacks bbr.c rack.c

tcp: refactor tcp_autorcvbuf() and associated sysctls

Run the entire function under the socket buffer lock.  Make it responsible
to set the new limit or clear SB_AUTOSIZE in case of a failure.  Use
unsigned type for newsize, that matches both the sb_hiwat type and min()
argument types.  Make byte counter in the tcpcb unsigned, too.  Make the
sizing tunables unsigned, and make the switching tunable a boolean.  Don't
execute Dtrace probe in case of a failure.  Simplify the Dtrace probe to
report only relevant information, the previous probe looked more like a
leftover from a debugging session.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D60731
DeltaFile
+23-27sys/netinet/tcp_input.c
+3-17sys/netinet/tcp_stacks/rack.c
+1-10sys/netinet/tcp_stacks/bbr.c
+5-6sys/netinet/tcp_var.h
+2-6sys/netinet/in_kdtrace.c
+1-1sys/netinet/tcp_usrreq.c
+35-676 files

FreeBSD/src 0a9e5c6 — sbin/ping/tests ping_test.sh

tests/ping: Fix date(1) invocations

Fixes:  069681afd58a ("ping: use CLOCK_REALTIME for ICMP Originate Timestamp")
(cherry picked from commit 667dd9eafa4d5352efdfcdc1a9e228c23fbc60f5)
DeltaFile
+2-2sbin/ping/tests/ping_test.sh
+2-21 files

FreeBSD/src 6c604ba — sbin/ping ping.c, sbin/ping/tests ping_test.sh

ping: use CLOCK_REALTIME for ICMP Originate Timestamp

RFC 792 defines the ICMP Originate Timestamp field as milliseconds
since midnight UTC.  However, ping(8) currently derives this value
from CLOCK_MONOTONIC, which represents time since an unspecified
starting point and is not related to UTC.

The issue was introduced by commit 1ad76f1b6047, which replaced
gettimeofday(2) with clock_gettime(CLOCK_MONOTONIC) for timekeeping
in ping(8).

Fix this by using CLOCK_REALTIME when generating the ICMP originate
timestamp.

Before:

$ ping -Mt -c1 127.0.0.1
ICMP_TSTAMP
PING 127.0.0.1 (127.0.0.1): 56 data bytes

    [17 lines not shown]
DeltaFile
+35-0sbin/ping/tests/ping_test.sh
+8-1sbin/ping/ping.c
+43-12 files

FreeBSD/src 49f56f3 — sbin/ping/tests ping_test.sh

ping: fix test timestamp_origin when tstamprepl is disabled

The timestamp_origin test sends an ICMP Timestamp Request (ping -Mt) and parses
the tso/tsr fields out of the reply.
When the sysctl net.inet.icmp.tstamprepl is 0, the kernel silently drops the
request, ping receives no reply, and the sed extraction yields an empty $tso.
The test then fails inside atf_check test -n "$tso" with the unhelpful message

Approved by:    maxim
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D57287

(cherry picked from commit ff873565bc2c3e47fe1d070305aa851189ee8bcf)
DeltaFile
+15-1sbin/ping/tests/ping_test.sh
+15-11 files

FreeBSD/src 4292233 — sbin/ping ping.c, sbin/ping/tests test_ping.py

ping: do a better job with what we received from the net, part 2

When we see a difference between the payload we sent and what we
received, we dump both but we were not prepared for the case when
the received payload is less than we sent.  In this case we were trying
to dump more than needed.

Funny enough, 23 years ago I already fixed a similar issue here but
didn't pay attention to this small dumping loop.

Test written by jlduran.

Reviewed by:    jlduran
MFC after:      1 month
Found with:     Claude Code Sonnet 5

Differential Revision: https://reviews.freebsd.org/D59556
Differential Revision: https://reviews.freebsd.org/D59582

(cherry picked from commit 0b9434d707c71de7b1b62e400e6e780224f0384d)
DeltaFile
+39-1sbin/ping/tests/test_ping.py
+4-2sbin/ping/ping.c
+43-32 files

FreeBSD/src 43e0c9c — sbin/ping ping.c

ping: do a better job checking what we receive from the net

- zero out a buffer for the incoming icmp message that
  we are about to parse
- for ICMP_MASKREPLY and ICMP_TSTAMPREPLY responses check their length
  and warn and reject them if they are truncated

Without these checks a part of stack allocated struct icmp icp could
be printed out which seems low severity since we already dropped root
privileges by the time icp is allocated.

Reviewed by:    glebius
MFC after:      1 month
Found with:     Claude Code Sonnet 5

Differential Revision: https://reviews.freebsd.org/D59555

(cherry picked from commit aa6683207d189a0b58ccf8806bd9f8793914bc45)
DeltaFile
+15-0sbin/ping/ping.c
+15-01 files

FreeBSD/src da04cf0 — usr.bin/mkimg mkimg.c

mkimg: Ignore redundant %align values

Partitions are trivially aligned to sector boundaries, so asking e.g.
for a partition to be aligned to a 64-byte boundary is pointless but
harmless.  Treat it as such, with a warning (in case the request was
a mistake, e.g. requesting 1-byte instead of 1M-byte alignment) rather
than as an error.

Reviewed by:    markj
Suggested by:   markj
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60819
DeltaFile
+9-1usr.bin/mkimg/mkimg.c
+9-11 files

FreeBSD/src 5774911 — release/tools ec2.conf

EC2: Align partitions to 1 MB boundaries

Reviewed by:    jlduran, imp
MFC after:      2 months
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60455
DeltaFile
+4-0release/tools/ec2.conf
+4-01 files

FreeBSD/src f46269a — release/tools vmimage.subr

vmimage.subr: Support partition alignment

If VM_PARTALIGN is set, pass %${VM_PARTALIGN} to mkimg in the
specification of swap, config, root, and ESP partitions.  (Boot
partitions are not aligned, both because they're small and in
case firmware makes assumptions about their locations.)

Reviewed by:    lwhsu, imp
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60454
DeltaFile
+11-7release/tools/vmimage.subr
+11-71 files

FreeBSD/src 1485ee7 — usr.bin/mkimg mkimg.c

mkimg: Remove duplicate variable assignment

Fixes:  459a61fd2d0a ("Add the ability to specify absolute and relative offsets to size partitions.")
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60452
DeltaFile
+0-1usr.bin/mkimg/mkimg.c
+0-11 files

FreeBSD/src 0f787e8 — . Makefile.inc1, sys/sys param.h

__FreeBSD_version: Bump for mkimg %align feature

MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60453
DeltaFile
+2-3Makefile.inc1
+1-1sys/sys/param.h
+3-42 files

FreeBSD/src b063ea6 — usr.bin/mkimg mkimg.1

mkimg.1: Document new %align mechanism

Reviewed by:    imp (earlier version)
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60451
DeltaFile
+21-3usr.bin/mkimg/mkimg.1
+21-31 files

FreeBSD/src 9bc2baa — sys/dev/mii smscphy.c miidevs

mii: Fix SMSC name

The LAN8700 / LAN8710 PHYs were Standard Microsystems Corporation parts,
which early on used SMC as an abbreviation but they were using SMSC when
they were exclusively an IC maker (as opposed to full add-in NICs).

SMSC was acquired by Microchip in 2012.  I kept the pre-acquisition
name, as NetBSD (from where we obtained miidevs) uses SMSC.

Reviewed by:    adrian
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56819

(cherry picked from commit 89c883c09ab5e0fdca7ac5dfe74fcc46b7669eb5)
(cherry picked from commit f2f67df8c92b51d0bff9c226755cd31c8d685573)
DeltaFile
+4-4sys/dev/mii/miidevs
+2-2sys/dev/mii/smscphy.c
+6-62 files

FreeBSD/src 8a6a769 — sys/dev/sound/pcm mixer.c

sound: Use GID_WHEEL/0666 instead of GID_AUDIO/0660 to create the mixer cdev

This change got accidentally carried over after an MFC, because in all
audio devices are now created with GID_AUDIO/0660 in -CURRENT.

Fixes:          2b61245f5a16 ("sound: Simplify how snd_mixer is fetched and how the cdev is created")
PR:             299683
Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-2sys/dev/sound/pcm/mixer.c
+2-21 files

FreeBSD/src 729883c — usr.bin/mkimg mkimg.c

mkimg: Add per-partition alignment

This adds a "%align" field to partition specifications, resulting in
the start of a partition being shifted to the next aligned position.
When both :offset and %align are used, a relative offset is treated as
a minimum value, while an unaligned absolute offset is an error.

Reviewed by:    imp (earlier version)
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60450
DeltaFile
+50-12usr.bin/mkimg/mkimg.c
+50-121 files

FreeBSD/src e7f84fe — usr.bin/mkimg mkimg.c

mkimg: Don't ignore invalid partition offsets

When handling PART_KIND_FILE, the "error" variable is set to reflect
any errors in parsing the specified offset; but that value is then
overwritten by the return value of image_copyin.

Error out immediately instead.  Note that it is not necessary to change
the code in PART_KIND_SIZE which parses the size, since in that case we
do not overwrite the value in "error".

Fixes:          8f3c71c85e5f ("mkimg: Add support for offset if the source is an image")
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60422
DeltaFile
+1-1usr.bin/mkimg/mkimg.c
+1-11 files

FreeBSD/src 38407c4 — usr.bin/mkimg vmdk.c

mkimg: Use reallocf

Reviewed by:    ngie
Suggested by:   ngie
Improves:       1a0523197c5c ("mkimg: Check for realloc failure")
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60419
DeltaFile
+2-5usr.bin/mkimg/vmdk.c
+2-51 files

FreeBSD/src c6d7a24 — contrib/unbound/services mesh.c outside_network.c, contrib/unbound/util/data dname.c msgparse.c

unbound: Update to 1.26.2

Release notes at
    https://community.nlnetlabs.nl/t/unbound-1-26-2-released

Merge commit 'ce3304d97ba4861eabac759e538426a568aef0a5'

Security:       CVE-2026-35501
Security:       CVE-2026-50106
Security:       CVE-2026-96405
Security:       CVE-2026-97206
Security:       CVE-2026-109125
DeltaFile
+40-21contrib/unbound/util/data/msgparse.c
+35-21contrib/unbound/services/authzone.c
+55-0contrib/unbound/util/data/dname.c
+45-0contrib/unbound/services/outside_network.c
+30-10contrib/unbound/services/mesh.c
+16-12contrib/unbound/validator/validator.c
+221-6424 files not shown
+317-11630 files