Commit graph

302096 commits

Author SHA1 Message Date
Kristof Provost
96bd22f2bd pf: fix anchor/ethernet anchor cleanup
Don't mess with reference counts, but use RB_FOREACH_SAFE() so we can safely
delete even wildcard anchors.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-08-11 21:27:09 +02:00
Kristof Provost
f5219cabcf pf: free anchor and ethernet anchor zones on vnet shutdown
Fixes:	029532e77b pf: also allocate ethernet anchors from a UMA zone
Fixes:	31131a9d6a pf: allocate pf_kanchor from a pool
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-08-11 21:27:09 +02:00
Michael Tuexen
52a9423761 icmp: remove unused BANDLIM_UNLIMITED
Reviewed by:		Nick Banks
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D51849
2025-08-11 18:46:08 +02:00
Faraz Vahedi
a3eab01304 lsvfs(1): Make slight refactor
Signed-off-by: Faraz Vahedi <kfv@kfv.io>

Reviewed by:	markj, asomers (both earlier version)
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1498
2025-08-11 16:13:40 +02:00
Dag-Erling Smørgrav
988426e815 kern.post.mk: Support flavors in PORTS_MODULES
MFC after:	1 week
PR:		288596
Reviewed by:	pkubaj
Differential Revision:	https://reviews.freebsd.org/D51833
2025-08-11 15:54:51 +02:00
Lexi Winter
0c13e9c3c4 krb5: Install pkgconfig data
Users of MIT Kerberos expect the MIT pkgconfig files to be installed,
and won't work without them.  For example, this breaks anything that
links against libcurl (ftp/curl) when curl is built with base GSSAPI.

Reviewed by:		ngie, des, cy
Differential Revision:	https://reviews.freebsd.org/D51842
2025-08-11 13:08:49 +01:00
Brooks Davis
0f434b2b50 rtld: require MAP_GUARD support
MAP_GUARD was added prior to 12.0.  We don't support such old kernels in
userspace so drop the support.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D50731
2025-08-11 12:18:51 +01:00
Xin LI
5853a9971a vmm: library version bump
PR:		misc/288780
Fixes:		a4197ea477
2025-08-11 00:44:05 -07:00
Lexi Winter
084a3e1e03 RELNOTES, UPDATING: Document Secure RPC DES removal 2025-08-10 16:40:08 +01:00
Lexi Winter
bc9867173f tests/sys/net: if_bridge_test does not require python
This was originally added for if_bridge_test:span which uses scapy, but
that requirement is now annotated in the test itself.

Remove the requirement so the remaining bridge tests can run without
Python installed.
2025-08-10 16:36:40 +01:00
Lexi Winter
6856b8f4e6 ifconfig.8: Remove VLAN filtering section
Move the options from the VLAN filtering section into the main bridge
section.  Some of these (e.g., ifuntagged and ifvlanproto) don't
specifically require VLAN filtering, and it would be confusing to
have only some of the vlan-related options in a separate section.

Differential Revision:	https://reviews.freebsd.org/D51758
2025-08-10 16:36:40 +01:00
Lexi Winter
43ac5806a5 bridge: Divorce ifuntagged from vlanfilter
The ifuntagged option was added as part of the VLAN filtering feature,
but it's useful on its own to be able to place interface traffic in a
VLAN without having to configure every interface for VLAN filtering.

Always do the pvid processing in bridge even if IFBRF_VLANFILTER isn't
enabled, and don't prohibit configuring it.

Add a test for the specific case of setting untagged without vlanfilter.

This has no effect on bridges which don't have at least one interface
configured with ifuntagged.

Differential Revision:	https://reviews.freebsd.org/D51760
2025-08-10 16:36:40 +01:00
Lexi Winter
7ac276298b Remove Secure RPC DES authentication
Following the earlier removal of keyserv, none of this functionality
works since it requires keyserv.

Remove the relevant symbols from libc's Symbol.map.  Leave compatibility
symbols for existing applications, but since the functions don't work
without keyserv, stub them out to return an error.

Remove some private symbols that were only used by keyserv; these don't
get compatibility symbols.

Remove the documentation for the old functions.

Remove rpc.ypupdated since it requires DES authentication.

