HardenedBSD/src cb58eb8sys/dev/xilinx if_xae.c axidma.c, sys/netpfil/ipfilter/netinet fil.c ip_nat.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+669-446sys/dev/xilinx/if_xae.c
+60-498sys/dev/xilinx/axidma.c
+90-2sys/netpfil/ipfilter/netinet/fil.c
+53-0sys/dev/xilinx/axidma_if.m
+37-16sys/dev/xilinx/if_xaevar.h
+41-1sys/netpfil/ipfilter/netinet/ip_nat.c
+950-9639 files not shown
+1,012-98315 files

HardenedBSD/src 4d84888contrib/unbound/iterator iter_scrub.c, usr.sbin/unbound/setup local-unbound-setup.sh

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+35-4contrib/unbound/iterator/iter_scrub.c
+4-4usr.sbin/unbound/setup/local-unbound-setup.sh
+39-82 files

HardenedBSD/src 0fb16becontrib/unbound/iterator iter_scrub.c, usr.sbin/unbound/setup local-unbound-setup.sh

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+35-4contrib/unbound/iterator/iter_scrub.c
+4-4usr.sbin/unbound/setup/local-unbound-setup.sh
+39-82 files

HardenedBSD/src d45816fusr.sbin/bsdinstall Makefile

bsdinstall: Ignore -p[0-9]+ in determining BRANCH

The patch level is not part of the branch per se and should not be
used in constructing the FreeBSD-base.conf file used by bsdinstall.

MFC after:      1 day
DeltaFile
+1-1usr.sbin/bsdinstall/Makefile
+1-11 files

HardenedBSD/src 5af240clib/libc/locale xlocale_private.h

libc: Simplify __get_locale()

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    fuz
Differential Revision:  https://reviews.freebsd.org/D53908
DeltaFile
+2-4lib/libc/locale/xlocale_private.h
+2-41 files

HardenedBSD/src 974ecf6sys/conf files.riscv, sys/dev/xilinx if_xae.c axidma.c

xae(4), axidma(4): rewrite DMA operation.

Due to performance constraints on a synthesized CHERI RISC-V core,
remove usage of xdma(4) scatter-gather framework.  Instead, provide
a minimalistic interface between two drivers.

This increases performance ~4-5 times.
Tested using scp(1) and nc(1) on Codasip Prime.

Sponsored by:   CHERI Research Centre
Differential Revision:  https://reviews.freebsd.org/D53932
DeltaFile
+669-446sys/dev/xilinx/if_xae.c
+60-498sys/dev/xilinx/axidma.c
+53-0sys/dev/xilinx/axidma_if.m
+37-16sys/dev/xilinx/if_xaevar.h
+1-10sys/dev/xilinx/axidma.h
+2-1sys/conf/files.riscv
+822-9716 files

HardenedBSD/src cd40a23contrib/unbound/iterator iter_scrub.c

Mitigate YXDOMAIN and nodata non-referral answer poisoning.

Add a fix to apply scrubbing of unsolicited NS RRSets (and their
respective address records) for YXDOMAIN and nodata non-referral
answers. This prevents a malicious actor from exploiting a possible
cache poison attack.

Obtained from:  NLnet Labs
Security:       FreeBSD-SA-25:10.unbound
Security:       CVE-2025-11411

(cherry picked from commit 2a3a6a1771148a709c2d9694c1d66c41ce8dee79)
DeltaFile
+35-4contrib/unbound/iterator/iter_scrub.c
+35-41 files

HardenedBSD/src b01f35acontrib/unbound/iterator iter_scrub.c

Mitigate YXDOMAIN and nodata non-referral answer poisoning.

Add a fix to apply scrubbing of unsolicited NS RRSets (and their
respective address records) for YXDOMAIN and nodata non-referral
answers. This prevents a malicious actor from exploiting a possible
cache poison attack.

Obtained from:  NLnet Labs
Security:       FreeBSD-SA-25:10.unbound
Security:       CVE-2025-11411

(cherry picked from commit 2a3a6a1771148a709c2d9694c1d66c41ce8dee79)
DeltaFile
+35-4contrib/unbound/iterator/iter_scrub.c
+35-41 files

