Commit graph

293733 commits

Author SHA1 Message Date
Li-Wen Hsu
04038c19d3 installer: Add download.freebsd.org to mirror list
download.freebsd.org is backed by project mirrors and a CDN, which
should benefit most users.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	delphij (releng)
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D54849

(cherry picked from commit 45079cdf8b517adf803db7dc7aa85e5728cfeb2f)
2026-04-30 07:39:21 +02:00
Enji Cooper
7390ecf80a crypto/openssl: update from 3.0.16 to 3.0.20
### Description

This particular change contains all functional and security fixes made
between 3.0.16 and 3.0.20, with the net-resulting security issues being
the ones addressed in 3.0.20 [1] [2].

This is a direct commit to stable/14 as stable/15 and later use OpenSSL
3.5, as of writing, and thus this change could not have been merged
through main and stable/15 since the 3.0.17+ was released after :main
switched to OpenSSL 3.5.

This does not contain any merge commits as any MFV changes are banned
unless they go through :main.

### Process used when updating the component

1. Run the subtree merge command in a staging tree.
2. Resolve conflicts.
3. Compare against reference branch.
4. Pull over remaining changes adding new manpages to the build.
5. Take changes from staging tree over to stable/14 .

### Test Plan

Tested with sanity checks on 14-STABLE (amd64) and `make tinderbox` on
all 14-STABLE supported architectures.

1. https://github.com/openssl/openssl/releases/tag/openssl-3.0.20
2. https://github.com/openssl/openssl/blob/openssl-3.0.20/CHANGES.md
2026-04-30 07:39:20 +02:00
Enji Cooper
5fe9c6676e OpenSSL: install .pc files from the exporters subdir
The .pc files generated in the root directory are used as part of the
build; they should never be installed. Use the versions from the
exporters subdirectory--which should be installed--as the .pc files
which are distributed with FreeBSD. This avoids the need for "fixing up"
these files after the fact (see `crypto/openssl/BSDmakefile` for more
details as part of this change).

Garbage collect `secure/lib/libcrypto/Makefile.version`, et al,
as they're orphaned files. They were technically unused prior to this
change as the vendor process properly embeds the version numbers in
various files, but this commit formalizes the removal.

This correction/clarification on the .pc files will be made in an
upcoming release of OpenSSL [1].

References:
1. https://github.com/openssl/openssl/issues/28803

Suggested by:	Richard Levitte (OpenSSL project)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D53043

(cherry picked from commit 97388e7215e080f2cb9fd446f4be4e46a9aeb114)
2026-04-30 07:39:20 +02:00
Enji Cooper
f19fe1bd86 OpenSSL: update build artifacts to match 3.0.16 release
The files committed match the output of the new vendor process. Much of
this involves regenerating manpages to catch up to content from the
initial 3.0 import.

This is a direct commit to stable/14.
2026-04-30 07:39:20 +02:00
Enji Cooper
bf91efef66 crypto/openssl: update vendor update instructions
This change fills out the requirements for doing vendor updates,
documents the new vendor update process, and guides whoever needs to do
the next version update a bit better than the documentation did prior to
this change so everyone can pitch in with version updates a bit better.

Convert the document to Markdown while here to make it easier to
render/print out the directions in a structured format.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D53190

Conflicts:
	crypto/openssl/FREEBSD-upgrade

(cherry picked from commit 08cdcff58acb2aec881e42c7f097d6492d864898)
2026-04-30 07:39:20 +02:00
Enji Cooper
e528055e11 crypto/openssl: remove autogenerated files
These files contain build host paths and other configuration details
that can be regenerated via the standard vendor import process. Don't
clutter up the FreeBSD tree with these files.

Add the paths to .gitignore to prevent them from accidentally being
added in a future update.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D53044

Conflicts:
	crypto/openssl/libcrypto.pc
	crypto/openssl/libssl.pc
	crypto/openssl/openssl.pc

