Commit graph

293733 commits

Author SHA1 Message Date
Gordon Tetlow
4dafdc15bf ldns: Fix query response validation
Approved by:	so
Security:	FreeBSD-SA-26:36.ldns
Security:	CVE-2026-10846
2026-06-10 08:45:22 +02:00
Gordon Tetlow
c141fbd4e4 openssl: Fix multiple vulnerabilities
This is a rollup commit from upstream to fix:
  Reject oversized inputs in ASN1_mbstring_ncopy()
  cms: kek_unwrap_key: Fix out-of-bounds read in check-byte validation
  cms: kek_unwrap_key: test for fix out-of-bounds read in check-byte validation
  Avoid length truncation in ASN1_STRING_set
  Reject potentially forged encrypted CMS AuthEnvelopedData messages
  Fix potential NULL dereference processing CMS PasswordRecipientInfo
  Match the local q DHX parameter against the peer's q
  Apply the buffered IV on the AES-OCB EVP_Cipher() path
  Fix handling of empty-ciphertext messages in AES-GCM-SIV and AES-SIV
  Fix possible use-after-free in OpenSSL PKCS7_verify()

Approved by:	so
Obtained from:	OpenSSL
Security:	FreeBSD-SA-26:35.openssl
Security:	CVE-2026-7383
Security:	CVE-2026-9076
Security:	CVE-2026-34180
Security:	CVE-2026-34182
Security:	CVE-2026-42766
Security:	CVE-2026-42770
Security:	CVE-2026-45445
Security:	CVE-2026-45446
Security:	CVE-2026-45447
2026-06-10 08:45:22 +02:00
Ed Maste
a1dbf5c27c vt: Avoid integer overflow in CONS_HISTORY ioctl
Approved by:	so
Security:	FreeBSD-SA-26:34.vt
Security:	CVE-2026-49416
Reviewed by:	markj, vexeduxr
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57250

(cherry picked from commit 0ae946e7223df5ef3f7980af1d774d7f593f6421)
(cherry picked from commit deaaddf1d3c4283649945553ad7e3208c8424308)
(cherry picked from commit b5a4f4bfbc95d5d5361da708728f7f4a6db2ee60)
2026-06-10 08:45:22 +02:00
Dag-Erling Smørgrav
3e5e514520 unbound: Apply upstream patches
- Use the same EDE removal logic when encoding errors as when encoding
  replies.
- Fix CVE-2026-33278, Possible remote code execution during DNSSEC
  validation. Thanks to Qifan Zhang, Palo Alto Networks, for the report.
- Fix CVE-2026-42944, Heap overflow and crash with multiple nsid,
  cookie, padding EDNS options. Thanks to Qifan Zhang, Palo Alto
  Networks, for the report.
- Fix CVE-2026-42959, Crash during DNSSEC validation of malicious
  content. Thanks to Qifan Zhang, Palo Alto Networks, for the report.
- Fix CVE-2026-32792, Packet of death with DNSCrypt. Thanks to Andrew
  Griffiths from 'calif.io' for the report.
- Fix CVE-2026-40622, "Ghost domain name" variant. Thanks to Qifan
  Zhang, Palo Alto Networks, for the report.
- Fix CVE-2026-41292, Parsing a long list of incoming EDNS options
  degrades performance. Thanks to GitHub user 'N0zoM1z0', also Qifan
  Zhang from Palo Alto Networks, for the report.
- Fix CVE-2026-42534, Jostle logic bypass degrades resolution
  performance. Thanks to Qifan Zhang, Palo Alto Networks, for the
  report.
- Fix CVE-2026-42923, Degradation of service with unbounded NSEC3 hash
  calculations. Thanks to Qifan Zhang, Palo Alto Networks, for the
  report.
- Fix CVE-2026-42960, Possible cache poisoning attack while following
  delegation. Thanks to TaoFei Guo from Peking University, Yang Luo and
  JianJun Chen, Tsinghua University, for the report.
- Fix CVE-2026-44390, Unbounded name compression in certain cases causes
  degradation of service. Thanks to Qifan Zhang, Palo Alto Networks, for
  the report.
- Fix CVE-2026-44608, Use after free and crash in RPZ code. Thanks to
  Qifan Zhang, Palo Alto Networks, for the report.