HardenedBSD/src 2a3a6a1contrib/unbound/iterator iter_scrub.c

Mitigate YXDOMAIN and nodata non-referral answer poisoning.

Add a fix to apply scrubbing of unsolicited NS RRSets (and their
respective address records) for YXDOMAIN and nodata non-referral
answers. This prevents a malicious actor from exploiting a possible
cache poison attack.

Obtained from:  NLnet Labs
Security:       CVE-2025-11411
DeltaFile
+35-4contrib/unbound/iterator/iter_scrub.c
+35-41 files

HardenedBSD/src 5a2f810usr.sbin/unbound/setup local-unbound-setup.sh

local-unbound: Read a tab separated resolv.conf

Use [[:space:]] rather than a white space character to delimit the keys
and the values in the resolv.conf file.

PR:             236079
Reviewed by:    des
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D53811

(cherry picked from commit 0628400590e025b7db1c0905e6ee488a24ef3f60)
DeltaFile
+4-4usr.sbin/unbound/setup/local-unbound-setup.sh
+4-41 files

HardenedBSD/src 5f2dd3dusr.sbin/unbound/setup local-unbound-setup.sh

local-unbound: Read a tab separated resolv.conf

Use [[:space:]] rather than a white space character to delimit the keys
and the values in the resolv.conf file.

PR:             236079
Reviewed by:    des
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D53811

(cherry picked from commit 0628400590e025b7db1c0905e6ee488a24ef3f60)
DeltaFile
+4-4usr.sbin/unbound/setup/local-unbound-setup.sh
+4-41 files

HardenedBSD/src 821774dsbin/ipf/libipf interror.c, sys/netpfil/ipfilter/netinet ip_nat.c

ipfilter: Verify ipnat on entry into kernel

The ipnat struct is built by ipnat(8), specifically ipnat_y.y when
parsing the ipnat configuration file (typically ipnat.conf). ipnat
contains a variable length string field at the end of the struct. This
data field, called in_names, may contain various text strings such as
NIC names. There is no upper bound limit to the length of strings as
long as the in_namelen length field specifies the length of in_names
within the ipnat structure and in_size specifies the size of the ipnat
structure itself.

Reported by:            Ilja Van Sprundel <ivansprundel at ioactive.com>
Reviewed by:            markj
MFC after:              1 week
Differential revision:  https://reviews.freebsd.org/D53843
DeltaFile
+41-1sys/netpfil/ipfilter/netinet/ip_nat.c
+6-0sbin/ipf/libipf/interror.c
+47-12 files

HardenedBSD/src eda1756sbin/ipf/libipf interror.c, sys/netpfil/ipfilter/netinet fil.c ip_fil.h

ipfilter: Verify frentry on entry into kernel

The frentry struct is built by ipf(8), specifically ipf_y.y when parsing
the ipfilter configuration file (typically ipf.conf). frentry contains
a variable length string field at the end of the struct. This data field,
called fr_names, may contain various text strings such as NIC names,
destination list (dstlist) names, and filter rule comments.  The length
field specifies the length of fr_names within the frentry structure and
fr_size specifies the size of the frentry structure itself.

The upper bound limit to the length of strings field is controlled by the
fr_max_namelen sysctl/kenv or the max_namelen ipfilter tuneable.

The initial concepts were discussed with emaste and jrm.

Reported by:            Ilja Van Sprundel <ivansprundel at ioactive.com>
Reviewed by:            markj
MFC after:              1 week
Differential revision:  https://reviews.freebsd.org/D53843
DeltaFile
+59-2sys/netpfil/ipfilter/netinet/fil.c
+5-0sbin/ipf/libipf/interror.c
+1-0sys/netpfil/ipfilter/netinet/ip_fil.h
+1-0sys/netpfil/ipfilter/netinet/mlfk_ipl.c
+66-24 files

HardenedBSD/src 525c535sys/netpfil/ipfilter/netinet fil.c ip_fil.h

ipfilter: Add ipf_check_names_string()