(cherry picked from commit d271d2ce152435b14e309bd8b25f47a0f4a2040f)
2026-04-30 07:39:20 +02:00
Enji Cooper
c36ac4bded crypto/openssl: fix importing new versions from pristine trees
Prior to this change, CC was not being passed through to Configure,
which was resulting in failures when Configure was running compiler
checks.

Pass through CC via `WRK_ENV` to Configure so the compiler is defined
properly as part of the initial build.

MFC after:	1 month
Fixes:		d18058b7b850 ("crypto/openssl: apply polish to new vendor import process")
Differential Revision:	https://reviews.freebsd.org/D52595

(cherry picked from commit 52c4b76d1dd385fbe33b78172e39a10749b83d13)
2026-04-30 07:39:20 +02:00
Enji Cooper
fd7ef6a342 crypto/openssl: apply polish to new vendor import process
This change does the following 2 things:
- Makes the build more repeatable by isolating the environment. This
  prevents bmake from leaking variables into gmake and makes the overall
  process a bit more robust.
- Add debug printouts to make the process more straightforward to the
  reader and whoever is executing doing the current vendor import.

MFC after: 1 month
Differential Revision:	https://reviews.freebsd.org/D52420

(cherry picked from commit d18058b7b850c78f2ca1be746ab411c0bed5acc9)
2026-04-30 07:39:20 +02:00
Enji Cooper
85b1f782a1 crypto/openssl: make vendor imports easier/less error prone
This change adds a custom BSD makefile containing multiple high-level PHONY
targets, similar to targets provided by the ports framework.

The Makefile does the following:
- Reruns Configure with a deterministic set of arguments to ensure that
  all appropriate features have been enabled/disabled in OpenSSL.
- Preens the pkgconfig files to remove duplicate paths in their
  `CFLAGS` and `includedir` variables.
- Rebuilds all ASM files to ensure that the content contained is fresh.
- Rebuilds all manpages to ensure that the content contained in the
  manpages is fresh.

Some additional work needs to be done to make the manpage regeneration
"operation" reproducible (the date the manpages were generated is
embedded in the files).

All dynamic configuration previously captured in
`include/openssl/configuration.h` and `include/crypto/bn_conf.h` has been
moved to `freebsd/include/dynamic_freebsd_configuration.h` and
`freebsd/include/crypto/bn_conf.h`, respectively. This helps
ensure that future updates don't wipe out FreeBSD customizations to
these files, which tune behavior on a per-target architecture basis, e.g.,
ARM vs x86, 32-bit vs 64-bit, etc.

MFC after: 1 month
Differential Revision:	https://reviews.freebsd.org/D51663

Conflicts:
	crypto/openssl/apps/CA.pl
	crypto/openssl/configdata.pm
	crypto/openssl/include/openssl/configuration.h
	crypto/openssl/include/openssl/fipskey.h
	crypto/openssl/tools/c_rehash
	crypto/openssl/util/shlib_wrap.sh
	crypto/openssl/util/wrap.pl
	secure/lib/libcrypto/Makefile.inc

(cherry picked from commit 267f8c1f4b)
2026-04-30 07:39:19 +02:00
Enji Cooper
010b500192 OSSL_HTTP_get(): Reset redirection_url in each iteration
Also remove some dead assignments.

Obtained from:	openssl (e78c8b791c0e03e750ef7196bc7bfee8e5bd00a0)

MFC after:	2 weeks
Requested by:	Phillip Sabatino
Sponsored by:	Dell, Inc.

(cherry picked from commit 18378ef11a)
2026-04-30 07:39:19 +02:00
Kristof Provost
6b092a943c pf: fix duplicate rule detection for automatic tables
We should look at the table name for automatic tables as well. These
are different tables, so the rules using them are (or can be) different
as well.

MFC after:	3 days
Reported by:	Michael Sinatra <michael@burnttofu.net>
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit fb838352751767e756bd45cd2040fa464ed4de20)
2026-04-30 07:39:19 +02:00
Kristof Provost
55f031f303 pfctl: parser must not ignore error from pfctl_optimize_ruleset()
Ignoring the error may cause pfctl(8) to load inconsistent ruleset
preventing pf(4) to enforce desired policy.