Approved by:	so
Security:	FreeBSD-SA-26:33.unbound
Security:	CVE-2026-33278
Security:	CVE-2026-42944
Security:	CVE-2026-42959
Security:	CVE-2026-32792
Security:	CVE-2026-40622
Security:	CVE-2026-41292
Security:	CVE-2026-42534
Security:	CVE-2026-42923
Security:	CVE-2026-42960
Security:	CVE-2026-44390
Security:	CVE-2026-44608
2026-06-10 08:45:22 +02:00
Mark Johnston
515d4bcec6 imgact_elf: Clear no-ASLR and -WXORX flags earlier for setugid images
Otherwise an unprivileged user can disable randomization of the base
address for PIEs even if they are setugid.

Add a regression test.

Approved by:	so
Security:	FreeBSD-SA-26:32.elf
Security:	CVE-2026-49414
Reported by:	David Berard
Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D57397
2026-06-10 08:45:22 +02:00
Andrew Turner
f92a82f2f4 arm64: Workaround the following errata
- ARM C1-Premium erratum 4193780
 - ARM C1-Ultra erratum 4193780
 - ARM Cortex-A76 erratum 4193800
 - ARM Cortex-A76AE erratum 4193801
 - ARM Cortex-A77 erratum 4193798
 - ARM Cortex-A78 erratum 4193791
 - ARM Cortex-A78AE erratum 4193793
 - ARM Cortex-A78C erratum 4193794
 - ARM Cortex-A710 erratum 4193788
 - ARM Cortex-X1 erratum 4193791
 - ARM Cortex-X1C erratum 4193792
 - ARM Cortex-X2 erratum 4193788
 - ARM Cortex-X3 erratum 4193786
 - ARM Cortex-X4 erratum 4118414
 - ARM Cortex-X925 erratum 4193781
 - ARM Neoverse-N1 erratum 4193800
 - ARM Neoverse-N2 erratum 4193789
 - ARM Neoverse-V1 erratum 4193790
 - ARM Neoverse-V2 erratum 4193787
 - ARM Neoverse-V3 erratum 4193784
 - ARM Neoverse-V3AE erratum 4193784

These are all variants on an erratum where TLBI+DSB instructions on
one CPU may incorrectly complete early leading to stores to an updated
address using an incorrect translation on another CPU.

In all cases the workaround is to add a second TLBI+DSB.

Sponsored by:	Arm Ltd

arm64: Add more CPU MIDR values

Found in Linux and https://github.com/arm-software/data

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D50726

(cherry picked from commit 124b5dbf5c)
(cherry picked from commit 935f00c4ddf6c0e90752e7017e1d8d165e0796a1)

arm64: Add the new C1 CPU IDs

Add the Arm C1-Nano, C1-Pro, C1-Premium, and C1-Ultra CPUs from their
Technical Reference Manuals.

Sponsored by:	Arm Ltd

(cherry picked from commit 8fee6b9ecc84d3602a461f1cd33df91e50849cdf)
(cherry picked from commit 25ff471f0bbcf5b489678e9f94877386366dc521)

Approved by:	so
Security:	FreeBSD-SA-26:31.arm64
Security:	CVE-2025-10263
2026-06-10 08:45:22 +02:00
Mark Johnston
8b5dfac406 linux: Correct the issetugid check in copyout_auxargs
The runtime linker in glibc relies on the AT_SECURE auxv entry to know
whether the executable is set-ugid, if so then various dangerous
functionality such as LD_PRELOAD is disabled.

The check added in commit 669414e4fb failed to take into account the
fact that during execve, P_SUGID may not yet be set for a set-ugid
process.  Correct the test.

Approved by:	so
Security:	FreeBSD-SA-26:30.linux
Security:	CVE-2026-49413
Reported by:	Minseong Kim
Fixes:		669414e4fb ("Implement AT_SECURE properly.")
Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D57350
2026-06-10 08:45:22 +02:00
Mark Johnston
6a23a684b2 in6_mcast: Fix a race in in6p_set_source_filter()
We drop the inpcb lock in order to copy in the source list, but this
leaves a window where the multicast filter structure might be freed.
This can be exploited to obtain root privileges.

In the v4 code this race is mitigated by holding the global multicast
lock across the gap.

Restructure the code to copy in filters before doing anything else, so
that there's no need to drop the inpcb lock and reason about the
correctness of doing so.  Do the same in the v4 code for consistency.

