FreeBSD/src 21f25cc — lib/libcasper/libcasper zygote.c libcasper.c

libcasper: tolerate kernels without PD_NOWAITPID

Commit 1a296762b3d0 made libcasper pass PD_NOWAITPID to pdfork(2).
Kernels predating the flag (15.1 and earlier, since the flag first
ships in 15.2) reject it with EINVAL, which makes cap_init() and every
service fork fail when a newer world runs on an older kernel, for
example in a poudriere jail.

Add casper_pdfork(), which retries without the flag on EINVAL, and use
it at both pdfork(2) call sites.  The retry is safe because the kernel
validates pdfork flags before creating a child.  On such kernels the
zombie must still be reaped with waitpid(2), as before the flag was
introduced.

The fallback is compiled out once __FreeBSD_version reaches 1700000,
so it disappears from main when stable/16 branches while remaining in
the stable/15 and stable/16 branches that need it.

Reviewed by:    kib

    [4 lines not shown]
DeltaFile
+23-0lib/libcasper/libcasper/libcasper_impl.h
+1-1lib/libcasper/libcasper/zygote.c
+1-1lib/libcasper/libcasper/libcasper.c
+25-23 files

FreeBSD/src 7c2a8e3 — sys/kern kern_proc.c

kern/kern_proc.c: do not throw out read data in get_ps_strings()

PR:     297512

(cherry picked from commit f6000e9dd934db9fefc31eaa07a7d8fa9277484e)
DeltaFile
+4-1sys/kern/kern_proc.c
+4-11 files

FreeBSD/src 9dbf67a — sys/kern sys_process.c

kern/sys_process.c: make vmspace_rwmem() similar to io functions

PR:     297512

(cherry picked from commit 1a71d24ecd0dbaf61fd2a44166e9be07c328b198)
DeltaFile
+4-1sys/kern/sys_process.c
+4-11 files

FreeBSD/src a66236e — sys/arm64/arm64 identcpu.c cpufunc_asm.S, sys/arm64/include cpufunc.h

arm64: avoid full icache flushes on PIPT icaches

On many arm64 processors, the kernel plays a part in maintaining
instruction cache (icache) coherence as the contents of the underlying
physical pages change.  Previously, the only mechanism for maintaining
icache coherence implemented by the machine-dependent layer was a full
icache flush.  However, on machines with physically indexed and
physically tagged (PIPT) icaches, where aliasing cannot occur, we can
instead selectively invalidate just the affected cache lines.

Reviewed by:    andrew
Tested by:      markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60271
DeltaFile
+64-17sys/arm64/arm64/cpufunc_asm.S
+12-4sys/arm64/arm64/identcpu.c
+2-0sys/arm64/include/cpufunc.h
+78-213 files

FreeBSD/src 88a5924 — lib/libc/stdlib getenv.c

libc/stdlib/getenv.c:  always allocate new environment

PR:     298747

(cherry picked from commit dec68aeff8ce0ce154e93325a74bba6af71c87af)
DeltaFile
+1-1lib/libc/stdlib/getenv.c
+1-11 files

FreeBSD/src 58ac9bf — libexec/rtld-elf rtld.c

rtld.c: avoid double-free on dso load failure in do_load_object()

(cherry picked from commit 274236ed084a259a0e8a11df1afebd2f2f1fb097)
DeltaFile
+1-0libexec/rtld-elf/rtld.c
+1-01 files

FreeBSD/src 46237e2 — libexec/rtld-elf/i386 reloc.c

rtld-elf/i386: remove no longer true __unused args annotations

(cherry picked from commit ea23918b025baf72a43c0ce6f3f505ef153c2644)
DeltaFile
+1-1libexec/rtld-elf/i386/reloc.c
+1-11 files

FreeBSD/src a6d8b44 — lib/libc/stdlib getenv.c

libc/stdlib/getenv.c:  always allocate new environment

PR:     298747

(cherry picked from commit dec68aeff8ce0ce154e93325a74bba6af71c87af)
DeltaFile
+1-1lib/libc/stdlib/getenv.c
+1-11 files

FreeBSD/src ec76d3f — sys/netinet6 nd6_rtr.c

nd6: Do not allocate an ifaddr for the interface ID in in6_ifadd()

Without a suitable link-local address, in6_ifadd() obtains the
interface identifier from in6_get_ifid().  It wrote the result into a
freshly allocated struct in6_ifaddr, M_NOWAIT since the function runs
in the network epoch, so SLAAC could fail under memory pressure over a
16 byte scratch buffer.

