FreeBSD/src 6883b12sys/netinet in_pcb.c in_pcb.h

inpcb: allow to specify different sizes for port and load balance hashes

Understand zero size as instruction to not allocate the hash.  Do not
allocate both hashes for rawip(4).  There are no functional changes to TCP
or UDP.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D56705
DeltaFile
+25-12sys/netinet/in_pcb.c
+3-2sys/netinet/in_pcb.h
+3-2sys/netinet/udp_usrreq.c
+1-1sys/netinet/tcp_subr.c
+1-1sys/netinet/raw_ip.c
+33-185 files

FreeBSD/src 9b8eb70sys/netinet in_pcb.c, sys/netinet6 in6_pcb.c in6_pcb.h

inpcb: improve some internal function names

The 'hash' subword doesn't bring any additional information.  All inpcb
lookup functions operate on hashes.

For lookup functions that work on either exact hash or wild hash just
perform s/hash_//.  Rename in_pcblookup_hash() into
in_pcblookup_with_lock(), emphasizing its difference to
in_pcblookup_smr().  Rename in_pcblookup_hash_locked() to
in_pcblookup_internal(), as it doesn't return a locked inpcb and is used
only for internal purposes.  Note that the IPv6 sibling of this function
already lives by name in6_pcblookup_internal().  Some future changes will
make such naming more justified.

No functional change.

Reviewed by:            pouria, markj
Differential Revision:  https://reviews.freebsd.org/D56482
DeltaFile
+28-25sys/netinet/in_pcb.c
+22-24sys/netinet6/in6_pcb.c
+1-1sys/netinet6/in6_pcb.h
+51-503 files

FreeBSD/src 67a63eatools/build depend-cleanup.sh, usr.bin/gh-bc/tests Makefile bc_tests.sh

bc: Fix tests

Stop generating test scripts at build time.  The dc test script is
broken and simply fixing the code that generates it won't help as there
is no reliable way to ensure it gets regenerated if it already exists in
the object tree.

MFC after:      1 week
Reviewed by:    se
Differential Revision:  https://reviews.freebsd.org/D56511
DeltaFile
+0-10usr.bin/gh-bc/tests/Makefile
+5-0usr.bin/gh-bc/tests/bc_tests.sh
+5-0usr.bin/gh-bc/tests/dc_tests.sh
+4-0tools/build/depend-cleanup.sh
+14-104 files

FreeBSD/src 4c99836tools/kerneldoc/subsys common-Doxyfile

kerneldoc: also ingest .md (markdown files)

The doxygen tooling has supported ingesting markdown files for a number
of years.  Adding this option allows them to be ingested into the
subsys builds.

Reviewed by:    netchild
Differential Revision:  https://reviews.freebsd.org/D56652
DeltaFile
+1-0tools/kerneldoc/subsys/common-Doxyfile
+1-01 files

FreeBSD/src 1cbd6e1lib/libnv/tests nvlist_send_recv_test.c, sys/contrib/libnv nvlist.c

libnv: fix heap overflow in nvlist_recv()

nvlist_check_header() validated nvlh_size for overflow before
performing conversion. An mallicous user can set
NV_FLAG_BIG_ENDIAN in the header and craft nvlh_size so that
the orginall value passes the check, but after the conversion the
sizeof(nvlist_header) + size can overflow.
This can lead to a heap buffer overflow.

Approved by:    so
Security:       FreeBSD-SA-26:17.libnv
Security:       CVE-2026-35547
Fixes:          36fa90dbde0060aacb5677d0b113ee168e839071
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56342
DeltaFile
+57-0lib/libnv/tests/nvlist_send_recv_test.c
+5-4sys/contrib/libnv/nvlist.c
+62-42 files

FreeBSD/src 45809b0lib/libnv msgio.c, lib/libnv/tests nvlist_send_recv_test.c

libnv: switch fd_wait() from select(2) to poll(2)

The previous implementation used FD_SET() on a stack-allocated fd_set,
which is an out-of-bounds write whenever the socket fd is >= FD_SETSIZE
(1024).