Issue reported and fix suggested by berts _from_ fastmail _dot_ com

'Looks good.' @deraadt

MFC after:	1 week
Obtained from:	OpenBSD, sashan <sashan@openbsd.org>, 9fd28a8cca
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 343ace42f82a629374af4dc3a72da5f46f2c3feb)
2026-04-30 07:39:19 +02:00
Kristof Provost
920990c75a 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
2026-04-30 06:53:59 +02:00
Kyle Evans
d958a3c04d if_tuntap: make SIOCIFDESTROY interruptible
There's no good justification to permanently hang a thread until the
tunnel can be destroyed.  Make it interruptible so that the admin can
^C it and remedy the situation if something erroneously has the tunnel
open, rather than forcing them to open another shell to resolve it.

Reviewed by:	markj

(cherry picked from commit 274bf7c8ae)
2026-04-29 22:28:11 +02:00
Andrey V. Elsukov
9c721b605c ipfw_nptv6: fix handling the ifaddr removal event
The result of IN6_ARE_MASKED_ADDR_EQUAL() macro is not an integer, so
threat it as a boolean value.

PR:		294114
Reported by:	Peter Much <pmc citylink dinoex sub org>

(cherry picked from commit d9d7b59486499615a5fdce54443ce62aecf557e8)
2026-04-29 22:27:52 +02:00
Joseph Mingrone
8aca16c3d1 libpcap: Update to 1.10.6
Changes:	https://raw.githubusercontent.com/the-tcpdump-group/libpcap/89e982c37c36ad0bf9f10b7ded421cb42422effa/CHANGES
Reviewed by:	bms, emaste
Obtained from:	https://www.tcpdump.org/release/libpcap-1.10.6.tar.gz
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D55545
Differential Revision:	https://reviews.freebsd.org/D55858

(cherry picked from commit 16cef5f7a65588def71db4fdfa961f959847e3b6)
2026-04-29 22:27:29 +02:00
Mark Johnston
39233c7d0d Add UPDATING entries and bump version
Approved by:	so
2026-04-29 22:15:07 +02:00
Mariusz Zaborski
7b7e6d7376 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:		36fa90dbde
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D56342
2026-04-29 22:15:06 +02:00
Mariusz Zaborski
4b28a8af30 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
2026-04-29 22:15:00 +02:00
Mariusz Zaborski
ba0c984194 libnv: add tests to verify potential overflow issues
Approved by:	so
Differential Revision:  https://reviews.freebsd.org/D46131

(cherry picked from commit 241a7ddd71)
2026-04-29 22:14:59 +02:00
Mariusz Zaborski
454e1b7659 libnv: add test to verify null termination of string in array
Approved by:	so
Differential Revision:  https://reviews.freebsd.org/D46138

(cherry picked from commit 2981431e04)
2026-04-29 22:14:58 +02:00
Mark Johnston
a40d4f3dca 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/)
2026-04-29 22:14:56 +02:00
Mark Johnston
153f069af1 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/)
2026-04-29 22:14:55 +02:00
Mark Johnston
810cfd4435 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:		f373437a01 ("Add helper functions to copy strings into struct image_args.")
Differential Revision:	https://reviews.freebsd.org/D56665
2026-04-29 22:14:53 +02:00
Kristof Provost
2ef27363b5 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
2026-04-29 22:14:44 +02:00
Kyle Evans
d9320cd313 amd64: fix INVLPGB range invalidation
AMD64 Architecture Programmer's Manual Volume 3 says the following:

> ECX[15:0] contains a count of the number of sequential pages to
> invalidate in addition to the original virtual address, starting from
> the virtual address specified in rAX. A count of 0 invalidates a
> single page. ECX[31]=0 indicates to increment the virtual address at
> the 4K boundary. ECX[31]=1 indicates to increment the virtual address
> at the 2M boundary. The maximum count supported is reported in
> CPUID function 8000_0008h, EDX[15:0].

ECX[31] being what we call INVLPGB_2M_CNT, signaling to increment the
VA by 2M.