Write the identifier into the on-stack address the rest of the function
uses instead.  Zero it first, in6_get_ifid() only fills in the low 64
bits, as the M_ZERO allocation did.  Track which path provided the
identifier with a flag instead of a pointer into the ifaddr, so each
path releases its own reference.

Reviewed by:            glebius
Fixes:                  9e792f7ef729 ("sys/netinet6: Fix SLAAC for interfaces with no /64 LL address")
Fixes:                  f9fc93690aef ("sys/netinet6: fix memory corruption in in6_ifadd")
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60488
DeltaFile
+21-29sys/netinet6/nd6_rtr.c
+21-291 files

FreeBSD/src c01c0a2 — 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).


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

FreeBSD/src c39dbb4 — sys/dev/acpica acpi_timer.c

acpi_timer: Trim some more leftovers from the ACPI-safe timer

The "safe" variant of the hook to read the timer is no longer used and
can be removed.  Instead, initialize the get_timecount member of
acpi_timer_timecounter to the normal hook statically.  While here,
initialize a few more fields in acpi_timer_timecounter statically.
I've kept the name as just "ACPI" instead of "ACPI-fast" now.

During device probe there is no longer any reason to alloc the
register resource since it is not used, so remove all that.  While
here, defer registration of the timecounter until attach (kind of odd
to do such a thing during probe leaving a window where the timer
register was unallocated but in theory could still be read via the
timecounter).

Reviewed by:    cperciva
Fixes:          00d061855deb ("Garbage-collect ACPI-safe timer and friends")
Differential Revision:  https://reviews.freebsd.org/D59933
(cherry picked from commit d23d186ff212023c4e1ff61a0f488dc4dcb1b75c)
DeltaFile
+15-67sys/dev/acpica/acpi_timer.c
+15-671 files

FreeBSD/src 9530d4e — sys/x86/acpica acpi_apm.c

acpi/apm: Store the ACPI softc in si_drv1

This avoids looking it up via a slower path in apmopen.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D59940

(cherry picked from commit 8cf4fe39e8ec301e582b63099252b4adab740c60)
DeltaFile
+13-6sys/x86/acpica/acpi_apm.c
+13-61 files

FreeBSD/src 7ae6593 — sys/dev/acpica acpi_timer.c

acpi_timer: Remove unneeded acpi_timer_freq global variable

This was just an alias of acpi_timer_timecounter.tc_frequency.  While
here, register the machdep.acpi_timer_freq sysctl node dynamically
only if the driver attaches rather than making the handler fail with
EOPNOTSUPP if the driver had not attached.

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

(cherry picked from commit 381840e88072a90df7ffb5731c08935412edbc19)
DeltaFile
+9-13sys/dev/acpica/acpi_timer.c
+9-131 files

FreeBSD/src dbdc129 — sys/dev/pci pci_pci.c

pcib: Only apply ARI translation to a bridge's own secondary bus

ARI changes RID interpretation only for the device on a downstream
port's secondary bus.  pcib_xlate_ari() applied that translation to
every config access through an ARI-enabled bridge, including cycles
forwarded to a subordinate bus.

A non-zero slot on a subordinate bus then panics an INVARIANTS kernel
and is misrouted otherwise.  Translate only when the access targets
this bridge's secondary bus.

Reviewed by:    kib, jhb
Fixes:          55d3ea1731d1 ("Add support for PCIe ARI")
Sponsored by:   AMD
Differential Revision:  https://reviews.freebsd.org/D60033
(cherry picked from commit 10409ee40baf593b810cd0140f3c2f0d737c1a65)
DeltaFile
+2-1sys/dev/pci/pci_pci.c
+2-11 files

FreeBSD/src fb36100 — sys/modules/dtrace Makefile Makefile.inc

dtrace: Remove bogus Makefile.inc

This was added in the initial import of dtrace and overrides the
normal load/unload targets with a custom target that loads a hardcoded
set of modules.  Over time, the set of modules has not been updated
and is now incomplete.  It's also not really useful compared to the
default implementation of these targets used for loading or unloading
an individual module being actively developed.

This functionality is also available via dtraceall.ko which is how
users commonly load the full suite of dtrace modules.

Reviewed by:    imp, markj
Differential Revision:  https://reviews.freebsd.org/D59821

(cherry picked from commit df7b90556859e1e5dbaf8d3dae2177ca607c0558)
DeltaFile
+0-23sys/modules/dtrace/Makefile.inc
+0-2sys/modules/dtrace/Makefile
+0-252 files