Approved by:    so
Security:       FreeBSD-SA-26:16.libnv
Security:       CVE-2026-39457
Reported by:    Joshua Rogers of AISLE Research Team (https://aisle.com/)
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56689
DeltaFile
+56-0lib/libnv/tests/nvlist_send_recv_test.c
+6-6lib/libnv/msgio.c
+62-62 files

FreeBSD/src 0729625lib/libnv/tests nvlist_send_recv_test.c Makefile, sys/contrib/libnv nv_impl.h nvlist.c

libnv: add tests to verify potential overflow issues

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

(cherry picked from commit 241a7ddd7112982ed41ccdd047c1dad59ee0256e)
DeltaFile
+193-0lib/libnv/tests/nvlist_send_recv_test.c
+9-0lib/libnv/tests/Makefile
+8-0sys/contrib/libnv/nv_impl.h
+0-7sys/contrib/libnv/nvlist.c
+210-74 files

FreeBSD/src 680e97flib/libnv/tests nv_array_tests.cc

libnv: add test to verify null termination of string in array

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

(cherry picked from commit 2981431e044fae3bc87e6fa891b8230b484dc84b)
DeltaFile
+56-2lib/libnv/tests/nv_array_tests.cc
+56-21 files

FreeBSD/src ae00a52sys/kern kern_exec.c

execve: Fix an operator precedence bug

The buggy version allowed userspace to overflow the copy into adjacent
execve KVA regions, which enables, among other things, injecting
environment variables into privileged processes.

Approved by:    so
Security:       FreeBSD-SA-26:13.exec
Security:       CVE-2026-7270
Reported by:    Ryan Austin of Calif.io
Reviewed by:    brooks, kib
Fixes:          f373437a01a3 ("Add helper functions to copy strings into struct image_args.")
Differential Revision:  https://reviews.freebsd.org/D56665
DeltaFile
+1-1sys/kern/kern_exec.c
+1-11 files

FreeBSD/src b3087e0sbin/dhclient dhclient.c

dhclient: Check for unexpected characters in some DHCP server options

Some options are written directly to the lease file, which may be parsed
by subsequent dhclient invocations.  We must make sure that a malicious
server can't control the "medium" field of a lease definition, otherwise
they can achieve RCE by injecting one into the lease file, whereupon it
will be passed to dhclient-script, which passes it through eval.

Approved by:    so
Security:       FreeBSD-SA-26:12.dhclient
Security:       CVE-2026-42511
Reported by:    Joshua Rogers of AISLE Research Team (https://aisle.com/)
DeltaFile
+12-0sbin/dhclient/dhclient.c
+12-01 files

FreeBSD/src ba21845sys/netpfil/pf pf.c, tests/sys/netpfil/pf sctp.py

pf: improve SCTP validation

As per RFC5061 "4.2.  New Parameter Types" the add/delete IP address
parameters (0xc001, 0xc002) may not be present in an INIT or INIT-ACK
chunk. They are only allowed to be present in an ASCONF chunk.

This also prevents unbounded recursion while parsing an SCTP packet.

Approved by:    so
Security:       FreeBSD-SA-26:14.pf
Security:       CVE-2026-7164
PR:             294799
Reported by:    Igor Gabriel Sousa e Souza
MFC after:      3 days
Sponsored by:   Orange Business Services
DeltaFile
+23-0tests/sys/netpfil/pf/sctp.py
+13-5sys/netpfil/pf/pf.c
+36-52 files

FreeBSD/src a813012sbin/dhclient dhclient.c

dhclient: Fix reallocation of dhclient script environments

When the number of DHCP options exceeds a threshold, script_set_env()
will reallocate the environment, stored as an array of pointers.  The
calculation of the array size failed to multiply by the pointer size,
resulting in a smaller than expected buffer which admits out-of-bounds
writes.

Approved by:    so
Security:       FreeBSD-SA-26:15.dhclient
Security:       CVE-2026-42511
Reported by:    Joshua Rogers of AISLE Research Team (https://aisle.com/)
DeltaFile
+2-2sbin/dhclient/dhclient.c
+2-21 files

FreeBSD/src 4408b68sbin/dhclient dhclient.c

dhclient: Fix reallocation of dhclient script environments

When the number of DHCP options exceeds a threshold, script_set_env()
will reallocate the environment, stored as an array of pointers.  The
calculation of the array size failed to multiply by the pointer size,
resulting in a smaller than expected buffer which admits out-of-bounds
writes.

Approved by:    so
Security:       FreeBSD-SA-26:15.dhclient
Security:       CVE-2026-42511
Reported by:    Joshua Rogers of AISLE Research Team (https://aisle.com/)
DeltaFile
+2-2sbin/dhclient/dhclient.c
+2-21 files

FreeBSD/src c3e943esys/kern kern_exec.c

execve: Fix an operator precedence bug

The buggy version allowed userspace to overflow the copy into adjacent
execve KVA regions, which enables, among other things, injecting
environment variables into privileged processes.

Approved by:    so
Security:       FreeBSD-SA-26:13.exec
Security:       CVE-2026-7270
Reported by:    Ryan Austin of Calif.io
Reviewed by:    brooks, kib
Fixes:          f373437a01a3 ("Add helper functions to copy strings into struct image_args.")
Differential Revision:  https://reviews.freebsd.org/D56665
DeltaFile
+1-1sys/kern/kern_exec.c
+1-11 files

FreeBSD/src 414e25dlib/libnv/tests nvlist_send_recv_test.c, sys/contrib/libnv nvlist.c

libnv: fix heap overflow in nvlist_recv()

nvlist_check_header() validated nvlh_size for overflow before
performing conversion. An mallicous user can set
NV_FLAG_BIG_ENDIAN in the header and craft nvlh_size so that
the orginall value passes the check, but after the conversion the
sizeof(nvlist_header) + size can overflow.
This can lead to a heap buffer overflow.

Approved by:    so
Security:       FreeBSD-SA-26:17.libnv
Security:       CVE-2026-35547
Fixes:          36fa90dbde0060aacb5677d0b113ee168e839071
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56342
DeltaFile
+57-0lib/libnv/tests/nvlist_send_recv_test.c
+5-4sys/contrib/libnv/nvlist.c
+62-42 files

FreeBSD/src e1c9f92sys/netpfil/pf pf.c, tests/sys/netpfil/pf sctp.py

pf: improve SCTP validation

As per RFC5061 "4.2.  New Parameter Types" the add/delete IP address
parameters (0xc001, 0xc002) may not be present in an INIT or INIT-ACK
chunk. They are only allowed to be present in an ASCONF chunk.

This also prevents unbounded recursion while parsing an SCTP packet.

Approved by:    so
Security:       FreeBSD-SA-26:14.pf
Security:       CVE-2026-7164
PR:             294799
Reported by:    Igor Gabriel Sousa e Souza
Sponsored by:   Orange Business Services
DeltaFile
+23-0tests/sys/netpfil/pf/sctp.py
+11-5sys/netpfil/pf/pf.c
+34-52 files

FreeBSD/src 2621f6csbin/dhclient dhclient.c

dhclient: Check for unexpected characters in some DHCP server options

Some options are written directly to the lease file, which may be parsed
by subsequent dhclient invocations.  We must make sure that a malicious
server can't control the "medium" field of a lease definition, otherwise
they can achieve RCE by injecting one into the lease file, whereupon it
will be passed to dhclient-script, which passes it through eval.

Approved by:    so
Security:       FreeBSD-SA-26:12.dhclient
Security:       CVE-2026-42511
Reported by:    Joshua Rogers of AISLE Research Team (https://aisle.com/)
DeltaFile
+12-0sbin/dhclient/dhclient.c
+12-01 files

FreeBSD/src 025789elib/libnv msgio.c, lib/libnv/tests nvlist_send_recv_test.c

libnv: switch fd_wait() from select(2) to poll(2)

The previous implementation used FD_SET() on a stack-allocated fd_set,
which is an out-of-bounds write whenever the socket fd is >= FD_SETSIZE
(1024).

Approved by:    so
Security:       FreeBSD-SA-26:16.libnv
Security:       CVE-2026-39457
Reported by:    Joshua Rogers of AISLE Research Team (https://aisle.com/)
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56689
DeltaFile
+56-0lib/libnv/tests/nvlist_send_recv_test.c
+6-6lib/libnv/msgio.c
+62-62 files

FreeBSD/src 6f9ddb3sys/netpfil/pf pf.c, tests/sys/netpfil/pf sctp.py

pf: improve SCTP validation

As per RFC5061 "4.2.  New Parameter Types" the add/delete IP address
parameters (0xc001, 0xc002) may not be present in an INIT or INIT-ACK
chunk. They are only allowed to be present in an ASCONF chunk.

This also prevents unbounded recursion while parsing an SCTP packet.

Approved by:    so
Security:       FreeBSD-SA-26:14.pf
Security:       CVE-2026-7164
PR:             294799
Reported by:    Igor Gabriel Sousa e Souza
Sponsored by:   Orange Business Services
DeltaFile
+23-0tests/sys/netpfil/pf/sctp.py
+11-5sys/netpfil/pf/pf.c
+34-52 files

FreeBSD/src e2219bblib/libnv/tests nvlist_send_recv_test.c, sys/contrib/libnv nvlist.c

libnv: fix heap overflow in nvlist_recv()

nvlist_check_header() validated nvlh_size for overflow before
performing conversion. An mallicous user can set
NV_FLAG_BIG_ENDIAN in the header and craft nvlh_size so that
the orginall value passes the check, but after the conversion the
sizeof(nvlist_header) + size can overflow.
This can lead to a heap buffer overflow.

Approved by:    so
Security:       FreeBSD-SA-26:17.libnv
Security:       CVE-2026-35547
Fixes:          36fa90dbde0060aacb5677d0b113ee168e839071
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56342
DeltaFile
+57-0lib/libnv/tests/nvlist_send_recv_test.c
+5-4sys/contrib/libnv/nvlist.c
+62-42 files

FreeBSD/src f5ea3dclib/libnv msgio.c, lib/libnv/tests nvlist_send_recv_test.c

libnv: switch fd_wait() from select(2) to poll(2)

The previous implementation used FD_SET() on a stack-allocated fd_set,
which is an out-of-bounds write whenever the socket fd is >= FD_SETSIZE
(1024).

Approved by:    so
Security:       FreeBSD-SA-26:16.libnv
Security:       CVE-2026-39457
Reported by:    Joshua Rogers of AISLE Research Team (https://aisle.com/)
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56689
DeltaFile
+56-0lib/libnv/tests/nvlist_send_recv_test.c
+6-6lib/libnv/msgio.c
+62-62 files

FreeBSD/src 8e8ddb0sys/kern kern_exec.c

execve: Fix an operator precedence bug

The buggy version allowed userspace to overflow the copy into adjacent
execve KVA regions, which enables, among other things, injecting
environment variables into privileged processes.

Approved by:    so
Security:       FreeBSD-SA-26:13.exec
Security:       CVE-2026-7270
Reported by:    Ryan Austin of Calif.io
Reviewed by:    brooks, kib
Fixes:          f373437a01a3 ("Add helper functions to copy strings into struct image_args.")
Differential Revision:  https://reviews.freebsd.org/D56665
DeltaFile
+1-1sys/kern/kern_exec.c
+1-11 files

FreeBSD/src 5d8e32asbin/dhclient dhclient.c

dhclient: Fix reallocation of dhclient script environments

When the number of DHCP options exceeds a threshold, script_set_env()
will reallocate the environment, stored as an array of pointers.  The
calculation of the array size failed to multiply by the pointer size,
resulting in a smaller than expected buffer which admits out-of-bounds
writes.

Approved by:    so
Security:       FreeBSD-SA-26:15.dhclient
Security:       CVE-2026-42511
Reported by:    Joshua Rogers of AISLE Research Team (https://aisle.com/)
DeltaFile
+2-2sbin/dhclient/dhclient.c
+2-21 files

FreeBSD/src 8008e4bsbin/dhclient dhclient.c

dhclient: Check for unexpected characters in some DHCP server options

Some options are written directly to the lease file, which may be parsed
by subsequent dhclient invocations.  We must make sure that a malicious
server can't control the "medium" field of a lease definition, otherwise
they can achieve RCE by injecting one into the lease file, whereupon it
will be passed to dhclient-script, which passes it through eval.

Approved by:    so
Security:       FreeBSD-SA-26:12.dhclient
Security:       CVE-2026-42511
Reported by:    Joshua Rogers of AISLE Research Team (https://aisle.com/)
DeltaFile
+12-0sbin/dhclient/dhclient.c
+12-01 files

FreeBSD/src 6c09b76. RELNOTES

RELNOTES: Add an entry for recent improvements to multicast routing

Reviewed by:    kevans
Sponsored by;   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D56710
DeltaFile
+5-0RELNOTES
+5-01 files

FreeBSD/src 2783fb7sys/arm64/arm64 locore.S

arm64: Fix a MTE check

It should be for FEAT_MTE2 as the registers aren't implemented for
FEAT_MTE.

While here fix the style of the comment explaining the check.

Reported by:    markj
Fixes:          58de79153622 ("arm64: mte: configure initial state for system registers")
Sponsored by:   Arm Ltd
DeltaFile
+3-3sys/arm64/arm64/locore.S
+3-31 files

FreeBSD/src 01ff0fasys/arm64/arm64 pmap.c vm_machdep.c, sys/arm64/include proc.h armreg.h

arm64: Support some per-thread sctlr_el1 fields

This will be used to enable MTE from userspace.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55950
DeltaFile
+11-0sys/arm64/arm64/pmap.c
+4-0sys/arm64/arm64/vm_machdep.c
+2-1sys/arm64/include/proc.h
+1-0sys/arm64/arm64/exec_machdep.c
+1-0sys/arm64/include/armreg.h
+19-15 files

FreeBSD/src bf1529dsys/netlink netlink_generic.c

netlink: fix LINT-NOVIMAGE build

Include the required header for securelevel_ge()

Fixes:          9933bdcb1264 ("pf: only allow a subset of netlink calls when securelevel is set")
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 3103d39cd99f0a49414f907459d8fd3c11dc36b8)
DeltaFile
+1-0sys/netlink/netlink_generic.c
+1-01 files

FreeBSD/src 6d3401cusr.sbin/ctladm/tests port.sh

ctladm tests: Only use allowed chars in IQN

_ isn't part of the allowed IQN format, but - is.

None functional change.

Reviewed by:            asomers, ngie
Approved by:            asomers (mentor)
Sponsored by:           ConnectWise
Differential Revision:  https://reviews.freebsd.org/D56557

(cherry picked from commit 51b65c6af2e19f1e944c67aa2b5252cd9dc9e2f7)
DeltaFile
+5-5usr.sbin/ctladm/tests/port.sh
+5-51 files

FreeBSD/src 09db364contrib/openbsm/bsm libbsm.h, contrib/openbsm/libbsm bsm_io.c bsm_token.c

Fix memory corruption bugs in BSM record parsing

fetch_newgroups_tok(3): clamp group count to AUDIT_MAX_GROUPS before the
loop to prevent a stack buffer overflow when a crafted record specifies
more than 16 groups.

fetch_execarg_tok(3), fetch_execenv_tok(3): add a bounds check at the
top of the string-walking loop to prevent an out-of-bounds read when the
previous string's nul byte is the last byte of the record buffer.

fetch_sock_unix_tok(3): clamp the memchr search length to the number of
bytes remaining in the buffer to prevent an out-of-bounds read on short
tokens. Also clamp slen to sizeof(path) to prevent a one-byte overflow
when no nul byte is found within the path data.

fetch_socket_tok: fix copy-paste error where the remote address was
written into l_addr instead of r_addr.
Previously reported by: @haginara


    [13 lines not shown]
DeltaFile
+44-6contrib/openbsm/libbsm/bsm_io.c
+8-2contrib/openbsm/bsm/libbsm.h
+1-1contrib/openbsm/libbsm/bsm_token.c
+53-93 files