Reviewed by:		manu, des, emaste
Differential Revision:	https://reviews.freebsd.org/D50442
2025-08-10 16:36:40 +01:00
Lexi Winter
992d2f9284 rc.d: Fix Kerberos rc scripts
Split the Kerberos rc scripts into two sections, one for MIT Kerberos
and one for Heimdal.  Don't install Heimdal-specific rc scripts (e.g.,
kfd) for the MIT case.

This does not include an OptionalObsoleteFiles change (even though one
is needed) because that will be fixed later in a different way.

Reviewed by:		des (previous version)
Differential Revision:	https://reviews.freebsd.org/D51830
2025-08-10 16:36:39 +01:00
Lexi Winter
10eecc467f krb5: Don't install gssapi.h twice
Currently we install /usr/include/gssapi/gssapi.h twice, once in
krb5/include/gssapi and once in krb5/lib/gssapi.

The version in krb5/include/gssapi is wrong: make searches ${.PATH} and
picks crypto/krb5/src/include/gssapi.h to install, but this is the file
which is supposed to be installed in /usr/include/gssapi.h.

The problem was masked by the fact that we install the correct
gssapi/gssapi.h later in krb5/lib/gssapi.

Remove gssapi.h and the unneeded ${.PATH} entry from krb/include/gssapi
and while here, remove the unused GSSAPI_KRB5 include group.

This change does not affect the ultimate result of installworld,
it just avoids installing the same file twice with different content.

PR:			288594
Reviewed by:		brooks, des
Differential Revision:	https://reviews.freebsd.org/D51840
2025-08-10 16:36:39 +01:00
Lexi Winter
5467020a54 rc.conf: Use user.localbase to determine _localbase
When running an rc.d script outside of boot, ${_localbase} isn't set,
and rc.conf hardcodes the default value to /usr/local.  Instead, try
to get the localbase from the user.localbase sysctl, and only fall
back to /usr/local if we can't for some reason.

This fixes e.g. /etc/rc.d/ldconfig when localbase has a non-default
value.

Reviewed by:		imp, des
Differential Revision:	https://reviews.freebsd.org/D51852
2025-08-10 16:36:39 +01:00
Wolfram Schneider
c8cf8d851c bsd-family-tree: improve EOL section with FreeBSD references
Reported by:	Herbert J. Skuhra <herbert@gojira.at>
2025-08-10 14:57:42 +00:00
Wolfram Schneider
5bffa1d206 bsd-family-tree: add End-of-Life (EOL) section 2025-08-10 05:39:36 +00:00
Wolfram Schneider
71d65d2595 bsd-family-tree: add End-of-life (EOL) section 2025-08-10 05:38:15 +00:00
Cy Schubert
f1c4c3dacc krb5: Update MIT KRB5 from 1.21 to 1.22
Merge commit 'd82a140dad3a571d66abb2da24acbba90191f168'
2025-08-09 22:29:02 -07:00
Wanpeng Qian
fef6c8f2ee nvmecontrol: Add Intel Drive Marketing Name Log support (0xdd)
Add Intel Drive Marketing Name Log support (0xdd)

Specification here:
https://www.intel.com/content/dam/support/us/en/documents/ssdc/hpssd/sb/Intel_SSD_DC_P3600_Series_PCIe_Product_Specification-004.pdf

Reviewed by: imp
Differential Revsion: https://reviews.freebsd.org/D33819
2025-08-09 22:11:09 -06:00
Wanpeng Qian
72170a4174 nvmecontrol: Add Micron Vendor Unique SMART logpage support
Micron 9200 SSD has a 0xca logpage. It is different from other vendors
this patch tested on 9200 SSD and works as expected.

Product Datasheet can be found here:
https://www.micron.com/-/media/client/global/documents/products/data-sheet/ssd/9200_u_2_pcie_ssd.pdf

Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>
Reviewed by: imp
Differential Revsion: https://reviews.freebsd.org/D33866
2025-08-09 22:11:09 -06:00
Minsoo Choo
3b908a92b3 types.h: Don't define true/false in C23
From C23, bool, false, and true are keywords.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44666
2025-08-09 22:11:09 -06:00
ShengYi Hung
ec99803ad7 bhyve: Populate the device version from the backend
The pci_xhci driver requires the USB device version to be known before
allocating a hub port. To support this, we split the original xHCI
initialization into two phases:

1. Probe: Parse the nvlist and determine the device version.
2. Init: Complete initialization and set up the softc details.