> This instruction invalidates the TLB entry or entries, regardless of
> the page size (4 Kbytes, 2 Mbytes, 4 Mbytes, or 1 Gbyte). [...]

Combined with this, my interpretation of the current code is: if
<va> is aligned on a PDE boundary, we'll use INVLPGB_2M_CNT to try and
invalidate <cnt> PDEs with a single call, but that only works if <va> is
the start of at least <cnt> 2M pages.  Otherwise, if <va> or any of the
subsequent PDEs isn't actually a superpage, then we would actually only
invalidate the *first* page within the PDE before skipping to the next
PDE, leaving the remainder of the 4K pages in between as they were.

The implication would seem to be that we would need to inspect the range
that we're trying to invalidate if we're planning on using
INVLPGB_2M_CNT at all, so this patch just simplifies it to a series of
4K invalidations.  My gut feeling is that we likely still come out on
top vs. the TLB shootdown we're avoiding.

This seems to explain some issues we've seen lately with fdgrowtable()
and kqueue on recent Zen4/Zen5 EPYC hardware, where we'd experience
corruption that we can't explain.

Approved by:	so
Security:	FreeBSD-EN-26:10.amd64
PR:		293382
Reviewed by:	alc, kib, markj

(cherry picked from commit 1b8e5c02f5c07521129e06ff8ab7c660238fd75c)
(cherry picked from commit ff11ae166cd9f8ae16a5c384d46aa1218f3ff013)
2026-04-29 22:13:01 +02:00
Philip Paeps
55bf54f5d1 contrib/tzdata: import tzdata 2025c, 2026a and 2026b
Changes: https://github.com/eggert/tz/blob/2025c/NEWS
Changes: https://github.com/eggert/tz/blob/2026a/NEWS
Changes: https://github.com/eggert/tz/blob/2026b/NEWS

Approved by:	so
Security:	FreeBSD-EN-26:09.tzdata

(cherry picked from commit a86dc94b84d177da8f00d1c9420ef0860576e4c4)
(cherry picked from commit 68e2f4cc5e4ef17e64da2a25fb9918a0e1074b03)
(cherry picked from commit 6becc3dff922476d667c15f029e520da496d4295)
(cherry picked from commit 4830cb713ed8ae377f7143c4be204b5994c178c2)
(cherry picked from commit 9b95cab0a2927dfe07dbe6dc0056a80d5c730414)
(cherry picked from commit 30eb33424e74f467346319876e20a83ff71e00cd)
2026-04-29 22:12:59 +02:00
Mark Johnston
a4b0d5b3e5 Add UPDATING entries and bump version
Approved by:	so
2026-04-29 22:12:57 +02:00
Mark Johnston
53a2985c43 pkru: Fix handling of 1GB largepage mappings
pmap_pkru_update_range() did not handle the case where a PDPE has PG_PS
set.  More generally, the SET_PKRU and CLEAR_PKRU sysarch
implementations did not check whether the request covers a "boundary" vm
map entry.  Fix this, add the missing PG_PS test, and add some tests.

Approved by:	so
Security:	FreeBSD-SA-26:11.amd64
Security:	CVE-2026-6386
Reported by:	Nicholas Carlini <npc@anthropic.com>
Reviewed by:	kib, alc
Differential Revision:	https://reviews.freebsd.org/D56184
2026-04-29 22:12:56 +02:00
Mark Johnston
e1ed334011 tty: Avoid leaving dangling pointers in tty_drop_ctty()
The TIOCNOTTY handler detaches the calling process from its controlling
terminal.  It clears the link from the session to the tty, but not the
pointers from the tty to the session and process group.  This means that
sess_release() doesn't call tty_rel_sess(), and that pgdelete() doesn't
call tty_rel_pgrp(), so the pointers are left dangling.

Fix this by clearing pointers in tty_drop_ctty().  Add a standalone
regression test.