Approved by:	re (cperciva)
Approved by:	so
Security:	FreeBSD-SA-26:29.ip6_multicast
Security:	CVE-2026-49412
Reported by:	Andrew Griffiths <andrew@calif.io>
Reported by:	Maik Münch <maik@secfault-security.com>
Reviewed by:	glebius
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D57347
2026-06-10 08:45:21 +02:00
Ed Maste
a6716e8cb1 sigqueue: In capability mode, only allow signalling self
This is copied from the check in kern_kill.

Approved by:	so
Security:	FreeBSD-SA-26:28.capsicum
Security:	CVE-2026-45259
Reviewed by:	markj, oshogbo
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57244

(cherry picked from commit b9d16b7fd2fa6bc4b3e8364804cbdc1b76ebe8a5)
(cherry picked from commit defd9b86ef995ce70363eae9b323d616bda865be)
(cherry picked from commit d11ff01b3aec336128e6babbff7a421fbce82015)
2026-06-10 08:42:37 +02:00
Mark Johnston
564070c417 sound: Fix software buffer lifetime issues
The channel buffer mapped by dsp_mmap_single() may be freed when the
device handle is closed, but the mapping persists beyond that, allowing
userspace to read or write memory owned by a different consumer.

Fix the problem by adding a reference counter to the sound buffer.
Define pager ops for the VM object returned by dsp_mmap_single() and use
them to manage the extra reference.

Add a regression test.

Approved by:	so
Security:	FreeBSD-SA-26:27.sound
Security:	CVE-2026-49417
Reported by:	Lexpl0it, 75Acol, Liyw979, Rob1n
Reviewed by	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D57393
2026-06-10 08:42:35 +02:00
Christos Margiolis
2845ed0a0e sound: Check for offset overflow in dsp_mmap_single()
Approved by:	so
Security:	FreeBSD-SA-26:27.sound
Security:	CVE-2026-45258
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
2026-06-10 08:42:33 +02:00
John Baldwin
b9ecbb4346 ktls: Don't attempt to modify non-anonymous mbufs on the receive path
Normally, data processed on the KTLS receive path is contained in
anonymous mbufs that can be modified in place.  Either the data
originates in receive buffers from a NIC driver, or for loopback
connections the data is anonymous-backed mbufs created when writing to
a socket.  One potential source of non-anonymous mbufs are mbufs
created by sendfile(2) which borrow the pages of the underlying file,
either via M_EXTPG or EXT_SFBUF that are sent over a loopback
connection.  For a well-formed loopback TLS session, the sender should
only use sendfile(2) if KTLS is enabled.  If TLS is fully handled in
userspace, the sender must use write(2) or send(2) which allocate
anonymous mbufs.  If KTLS transmit is enabled, then sendfile(2) on a
loopback connection will always use crypto via OCF and will allocate
anonymous pages to hold the encrypted data.

However, if sendfile(2) is used to send file-backed data directly over
a loopback connection where KTLS is not enabled on the sender side,
the KTLS receive path can modify the file-backed pages in place
overwriting the file's data.  One potential fix would be to replace
non-anonymous mbufs in a received TLS record with anonymous mbufs
(e.g. via m_dup()) before passing the record to OCF.  However, there
is no legitimate use case for using sendfile(2) over a loopback TLS
connection without using KTLS on the sender side, so instead simply
fail decryption requests and close the connection if non-anonymous
mbufs are encountered in the RX decryption path.

Add a test for this that verifies that the original data backing the
file descriptor used as the source for sendfile() is unchanged after
being processed.

Approved by:	so
Security:	FreeBSD-SA-26:26.ktls
Security:	CVE-2026-45257
Co-authored-by:	Drew Gallatin <gallatin@FreeBSD.org>
Sponsored by:	Chelsio Communications
Sponsored by:	Netflix
2026-06-10 08:42:32 +02:00
Mark Johnston
e3ef044fcd thr_kill2: Respect p_cansignal()
Approved by:	so
Security:	FreeBSD-SA-26:25.thr
Security:	CVE-2026-45256
Reported by:	Igor Gabriel Sousa e Souza
Reported by:	Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by:	emaste, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D57237
2026-06-10 08:42:31 +02:00
Andrey V. Elsukov
119b20a90f ipfw: treat ipv6 address with zero mask as 'any'
Make the behaviour similar for both IPv4 and IPv6. Also add
the corresponding tests.