ipf_check_names_string will verify userland inputs in names strings
(fr.fr_names, in.in_names) for correctness.

Original concept of ipf_check_names_string() instead of macros by
markj.

Reviewed by:            markj
MFC after:              1 week
Differential revision:  https://reviews.freebsd.org/D53843
DeltaFile
+31-0sys/netpfil/ipfilter/netinet/fil.c
+1-0sys/netpfil/ipfilter/netinet/ip_fil.h
+32-02 files

HardenedBSD/src e00a781sys/modules/mqueue Makefile

mqueue: Export kern_kmq_* symbols from kernel module

linux.ko supports POSIX message queues using these symbols, so they need
to be exported rather than relying on the kernel linker's misfeature of
linking against debug or local symbols (which will soon be disabled by
default).

Reported by:    mav
Reviewed by:    zlei
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53907
DeltaFile
+7-0sys/modules/mqueue/Makefile
+7-01 files

HardenedBSD/src 0a4747ctests/sys/common vnet.subr

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+1-1tests/sys/common/vnet.subr
+1-11 files

HardenedBSD/src 23af364tests/sys/common vnet.subr

tests: detect built-in modules

When checking vnet test prerequisites we check if if_epair and if_bridge are
available, but we only checked for loadable modules. It's possible for these to
be built into the kernel instead.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+1-1tests/sys/common/vnet.subr
+1-11 files

HardenedBSD/src 925ee1dlib/libc/stdlib strfmon.c, sys/dev/nvme nvme.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+1-1lib/libc/stdlib/strfmon.c
+1-1sys/dev/nvme/nvme.h
+2-22 files

HardenedBSD/src cf26a98contrib/llvm-project/clang/lib/Driver/ToolChains FreeBSD.h, lib/clang freebsd_cc_version.h

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+5-0contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h
+1-1lib/clang/freebsd_cc_version.h
+2-0lib/libgcc_s/Makefile
+8-13 files

HardenedBSD/src 6ab30d0contrib/llvm-project/clang/lib/Driver/ToolChains FreeBSD.h, lib/clang freebsd_cc_version.h

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+5-0contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h
+1-1lib/clang/freebsd_cc_version.h
+2-0lib/libgcc_s/Makefile
+8-13 files

HardenedBSD/src e4e5e7dcontrib/llvm-project/clang/lib/Driver/ToolChains FreeBSD.h, lib/clang freebsd_cc_version.h

