FreeBSD/src 5233aac — usr.bin/top display.c

top: fix off-by-one in screenbuf

There is a heap overflow for screenbuf originating from
the top import to the tree. The i_process()/u_process() functions
write a terminating NUL one byte past each screenbuf line slot
when the line fills the slot, which is a 1-byte heap overflow on the last slot.

The display_resize() function allocates screen_width bytes per line.
i_process() and u_process() cut lines to screen_width characters and
then stpcpy() them into the slot, which writes screen_width + 1 bytes.
line_update() can do the same with *old = ch. For inner slots,
the NUL lands in byte 0 of the next slot. This can corrupt the saved
contents used when updating the next line. For the last slot, it writes
one byte past the end of screenbuf.

Fix by allocating (screen_width + 1) bytes per line and updating the
line offsets to fit the terminating NUL.

Reviewed by:    kib

    [3 lines not shown]
DeltaFile
+3-3usr.bin/top/display.c
+3-31 files

FreeBSD/src afeeac4 — sys/powerpc/aim mmu_radix.c

powerpc/pmap: Use dcbz to zero pages in the radix pmap

pagezero() was a plain store loop (bzero), which under the kernel build
flags (-mno-vsx -msoft-float) compiles to byte stores.  dcbz
establishes a zeroed cache line directly in the cache without a
read-for-ownership fetch from memory, roughly halving the memory
transactions of page zeroing.

Measured on POWER9 (Raptor Blackbird, DD2.3, bare metal), zeroing a
cold 256 MB buffer with 128-byte scalar loops:

  byte stores (current libkern memset)     8.6 GB/s
  doubleword (std) stores                  26.8 GB/s
  dcbz                                     34.6 GB/s

dcbz raises an alignment interrupt on caching-inhibited mappings, and
the kernel does not emulate it, so mmu_radix_zero_page() falls back to
bzero() for any page whose memattr is not the write-back default.  The
internal pagezero() callers only touch freshly allocated page-table

    [11 lines not shown]
DeltaFile
+16-3sys/powerpc/aim/mmu_radix.c
+16-31 files

FreeBSD/src 870e5b8 — sys/powerpc/aim mmu_radix.c

powerpc/pmap: Use dcbz to zero pages in the radix pmap

pagezero() was a plain store loop (bzero), which under the kernel build
flags (-mno-vsx -msoft-float) compiles to byte stores.  dcbz
establishes a zeroed cache line directly in the cache without a
read-for-ownership fetch from memory, roughly halving the memory
transactions of page zeroing.

Measured on POWER9 (Raptor Blackbird, DD2.3, bare metal), zeroing a
cold 256 MB buffer with 128-byte scalar loops:

  byte stores (current libkern memset)     8.6 GB/s
  doubleword (std) stores                  26.8 GB/s
  dcbz                                     34.6 GB/s

dcbz raises an alignment interrupt on caching-inhibited mappings, and
the kernel does not emulate it, so mmu_radix_zero_page() falls back to
bzero() for any page whose memattr is not the write-back default.  The
internal pagezero() callers only touch freshly allocated page-table

    [11 lines not shown]
DeltaFile
+16-3sys/powerpc/aim/mmu_radix.c
+16-31 files

FreeBSD/src 7d43e93 — sys/kern sched_ule.c

sched_ule: Fix two typos in comments introduced in previous commit

Reported by:    kib
Fixes:          538c48bf6247 ("sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread")
Sponsored by:   The FreeBSD Foundation
DeltaFile
+3-3sys/kern/sched_ule.c
+3-31 files

FreeBSD/src f0798d0 — secure/lib/libcrypto/modules Makefile.inc, secure/lib/libcrypto/modules/legacy Version.map Makefile

openssl: build legacy provider as upstream does

- Build with libcrypto's compile flags: modules/Makefile.inc now
  includes libcrypto's Makefile.inc, which brings in Makefile.common
  (NDEBUG, the asm dispatch defines, OPENSSL_PIC, the directory
  defines).  Before this change, assertions were enabled in legacy.so.
- Use upstream's per-architecture source list: the provider's own CPU
  capability code (cpuid asm and armcap.c/ppccap.c, or mem_clr.c
  without asm), and the MD5, RC4 and DES asm where upstream uses it.
  The provider no longer uses libcrypto's exported RC4, SHA1 and
  CRYPTO_*128 functions.