PR:             294733
Differential Revision:	https://reviews.freebsd.org/D56618

(cherry picked from commit 2872268c7f6d473aae9b02ebb5d2c24fc2cff9b1)
2026-06-08 15:34:14 +02:00
Boris Lytochkin
d796c02b50 ipfw: add ability to run ipfw(8) binary with 15.0+ kernel module
After D46183 the KBI was changed and this made the upgrade procedure
to 15.0+ version a bit difficult, because the old binary can not load
firewall rules when the new kernel is loaded.

This commit adds the sbin/ipfw15 binary that uses new KBI, and then
original sbin/ipfw can detect new KBI and run the new binary instead.

PR:		291562
Reviewed by:	jhb, glebius
Fixes:		4a77657cbc
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54763
2026-06-08 15:33:40 +02:00
Pouria Mousavizadeh Tehrani
8616e879e3 rtnetlink: Align RTA_MULTIPATH length validation in nlattr_get
Fix length validation of RTA_MULTIPATH attributes in
nlattr_get_multipath() by making sure the user request is align.

PR:		295102
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	markj
Fixes:		7e5bf68495 ("netlink: add netlink support")
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D56963

(cherry picked from commit 4329663a861ef74796b79b6b0872cfe10d31c591)
(cherry picked from commit 2c6617658f0cabb1e83a47da02882454e4210bd9)
2026-06-02 07:35:06 +02:00
Pouria Mousavizadeh Tehrani
5b36a1dd27 rtnetlink: Check for allocation failure in nlattr_get_multipath()
Check for alloction failure on `npt_alloc()` for RTA_MULTIPATH
attributes in `nlattr_get_multipath()`.

Reported by:	Joshua Rogers of AISLE Research Team
Reviewed by:	markj
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D56954

(cherry picked from commit 188631e43a1a5d2985156141c2e244a925670683)
(cherry picked from commit 3e2308d57080a2345e3db1139683368b504ee0bd)
2026-06-02 07:35:06 +02:00
Kristof Provost
4d0636d61d pf: do not reject rules with colliding hashes
We insert rules in pf_krule_global solely for the benefit of the
'keepcounters' feature. Failing to insert (beause the rule hash
collides, or an identical rule already exists) would be worse than
restoring counts to the wrong rule (or failing to restore them at all).

PR:		282863, 294860, 294859, 294858
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D56745

(cherry picked from commit a0e4c65f1814a7a677364dc29bb703f84323d175)
2026-06-02 07:33:28 +02:00
Kristof Provost
3a22f53247 pfsync: reject invalid SCTP states
SCTP states should always have a src scrub object associated with them.
Crafted pfsync packets might not have this, leading to us derferencing a
NULL pointer on cleanup.

Validate the pfsync state insertion packet to make sure this is correct.

PR:		294989
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit bf6d00afdb6171ba04a1c5a7fde904cde87d212d)
2026-06-02 07:33:21 +02:00
Mark Johnston
0199ee3ce1 routing: Initialize V_rt_numfibs earlier during boot
V_rt_numfibs can be set at compile time (with the ROUTETABLES kernel
config option) or boot time (with the net.fibs tunable).
vnet_rtables_init(), running during SI_PROTO_DOMAIN, was checking the
tunable and updating V_rt_numfibs accordingly, but that means that
earlier SYSINITs, such as vnet_mroute_init(), see the compile-time value
for V_rt_numfibs before it gets corrected in vnet_rtables_init().

Fix this by initializing V_rt_numfibs earlier, so that SYSINITs are less
likely to use the wrong value.

Add a comment describing the weird, preexisting semantic of resetting
rt_numfibs to 1 in VNET jails.

PR:		294510
Reviewed by:	glebius, zlei, pouria
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56473

(cherry picked from commit 2b264cb802b9b45306b1f3dfd3e9d4edfb23b2f6)
2026-06-02 07:27:31 +02:00
Mark Johnston
ed87e2c568 routing: Use a better error number in sysctl_fibs()
ENOTCAPABLE is for capsicum and its use here is inappropriate.  In
particular, note that syscallret() treats this value specially.

Reviewed by:	glebius, pouria, zlei
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56481