FreeBSD/src 42f4c37 — sys/x86/acpica acpi_apm.c

acpi/apm: Don't claim silent success for APMIO_BIOS ioctls

Report failure as if the request had failed.  This causes apm(8) to
correctly report the resume timer as "unknown" rather than random
garbage.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D59939

(cherry picked from commit 1d7f0c742863ad65e9d27df8f5ae4afddd6cc5e2)
DeltaFile
+1-2sys/x86/acpica/acpi_apm.c
+1-21 files

FreeBSD/src 3fd7a95 — sys/dev/acpica acpi_timer.c

acpi_timer: I/O resource cleanups

- Use bus_read_4 and remove explicit bus_space tag and handle

- Pass rid by value to bus_alloc_resource_any

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

(cherry picked from commit 8d70bf332c519c427e3a36f54501201917506989)
DeltaFile
+5-11sys/dev/acpica/acpi_timer.c
+5-111 files

FreeBSD/src e0d2f27 — sys/dev/acpica acpi_timer.c

acpi_timer: Add a softc to avoid use of global variables

Add a softc and use it to mostly replace the use of global variables
in this driver.  Simplify the suspend and resume event handlers by
saving the old timecounter in the softc and passing the softc pointer
to the handlers.

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

(cherry picked from commit 34cf45a93c54ee9a222d2893b97832283a850715)
DeltaFile
+63-51sys/dev/acpica/acpi_timer.c
+63-511 files

FreeBSD/src e4bf15b — sys/x86/conf NOTES

x86/NOTES: Drop stale comments about si(4)

This driver was removed several years ago.

Fixes:          c1c9764296e5 ("Remove the si(4) driver and sicontrol(8) for Specialix serial cards.")
(cherry picked from commit 600c16c71ba1c1e0ad176437bcfeea12492d5ae7)
DeltaFile
+0-7sys/x86/conf/NOTES
+0-71 files

FreeBSD/src c9ea1e9 — sys/dev/cxgbe/crypto t7_kern_tls.c

cxgbe: Use the correct GHASH offset for a GMAC from a full TLS record

If a TLS request transmits all but a part of the GMAC at the end of a
TLS record, the work request asks the crypto engine to return the
calculated GMAC to the driver so it can be sent in a simple TCP packet
when the rest of the TLS record is transmitted in the future.
However, the offset of the returned GHASH offset was calculated
incorrectly in this case causing the driver to not recognize the
cached GMAC and instead use a more wasteful work request in the future
that encrypted the entire TLS record discarding all but the needed
bytes of the trailer.

Note that this does not effect correctness, just efficiency.

Reviewed by:    np
Fixes:          9e269eafebfc ("cxgbe: Use partial GCM mode for partial TLS records on T7")
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D59711
(cherry picked from commit ed5fc8066f98e639f624de9997b33727ed883c32)
DeltaFile
+1-1sys/dev/cxgbe/crypto/t7_kern_tls.c
+1-11 files

FreeBSD/src 1e838b3 — sys/dev/cxgbe/crypto t7_kern_tls.c

cxgbe(4): Use correct FID in KTLS tx work requests

MFC after:      1 week
Sponsored by:   Chelsio Communications

(cherry picked from commit 309fc9f765917fa032cdae7043bafffb6da5713b)
DeltaFile
+2-2sys/dev/cxgbe/crypto/t7_kern_tls.c
+2-21 files

FreeBSD/src e3aa820 — usr.sbin/bhyve pci_emul.c

bhyve: Refactor initial PCI BAR setup

Fully initialize BARs with an address of 0 in pci_emul_alloc_bar()
instead of deferring some of that initialization to
pci_emul_assign_bar().  Now, the latter is only used to allocate an
initial address range for PCI BARs.

Note that this means that the pci_passthru model now overrides the
initial lobits after they are set removing the need for a workaround
in pci_emul_assign_bar().

Reviewed by:    bnovkov
Differential Revision:  https://reviews.freebsd.org/D58893

(cherry picked from commit b00bb87a614212a2bbb156288bfdd51b27bcb329)
DeltaFile
+63-53usr.sbin/bhyve/pci_emul.c
+63-531 files

FreeBSD/src 0fc0222 — sys/dev/cxgbe/crypto t7_kern_tls.c

cxgbe KTLS tx: Distribute FW6_PLD replies across rx queues

If the connection flowid is available then the replies are requested on
the rx queue that is receiving wire traffic for the connection.  This
reduces contention for the txq lock.