- Drop the objects that upstream's linker leaves out of legacy.so
  (fcrypt_b.c, md5_one.c, md5_sha1.c, provider_err.c and
  ciphercommon_{ccm,gcm}*.c / ciphercommon_hw.c).  Without them,
  params_idx.c is not needed either.
- Add a version script, a copy of upstream's providers/legacy.ld, so
  that only OSSL_provider_init is exported.  Around 209 symbols were
  exported before.


    [5 lines not shown]
DeltaFile
+49-18secure/lib/libcrypto/modules/legacy/Makefile
+3-9secure/lib/libcrypto/modules/Makefile.inc
+5-0secure/lib/libcrypto/modules/legacy/Version.map
+57-273 files

FreeBSD/src a618be8 — secure/lib/libcrypto/engines/loader_attic Makefile, secure/lib/libcrypto/engines/padlock Makefile

openssl: fix engine defines to match upstream

Two engine Makefiles define different macros from upstream's
engines/build.info:

- padlock: engines/e_padlock.c builds the engine only when PADLOCK_ASM
  is defined.  Upstream defines it on x86 and x86_64, but our Makefile
  never did, so padlock.so has been a stub whose bind_engine() returns
  0 and the e_padlock-x86*.S code it links was never called.  Define
  PADLOCK_ASM on amd64 and i386, where that asm is built.

- loader_attic: upstream defines OPENSSL_NO_PROVIDER_CODE; the Makefile
  had OPENSSL_NO_PROVIDER_CORE.  No source tests either name, so the
  build does not change; this only follows upstream.

Found by comparing per-file compile flags against an upstream 3.5.9
build.  Checked by preprocessing e_padlock.c for amd64 and i386:
COMPILE_PADLOCKENG is now defined.


    [5 lines not shown]
DeltaFile
+1-1secure/lib/libcrypto/engines/loader_attic/Makefile
+2-0secure/lib/libcrypto/engines/padlock/Makefile
+3-12 files

FreeBSD/src e987a47 — secure/lib/libcrypto/engines Makefile.inc Version.map

openssl: export only the engine entry points

Upstream links every dynamic engine with a version script,
engines/<name>.ld, that exports bind_engine and v_check and makes
everything else local.  FreeBSD's engines had no version script, so
they exported every global symbol, including _init and _fini.
loader_attic.so compiles its own copy of crypto/pem/pvkfmt.c and so
also exported 21 of its functions; 14 of them (b2i_*, i2b_*) have the
same names as public libcrypto functions.

Add one Version.map for all engines, the same as upstream's, and use it
from engines/Makefile.inc.

The engines are loaded only with dlopen(), and libcrypto looks up only
bind_engine and v_check, so hiding the other symbols does not affect
any consumer.

Tested via tinderbox: capi.so, devcrypto.so and loader_attic.so link
with --no-undefined-version and export only bind_engine and v_check.

    [8 lines not shown]
DeltaFile
+6-0secure/lib/libcrypto/engines/Version.map
+3-0secure/lib/libcrypto/engines/Makefile.inc
+9-02 files

FreeBSD/src 481e348 — sys/crypto/openssl/aarch64 sm4-armv8.S vpsm4_ex-armv8.S, sys/crypto/openssl/i386 rc5-586.S cast-586.S

openssl: stop generating asm that nothing builds

Makefile.asm generated eight perlasm outputs that neither libcrypto nor
the kernel builds. Additionally, upstream does not build them for these
architectures with FreeBSD's configuration:

- aarch64: ecp_sm2p256-armv8, sm3-armv8, sm4-armv8, vpsm4-armv8 and
  vpsm4_ex-armv8.  SM2, SM3 and SM4 are disabled (disable-sm2/sm3/sm4).