(cherry picked from commit 8de0fc10a1c2d65bdb39eff862266ab1f87902c8)
2026-06-02 07:27:31 +02:00
Mark Johnston
29d31ff700 if_vxlan: Update *m0 after a pullup
vxlan_input()'s caller is supposed to free *m0 if it is non-NULL after
the function returns.  vxlan_input() failed to update *m0 after the
pullup however, so if it hits an error case after the pullup, we'll free
the mbuf twice.  Currently this can happen only if the interface is
brought down or due to a packet loop.

Reported by:	Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai
Reviewed by:	pouria, zlei
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56944

(cherry picked from commit a6c4fe2d1a38885914b1c3e85508b965ccdb7874)
2026-06-02 07:27:10 +02:00
Mark Johnston
b804ac48f3 igmp: Avoid leaving dangling pointers in the state-change queue
When igmp_v3_merge_state_changes() is iterating over state-change
packets, there is a case where it'll free a queued packet but will fail
to remove it from the queue.  Fix that.

Reported by:	Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai
Reviewed by:	pouria, glebius
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56947

(cherry picked from commit beab4a237a45aea809e81802b9e1e9ff30f3d929)
2026-06-02 07:26:59 +02:00
Timo Völker
a03bb8aa3b ipfw: fix checksum after NAT
When checksum offloading is used, IPFW needs to fix the checksum
after libalias has done NAT. The ipfw_nat() function does so, but
only for mbufs without a receiving interface. However, if, for example,
the packet was sent inside a jail that used checksum offloading over
an epair, ipfw still needs to fix the checksum even though the mbuf
has set a receiving interface (epair).
This patch just removes the check whether a receiving interface is set.

PR:			295057
Reviewed by:		tuexen
Differential Revision:	https://reviews.freebsd.org/D57091

(cherry picked from commit 81b47a7c604f1d563283759572fa7a1f9d4dc56f)
2026-06-02 07:26:19 +02:00
Alex Richardson
26747f5779 if_ovpn.c: fix use of uninitialized variable
In case we use OVPN_CIPHER_ALG_NONE, the memcpy will attempt to copy 0
bytes from an uninitialized pointer. While the memcpy() implementation
will treat this as a no-op and not actually dereferece the undefined
variable it is still undefined behaviour to the compiler and should be
fixed. Found by building with clang HEAD

Reviewed by:	kp
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D52543

(cherry picked from commit 969be39fb3caf4272f128dbf3267ceba5966a6ce)
2026-06-02 07:26:08 +02:00
Alex Richardson
daedb8bb36 netmap: silence -Wdefault-const-init-field-unsafe warning
The netmap_ring struct starts with various const members and rencent
clang warns about leaving them uninitialized. Having them const in the
first place is highly suspicious since they are updated with various
macros but using hand-coded __DECONST(). But fixing that is a more
invasive change that I am unable to test.

```
.../freebsd/sys/dev/netmap/netmap_kloop.c:320:21: error: default initialization of an object of type 'struct netmap_ring' with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe]
  320 |         struct netmap_ring shadow_ring; /* shadow copy of the netmap_ring */
      |                            ^
.../freebsd/sys/net/netmap.h:290:16: note: member 'buf_ofs' declared 'const' here
  290 |         const int64_t   buf_ofs;
      |                         ^
```

Test Plan: Compiles

Reviewed by:	vmaffione, jhb
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D52568

(cherry picked from commit 2ed21f90906b230476d3f12ff9dce0e2c4642af2)
2026-06-02 07:26:00 +02:00
Vyacheslav Terehov
15be895f78 ipfw: fix parsing error in nat config port_range
Also fix the corresponding tests.

PR:		263240
Differential Revision:	https://reviews.freebsd.org/D57010

(cherry picked from commit 6eba055fcf5b0bbfbebcac59f5982d13815001b0)
2026-06-02 07:25:48 +02:00
Mark Johnston
b3f06c1774 Add UPDATING entries and bump version
Approved by:	so
2026-05-21 07:33:00 +02:00
Mariusz Zaborski
60f8236dd2 cap_net: do not allow new limits to drop keys from the old ones
If the old limit had family/hosts/sockaddr set, the new limit must
have them too. Before, a missing key in the new limit was treated as
"allow any", which let a caller silently extend their limits.

Approved by:	so
Security:	FreeBSD-SA-26:24.cap_net
Security:	CVE-2026-45254
Reported by:	Joshua Rogers of AISLE Research Team
Reviewed by:	markj
MFC after:	1 day
Differential Revision:	https://reviews.freebsd.org/D56991