Reviewed by:    jhb
MFC after:      3 days
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D53385

(cherry picked from commit a6ae6090bb3dc14eda750aa53650fccf4c0bf818)
DeltaFile
+12-6sys/dev/cxgbe/crypto/t7_kern_tls.c
+12-61 files

FreeBSD/src 00c5819 — usr.sbin/bhyve pci_emul.c

bhyve: Don't set the prefetch flag for large 64-bit memory BARs

The only device model that can create a large 64-bit memory BAR is the
passthru device model, and that device model reuses the lobits of the
existing BAR explicitly.

Fixes:          e87a6f3ef284 ("bhyve: use physical lobits for BARs of passthru devices")
(cherry picked from commit 3807c8be4645d7f02c5253aa88b193000e6aef09)
DeltaFile
+1-2usr.sbin/bhyve/pci_emul.c
+1-21 files

FreeBSD/src 2c3ad0c — libexec/rtld-elf rtld.c

rtld: Remove a stale #ifdef PIC

rtld has always been built PIC since commit
7ca8e6a67068e8357e251bd3ea86253c8a751d59.  The stale #ifdef might
confuse a reader by thinking rtld can be built as non-PIC.

Reviewed by:    kib
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D58623

(cherry picked from commit ec8985a1003326eff53cb6b594000b7cbb2114c5)
DeltaFile
+0-2libexec/rtld-elf/rtld.c
+0-21 files

FreeBSD/src 999ce44 — sys/kern link_elf.c

kld: Reject kernel modules with PT_LOAD segments where filesz > memsz

All sorts of places in the ELF loading code assume that filesz <=
memsz, so check that explicitly up front.

Reported by:    Jane Smith <thebugfixers at pm.me> (via D57785)
Reviewed by:    jrtc27, kib
Differential Revision:  https://reviews.freebsd.org/D58542

(cherry picked from commit 486dfbb67e093a461a5ebd97f66be9b345f9de77)
DeltaFile
+8-0sys/kern/link_elf.c
+8-01 files

FreeBSD/src db8b81c — libexec/rtld-elf rtld.c map_object.c

rtld: Reject ELF files with PT_LOAD or PT_TLS segments where filesz > memsz

All sorts of places in the ELF loading code assume that filesz <=
memsz, so check that explicitly up front.  The kernel already performs
this check for the PT_LOAD segments in the main binary and rtld in
imgact_elf.c.

Reviewed by:    jrtc27, kib
Differential Revision:  https://reviews.freebsd.org/D58541

(cherry picked from commit 535eb24d8451bad8de745937018800df1895a9aa)
DeltaFile
+12-0libexec/rtld-elf/map_object.c
+6-0libexec/rtld-elf/rtld.c
+18-02 files

FreeBSD/src 227ad49 — usr.sbin/bhyve pci_emul.h pci_nvme.c

bhyve: Return void from pci_emul_alloc_bar

This function never fails.

Reviewed by:    bnovkov, chuck, markj
Differential Revision:  https://reviews.freebsd.org/D58579

(cherry picked from commit b29dc5a30cce666896217a03a8067eba8b018eb6)
DeltaFile
+6-16usr.sbin/bhyve/pci_emul.c
+2-5usr.sbin/bhyve/pci_fbuf.c
+1-5usr.sbin/bhyve/pci_nvme.c
+2-4usr.sbin/bhyve/pci_passthru.c
+1-1usr.sbin/bhyve/pci_emul.h
+12-315 files

FreeBSD/src 9523917 — release/scripts make-manifest.sh

release: Use "debug info" for lib32 set description

This mirrors the changes applied to kernel debug symbol sets in commit
9a354a41be9a40c3c0a16cc20f4009d3b31679cc.

Reviewed by:    emaste
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D59058

(cherry picked from commit 22293f8c547ea0ee7f9d64b90384d7006b808feb)
DeltaFile
+1-1release/scripts/make-manifest.sh
+1-11 files

FreeBSD/src e5514ce — sys/kern kern_rangelock.c

rangelock: Enable rl_q_owner tracking under INVARIANT_SUPPORT

This fixes the build for kernels with INVARIANT_SUPPORT but without
INVARIANTS.

Fixes:          2e376cca379b ("rangelock: Reimplement _rangelock_cookie_assert()")
(cherry picked from commit bcd1e7a8caac9129cc08995f8ff81a0eef0529bc)
DeltaFile
+5-5sys/kern/kern_rangelock.c
+5-51 files