- i386: cast-586 (upstream's x86 configuration uses the C CAST code)
  and rc5-586 (RC5 is disabled by default).
- powerpc: aes-gcm-ppc.  Upstream builds it only for 64-bit
  little-endian; libcrypto and ossl(4) use it only on powerpc64 and
  powerpc64le, whose copies stay.

Remove them from Makefile.asm and delete the generated files, so the
next vendor import does not regenerate them.  If one of these algorithms
is ever enabled, add its script back to Makefile.asm and run "make
buildasm".


    [10 lines not shown]
DeltaFile
+0-5,021sys/crypto/openssl/aarch64/vpsm4-armv8.S
+0-4,543sys/crypto/openssl/aarch64/vpsm4_ex-armv8.S
+0-2,002sys/crypto/openssl/i386/cast-586.S
+0-1,264sys/crypto/openssl/i386/rc5-586.S
+0-1,093sys/crypto/openssl/aarch64/sm4-armv8.S
+0-988sys/crypto/openssl/powerpc/aes-gcm-ppc.S
+0-14,9113 files not shown
+3-16,2769 files

FreeBSD/src a509f95 — secure/lib/libcrypto Makefile compat.c

openssl: restore removed libcrypto symbols as compat symbols

c01c0a27cb82 (D60397) stopped exporting 52 names from libcrypto.so.35 that
upstream does not export.  Binaries and libraries linked against the
earlier libcrypto.so.35 can still import them; the libssl.so.35 from
15.0 and 15.1 imports 15 of them, so it fails to load with the new
libcrypto.

Provide all 52 again as non-default (compat) versions, in the version
nodes they had before: OPENSSL_cpuid_setup at OPENSSL_3_0_9, the others
@OPENSSL_3_5_0.  Existing consumers resolve them; new links cannot bind
to them.  The default exports do not change and still match upstream.

The wrappers live in a new FreeBSD-only file, compat.c.  Remove it at
the next SHLIB_MAJOR bump.

Reviewed by:            ngie
Fixes:                  c01c0a27cb82 ("openssl: make libcrypto export the same symbols as upstream")
Event:                  FreeBSD Vendor Summit 2026

    [3 lines not shown]
DeltaFile
+425-0secure/lib/libcrypto/compat.c
+9-0secure/lib/libcrypto/Makefile
+434-02 files

FreeBSD/src bb57d27 — secure/lib/libcrypto Version.map

openssl: make libcrypto export the same symbols as upstream

Make the libcrypto Version.map export the same symbol names as upstream
3.5.8 (and 3.5.9, no new symbols were added).

Remove 52 names that upstream does not export:
- the internal threading and record layer functions (ossl_crypto_*,
  ssl3_cbc_*, tls1_cbc_*), which only libssl used;
- the internal WPACKET_quic_* functions;
- OPENSSL_cpuid_setup;
- ASN.1 item functions that are not in util/libcrypto.num.

Add 7 public names that were missing (ASYNC_get_mem_functions,
ASYNC_set_mem_functions, CMS_EnvelopedData_it, EVP_CipherPipeline*) to
OPENSSL_3_5_0, where the other symbols from upstream 3.1 to 3.5 are.

EC_GFp_nistp224_method, EC_GFp_nistp256_method and
EC_GFp_nistp521_method stay unexported (see 6f6446b33064).


    [10 lines not shown]
DeltaFile
+7-52secure/lib/libcrypto/Version.map
+7-521 files

FreeBSD/src 4ce723f — usr.sbin/uefisign uefisign.c

uefisign: use ASN1_STRING_set0() instead of ASN1_STRING_set()

Prepare for future OpenSSL API changes.

OpenSSL 4.1 deprecates ASN1_STRING_set. Move to ASN1_STRING_set0 which
requires the DER buffer to be allocated with OPENSSL_zalloc so ownership
can be assumed by the string.

Reviewed by:            imp
Differential Revision:  https://reviews.freebsd.org/D61532
DeltaFile
+4-3usr.sbin/uefisign/uefisign.c
+4-31 files

FreeBSD/src e550130 — sys/netinet/tcp_stacks rack.c

tcp/rack: reject wma_divisor values <= 0

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

(cherry picked from commit 7668705cb9837d4c3a6db9b3434b3a522220c8ea)
DeltaFile
+21-5sys/netinet/tcp_stacks/rack.c
+21-51 files

FreeBSD/src 71ed238 — contrib/llvm-project/llvm/lib/Transforms/Vectorize SLPVectorizer.cpp

Merge commit 72a20b8e2987 from llvm git (by Gabriel Baraldi):

  [SLPVectorizer] Check std::optional coming out of getPointersDiff (#175784)

  Fixes https://github.com/llvm/llvm-project/issues/175768
  There are other unchecked uses std::optional in this pass but I couldn't
  figure out a test that triggers them

This fixes a clang crash in the SLP vectorizer, hit when building
audio/csound on powerpc64le. The hardened libc++ traps on the disengaged
optional, so clang dies with exit code 133. The second hunk is adapted to
llvm 21, where analyzeConstantStrideCandidate() is still isStridedLoad().

Approved by:    re (cperciva)
Reviewed by:    dim
MFC after:      3 days

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


    [2 lines not shown]
DeltaFile
+25-7contrib/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+25-71 files

FreeBSD/src 866760f — share/man/man4 mps.4 mpr.4, sys/dev/mpr mprvar.h mpr.c

mps(4): add support for hostboot

If the mps/mpr(4) device has corrupted or missing firmware then
it will fail to attach.

Add an interface to use firmware(9) to load the firmware at boot.

Loosely based on https://github.com/marcan/lsirec/

Assisted-by:    Claude Code (Opus 5)
Reviewed by:    imp
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D59854
DeltaFile
+251-19sys/dev/mps/mps.c
+252-18sys/dev/mpr/mpr.c
+44-1share/man/man4/mps.4
+44-1share/man/man4/mpr.4
+2-0sys/dev/mps/mpsvar.h
+2-0sys/dev/mpr/mprvar.h
+595-396 files

FreeBSD/src b3b7381 — libexec/nuageinit nuageinit

nuageinit: Skip ssh keys if default user adduser fails

Commit d9fa6016011e ("nuageinit; Skip SSH keys and doas/sudo if adduser
fails") handled nil return from a failing adduser when adding secondary
users, but the same issue also existed in the default user handling.

Reported by:    llm-postcr
Reviewed by:    dtxdf
Supported by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61511
DeltaFile
+1-1libexec/nuageinit/nuageinit
+1-11 files

FreeBSD/src 3c6fd43 — sys/netinet/tcp_stacks bbr.c

tcp bbr: improve handling of retransmissions in LAST-ACK

When performing a timer based retransmission, clear the
BBR_RWND_COLLAPSED flag. If it sticks, t_rxtshift is never incremented
resulting in unlimited retransmissions in the LAST-ACK state.

Reported by:            Illia Vynohradov
Reviewed by:            Peter Lei
MFC after:              3 days
MFC to:                 stable/15
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61586
DeltaFile
+1-1sys/netinet/tcp_stacks/bbr.c
+1-11 files

FreeBSD/src 9fe57fe — sys/conf files.amd64, sys/dev/asmc asmc.c asmcmmio.h

asmc: rename asmcmmio.{c,h} to asmc_mmio.{c,h}

No functional change.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61538
DeltaFile
+0-401sys/dev/asmc/asmcmmio.c
+401-0sys/dev/asmc/asmc_mmio.c
+0-56sys/dev/asmc/asmcmmio.h
+56-0sys/dev/asmc/asmc_mmio.h
+1-1sys/dev/asmc/asmc.c
+1-1sys/conf/files.amd64
+459-4592 files not shown
+461-4618 files

FreeBSD/src 9345176 — sys/dev/asmc asmc.c asmc_sysctl.c

asmc: make asmc_sysctl_add_system() void

Its only caller already discarded the return value with (void). Match
the other sysctl subtree builders.

Reviewed by:    adrian

Differential Revision:  https://reviews.freebsd.org/D61537
DeltaFile
+2-4sys/dev/asmc/asmc_sysctl.c
+3-3sys/dev/asmc/asmc_sysctl.h
+1-1sys/dev/asmc/asmc.c
+6-83 files

FreeBSD/src 58d8364 — sys/dev/asmc asmc_sysctl.c

asmc: do not report absent sensors as a temperature

A key can exist for a sensor the model was never built with; the SMC
answers those with a fixed sentinel instead of an error. Return ENXIO
for the sentinel instead of publishing it as a reading.

MFC after:      3 days

Reviewed by:    adrian

Differential Revision:  https://reviews.freebsd.org/D61489
DeltaFile
+6-0sys/dev/asmc/asmc_sysctl.c
+6-01 files

FreeBSD/src fcc8bf0 — sys/dev/asmc asmcvar.h asmcmmio.h

asmc: wrap the lines that exceed 80 columns

Remove linter noise.
No functional change.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61488
DeltaFile
+4-3sys/dev/asmc/asmc_sysctl.c
+2-1sys/dev/asmc/asmc_debug.c
+2-1sys/dev/asmc/asmc.c
+1-1sys/dev/asmc/asmcvar.h
+1-1sys/dev/asmc/asmcmmio.h
+10-75 files

FreeBSD/src 49ba287 — share/man/man4 asmc.4, sys/dev/asmc asmc_sysctl.c

asmc: report temperatures in deciKelvin

The handler returned the raw key's high byte, dropping the sign and
fraction of the sp78 encoding, and published -1 on a failed read.

Read through asmc_sensor_read() instead, convert to deciKelvin, and
register the leaves as "IK". Changes the unit of dev.asmc.N.temp.*.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61487
DeltaFile
+12-19sys/dev/asmc/asmc_sysctl.c
+8-2share/man/man4/asmc.4
+20-212 files

FreeBSD/src 5e421b3 — share/man/man4 asmc.4

asmc.4: fix the unterminated SYNOPSIS and FILES blocks

The SYNOPSIS .Bd and the FILES .Bl were both left open, producing two
mandoc block-nesting errors. Reduce SYNOPSIS to the .Cd line man4
style calls for, and close the FILES list.

MFC after:      3 days

Reviewed by:    ziaee, ngie

Differential Revision:  https://reviews.freebsd.org/D61486
DeltaFile
+1-3share/man/man4/asmc.4
+1-31 files

FreeBSD/src cd82709 — sys/dev/asmc asmc_sysctl.c

asmc: propagate sysctl read and write errors

Several handlers discarded the key transport's result: fan speed, SMS
and ambient light handlers published a value regardless of read
success; a rejected fan speed or keyboard backlight write reported success;
fan id returned EPERM on an unreadable key instead of ENXIO.

asmc_fan_getvalue()/asmc_fan_setvalue() now return the error and pass
the speed out by reference instead of returning -1 for failure.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61485
DeltaFile
+40-35sys/dev/asmc/asmc_sysctl.c
+40-351 files

FreeBSD/src e029e26 — sys/dev/asmc asmc_sysctl.c

asmc: register the fan id sysctl with a string format

Every fan sysctl was registered with a hardcoded "I" format, but id
is CTLTYPE_STRING. Carry the format in the table instead.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61484
DeltaFile
+12-8sys/dev/asmc/asmc_sysctl.c
+12-81 files

FreeBSD/src cf3e63b — sys/dev/asmc asmc.c

asmc: clear the sensor counts in detach

The key arrays are freed but the counts were left set, leaving the
softc describing freed memory. Reachable via the attach error path,
which calls detach directly.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61483
DeltaFile
+5-0sys/dev/asmc/asmc.c
+5-01 files

FreeBSD/src 902b401 — sys/dev/asmc asmc.c

asmc: do not drop shutdown notification when the system node fails

asmc_attach() registered the MBSS shutdown-cause handler
(EVENTHANDLER_REGISTER(shutdown_pre_sync, asmc_shutdown, ...))
after attempting to add the dev.asmc.N.system sysctl subtree. If that
subtree registration failed, the error path took goto nosms, jumping clean
over the shutdown-handler registration. On T2 Macs this silently drops
the only thing standing between a clean shutdown and bridgeOS's
watchdog power-cycling the machine.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61482
DeltaFile
+3-4sys/dev/asmc/asmc.c
+3-41 files

FreeBSD/src 14a88ee — sys/dev/asmc asmcvar.h

asmc: remove the unused sc_dev softc field

It was never assigned or read. legacy code.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61481
DeltaFile
+0-1sys/dev/asmc/asmcvar.h
+0-11 files

FreeBSD/src 92f5c74 — sys/dev/asmc asmc.c

asmc: add MODULE_VERSION

Advertise the module's ABI version.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61480
DeltaFile
+1-0sys/dev/asmc/asmc.c
+1-01 files

FreeBSD/src 40d0f9e — sys/dev/asmc asmc.c

asmc: print the last field of the SMC revision correctly

Use be16dec() at the correct offset instead of an unaligned,
off-by-two-bytes read through a cast pointer.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61479
DeltaFile
+1-2sys/dev/asmc/asmc.c
+1-21 files

FreeBSD/src ddf06e9 — sys/dev/asmc asmcvar.h asmc.c

asmc: restore SMC state across suspend/resume

Reinit the SMS interrupt mask, motion thresholds, and shock window on
resume. Guard the backlight rewrite on sc_has_light. Add
device_suspend to release manual fan control before sleep and restore
it on resume.

MFC after:      3 days

Reviewed by:    ngie

Differential Revision:  https://reviews.freebsd.org/D61478
DeltaFile
+93-3sys/dev/asmc/asmc.c
+1-0sys/dev/asmc/asmcvar.h
+94-32 files