(cherry picked from commit d705a519525f2acae3c1efba11436ec6ee8aea0a)
(cherry picked from commit b79faca1c5964d89c125d02de35928b733041f3f)
2026-05-21 07:32:58 +02:00
Mark Johnston
7efe37333e bsdconfig: Make sure that SSID names are properly escaped
The f_menu_wpa_scan_results() function returns a list of networks
discovered by a scan.  The untrusted network names are evaluated in
f_dialog_menu_wireless_edit.  The quoting applied in
f_menu_wpa_scan_results() protects against evaluation of something like
"$(whoami)" but one can add single quotes to defeat that.

Pass the SSID names through f_shell_escape to work around this.  Escape
single quotes in f_dialog_wireless_edit() and f_menu_wireless_configs()
too for consistency.

I note that this module doesn't seem to actually work, see e.g.,
bugzilla PR 229883.

Approved by:	so
Security:	FreeBSD-SA-26:23.bsdinstall
Security:	CVE-2026-45255
Reported by:	Austin Ralls
Reviewed by:	dteske, des
Differential Revision:	https://reviews.freebsd.org/D56974
2026-05-21 07:32:57 +02:00
Renato Botelho
e13b3978d0 bsdinstall: Avoid invoking eval on the wlan SSID list
The wlanconfig utility is not careful about handling untrusted network
names, which can contain shell metacharacters.  Factor network selection
into a subroutine and use the `set -- "$@"` trick to build up a list of
positional parameters for bsddialog without evaluating them.

Approved by:	so
Security:	FreeBSD-SA-26:23.bsdinstall
Security:	CVE-2026-45255
Reported by:	Austin Ralls
Reviewed by:	dteske, des, asiciliano
Differential Revision:	https://reviews.freebsd.org/D56973
2026-05-21 07:32:56 +02:00
Mariusz Zaborski
9bb455f9c9 libcasper: switch 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).

poll(2) takes an array indexed by slot rather than by fd value, so it
has no FD_SETSIZE limit.

Approved by:	so
Security:	FreeBSD-SA-26:22.libcasper
Security:	CVE-2026-39461
Reported by:    Joshua Rogers
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D56695
2026-05-21 07:32:55 +02:00
Mark Johnston
ed2557cfa3 ptrace: Fix validation of PT_SC_REMOTE arguments
- Fix an off-by-one in the system call number check.  A value of
  SYS_MAXSYSCALL was permitted.
- Validate the system call number after we've dealt with
  syscall(2)/__syscall(2), since they pass the syscall number as an
  argument.
- When the syscall number is for syscall(2) or __syscall(2), we must
  make sure that nargs > 0 to avoid an underflow when shifting arguments
  down.

Add regression tests.

Approved by:	so
Security:	FreeBSD-SA-26:21.ptrace
Security:	CVE-2026-45253
Fixes:		140ceb5d95 ("ptrace(2): add PT_SC_REMOTE remote syscall request")
Reported by:	Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by:	kib, emaste
Differential Revision:	https://reviews.freebsd.org/D56978
2026-05-21 07:32:54 +02:00
Alan Somers
77b65f9135 fusefs: Handle buggy servers' LISTXATTR response
The fuse protocol requires server to respond to LISTXATTR with a
NUL-terminated string.  If they don't, report an error rather than
attempt to scan through uninitialized memory for a NUL.

Approved by:	so
Security:	FreeBSD-SA-26:20.fusefs
Security:	CVE-2026-45252
admbugs:	1039
Reported by:	Joshua Rogers
Sponsored by:	ConnectWise
2026-05-21 07:32:52 +02:00
Mark Johnston
06e5f25883 netmap: Drain selinfo sleepers in nm_os_selinfo_uninit()
Approved by:	so
Security:	FreeBSD-SA-26:19.file
Security:	CVE-2026-45251
2026-05-21 07:32:51 +02:00
Mark Johnston
c121cc691e procdesc: Make sure to drain selinfo sleepers in procdesc_free()
Otherwise they are left on a freed list after procdesc_free() is called.
This can be exploited to elevate privileges.

Remove the PDF_SELECTED micro-optimization.  doselwakeup() is a no-op if
no one ever called selrecord() on the file description, so I see no
reason to complicate the code to avoid the call.

Add some regression tests.

