Commit Graph

306606 Commits

Author SHA1 Message Date
Dag-Erling Smørgrav 5074d5c984 libc: Improve POSIX conformance of dirfd()
POSIX states that dirfd() should set errno to EINVAL and return -1 if
dirp does not refer to a valid directory stream.  Our interpretation is
that this applies if dirp is null or the file descriptor associated
with it is negative.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D55025
2026-02-02 16:46:57 +01:00
Dag-Erling Smørgrav 387ae63905 libc: Clean up *dir() code
Fix style nits (mostly whitespace issues) and clean up the manual page.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D55024
2026-02-02 16:46:53 +01:00
Warner Losh 350c1232a5 nvmecontrol: telemetry-log --verbose
Add -v / --verbose to report status report since these things can take
minutes to retrieve.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D55019
2026-02-02 06:31:21 -07:00
Warner Losh ff9fe85ff2 nvmecontrol: telemetry-log don't sanity check host generation number
Don't sanity check the host initiated generation number. It's not
necessarily constant between the two log page fetches. nvme-cli doesn't
do this stanity check and it generates a lot of false positives.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D55018
2026-02-02 06:31:21 -07:00
Warner Losh 05322eec86 nvmecontrol: Always set the RAE bit on telemetry-log requests
nvme-cli, as well as some vendor scripts, always set the RAE bit of the
GET LOG PAGE request when retrieving telemetry logs to avoid the log
getting reset to something new. Adopt that praactice here (nvme-cli
telemetry-log does have a --rae option, but that just turns on the rae
bit which defaults to being on: there's no way to turn it off).

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D55017
2026-02-02 06:31:21 -07:00
Zhenlei Huang e63ee5fedb e1000: Fix setting the promiscuous mode
The variable reg_rctl stores the value read from reg E1000_RCTL. It
may contain bits E1000_RCTL_VFE and E1000_RCTL_CFIEN which control
VLAN hardware filter feature. The promiscuous mode implies all tagged
or untagged packets should be accepted, so the VLAN hardware filter
feature should be disabled when enabling the promiscuous mode.
Calling em_if_vlan_filter_disable() did the task, but later writing
the value of reg_rctl back to the reg E1000_RCTL may restore the
feature.

Move the calling of em_if_vlan_filter_disable() after writing the reg
to fix that.

PR:		292759
Reviewed by:	kbowling
Tested by:	vova@zote.me
Fixes:		2796f7cab1 e1000: Fix up HW vlan ops
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54973
2026-02-02 20:26:31 +08:00
Pouria Mousavizadeh Tehrani 6d37c3db62 bcmp(3): update manpage to following the Posix Standard
Reviewed by: glebius
Approved by: glebius (mentor)
Differential Revision: https://reviews.freebsd.org/D52980
2026-02-02 10:28:26 +03:30
Xin LI c408e7413b Vendor import of less v691. 2026-02-01 22:24:58 -08:00
zxbv3 49d75d9320 pkgbase-stage.lua: Add '*-jail-dbg' variant to dvd1
- Add *-jail-dbg variant to dvd1 to match the non-jail variant;
- Remove assertion introduced in the previous commit for consistency with existing code.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1991
2026-02-01 14:51:11 -07:00
zxbv3 638fb31a75 pkgbase-stage.lua: Add *-jail metapackages to the offline repo
Having *-jail metapackage variants on the installation media allows convenient offline jail creation.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1991
2026-02-01 14:51:10 -07:00
Ali Mashtizadeh 37bba2ad92 hwpmc_amd: Add support for additional counters.
Rather than provide a static table of counters, this change computes the
number of counters that are available by checking several CPUID leafs
and falling back to defaults on older processors.  The limits are set to
support the maximum number of counters of each type.

Sponsored by: Netflix
Reviewed by: imp, mhorne
Pull Request: https://github.com/freebsd/freebsd-src/pull/1983
2026-02-01 14:26:48 -07:00
Defenso-EBO 851dffef53 ig4: Add support for Lunar Lake-M I2C
this patch adds PCI IDs to the ig4(4) driver:
- Lunar Lake-M (0xa878, 0xa879, 0xa87a, 0xa87b)
These controllers use the Tiger Lake hardware revision of the I2C IP.
Adding these IDs enables support for peripherals connected to the I2C Bus.
Tested on: Intel Lunar Lake (LENOVO_MT_21QX_BU_Think_FM_ThinkPad T14s Gen 6)

Signed-off-by: Defenso-EBO <etienne.bonnand@defenso.fr>

MFC after: 2 weeks

Sponsored by: Defenso

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1995
2026-02-01 14:22:15 -07:00
Yogesh Bhosale 98bdf63f6e ice(4): Handle allmulti flag in ice_if_promisc_set function
In the ice_if_promisc_set function, the driver currently disables the
IFF_ALLMULTI flag, thereby preventing the activation of multicast mode.
To address this issue, implement appropriate handling to ensure the
flag is managed correctly.

Signed-off-by: Yogesh Bhosale <yogesh.bhosale@intel.com>

Tested by:	Gowthamkumar K S <gowtham.kumar.ks@intel.com>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54186
2026-02-01 10:27:36 -07:00
Enji Cooper cea2683bb6 Remove example tests when MK_EXAMPLES=no
This change cleans up example tests for atf, googletest, plain, and TAP
when MK_EXAMPLES=no. Not having this in results
`kyua test -k /usr/tests/share/examples/Kyuafile` being broken on a host
where the content in that directory tree is stale. I ran into that case
because at some point in time in the past I had specified
`MK_GOOGLETEST=no` one of my dev instances.

MFC after:	1 week
2026-02-01 09:12:44 -08:00
Enji Cooper e6c8997a89 OpenSSL: commit sys/crypto changes for 3.5.5
These files were changed as part of the 3.5.4 -> 3.5.5 upgrade. Please
see the upstream release notes linked in
1731fc70f7, et al, for more details.

MFC after:	6 days
MFC with:	1731fc70f7
Fixes:	1731fc70f7 ("OpenSSL: update vendor sources to match 3.5.5 content")
2026-02-01 09:05:55 -08:00
Alexander Ziaee a97ed3a39c vt.4: Sprinkle mdoc macros
Now that we have angle bracket characters for all common display sizes,
sprinkle in the correct macros for the structures in this page. While
here, fix a mdoc typo, a linter warning, and switch a parenthetical to
a much smoother appositive.

MFC after:	3 days
Fixes:		7cd6da268a (vt.4: Style pass)
2026-02-01 10:52:54 -05:00
Alexander Ziaee 0d602f923e contrib/spleen: Update to 2.2.O
This release adds several new characters critical to the manual pages
that were previously missing on high-dpi displays: em-dash, en-dash,
hyphen, angle brackets, white square, dagger, and double dagger. It
also features improved alignment for numerous characters in different
sizes.

Thanks:		Fredric Cambus
MFC after:	3 days
Discussed with:	emaste
2026-02-01 10:36:15 -05:00
Alexander Ziaee 147eec579c Vendor import of Spleen font 2.2.0 2026-02-01 10:20:32 -05:00
Michal Meloun d78cbf483f arm: Implement kernel ifunc
Add kernel ifunc support on arm.

MFC after :	3 weeks
Reviewed by:	kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D54970
2026-02-01 09:17:43 +01:00
Alexander Ziaee 1f5795b642 INDEX.fonts: Minor maintenance
+ Mention relevance of this file in the vt manual screen.font entry
+ The vidfont manual is in section one, not eight
+ Remove leftover blank line from freebsd tag removal

MFC after:	3 days
2026-01-31 19:27:37 -05:00
Enji Cooper 1731fc70f7 OpenSSL: update vendor sources to match 3.5.5 content
MFC with:	f25b8c9fb4
MFC after:	1 week
2026-01-31 14:07:17 -08:00
Enji Cooper f25b8c9fb4 openssl: import 3.5.5
This change adds OpenSSL 3.5.5 from upstream [1].

The 3.5.5 artifact was been verified via PGP key [2] and by SHA256 checksum [3].

This is a security release, but also contains several bugfixes. All of
the CVE-worthy issues have already been addressed on the target
branch(es), so the net-result is that this is a bugfix release.

More information about the release (from a high level) can be found in
the release notes [4].

MFC after:	1 week

1. https://github.com/openssl/openssl/releases/download/openssl-3.5.5/openssl-3.5.5.tar.gz
2. https://github.com/openssl/openssl/releases/download/openssl-3.5.5/openssl-3.5.5.tar.gz.asc
3. https://github.com/openssl/openssl/releases/download/openssl-3.5.5/openssl-3.5.5.tar.gz.sha256
4. https://github.com/openssl/openssl/blob/openssl-3.5.5/NEWS.md

Merge commit '808413da28df9fb93e1f304e6016b15e660f54c8'
2026-01-31 14:00:39 -08:00
Michael Osipov fe81e3944c sockstat: Surround explicit IPv6 addresses with brackets
PR:		254611
Approved by:	otis, tuexen, des
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54375
2026-01-31 21:48:56 +01:00
Michael Tuexen d195b3783f sctp: fix socket type created by sctp_peeloff()
When calling sctp_peeloff() on a SOCK_SEQPACKET socket, the created
and returned socket has the type SOCK_STREAM.
This is specified in section 9.2 of RFC 6458.

Reported by:	Xin Long
MFC after:	3 days
2026-01-31 19:11:08 +01:00
Dag-Erling Smørgrav 1538284a5f libc/resolv: Switch default to loopback address
If no resolver configuration was found, we would fall back to INADDR_ANY
and IN6ADDR_ANY.  This made sense when it was first written thirty or
forty years ago but not today, especially since connecting to INADDR_ANY
or IN6ADDR_ANY is no longer supported.  Switch to the loopback address
and simplify the code.

Note that (as the pre-existing comment in the code states) running
without a resolver configuration is not really supported.  Still, if
we're going to have a hardcoded fallback, it might as well work.

PR:		291790
MFC after:	1 week
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D55011
2026-01-31 18:52:53 +01:00
John Baldwin f4c40a5acb riscv: Add ffs.c and ffsdi2.c
These are only needed for GCC, but it doesn't hurt to include these
always.

Reviewed by:	mhorne
Differential Revision:	https://reviews.freebsd.org/D54968
2026-01-31 12:21:11 -05:00
John Baldwin 4c822dd4a1 libkern: Add libcalls for ffs and __ffsdi2
These are needed when compiling a RISC-V kernel with GCC which does
not inline __builtin_ffs*.

The __ffsdi2 is adapated from the previous ffsl.c.

This partially reverts commit f4db342d44.

Reviewed by:	mhorne
Differential Revision:	https://reviews.freebsd.org/D54967
2026-01-31 12:20:50 -05:00
John Baldwin 31b259049e riscv: Enable the zifencei extension explicitly in -march
clang is more tolerant and implies this extension whereas GCC is
stricter and requires it to be included.

Reviewed by:	mhorne
Differential Revision:	https://reviews.freebsd.org/D54965
2026-01-31 12:10:56 -05:00
John Baldwin fe45651224 stand: Add compiler builtins needed by GCC for RISC-V
Reviewed by:	mhorne
Differential Revision:	https://reviews.freebsd.org/D54963
2026-01-31 12:10:36 -05:00
John Baldwin 2e8ef82b34 stand: Use the correct OUTPUT_ARCH in the linker script for RISC-V
Compare to the OUTPUT_ARCH in sys/conf/ldscript.riscv.

Reviewed by:	mhorne
Differential Revision:	https://reviews.freebsd.org/D54962
2026-01-31 12:09:44 -05:00
John Baldwin b26a7af438 heimdal: Pass the correct pointer to free in an error case
This fixes a warning reported by GCC 14 on stable/14:

crypto/heimdal/lib/hdb/keys.c:241:13: warning: 'free' called on pointer 'ext' with nonzero offset 16 [-Wfree-nonheap-object]
  241 |             free(hist_keys);
      |             ^~~~~~~~~~~~~~~
crypto/heimdal/lib/hdb/keys.c:234:15: note: returned from 'calloc'
  234 |         ext = calloc(1, sizeof (*ext));
      |               ^~~~~~~~~~~~~~~~~~~~~~~~

Reviewed by:	rmacklem, cy
Fixes:		5000d023a4 ("heimdal-kadmin: Add support for the -f dump option")
Differential Revision:	https://reviews.freebsd.org/D54932
2026-01-31 12:00:44 -05:00
John Baldwin 8a8dc73ef8 heimdal: Add missing function prototypes
This fixes the build with GCC 14 on stable/14 which raises fatal
-Wimplicit-function-declaration warnings.

Reviewed by:	rmacklem, cy
Fixes:		5000d023a4 ("heimdal-kadmin: Add support for the -f dump option")
Differential Revision:	https://reviews.freebsd.org/D54931
2026-01-31 12:00:15 -05:00
John Baldwin 6e82cb2906 wlanstat: Drop unneeded bsd.compiler.mk from Makefile
No functional change, but downstream in CheriBSD this was causing a
link error as the Makefile was overriding CFLAGS set via a side effect
of bsd.compiler.mk.

Reviewed by:	bz, brooks, emaste
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D54894
2026-01-31 11:58:39 -05:00
Alan Somers df68a09ea2 tests: sys/capsicum/functional requires mqueuefs
Skip this test if mqueuefs isn't loaded.  Unfortunately, that will skip
the entire googletest test program, including test cases that don't
require mqueuefs.  But the test's own skipping logic doesn't work, and
we don't yet have a googletest-compatible require_kmods() function.

MFC after:	2 weeks
Sponsored by:	ConnectWise
Reviewed by:	emaste, ngie
Differential Revision: https://reviews.freebsd.org/D54902
2026-01-31 08:46:35 -07:00
Gordon Bergling 0a3e7ba466 cpufreq(4): Fix a typo in a source code comment
- s/transcation/transaction/

MFC after:	5 days
2026-01-31 16:22:00 +01:00
Gordon Bergling a17659fe26 ath_hal(4): Fix a typo in a source code comment
- s/arithmatic/arithmetic/

MFC after:	5 days
2026-01-31 16:20:32 +01:00
Michael Tuexen 7b6e84c9ac ure: improve checksum offloading
This patch fixes three issues:
(1) Initially, set the hwassist flags correctly when enabling
    transmit checksum offload for TCP/IPv6 and UDP/IPv6.
(2) Keep the hwassist flags in sync with the capabilities when
    changing txcsum.
(3) Keep the hwasssit flags in sync with the capabilities when
    changing txcsum6.
Without this patch, transmit checksum offloading for TCP/IPv6 and
UDP/IPv6 is never used and transmit checksum offloading for IPv4,
TCP/IPv4 and UDP/IPv4 is always used, even if disabled via
ifconfig ue? -txcsum.

Reviewed by:		Timo Völker
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D54974
2026-01-31 11:42:10 +01:00
Enji Cooper ab9b047369 clang-format: adjust to sort C++ headers per style(9)
Many standard C++ headers do not have the .h file extension: some, such as
`iostream`, lack it; others have a .hpp file extension. Moreover, some
projects (like ATF/Kyua) also contain .ipp files, which are C++ "interface"
files.

Relax the regular expression to ensure that non-traditional C "system"
headers, C++ headers, etc, with angle brackets are sorted before
"local" headers.

MFC after:	1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D54401
2026-01-30 20:14:10 -08:00
Gleb Smirnoff 9df110b11f tests/netinet: fix tests that depended on connect(in6addr_any)
Fixes:	627e126dbb
2026-01-30 13:31:13 -08:00
Mark Johnston 56e1cba88b ip6_mroute: Remove unnecessary casts
No functional change intended.

MFC after:	1 week
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
2026-01-30 20:39:34 +00:00
Mark Johnston 34c3e1d718 netstat: Fix whitespace in libxo output for multicast routes
Also fix some bogus libxo format strings in mroute6.c, and close a
couple of lists instead of opening them twice.

Fixes:		ade9ccfe21 ("Convert netstat to use libxo.")
MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
2026-01-30 20:30:58 +00:00
Konstantin Belousov 245157fd8a ktrcsw(): should not be called when the thread is owning interlock or on sleepq
The issue is that for ktrcsw() we lock the ktrace_mtx mutex while owning
the interlock from a subsystem that called msleep().  In particular, the
VM subsystem might call msleep() if page allocation failed.  This
establishes order VM locks (e.g. domain free queue lock) -> ktrace_mtx.
Calling free() while owning ktrace_mtx gives the reverse order.

Worse, msleep_spin_sbt() call s ktrcsw() while the thread is put on
sleep queue.  Then, since the mutex might be contested, the thread needs
to be put on turnstil, which cannot work.

Move the ktrcsw() call for switch-out after the wakeup, when the thread
does not yet re-obtained any locks.  From there, we call a special
version of ktrcsw(), which is passed the actual time when the context
switch occured.

The drawback is that the switch-out record is only written in the
ktrace.out file after the switch-in occurred, but this is probably not
too serious.

Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-30 20:45:48 +02:00
Colin Percival bda8028146 release: Ship firmware from kmods repo on DVD
The packages for X.Y-RELEASE are a snapshot of the quarterly branch
for stable/X, i.e. typically built on X.(Y-1)-RELEASE.  (The case of
Y=0 is an exception for obvious reasons.)  This works for most ports
but not for kernel modules, which may need to be built on the release
in question; this is why we have a separate "kmods" repository.

Make sure that we put the packages from the kmods repository onto the
mini-pkg-repo on the DVD rather than shipping unusable firmware.

Reviewed by:	bz
MFC after:	1 week
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D52581
2026-01-30 09:41:51 -08:00
Andy Carrel 93d3ac1daa arm64: Fix kernel panic in get_arm64_sve during core dump
The coredump logic calls get_arm64_sve twice: once to get the note size,
and once to get the data. The note size calculation depended on the
volatile `PCB_FP_SVEVALID` flag. If this flag was cleared between the
two calls (e.g., due to a context switch clearing the flag to comply
with the ABI), the second call would expect a smaller buffer size than
the first, triggering a KASSERT panic ("invalid size").

Fix this by ensuring the SVE state is saved to the PCB before we decide
whether to use SVE or VFP.

PR: 292195
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D54532
2026-01-30 17:01:49 +00:00
Christos Margiolis c88f012faa lib/virtual_oss/sndio: Remove trailing backslash
Fixes:		d78291b0e9 ("lib/virtual_oss: don't (over)link to libsamplerate")
Reported by:	pkg-fallout
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
2026-01-30 18:25:02 +02:00
Christos Margiolis b9289743f4 src.opts: Remove MK_SOUND artifact
Fixes:		f74f891581 ("src.opts: Introduce MK_SOUND")
PR:		291853
Sponsored by:	The FreeBSD Foundation
MFC after:	4 days
2026-01-30 18:14:28 +02:00
Mark Johnston 1539a657ad ip6_output tests: Remove an unused import
No functional change intended.

MFC after:	1 week
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
2026-01-30 15:27:22 +00:00
Mark Johnston a03eabfebb ip6_mroute: Mark functions as static
No functional change intended.

MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
2026-01-30 15:25:52 +00:00
Timo Völker 574d46b25a epair: add VLAN_HWTAGGING
Add capability VLAN_HWTAGGING to the epair interface and enable it by
default.
When sending a packet over a VLAN interface that uses an epair
interface, the flag M_VLANTAG and the ether_vtag (which contains the
VLAN ID and/or PCP) are set in the mbuf to inform the hardware that
the VLAN header has to be added. The sending epair end does not need
to actually add a VLAN header. It can just pass the mbuf with this
setting to the other epair end, which receives the packet. The
receiving epair end can just pass the mbuf with this setting to the
upper layer. Due to this setting, the upper layer believes that there
was a VLAN header that has been removed by the interface.
If the packet later leaves the host, the outgoing physical interface
can add the VLAN header in hardware if it supports VLAN_HWTAGGING.
If not, the implementation of Ethernet or bridge adds the VLAN header
in software.

Reviewed by:		zlei, tuexen
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D52465
2026-01-30 11:54:33 +01:00
Michael Tuexen 33596d9255 dpaa2: add support for several interface counters
Add support for IFCOUNTER_IPACKETS, IFCOUNTER_OPACKETS,
IFCOUNTER_OBYTES, IFCOUNTER_OMCASTS, IFCOUNTER_OERRORS, and
IFCOUNTER_OQDROPS.
This allows tools like systat to report the incoming and outgoing
bandwidth.

Reviewed by:		dsl, Timo Völker
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D54893
2026-01-30 10:58:57 +01:00