FreeBSD/src f14ca37sys/kern uipc_socket.c

splice: Fix leaks that can happen when initiating a splice

- change the state to SPLICE_EXCEPTION to allow so_unsplice() to work
  to cleanup failed splices (fixes socket reference leak)
- NULL out sp->dst when unsplicing from so_splice() before so2 has been
   been referenced.
- Deal with a null sp->dst / so2 in so_unsplice
- Fix asserts that talked about sp->state == SPLICE_INIT; that state
  is not possible here.

Differential Revision: https://reviews.freebsd.org/D54157
Reviewed by: markj
Sponsored by: Netflix
Fixes: c0c5d01e5374 ("so_splice: Synchronize so_unsplice() with so_splice()")
MFC after: 3 days

(cherry picked from commit a837d1fe49e0255d81c670dc271ff245ae960097)
DeltaFile
+27-17sys/kern/uipc_socket.c
+27-171 files

FreeBSD/src f2cb620sys/dts/arm/overlays spigen-rpi-b.dtso, sys/modules/dtb/rpi Makefile

Remove: sys/dts/arm/overlays/spigen-rpi-b.dtso

Remove SPIGEN device tree overlay used with rpi-b (BCM2835/armv6)

Approved by: manu (mentor)
Differential revision: https://reviews.freebsd.org/D54188
DeltaFile
+0-30sys/dts/arm/overlays/spigen-rpi-b.dtso
+0-1sys/modules/dtb/rpi/Makefile
+0-312 files

FreeBSD/src cd79149lib/libdiff Makefile, lib/libfido2 Makefile