Approved by:	so
Security:	FreeBSD-SA-26:19.file
Security:	CVE-2026-45251
Reported by:	75Acol, Lexpl0it, fcgboy, and robinzeng2015
Reviewed by:	kib, oshogbo
Fixes:		cfb5f76865 ("Add experimental support for process descriptors")
Differential Revision:	https://reviews.freebsd.org/D56887
2026-05-21 07:32:50 +02:00
Dag-Erling Smørgrav
dbcb565ad6 setcred: Fix buffer overflow
Since groups is a pointer to a pointer to an array of gid_t, we should
use sizeof(**groups) or sizeof(gid_t) when calculating how much to
allocate and copy in.  We were using sizeof(*groups) instead, which
meant that on 64-bit platforms, we would allocate and copy in twice as
much as we should.  Unfortunately, in the smallgroups case, we copy
into a preallocated buffer which has the correct size, which means that
if sc_supp_groups_nb >= CRED_SMALLGROUPS_NB / 2, we overflow smallgroups.

This is a direct commit to stable/14.

Approved by:	so
Security:	FreeBSD-SA-26:18.setcred
Reported by:	Ryan of Calif.io
Fixes:		ddb3eb4efe ("New setcred() system call and associated MAC hooks")
2026-05-21 07:32:48 +02:00
Dag-Erling Smørgrav
19387ebaef freebsd-update: Skip /etc/ssl/cert.pem
We already run `certctl rehash` at the end, there is no point in asking
users upgrading from 15.0 to 15.1 to manually merge the trust store.

Approved by:	so
Security:	FreeBSD-EN-26:13.freebsd-update
MFC after:	3 days
Reviewed by:	cperciva
Differential Revision:	https://reviews.freebsd.org/D57028

(cherry picked from commit 2509ddee9bdb2240ba2f622e3a55a98ebc2aa4ae)
(cherry picked from commit 7d9c1d3895b307085131f922d7e46a4812f04675)
2026-05-21 07:32:45 +02:00
Mark Johnston
c15566c7b8 Add UPDATING entries and bump version
Approved by:	so
2026-05-21 07:32:03 +02:00
Dag-Erling Smørgrav
1ca7f34a07 dhclient: Improve server and filename validation
* Don't iterate over each string three times; once is enough.

* Reject control characters (anything below space) in addition to the
  double quote and backslash.

* If an unsafe character is encountered, discard the string instead of
  rejecting the entire lease.

* If backslashes are encountered in the file name option, convert them
  to forward slashes instead of rejecting the option.

* Tweak the warning messages a bit.  Looking through the rest of the
  code, it seems to me that notes generally end with a period while
  warnings generally don't.

Approved by:	so
Security:	FreeBSD-EN-26:11.dhclient
Fixes:		8008e4b88daf ("dhclient: Check for unexpected characters in some DHCP server options")
PR:		294886
MFC after:	1 week
Reviewed by:	brooks, markj
Differential Revision:	https://reviews.freebsd.org/D56740

(cherry picked from commit 873a195ba63575e46686cfd6ea9670a0ca340fa0)
(cherry picked from commit 2f9478ad42c442c49a7eff60227148bf2b90b48c)
2026-05-21 07:32:00 +02:00
Joseph Mingrone
81f87c4d69 ipfwpcap: Fix build after libpcap 1.10.6 update
pcap-int.h now references SIZEOF_TIME_T from libpcap's config.h, which
is not available to consumers of the internal header outside of the
libpcap build.  Switch to the public <pcap.h> header and replace the
direct FILE* casts and ferror()/fflush() calls with pcap_dump_flush(3),
which is the correct public API for flushing a pcap dump file.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit a0b3ef1952603ebf0307ca723b03e5a71598dd5a)
2026-04-30 08:26:37 +02:00
Michael Tuexen
0064d9a193 sctp: fix so_proto when peeling off a socket
Reported by:		glebius
Reviewed by:		rrs
Fixes:			d195b3783fa4 ("sctp: fix socket type created by sctp_peeloff()")
Differential Revision:	https://reviews.freebsd.org/D55454
Event:			Wiesbaden Hackathon 2026