This change ensures proper hub port allocation based on accurate device
version.

Approved by:    markj (mentor)
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51478
2025-08-09 23:15:41 -04:00
Enji Cooper
bc59895909 autofs: Plug memory leak
Originally, this was an extra free, but ngie@ suggested this
change. Since that's the whole thing, I've set her as the author for
this ancient review instead of trix@juniper.net.

Sugggested by: ngie
Differential Revision: https://reviews.freebsd.org/D10063
Sponsored by:		Netflix
2025-08-09 19:54:42 -06:00
Konstantin Belousov
e8b37e7545 timerfd_read(): stop setting td_rtcgen
The sleep is not time-bound.  More, setting td_rtcgen and not clearing
it would cause future sleeps to be spuriously interrupted.

Reviewed by:	imp, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D51836
2025-08-10 01:04:50 +03:00
Rick Macklem
4046ad6bb0 vfs_syscalls.c: Fix handling of offset args for copy_file_range
Commit 197997a broke handling of the offset
arguments to copy_file_range() when specified non-NULL.
The code fails to update the offsets and, as such, a loop like:

do {

   len = copy_file_range(infd, &inpos, outfd, &outpos,
      SSIZE_MAX, 0);
} while (len > 0);

becomes an infinite loop, just doing the same copy over and
over again.

This patch fixes it.

The clause "(foffsets_locked || foffsets_set)" in the if is not
actually needed for correctness, but I thought it made the code
a little more readable and might avoid some static
analyzer from throwing a "used before being set" for
the savinoff and savoutoff variables.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D51845
MFC after:	2 weeks
Fixes:	197997a4c3 ("file: Fix offset handling in kern_copy_file_range()")
2025-08-09 14:16:18 -07:00
Rick Macklem
7a9834041c vfs: Put the definition of COPY_FILE_RANGE_CLONE in unistd.h
kib@ noted that having COPY_FILE_RANGE_CLONE defined
in vnode.h was inappropriate, since it is meant to be used from
user space as well as kernel space.

This patch moves it into sys/unistd.h and reverts the addition
of it in vnode.h.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D51838
Fixes:	37b2cb5ecb ("vfs: Add support for file cloning to VOP_COPY_FILE_RANGE")
2025-08-09 13:33:53 -07:00
Robert Clausecker
9f4eb76796 man/man7: drop i386 from simd(7)
MFC:		no
2025-08-09 22:13:28 +02:00
Robert Clausecker
30acc84270 libc/amd64: rewrite memrchr() scalar impl. to read the string from the back
A very simple implementation as I don't have the patience right now
to write a full SWAR kernel.  Should still do the trick if you wish
to opt out of SSE for some reason.

Reported by:	Mikael Simonsson <m@mikaelsimonsson.com>
Reviewed by:	strajabot
PR:		288321
MFC after:	1 month
2025-08-09 22:13:27 +02:00
Robert Clausecker
4b15965daa libc/amd64: rewrite memrchr() baseline impl. to read the string from the back
This ensures O(1) behaviour if the character is a constant offset
from the end of the string, regardless of how long the string is.

Reported by:	Mikael Simonsson <m@mikaelsimonsson.com>
Reviewed by:	benni
PR:		288321
MFC after:	1 month
2025-08-09 22:13:27 +02:00
Mitchell Horne
60fce0e221 busdma: another fix for small bounce transfers
More fallout from a77e1f0f81.

When the tag has an alignment requirement but a small (remaining)
transfer size, the transfer will be rounded up to exceed its bounds,
resulting in memory corruption.

The issue is observed on powerpc as noted in the pull request:
https://github.com/freebsd/freebsd-src/pull/1415

I also observe the issue locally on riscv hardware, with an 8-byte
transfer having 64-byte alignment.

There is some uncertainty about the purpose/need for the alignment
roundup; both its original intention and present effect. Notably, it is
no longer present at all in arm/arm64 implementations. Possibly, this
roundup can be removed altogether, but this requires more careful
analysis of the edge-cases and history of the property.

For now, simply clamp sgsize to be no larger than the remaining buflen,
as this is certain to be correct within the current scheme and fixes
the affected transfers.