Reapply "Merge commit e24f90190c77 from llvm git (by Brad Smith):"

    [Driver] Enable outline atomics for FreeBSD/aarch64 (#156089)

The compiler_rt helper functions have been built since 12.4, 13.1, 14
and anything newer.

This reverts commit bd27bd1f51d049538cc7a0053be9d99110a53ae1.

Only some people (including the release manager, unfortunately) ran into
build issues with the previous iteration of this commit, because they
were bootstrapping the compiler, either via the WITHOUT_SYSTEM_COMPILER
src.conf(5) setting, or because the build system determined that their
base system compiler was out of date.

The bootstrapped compiler would then enable outline atomics and compile
libgcc_s with these, but because libgcc_s is linked with -nodefaultlibs,
it could not find the helper routines in libcompiler_rt.a.


    [17 lines not shown]
DeltaFile
+5-0contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h
+1-1lib/clang/freebsd_cc_version.h
+2-0lib/libgcc_s/Makefile
+8-13 files

HardenedBSD/src a48358dcontrib/llvm-project/clang/lib/Driver/ToolChains FreeBSD.h, lib/clang freebsd_cc_version.h

Reapply "Merge commit e24f90190c77 from llvm git (by Brad Smith):"

    [Driver] Enable outline atomics for FreeBSD/aarch64 (#156089)

The compiler_rt helper functions have been built since 12.4, 13.1, 14
and anything newer.

This reverts commit bd27bd1f51d049538cc7a0053be9d99110a53ae1.

Only some people (including the release manager, unfortunately) ran into
build issues with the previous iteration of this commit, because they
were bootstrapping the compiler, either via the WITHOUT_SYSTEM_COMPILER
src.conf(5) setting, or because the build system determined that their
base system compiler was out of date.

The bootstrapped compiler would then enable outline atomics and compile
libgcc_s with these, but because libgcc_s is linked with -nodefaultlibs,
it could not find the helper routines in libcompiler_rt.a.


    [17 lines not shown]
DeltaFile
+5-0contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h
+1-1lib/clang/freebsd_cc_version.h
+2-0lib/libgcc_s/Makefile
+8-13 files

HardenedBSD/src 718acd7sys/dev/nvme nvme.h

nvme: Use 'unsigned int' in preference to bare unsigned

It's our preferred style. No functional change.

Noticed by: avg
Sponsored by: Netflix
DeltaFile
+1-1sys/dev/nvme/nvme.h
+1-11 files

HardenedBSD/src 91e7f19lib/libc/stdlib strfmon.c

strfmon: Fix typo s/poistion/position/

MFC after:      1 week
DeltaFile
+1-1lib/libc/stdlib/strfmon.c
+1-11 files

HardenedBSD/src 489d73esys/cam/nvme nvme_da.c, sys/dev/cxgbe t4_main.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+18-3sys/dev/cxgbe/t4_main.c
+4-5sys/cam/nvme/nvme_da.c
+2-2sys/net/if.h
+1-0sys/modules/agp/Makefile
+25-104 files

HardenedBSD/src bd2919elib/libc/stdlib/malloc/jemalloc jemalloc.3, sys/cam/nvme nvme_da.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+179-21lib/libc/stdlib/malloc/jemalloc/jemalloc.3
+4-5sys/cam/nvme/nvme_da.c
+183-262 files

HardenedBSD/src e271f93sys/cam/nvme nvme_da.c

nda: fix setting of unmappedio flag

The upstream refactoring of ndaregister() to split out ndasetgeom()
accidentally used an uninitialed variable to decide whether or not
to set DISKFLAG_UNMAPPED_BIO.  Fix this by moving that portion of
ndasetgeom() back up to ndaregister().  The check for PIM_UNMAPPED
is not really needed because nvme devices always have that set,
so it cannot change in the other path that ndasetgeom() is now called.

Reviewed by:    imp
Fixes:          dffd882d12d2a71aca464f48209ec9ae6f393b15
Sponsored by:   Netflix
MFC After:      1 minute
(cherry picked from commit 2b4dbad2db5766294ee97bb96228ec6826a9e7c3)
DeltaFile
+4-5sys/cam/nvme/nvme_da.c
+4-51 files

HardenedBSD/src 2b4dbadsys/cam/nvme nvme_da.c

nda: fix setting of unmappedio flag

The upstream refactoring of ndaregister() to split out ndasetgeom()
accidentally used an uninitialed variable to decide whether or not
to set DISKFLAG_UNMAPPED_BIO.  Fix this by moving that portion of
ndasetgeom() back up to ndaregister().  The check for PIM_UNMAPPED
is not really needed because nvme devices always have that set,
so it cannot change in the other path that ndasetgeom() is now called.

Reviewed by:    imp
Fixes:          dffd882d12d2a71aca464f48209ec9ae6f393b15
Sponsored by:   Netflix
MFC After:      1 minute
DeltaFile
+4-5sys/cam/nvme/nvme_da.c
+4-51 files

HardenedBSD/src 98f6f6esys/dev/cxgbe t4_main.c

cxgbe(4): Enable IFCAP_NV and implement SIOCGIFCAPNV/SIOCSIFCAPNV

MFC after:      1 week
Sponsored by:   Chelsio Communications
DeltaFile
+18-3sys/dev/cxgbe/t4_main.c
+18-31 files

HardenedBSD/src cbe0ccdlib/libc/stdlib/malloc/jemalloc jemalloc.3

jemalloc: apply freebsd changes to jemalloc 5.3.0 man page

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1890

(cherry picked from commit 80ec82aba9ae7286cac1a4f8000262cf2cf34d0c)
DeltaFile
+31-1lib/libc/stdlib/malloc/jemalloc/jemalloc.3
+31-11 files