(cherry picked from commit 454212b9718b55b43781f81bef252658e20e0fd3)
2026-04-30 07:39:21 +02:00
Enji Cooper
6b41d9082e chore: replace {0, 0} with {DEV,KOBJ}METHOD_END
Both of the aforementioned macros have been present in FreeBSD
for well over a decade: 2009 for `KOBJMETHOD_END`; 2011 for
`DEVMETHOD_END`.

Adapt all hardcoded references of `{0, 0}` with `DEVMETHOD_END`
and `KOBJMETHOD_END` as appropriate. This helps ensure that
future adaptations to drivers following patterns documented
in driver(9) can be made more easily/without issue.

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

MFC notes:
	All conflicts were dropped as they didn't apply to code in branch.

Conflicts:
	sys/dev/flash/w25n.c
	sys/dev/nvd/nvd.c
	sys/dev/nvme/nvme_sim.c
	sys/dev/sound/pci/hdsp-pcm.c
	sys/dev/sound/pci/hdsp.c
	sys/dev/ufshci/ufshci_pci.c

(cherry picked from commit 0fc6c3f731a2cca3120798806c330a3081c9424b)
2026-04-30 07:39:21 +02:00
Enji Cooper
819191d98b divert: unbreak the LINT-NOIP build
Only expose `dcb` when either `INET` or `INET6` is defined.

Reported by:	clang (`-Wunused`)
MFC after:	1 week
Fixes 5547a7bb39 ("divert: Use a better source identifier...")
Differential Revision: https://reviews.freebsd.org/D55548

(cherry picked from commit bd758ebac3272f720c051570e043e4bc653dcd48)
2026-04-30 07:39:21 +02:00
Mark Johnston
21c327af86 linuxkpi: Fix an off-by-one error in the kfifo implementation
"total" is the number of slots in the array, so wraparound needs to be
done when "first" or "last" is greater than or equal to the number of
slots.

Note that no consumers of the code are currently connected to the kernel
build.

Reported by:	Stanislav Fort <stanislav.fort@aisle.com>
Reviewed by:	bz, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56371

(cherry picked from commit 52d2fc702b85d56b35f8828fe7efca3cde0d25b7)
2026-04-30 07:39:21 +02:00
Mark Johnston
788c51ad94 in_mcast: Fix a lock leak in inp_set_source_filters()
MFC after:	3 days
Reported by:	Claude Opus 4.6

(cherry picked from commit bebc1a5b09e358b420077a1b5c0f85f8e7f0812f)
2026-04-30 07:39:21 +02:00
Gordon Bergling
ce12e9a52e sctp(4): Fix a typo in a source code comment
- s/initited/initiated/

Obtained from:	NetBSD

(cherry picked from commit a154d72775cbf3f0679fb2f989b3d1a035ae41c9)
2026-04-30 07:39:21 +02:00
Yuichiro NAITO
98e3a18a80 ixgbe: Fix MRQC register value.
Focus on the MRQE field of the MRQC register, which is 4 bits wide,
and we use these 3 types of values.

  - IXGBE_MRQC_RSSEN 0x1  (non VF mode)
  - IXGBE_MRQC_VMDQRSS32EN 0xA (less than 33 VFs)
  - IXGBE_MRQC_VMDQRSS64EN 0xB (less than 65 VFs)

If we always take a bitwise OR with IXGBE_MRQC_RSSEN,
IXGBE_MRQC_VMDQRSS32EN will never be chosen.
Select these 3 types of values for the proper case.

Signed-off-by: Yuichiro NAITO <naito.yuichiro@gmail.com>

Pull Request:	https://github.com/freebsd/freebsd-src/pull/2132

(cherry picked from commit 938c076b9b0bc458a3877b52535527d37199fc09)
2026-04-30 07:39:21 +02:00
Pouria Mousavizadeh Tehrani
29fa156859 routing: Fix use-after-free in finalize_nhop
FIB_NH_LOG calls the `nhop_get_upper_family(nh)` to read
`nh->nh_priv->nh_upper_family` for failure logging.
Call FIB_NH_LOG before freeing nh so failures are logged
without causing a panic.

MFC after: 3 days

(cherry picked from commit 7d38eb720a8d8345949986d779e785984ae19ae0)
2026-04-30 07:39:21 +02:00
Gordon Bergling
91e9dca98e ixl(4): Fix a typo in a source code comment
- s/seperated/separated/

(cherry picked from commit ef3703a8cd9ade13d0c7a685577100e1fc18ee09)
2026-04-30 07:39:21 +02:00