Discussed with:	jhb, markj
MFC after:	3 weeks
Fixes:	a77e1f0f81 ("busdma: better handling of small segment bouncing")
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1415
Signed-off-by:	Chattrapat Sangmanee <aomsin27@hotmail.co.th>
Co-authored-by:	Chattrapat Sangmanee <aomsin27@hotmail.co.th>
Differential Revision:	https://reviews.freebsd.org/D47807
2025-08-09 15:42:33 -03:00
Steve Kargl
a1d051bc87 Updates for ccosh[f] and csinh[f]
* lib/msun/src/s_ccosh.c:
  . Update Copyright years.
  . sin() and cos() are needed at the same time, so use sincos() to
    compute values.  This does argument reduction once instead of twice.
  . Replace '* 0.5' with '/ 2'. This reduces diff with s_ccoshf.c.
  . For (LDBL_MANT_DIG == 53), add weak references for ccoshl and ccosl.

* lib/msun/src/s_ccoshf.c:
  . Update Copyright years.
  . sin() and cos() are needed at the same time, so use sincos() to
    compute values.  This does argument reduction once instead of twice.
  . Replace '* 0.5F' with '/ 2'. This reduces diff with s_ccoshf.c.

* lib/msun/src/s_csinh.c:
  . Update Copyright years.
  . sin() and cos() are needed at the same time, so use sincos() to
    compute values.  This does argument reduction once instead of twice.
  . Replace '* 0.5' with '/ 2'. This reduces diff with s_csinhf.c.
  . For (LDBL_MANT_DIG == 53), add weak references for csinhl and csinl.

* lib/msun/src/s_csinhf.c:
  . Update Copyright years.
  . sin() and cos() are needed at the same time, so use sincos() to
    compute values.  This does argument reduction once instead of twice.
  . Replace '* 0.5F' with '/ 2'. This reduces diff with s_ccoshf.c.

PR:		288740
MFC after:	1 week
2025-08-09 19:28:07 +02:00
Steve Kargl
53b77089e5 Remove unused variables in msun/bsdsrc/b_tgamma.c
PR:		288736
MFC after:	3 days
2025-08-09 19:25:25 +02:00
Kyle Evans
239e8c9863 ssh: sshd-session: properly save off the privileged gid
Current and traditional FreeBSD behavior means that getegid() here is
the first element in the prior setgroups() call, if any, so we may
inadvertently wipe out our rgid with the unprivileged gid.  This is
rendered somewhat harmless by the fact that we're losing the privileged
gid -- we'll still regain it as the egid in restore_uid() later by way
of restoring saved_egroups, rather than by intentionally restoring it
from getgid().

This will be promptly reverted if we can get setgroups(2)/getgroups(2)
changed in FreeBSD 15.0, but it seemed wise to get this technically
correct for previous branches.

Reviewed by:	jlduran
Differential Revision:	https://reviews.freebsd.org/D51753
2025-08-09 11:01:57 -05:00
Kyle Evans
5f72125339 top: improve sort field storage/lookup
Switch up comparator mapping to avoid these kinds of errors, use a
simple array of (name, comparator) pairs rather than having to maintain
entries in two separate arrays that must have matching indices.

Reviewed by:	obiwac
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37083
2025-08-09 11:00:31 -05:00
Colin Percival
db7c0e32a0 Bump __FreeBSD_version for 4757b351ea
This is necessary so that pkg builds will link to the new libutil
shared object version.

Fixes:	4757b351ea ("openssl: Import version 3.5.1")
2025-08-09 07:04:07 -07:00
Dag-Erling Smørgrav
a276bb4794 geom: Correct use of expand_number()
Several GEOM classes use G_TYPE_NUMBER for options where the argument
(or at least the default value of -1) may be negative.

PR:		288723
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D51834
2025-08-09 15:14:01 +02:00
Jean-Sébastien Pédron
f0e4459126
linuxkpi: Update posittion after copy in seq_read()
`seq_read()` is usually called in a loop because the destination buffer
might be smaller than the source. The caller relies on the updated
position to read what is next.