Approved by:	so
Security:	FreeBSD-SA-26:10.tty
Security:	CVE-2026-5398
Reported by:	Nicholas Carlini <npc@anthropic.com>
Reviewed by:	kib, kevans
Fixes:		1b50b999f9 ("tty: implement TIOCNOTTY")
Differential Revision:	https://reviews.freebsd.org/D56046
2026-04-29 22:12:55 +02:00
Jake Freeland
6ffe3a31b8 timerfd: Fix interval callout scheduling
When a timerfd interval callout misses its scheduled activation time, a
differential is calculated based on the actual activation time and the
scheduled activation time. This differential is divided by the timerfd's
interval time and the quotient is added to the timerfd's counter.

Before this change, the next callout was scheduled to activate at:
scheduled activation time + timerfd interval.

This change fixes the scheduling of the next callout to activate at:
actual activation time + timerfd interval - remainder.

Security:		FreeBSD-26:06.timerfd
Approved by:		so
Reviewed by:		markj
Differential Revision:	https://reviews.freebsd.org/D55790
MFC after:		2 weeks

(cherry picked from commit 85c0f1a87da1fd1eb3e646e86f70e630c48da91a)
(cherry picked from commit 3c00f603a2801fd780666f9e94a26f264a887c90)
2026-04-29 22:12:53 +02:00
Mark Johnston
74e09b2d0d vm_fault: Reset m_needs_zeroing properly
- When allocating a page, we should only consider the PG_ZERO flag when
  handling the top-level page.
- Unconditionally reset the flag when restarting the fault handler.
  Previously, vm_fault_busy_sleep() would fail to reset it.

Approved by:	so
Security:	FreeBSD-EN-26:05.vm
PR:		294039
Reviewed by:	kib
Tested by:	Peter Much <pmc@citylink.dinoex.sub.org>
MFC after:	3 days
Fixes:		cff67bc43df1 ("vm_fault: only rely on PG_ZERO when the page was newly allocated")
Differential Revision:	https://reviews.freebsd.org/D56234

(cherry picked from commit 04132e01004316ddd0e0cde6ef15b100b7b1844d)
(cherry picked from commit 9b7c0f4f81f06424899094d4381dede79669b623)
2026-04-29 22:12:52 +02:00
Bjoern A. Zeeb
4ad47b697b LinuxKPI: add supporting #includes
Compiling drm-kmod on !X86 does not include asm/smp.h which includes
preempt.h on FreeBSD.  In order to compile drm-kmod on other
architectures add the secondary #includes for preempt.h to
spinlock.h and hardirq.h (which now also gets included from highmem.h)
to connect the #include chain.

Sponsored by:	The FreeBSD Foundation
PR:		279864
Reviewed by:	jhibbits, emaste
Differential Revision: https://reviews.freebsd.org/D55974

(cherry picked from commit 1d18872c2519d7ca726ddc49735180ab1d8916e0)
(cherry picked from commit 29dce45d8c)
2026-04-08 15:25:05 +02:00
Bjoern A. Zeeb
b3d03b18e3 net80211: fix VHT160/80P80/80 chanwidth selection in the "40-" case
Depending on the base channel ni_vht_chan2 - ni_vht_chan1 can be
negative.  Apply abs() as indicated in the comments right above
	| CCFS1 - CCFS0 | = 8  or > 16
in order to fix the channel width selection.

Sponsored by:	The FreeBSD Foundation
PR:		293645
Fixes:		4bf049bfee
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D55717

(cherry picked from commit 6cfd2b93e68061c7831016b91c2e308d01658764)
(cherry picked from commit 68fcf0b94c)
2026-04-08 15:24:45 +02:00
Gordon Bergling
a30ec3bb9f if_types: Fix a typo in a source code comment
- s/Circiut/Circuit/

Obtained from:	OpenBSD