*/*: remove recallocarray() compat shims following import into libc

libopenbsd retains recallocarray() during bootstrapping for now
as it is needed for mandoc.

Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D52864

(cherry picked from commit acd546f01e58354af049455472980c6c4a52e18b)
DeltaFile
+1-2usr.bin/mandoc/Makefile
+1-1lib/libdiff/Makefile
+0-1lib/libfido2/Makefile
+0-1tests/oclo/Makefile
+2-54 files

FreeBSD/src 24ea810include stdlib.h, lib/libc/stdlib memalignment.3 memalignment.c

lib/libc: implement C23 memalignment()

This new function computes the alignment of a pointer.
It is part of ISO/IEC 9899:2024, the new C standard.
If the pointer is a null pointer, null is returned.
I have tried to write an implementation that can cope
with traditional address-based architectures, even if
size_t and uintptr_t are of different length.  Adjustments
may be needed for CHERI though.

A man page is provided, too.  No unit test for now.

Reviewed by:    kib, imp, ziaee (manpages), pauamma at gundo.com
Approved by:    markj (mentor)
MFC after:      1 month
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D53673

(cherry picked from commit 6c57e368eb1777f6097158eeca2fcc175d068dba)
DeltaFile
+53-0lib/libc/stdlib/memalignment.3
+28-0lib/libc/stdlib/memalignment.c
+8-0include/stdlib.h
+2-2lib/libc/stdlib/Makefile.inc
+1-0lib/libc/stdlib/Symbol.map
+92-25 files

FreeBSD/src e72536alib/libc/stdlib recallocarray.c reallocarray.3, lib/libopenbsd recallocarray.c Makefile

lib/libc: add recallocarray()

This function from OpenBSD is a hybrid of reallocarray() and calloc().
It reallocates an array, clearing any newly allocated items.
reallocarray() ultimately originates from OpenBSD.

The source is taken from lib/libopenbsd, which now no longer has the
function unless when bootstrapping (needed for mandoc).

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D52863

(cherry picked from commit 42664610795bc0a728851ba6223fcf9b93801167)
DeltaFile
+0-82lib/libopenbsd/recallocarray.c
+82-0lib/libc/stdlib/recallocarray.c
+36-1lib/libc/stdlib/reallocarray.3
+6-2lib/libopenbsd/Makefile
+4-0lib/libc/stdlib/Symbol.map
+2-1lib/libc/stdlib/Makefile.inc
+130-861 files not shown
+132-867 files

FreeBSD/src 9d2981ftools/test/stress2/misc pg_zero.sh

stress2: Fix looping at exit and fix the cleanup
DeltaFile
+2-2tools/test/stress2/misc/pg_zero.sh
+2-21 files

FreeBSD/src 5c02597sys/fs/unionfs union_vnops.c, sys/kern vfs_default.c

unionfs: Implement VOP_GETLOWVNODE

This function returns the vnode that will be used to resolve the
access type specified in the 'flags' argument, and is useful for
optimal behavior of vn_copy_file_range(). While most filesystems
can simply use the default implementation which returns the passed-
in vnode, unionfs (like nullfs) ideally should resolve the access
request to whichever base layer vnode will be used for the I/O.

For unionfs, write accesses must be resolved through the upper vnode,
while read accesses will be resolved through the upper vnode if
present or the lower vnode otherwise.  Provide a simple
unionfs_getlowvnode() implementation that reflects this policy.

Reviewed by:    kib, olce
Tested by:      pho
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D53988
DeltaFile
+45-0sys/fs/unionfs/union_vnops.c
+1-2sys/kern/vfs_default.c
+1-0sys/sys/vnode.h
+47-23 files

FreeBSD/src 0247b40sys/fs/unionfs union_vfsops.c

unionfs: detect common deadlock-producing mount misconfigurations

When creating a unionfs mount, it's fairly easy to shoot oneself
in the foot by specifying upper and lower file hierarchies that
resolve back to the same vnodes.  This is fairly easy to do if
the sameness is not obvious due to aliasing through nullfs or other
unionfs mounts (as in the associated PR), and will produce either
deadlock or failed locking assertions on any attempt to use the
resulting unionfs mount.

Leverage VOP_GETLOWVNODE() to detect the most common cases of
foot-shooting at mount time and fail the mount with EDEADLK.
This is not meant to be an exhaustive check for all possible
deadlock-producing scenarios, but it is an extremely cheap and
simple approach that, unlike previous proposed fixes, also works
in the presence of nullfs aliases.

PR:             172334
Reported by:    ngie, Karlo Miličević <karlo98.m at gmail.com>

    [4 lines not shown]
DeltaFile
+25-2sys/fs/unionfs/union_vfsops.c
+25-21 files

FreeBSD/src 38d60d4sys/kern vnode_if.src

vnode_if.src: fix function name in locking annotation

getwritevnode->getlowvnode

Reviewed by:    kib, olce
Tested by:      pho
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D53988
DeltaFile
+1-1sys/kern/vnode_if.src
+1-11 files

FreeBSD/src 478ac7dsys/cam/scsi scsi_xpt.c

cam: Also reduce timeout for wlun probing

wlun probing was added after my initial work on this and was overlooked
in merging forward. Add the timeout here too, for the same reasons as
for REPORT LUNS. This doesn't change the default.

Fixes: 8ac7a3801c6a cam: Reduce overly long timeout values for initial device probing
Sponsored by:           Netflix
Reviewed by:            jaeyoon
Differential Revision:  https://reviews.freebsd.org/D54184
DeltaFile
+1-1sys/cam/scsi/scsi_xpt.c
+1-11 files

FreeBSD/src 5588350. ObsoleteFiles.inc, share/man/man9 pfind.9 Makefile

pfind(9): follow-up fixes and improvements

(Found on a branch from a year ago.)

- Adjust NAMEs
- MLINKS: add pfind_any.9, pfind_any_locked.9; remove old zpfind.9
- Reword the description of pfind_any() so that it doesn't imply only
  zombie processes are returned
- Fix a comma
- Use .Dv for the macro PRS_ZOMBIE
- Move the (logically separate) final statement to a new paragraph
- .Xr to pget(9)

Reviewed by:    0mp
Fixes:  07d78399eb79 ("pfind(9): Update to recent behavior")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D53548

(cherry picked from commit 2ace05b65a2c912888aeec921fc6f990a5c36909)
DeltaFile
+17-17share/man/man9/pfind.9
+3-0ObsoleteFiles.inc
+2-1share/man/man9/Makefile
+22-183 files

FreeBSD/src f2a21b1sys/dev/e1000 e1000_82571.c

e1000: Don't enable ASPM L1 without L0s

Reporter noted packet loss with 82583.  NVM is down level.  The
errata docs mention disabling this, which should be the firmware
default, so I am not sure why we were enabling this bit.  Linux and
OpenBSD have the same issue, while NetBSD got it right.

Reported by:    Codin <codin at nagi.ftp.sh>
Tested by:      Codin <codin at nagi.ftp.sh>

(cherry picked from commit 2ead091715dee327b3e00bc9840e1a95827b8e82)
DeltaFile
+2-1sys/dev/e1000/e1000_82571.c
+2-11 files

FreeBSD/src 618083esys/dev/e1000 if_em.c

e1000: Bump 82574/82583 PBA to 32K

The reporter contacted me with packet loss and throughput fluctuations
on a low power machine (Intel J1900) that got worse with the recent AIM
algorithm in FreeBSD 14.2+.

32K RX PBA matches Linux default.  Add a conditional path since we don't
otherwise do a fixup for jumbo frames to retain space for two frames in
Tx.

With this change and an additional errata change, the throughput meets
line rate for the reporter.

Reported by:    Codin <codin at nagi.ftp.sh>
Tested by:      Codin <codin at nagi.ftp.sh>

(cherry picked from commit aa30bab9a92e1be230b9708bff9f33aae7d384e5)
DeltaFile
+5-1sys/dev/e1000/if_em.c
+5-11 files

FreeBSD/src ca69366sys/dev/e1000 e1000_82571.c

e1000: Don't enable ASPM L1 without L0s

Reporter noted packet loss with 82583.  NVM is down level.  The
errata docs mention disabling this, which should be the firmware
default, so I am not sure why we were enabling this bit.  Linux and
OpenBSD have the same issue, while NetBSD got it right.

Reported by:    Codin <codin at nagi.ftp.sh>
Tested by:      Codin <codin at nagi.ftp.sh>

(cherry picked from commit 2ead091715dee327b3e00bc9840e1a95827b8e82)
DeltaFile
+2-1sys/dev/e1000/e1000_82571.c
+2-11 files

FreeBSD/src 714051fsys/dev/e1000 if_em.c

e1000: Bump 82574/82583 PBA to 32K

The reporter contacted me with packet loss and throughput fluctuations
on a low power machine (Intel J1900) that got worse with the recent AIM
algorithm in FreeBSD 14.2+.

32K RX PBA matches Linux default.  Add a conditional path since we don't
otherwise do a fixup for jumbo frames to retain space for two frames in
Tx.

With this change and an additional errata change, the throughput meets
line rate for the reporter.

Reported by:    Codin <codin at nagi.ftp.sh>
Tested by:      Codin <codin at nagi.ftp.sh>

(cherry picked from commit aa30bab9a92e1be230b9708bff9f33aae7d384e5)
DeltaFile
+5-1sys/dev/e1000/if_em.c
+5-11 files

FreeBSD/src 2635037sys/dev/hwpmc hwpmc_intel.c

pmc: add alderlake model

The commit 601925180df4 added the models 6-B7, 6-BA, 6-BF to libpmc, but
they must also be added to the hwpmc module to allow pmc to work on
those CPUs.

Reviewed by:    mhorne
MFC after:      1 week
Fixes:          601925180df4 ("libpmc: add more alderlake models")
Sponsored by:   Stormshield
Differential Revision:  https://reviews.freebsd.org/D49255

(cherry picked from commit 057dae35ffc6b17dacc84fa21921e93a17ce12b0)
DeltaFile
+3-0sys/dev/hwpmc/hwpmc_intel.c
+3-01 files

FreeBSD/src e56189dlib/libpmc/pmu-events/arch/x86/alderlaken adln-metrics.json pipeline.json

pmc: add alderlaken model

This commit adds alderlaken CPU model to hwpmc/libpmc. JSON event
definitions are imported from Intel perfmon version 1.16.

Reviewed by:    mhorne
MFC after:      1 week
Sponsored by:   Stormshield
Differential Revision:  https://reviews.freebsd.org/D49229

(cherry picked from commit ca3e47b0ea68664c7e10e1c3e28c5ac7d9932c21)
DeltaFile
+583-0lib/libpmc/pmu-events/arch/x86/alderlaken/adln-metrics.json
+533-0lib/libpmc/pmu-events/arch/x86/alderlaken/pipeline.json
+330-0lib/libpmc/pmu-events/arch/x86/alderlaken/cache.json
+175-0lib/libpmc/pmu-events/arch/x86/alderlaken/uncore-memory.json
+81-0lib/libpmc/pmu-events/arch/x86/alderlaken/memory.json
+47-0lib/libpmc/pmu-events/arch/x86/alderlaken/virtual-memory.json
+1,749-07 files not shown
+1,870-013 files

FreeBSD/src f7129eflib/libpmc/pmu-events/arch/x86/emeraldrapids uncore-cache.json uncore-interconnect.json

pmc: add emerald rapids model

This commit adds emerald rapids CPU model to hwpmc/libpmc. JSON event
definitions are imported from Intel perfmon version 1.06.

Reviewed by:    mhorne
MFC after:      1 week
Sponsored by:   Stormshield
Differential Revision:  https://reviews.freebsd.org/D49228

(cherry picked from commit 51a01f3debff8abf63c7cc21db9523c8feb53823)
DeltaFile
+6,248-0lib/libpmc/pmu-events/arch/x86/emeraldrapids/uncore-cache.json
+6,199-0lib/libpmc/pmu-events/arch/x86/emeraldrapids/uncore-interconnect.json
+3,617-0lib/libpmc/pmu-events/arch/x86/emeraldrapids/uncore-io.json
+3,308-0lib/libpmc/pmu-events/arch/x86/emeraldrapids/uncore-memory.json
+962-0lib/libpmc/pmu-events/arch/x86/emeraldrapids/pipeline.json
+888-0lib/libpmc/pmu-events/arch/x86/emeraldrapids/cache.json
+21,222-010 files not shown
+23,302-016 files

FreeBSD/src 9ac7027lib/libpmc/pmu-events/arch/x86/alderlaken adln-metrics.json pipeline.json

pmc: add alderlaken model

This commit adds alderlaken CPU model to hwpmc/libpmc. JSON event
definitions are imported from Intel perfmon version 1.16.

Reviewed by:    mhorne
MFC after:      1 week
Sponsored by:   Stormshield
Differential Revision:  https://reviews.freebsd.org/D49229

(cherry picked from commit ca3e47b0ea68664c7e10e1c3e28c5ac7d9932c21)
DeltaFile
+583-0lib/libpmc/pmu-events/arch/x86/alderlaken/adln-metrics.json
+533-0lib/libpmc/pmu-events/arch/x86/alderlaken/pipeline.json
+330-0lib/libpmc/pmu-events/arch/x86/alderlaken/cache.json
+175-0lib/libpmc/pmu-events/arch/x86/alderlaken/uncore-memory.json
+81-0lib/libpmc/pmu-events/arch/x86/alderlaken/memory.json
+47-0lib/libpmc/pmu-events/arch/x86/alderlaken/virtual-memory.json
+1,749-07 files not shown
+1,870-013 files

FreeBSD/src 6b0cb6elib/libpmc/pmu-events/arch/x86/emeraldrapids uncore-cache.json uncore-interconnect.json

pmc: add emerald rapids model

This commit adds emerald rapids CPU model to hwpmc/libpmc. JSON event
definitions are imported from Intel perfmon version 1.06.

Reviewed by:    mhorne
MFC after:      1 week
Sponsored by:   Stormshield
Differential Revision:  https://reviews.freebsd.org/D49228

(cherry picked from commit 51a01f3debff8abf63c7cc21db9523c8feb53823)
DeltaFile
+6,248-0lib/libpmc/pmu-events/arch/x86/emeraldrapids/uncore-cache.json
+6,199-0lib/libpmc/pmu-events/arch/x86/emeraldrapids/uncore-interconnect.json
+3,617-0lib/libpmc/pmu-events/arch/x86/emeraldrapids/uncore-io.json
+3,308-0lib/libpmc/pmu-events/arch/x86/emeraldrapids/uncore-memory.json
+962-0lib/libpmc/pmu-events/arch/x86/emeraldrapids/pipeline.json
+888-0lib/libpmc/pmu-events/arch/x86/emeraldrapids/cache.json
+21,222-010 files not shown
+23,302-016 files

FreeBSD/src a401677sys/dev/hwpmc hwpmc_intel.c

pmc: add alderlake model

The commit 601925180df4 added the models 6-B7, 6-BA, 6-BF to libpmc, but
they must also be added to the hwpmc module to allow pmc to work on
those CPUs.

Reviewed by:    mhorne
MFC after:      1 week
Fixes:          601925180df4 ("libpmc: add more alderlake models")
Sponsored by:   Stormshield
Differential Revision:  https://reviews.freebsd.org/D49255

(cherry picked from commit 057dae35ffc6b17dacc84fa21921e93a17ce12b0)
DeltaFile
+3-0sys/dev/hwpmc/hwpmc_intel.c
+3-01 files

FreeBSD/src 8ac7a38. UPDATING, share/man/man4 scsi.4

cam: Reduce overly long timeout values for initial device probing

Currently, we have very long timeouts for the initial probing
commands. However, these are not appropriate for modern (post 2010) SCSI
disks. Sandards since SPC3 state that these commands should not wait for
media access. Since we retry them several times during the initial bus
scan, these delays can delay the boot by minutes (5 minutes per errant
disk in our expereince). These delays don't help and only hurt, so
reduce the TESTUNITREADY, INQUIRY and MODESENSE commands (during the
initial probe). Provide sysctl/tuneables to change the time for these
and also the REPORTLUNS commands for people that might need to adjust
them for devices that violate this belief but none-the-less work with
longer timeouts.
        kern.cam.tur_timeout            (default was 60s, now 1s)
        kern.cam.inquiry_timeout        (default was 60s, now 1s)
        kern.cam.reportluns_timeout     (default is 60s)
        kern.cam.modesense_timeout      (default was 60s, now 1s)
This can be partially merged: the sysctls can, but the new defaults likely
shouldn't.

    [3 lines not shown]
DeltaFile
+33-1share/man/man4/scsi.4
+22-6sys/cam/scsi/scsi_xpt.c
+11-0UPDATING
+66-73 files

FreeBSD/src 7720566cddl/lib/libdtrace io.d

libdtrace: Update io.d to chase changes to struct bio layout

Fixes:  6c406b5b9312 ("exterror(9): add infra for bufs and bios")

(cherry picked from commit 1ca7542a1b31fffefaac5a2ff45ef23f908b33c2)
DeltaFile
+1-1cddl/lib/libdtrace/io.d
+1-11 files

FreeBSD/src b9915c2sys/dts/arm imx53x.dtsi imx51x.dtsi, sys/modules/dtb/imx5 Makefile

sys/dts: Remove i.MX5 device tree

IMX51 is already EOL and IMX53 is going to be EOL in Feb 2026.
See NXP product longevity site

Remove
Digi ConnectCore Wi-i.MX53
Genesi Efika MX
FreeBSD own DTSI for imx51 and imx53
sys/modules/dtb/imx5 for i.MX53 quick start board.

Approved by: manu (mentor)
Differential revision: https://reviews.freebsd.org/D53888
DeltaFile
+0-712sys/dts/arm/imx53x.dtsi
+0-619sys/dts/arm/imx51x.dtsi
+0-151sys/dts/arm/digi-ccwmx53.dts
+0-125sys/dts/arm/efikamx.dts
+0-5sys/modules/dtb/imx5/Makefile
+0-1,6125 files

FreeBSD/src e29fe1csys/netinet ip_divert.c

divert: Use CK_SLISTs for the divcb hash table

The hash table is accessed in ip_divert_packet(), and there the accesses
are synchronized only by the net epoch, so plain SLIST is not safe.

Reviewed by:    ae
MFC after:      1 week
Sponsored by:   OPNsense
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54011

(cherry picked from commit 74f7e916211acafd10af05efd893ccbac1881119)
DeltaFile
+9-8sys/netinet/ip_divert.c
+9-81 files

FreeBSD/src f50f8cbsys/riscv/riscv pmap.c

riscv/pmap: Handle superpages in pmap_extract_and_hold()

Without this change, vm_fault_quick_hold_pages() falls back to the slow
fault handler when it encounters a superpage mapping.

Reviewed by:    alc, kib
Reported and tested by: br
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54022

(cherry picked from commit 20a0a2f8f36f5db704b674106fa61d8d95b6b071)
DeltaFile
+16-6sys/riscv/riscv/pmap.c
+16-61 files

FreeBSD/src fe21dbfsys/compat/linux linux_file.c linux_file.h

linux: Implement F_DUPFD_QUERY fcntl with kcmp(2) KCMP_FILE

Signed-off-by: Ricardo Branco <rbranco at suse.de>
Reviewed by:    kib
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1920
DeltaFile
+8-0sys/compat/linux/linux_file.c
+1-0sys/compat/linux/linux_file.h
+9-02 files

FreeBSD/src dbac191sys/compat/linux linux_misc.c linux_misc.h

linux: Add support for kcmp(2) system call

Signed-off-by: Ricardo Branco <rbranco at suse.de>
Reviewed by:    kib
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1920
DeltaFile
+27-0sys/compat/linux/linux_misc.c
+11-0sys/compat/linux/linux_misc.h
+0-2sys/compat/linux/linux_dummy.c
+38-23 files

FreeBSD/src 95d8576sys/tools/fdt make_dtb.sh

make_dtb.sh: add include path

The device tree include file for TI TPS65* is in a
relative path to the source for example:
device-tree/src/arm/ti/omap/am335x-bone-common.dtsi#n305
device-tree/src/arm/rockchip/rk3066a-marsboard.dts#n183

This patch gets the dts path and adds that as an include path
for the device tree compiler.

Approved by: manu (mentor)
Differential revision: https://reviews.freebsd.org/D53887
DeltaFile
+2-1sys/tools/fdt/make_dtb.sh
+2-11 files

FreeBSD/src f825427krb5/lib/gssapi version.map

krb5: Add missing symbol

Submitted by:   lampa at fit.vutbr.cz
PR:             291565
MFC after:      1 day
DeltaFile
+1-0krb5/lib/gssapi/version.map
+1-01 files