We also use `memcpy()` instead of `strscpy()` because we don't need to
append a NUL character.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51560
2025-08-09 14:26:25 +02:00
Jean-Sébastien Pédron
7cbc4d8759
linuxkpi: Use __builtin_popcountg() instead of bitcount*()
The DRM drivers generic code started to use `HWEIGHT64()` in the
definition of an array field in a structure. Therefore, the array size
needs to be known at compile time. This was not the case with the
`HWEIGHT*()` macros based on `bitcount*()`. The use of
`__builtin_popcountg()` solves that problem.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50995
2025-08-09 14:26:25 +02:00
Jean-Sébastien Pédron
d17bfb2370
linuxkpi: Include <linux/spinlock.h> from <linux/refcount.h>
The <linux/refcount.h> header uses the `spinlock_t` type and some
consumers in the DRM drivers don't include <linux/spinlock.h> directly
or indirectly. This led to compilation errors because the type was
undefined.

On Linux, <linux/refcount.h> includes <linux/spinlock_type.h> as a
comparision.

Reviewed by:	emaste, manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50994
2025-08-09 14:26:25 +02:00
Jean-Sébastien Pédron
3c9acc35b1
linuxkpi: Add the topology_*() functions
... from <asm/topology.h>.

The amdgpu DRM driver started to use `topology_num_cores_per_package()`
in Linux 6.9.

Reviewed by:	manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50993
2025-08-09 14:26:24 +02:00
Jean-Sébastien Pédron
cdfdafdc34
linuxkpi: Define DEFINE_SHOW_STORE_ATTRIBUTE()
It is the same as `DEFINE_SHOW_ATTRIBUTE()` with a `write` function
added.

The i915 DRM driver started to use it in Linux 6.9.

Reviewed by:	manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50992
2025-08-09 14:26:24 +02:00
Jean-Sébastien Pédron
621f43ffe2
linuxkpi: Declare several log message prefixes
The amdgpu DRM driver started to use `HW_ERR` in Linux 6.9.

Reviewed by:	emaste, manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50990
2025-08-09 14:26:24 +02:00
Jean-Sébastien Pédron
a7a05ace5d
linuxkpi: Add name field to struct resource
The i915 DRM driver started to display this field in log messages in
Linux 6.9.

Reviewed by:	emaste, manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50989
2025-08-09 14:26:24 +02:00
Jean-Sébastien Pédron
c903f3756a
linuxkpi: Add ida_alloc_range()
The amdgpu DRM driver from Linux 6.9 started to use this function.

Reviewed by:	manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50988
2025-08-09 14:26:23 +02:00
Jean-Sébastien Pédron
7e5d7b0e81
linuxkpi: Add sysfs_add_file_to_group() and sysfs_remove_file_from_group()
They are used by the amdgpu DRM driver for quite some time, but new code
using them added to Linux 6.9 made me discover that these functions were
missing and existing code was commentted out.

Reviewed by:	manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50987
2025-08-09 14:26:23 +02:00
Michael Tuexen
f0f6e50388 tcp: mitigate a side channel for detection of TCP connections
If a blind attacker wants to guess by sending ACK segments if there
exists a TCP connection , this might trigger a challenge ACK on an
existing TCP connection. To make this hit non-observable for the
attacker, also increment the global counter, which would have been
incremented if it would have been a non-hit.
This issue was reported as issue number 11 in Keyu Man et al.:
SCAD: Towards a Universal and Automated Network Side-Channel
      Vulnerability Detection

Reviewed by:		Nick Banks, Peter Lei
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D51724
2025-08-09 14:17:38 +02:00
Michael Tuexen
2eb786d96e tcp: rate limit the sending of all RST segments
Also rate limit the sending of RST segments in the following cases:
* when receiving data on a closed socket.
* when a socket can not be created at the end of the handshake and
  the sysctl-variable net.inet.tcp.syncache.rst_on_sock_fail is 1.
* when an ACK segment is received in SYN SENT state and it does not
  acknowledge the SYN segment.
After this change, there is no need anymore to provide a rstreason
to tcp_dropwithreset(), since it is always BANDLIM_TCP_RST.
This will be a follow-up commit, since it will change the code in a
couple of places, but will not change the functionality.

Reviewed by:		rrs, Nick Banks, Peter Lei
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D51815
2025-08-07 22:23:54 +02:00
Michael Tuexen
b6521ceaf2 tcp : remove assignment without effect
rstreason is only relevant in the code paths with the label
'dropwithreset', but not in the one with the label 'drop'.
No functional change intended.

Reviewed by:		Nick Banks, rrs, Peter Lei, imp
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D51814
2025-08-07 22:14:08 +02:00