(cherry picked from commit 8bc31c88d65ad99cd510fbe511958799d3531477)
2026-04-08 15:24:26 +02:00
Philip Paeps
ff0b11e0a4 Add UPDATING entries and bump version
Approved by:	so
2026-03-26 08:04:53 +01:00
Kristof Provost
5d8b34a1e4 pf: include all elements when hashing rules
Approved by:	so
Security:	FreeBSD-SA-26:09.pf
Security:	CVE-2026-4748
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit c6bcf6e6fd507d952a48226b51cc161b8ef972a2)
(cherry picked from commit e3b801edded92c1ccef67f9aef8653e996493460)
2026-03-26 08:04:52 +01:00
Kristof Provost
3aa9ae8870 pfctl: always warn if a duplicate rule was detected
Approved by:	so
Security:	FreeBSD-SA-26:09.pf
Security:	CVE-2026-4748
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 66d66dd0f6f83926980fc1d68dd366c0057350c5)
(cherry picked from commit e79818ec36efafc994d8c5a912dcb94986c038c5)
2026-03-26 08:04:51 +01:00
Kristof Provost
9b77f8cc18 pf tests: verify that we handle address range rules correctly
There's been a problem where rules which differed only in address ranges
were considered duplicates and not added. Test for this.

Approved by:	so
Security:	FreeBSD-SA-26:09.pf
Security:	CVE-2026-4748
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit ab74151e8d097b263237942c0b12277098bc9533)
(cherry picked from commit 958dbc87e9c59a2e9f83d84115ce03fb96e9b249)
2026-03-26 08:04:50 +01:00
Michael Gmelin
4b1f421140 pf: Fix hashing of IP address ranges
This corrects the false detection of duplicate rules.

Approved by:	so
Security:	FreeBSD-SA-26:09.pf
Security:	CVE-2026-4748
Reviewed by:	kp

(cherry picked from commit 1fa873c93c8b08561c53107c7b90c53dfad30ddc)
(cherry picked from commit ac6bb58a715eaf0afb7a80dc87083f9819e10ac1)
2026-03-26 08:04:49 +01:00
Mark Johnston
97ff4784ce rpcsec_gss: Fix a stack overflow in svc_rpc_gss_validate()
svc_rpc_gss_validate() copies the input message into a stack buffer
without ensuring that the buffer is large enough.  Sure enough,
oa_length may be up to 400 bytes, much larger than the provided space.
This enables an unauthenticated user to trigger an overflow and obtain
remote code execution.

Add a runtime check which verifies that the copy won't overflow.

Approved by:	so
Security:	FreeBSD-SA-26:08.rpcsec_gss
Security:	CVE-2026-4747
Reported by:	Nicholas Carlini <npc@anthropic.com>
Reviewed by:	rmacklem
Fixes:		a9148abd9d
2026-03-26 08:04:47 +01:00
Michael Tuexen
0da18fba2b tcp: plug an mbuf leak
When a challenge ACK should be sent via tcp_send_challenge_ack(),
but the rate limiter suppresses the sending, free the mbuf chain.
The caller of tcp_send_challenge_ack() expects this similar to the
callers of tcp_respond().

Approved by:	so
Security:	FreeBSD-SA-26:06.tcp
Security:       CVE-2026-4247
Reviewed by:	lstewart
Tested by:	lstewart
Sponsored by:	Netflix, Inc.
2026-03-26 08:04:46 +01:00
Zhenlei Huang
fb61125e8b ifnet: Fix decreasing the vnet interface count
It should be decreased only when the interface has been successfully
removed from the "active" list.

This prevents vnet_if_return() from potential OOB writes to the
allocated memory "pending".

Reviewed by:	kp, pouria
Fixes:		a779388f8b if: Protect V_ifnet in vnet_if_return()
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D55873

(cherry picked from commit 8065ff63c0e5c3bb4abb02f55b20cb47bb51d1a7)
(cherry picked from commit 1b7687f053)
2026-03-26 08:02:22 +01:00
Siva Mahadevan
4dcd14893b LinuxKPI: avoid -Werror=unused-value in sort() from BUILD_BUG_ON_ZERO()
The BUILD_BUG_ON_ZERO() macro returns an (int)0 if it does not fail
at build time. LinuxKPI sort() has it as a guard for an unsupported
argument but ignores the return value.

This leads to gcc complaining:

/usr/src/sys/compat/linuxkpi/common/include/linux/build_bug.h:60:33: error: statement with no effect [-Werror=unused-value]
   60 | #define BUILD_BUG_ON_ZERO(x)    ((int)sizeof(struct { int:-((x) != 0); }))
      |                                 ^
/usr/src/sys/compat/linuxkpi/common/include/linux/sort.h:37:9: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
   37 |         BUILD_BUG_ON_ZERO(swap);                        \
      |         ^~~~~~~~~~~~~~~~~
/usr/src/sys/contrib/dev/rtw89/core.c:2575:9: note: in expansion of macro 'sort'
 2575 |         sort(drift, RTW89_BCN_TRACK_STAT_NR, sizeof(*drift), cmp_u16, NULL);

Change to BUILD_BUG_ON() for the statement version.

Reported by:	CI
Co-authored-by:	bz
Approved by:	emaste (mentor)
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D55634

(cherry picked from commit f26cb4757eb74ceace39144933ae198ebf1b4f28)
2026-03-26 08:01:55 +01:00
Zhenlei Huang
6e01be67e8 vnet: Ensure the space allocated by vnet_data_alloc() is sufficent aligned
Some 32-bit architectures, e.g., armv7, require strict 8-byte
alignment while doing atomic 64-bit access. Hence aligning to the
pointer type (4-byte alignment) does not meet the requirement on
those architectures.

Make the space allocated by vnet_data_alloc() sufficent aligned to
avoid unaligned access.

PR:		265639
Diagnosed by:	markj
Reviewed by:	jhb, markj
Co-authored-by:	jhb
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D55560

(cherry picked from commit 32beb3ae71cb320dbe4190a01c036943d99083b3)
(cherry picked from commit 973d607b28)
2026-03-09 09:15:19 +01:00
Kevin Bowling
1f54b94dc1 e1000: Increase FC pause/refresh time on PCH2 and newer
This corresponds to Linux f74dc880098b4a29f76d756b888fb31d81ad9a0c

That commit does not provide any public background detail, but it's been
in use for over 5 years and corresponds to previous chip bugs w.r.t.
automatic generation of PAUSE frames.

Reviewed by:	kgalazka
Differential Revision:	https://reviews.freebsd.org/D54555

(cherry picked from commit 2bdec2ee73be7dbafce9982b0dc5c273918a5443)
2026-03-09 09:15:10 +01:00
Ahmad Khalifa
b4ddb3e0f1 bsdinstall: fix EFI boot entry creation
update_uefi_bootentry assumes that the caller sets FREEBSD_BOOTNAME and
mntpt, which isn't the case anymore. The result is that there is no
"FreeBSD" boot entry created/updated after install. Most machines manage
to boot from the removable media path (if the loader is installed there
too), but some don't.

Take the loader's path as an argument and rename the variable used in
the ZFS mirror loop so mntpt can be reused below.

Also mark nentries as a local variable so it doesn't leak out of the
function.

PR:		293385
Fixes:		494de51bc0074472d1b01604f085daea0844f240
MFC after:	2 days
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55469

(cherry picked from commit 0fd91c489134643ac9e38c0f55ba7464fe892c5e)
2026-02-27 19:22:23 +01:00
Mark Johnston
c2b3d1d6e4 divert: Use a better source identifier for netisr_queue_src() calls
These opaque IDs are used by netisr to distribute work among threads.
The mapping function is simply SourceID % numthreads, so using socket
addresses as source IDs isn't going to distribute packets well due to
alignment.

Use the divert socket's generation number instead, as that suits this
purpose much better.
2026-02-26 17:16:09 +01:00
Mark Johnston
f9831b4389 Add UPDATING entries and bump version
Approved by:	so
2026-02-24 19:22:15 +01:00
Mark Johnston
4ab9730727 rtsock: Fix stack overflow
Approved by:	so
Security:	FreeBSD-SA-26:05.route
Security:	CVE-2026-3038
Fixes:		92be2847e8 ("rtsock: Avoid copying uninitialized padding bytes")

(cherry picked from commit cd00cd9f6ed4b6f6e6bb8ae168f2537968991b53)
(cherry picked from commit f44d771c2c6c80f3fabd11d335964e1efdf50a21)
2026-02-24 19:22:14 +01:00