Commit Graph

307804 Commits

Author SHA1 Message Date
Konstantin Belousov 6275cd73ac sys/param.h: bump __FreeBSD_version for amd64 struct trapframe size change
Requested by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-03-21 00:48:30 +02:00
Konstantin Belousov e909506273 x86 FRED: add hardware definitions for the trap frames fields
as provided by the Intel document 346446-009 AKA FRED 8.0 and SDM v90,
February 2026.

Note that the layout of the struct trapframe does not change with
FRED. The differences are in addition of two fields at the end of the
structure. Other members are carved from existing tf_cs and tf_ss by
limiting hw-written segments to 16 bits officially, and reusing rest
from the doubleword for the new data.

Reviewed by:	jhb, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55831
2026-03-20 23:05:15 +02:00
Konstantin Belousov 8892176c86 amd64: check that %cs and %ss values from ucontext fit into registers
This change only checks that the values from the user-supplied context
are not truncated by C implicit type convertions.  The validity of the
segment selectors is still checked by hardware.

Reviewed by:	jhb, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55861
2026-03-20 23:05:15 +02:00
Konstantin Belousov e18449fbe2 amd64: move code to check for traps with interrupts disabled into helpers
Reviewed by:	jhb, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55809
2026-03-20 23:05:15 +02:00
Enji Cooper 67b918e034 Revert "libcrypto: compile all PIC objects with -DOPENSSL_PIC"
This commit broke the build with some build options.

Some validation needs to be done to confirm that moving the preprocessor
argument to `secure/lib/libcrypto/Makefile.inc` works without breaking
the build, but revert for now until a `tinderbox` run can be done with
the change.

PR:		293934
Reported by:	Jenkins, Trond Endrestøl

This reverts commit 14b9955e57.
2026-03-20 13:12:26 -07:00
Ed Maste e296211fd5 Makefile.inc1: Don't force LLVM_BINUTILS off for cross-tools
Because of this setting we were still using ELF Tool Chain tools for
buildworld.  The sets of binary utilities are largely equivalent and
this went unnoticed after commit 1cae7121c6 ("Enable LLVM_BINUTILS
by default").

This was discovered recently because ELF Tool Chain objcopy produces
standalone debug files without phdrs and this caused an issue with a
3rd party ELF parser [1].  Remove the forced setting so that we use
LLVM's binutils to build the system.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=33876

Re-commit after fixing a bootstrapping issue with LLVM binutils (in
17494c6e6b "build: Boostrap LLVM_BINUTILS for cross-tools").

Reviewed by:	imp, jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55650
2026-03-20 15:00:41 -04:00
Chuck Silvers 1fd43ee968 tpm: fix multi-threaded access with per-open state
The TPM driver currently has a single buffer per instance to hold the
result of a command, and does not allow subsequent commands to be sent
until the current result is read by the same OS thread that sent the
command, with a timeout to throw away the result after a while if the
result is not read in a timely fashion.  This has a couple problems:

 - The timeout code has a bug which causes all subsequent commands to
   hang forever if a different OS thread tries to read the result
   before the OS thread which sent the command, and the OS thread
   which sent the command never tries to read the result.

 - Even if the first problem is fixed, applications expect to be able
   to read the result from a different OS thread than the OS thread
   which sent the command. The particular case that we saw was a go
   application where the go runtime scheduled the goroutine which read
   the result to a different OS thread from one where the goroutine
   that sent the command ran, and there's no way to force these to
   always run on the same OS thread.

Fix all of this by replacing the global result buffer with a per-open
result buffer via devfs_set_cdevpriv(), so that we no longer need to
block subsequent commands until the results of a previous command are
retrieved or care about which OS thread is reading the result of a
command.

Sponsored by:	Netflix
Reviewed by:	olivier, imp
Differential Revision:	https://reviews.freebsd.org/D52328
2026-03-20 11:48:44 -07:00
Chuck Silvers 632ddb864e krb5: append to LDFLAGS instead of replacing
Sponsored by:	Netflix
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55335
2026-03-20 10:19:35 -07:00
Gleb Smirnoff 03b7b779a8 tcp/rack: don't call call tcp_state_change() before tcp_close()
Reviewed by:		tuexen, rrs
Differential Revision:	https://reviews.freebsd.org/D55969
2026-03-20 09:55:04 -07:00
Gleb Smirnoff 0798ad8023 tcp: remove extraneous code
The tcp_close() will perform both actions.

Reviewed by:		pouria, tuexen, rrs
Differential Revision:	https://reviews.freebsd.org/D55965
2026-03-20 09:54:54 -07:00
Abdelkader Boudih 3d218b6289 cam (scsi): silence "Medium not present" SCSI sense logging for removable media
Change SS_FATAL to SS_FAIL for SCSI sense code 0x3A (Medium not present)
to suppress console spam when card readers or other removable media
devices have no media inserted.

The error is still returned to callers (ENXIO), but no longer prints to
dmesg during boot/probe.

Verified with Apple SD Card Reader - reduced boot messages from 4 to 2.

Reviewed by:	emaste, imp
Differential Revision: https://reviews.freebsd.org/D55287
2026-03-20 11:29:57 -04:00
Alexander Ziaee 8475cd93fb dwcotg.4: Initial manual page
Create visibility in apropos and the Hardware Release Notes.

MFC after:		3 days
Reviewed by:		pauamma, ray
Differential Revision:	https://reviews.freebsd.org/D53287
2026-03-20 10:45:11 -04:00
Navdeep Parhar 0661997cea loader(8): embedded MD should be the most preferred currdev
A loader built with MD_IMAGE_SIZE is almost always meant for use with
its embedded image and should try that as currdev before anything else.
Recent changes (d69fc3a9dc, 784150fd25) seem to have relaxed the ZFS
code's search for a rootfs and exposed this problem.

Reviewed by:	imp, tsoome
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D55979
2026-03-20 07:40:41 -07:00
Ed Maste 17494c6e6b build: Boostrap LLVM_BINUTILS for cross-tools
Reported by:	vexeduxr, jrtc27
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Pull request:	https://github.com/freebsd/freebsd-src/pull/2084
Differential Revision: https://reviews.freebsd.org/D55923
2026-03-20 09:38:40 -04:00
Baptiste Daroussin dc2687bf71 src.conf(5): rebuild after introduction of WITHOUT_PKGSERVE 2026-03-20 13:32:55 +01:00
Baptiste Daroussin b42e852e89 pkg-serve(8): serve pkg repositories over TCP via inetd (8)
Reviewed by:	manu, bdrewery (previous version)
Differential Revision:	https://reviews.freebsd.org/D55895
2026-03-20 13:29:48 +01:00
Poul-Henning Kamp a0170dbd4e "Pending" is more correct than "Missing"
Pointed out by: Alex "the PS/2 guy"
2026-03-20 10:32:30 +00:00
Jake Freeland 33345b8834 timerfd: Suppress kqueue readability after jump read
Do not report EVFILT_READ after reading a discontinuous clock jump.
This makes the kqueue filter consistent with Linux epoll behavior
and timerfd_poll(), which already checks tfd_jumped != TFD_READ before
reporting POLLIN.

MFC after: 2 weeks
2026-03-20 02:15:09 -05:00
Jake Freeland b11fba4126 timerfd: Wake up on discontinuous jump
If a discontinous realtime clock change occurs and sets any TFD_JUMPED
bits on the timerfd, then wake up waiting readers. This fixes failures
from the timerfd_root__clock_change_notification test case.

MFC after: 2 weeks
2026-03-20 02:15:08 -05:00
Jake Freeland 0e8f351be7 timerfd: Use saturating sbintime conversions
Some timerfd consumers set expirations with timespec tv_sec components
larger than 2^31 - 1. In such cases, converting that timespec to
sbintime results in data loss or sign flip, yielding a shorter
expiration than desired.

To avoid this problem, use saturating timespec-to-sbintime conversion
functions. These will clamp the converted sbintime to SBT_MAX under
circumstances where the normal conversion functions would overflow.

Saturating conversions still result in data loss, but the consequences
are less severe, causing problems only after SBT_MAX (~68 years) of
system uptime elapses.

Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D55792
MFC after:		2 weeks
2026-03-20 02:15:08 -05:00
Jake Freeland e3799530b3 sys/time: Add saturating sbt conversions
When converting from timespec to sbintime, the timespec's 64-bit tv_sec
component is shifted to the left 32 bits, causing any information in the
upper 32 bits to be lost.

This data loss during conversion can turn timespecs with very large
tv_sec counters into sbintimes that represent much smaller time
durations.

Add tstosbt_sat() and tvtosbt_sat(), which are saturating versions of
tstosbt and tvtosbt. With these routines, any overflow resulting from
the conversion is clamped to [-SBT_MAX - 1, SBT_MAX].

Reviewed by:		imp, markj
Differential Revision:	https://reviews.freebsd.org/D55791
MFC after:		2 weeks
2026-03-20 02:15:08 -05:00
Jake Freeland 85c0f1a87d 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.

Reviewed by:		markj
Differential Revision:	https://reviews.freebsd.org/D55790
MFC after:		2 weeks
2026-03-20 02:15:08 -05:00
Jake Freeland 834c1ba793 timerfd: Add tests
Take Jan Kokemuller's timerfd tests from the epoll-shim project,
stripping out code that isn't directly related to FreeBSD.

Reviewed by:		markj
Differential Revision:	https://reviews.freebsd.org/D55789
MFC after:		2 weeks
2026-03-20 02:15:08 -05:00
Mateusz Piotrowski 2eb0a88891 dtrace.1: Reference dtrace_cam.4
Fixes:	1a7151f796 cam: Add probes for xpt actions
Event:	AsiaBSDCon 2026
2026-03-20 13:10:59 +08:00
Enji Cooper 14b9955e57 libcrypto: compile all PIC objects with -DOPENSSL_PIC
This change modifies the libcrypto PIC objects to always compile with
`-DOPENSSL_PIC` to restore parity with the upstream build process. This
ensures that `-DOPENSSL_PIC` is used whenever building the auxiliary
shared objects. In this case, just the legacy provider (we no longer
distribute the fips provider).

MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D44896
2026-03-19 17:51:51 -07:00
Bjoern A. Zeeb f979561541 ath11k: restore module Makefile
During the subtree merge and checking out the updated version of ath12k
parts of the previous ath11k merge were accidentally undone.
Retore the ath11k Makefile as well after 3c4eef5d83 restored the
driver bits.

Fixes:		a96550206e ("ath12k: update Atheros/QCA's ath12k ..")
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-03-20 00:17:41 +00:00
Bjoern A. Zeeb 3c4eef5d83 ath11k: reduce diff to upstream Atheros/QCA's ath11k driver
It seems that over the time of merging and only partly working
on making it compile again a few mis-merges happened.
Reduce diff to the v6.19 upstream version so that we only have
additions to the driver (usually guarded by #ifdef __FreeBSD__).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-03-19 23:54:21 +00:00
Bjoern A. Zeeb 03ba27c194 ath12k: update module Makefile after vendor import of v6.19
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-03-19 23:34:31 +00:00
Bjoern A. Zeeb a96550206e ath12k: update Atheros/QCA's ath12k driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
05f7e89ab9731565d8a62e3b5d1ec206485eeb0b ( tag: v6.19 ).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-03-19 23:33:59 +00:00
Bjoern A. Zeeb 09cacabd8c ath11k: update module Makefile after vendor import of v6.19[-rc6]
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
2026-03-19 23:31:23 +00:00
Bjoern A. Zeeb 187d8a3ce5 ath11k: update Atheros/QCA's ath11k driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7 ( tag: v6.19-rc6 ).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-03-19 23:30:37 +00:00
Martin Matuska 80aae8a3f8 zfs: merge openzfs/zfs@3ee08abd2
Notable upstream pull request merges:
 #17000 -multiple cmd/zfs: support creating parents with canmount=no
 #17926 b481a8bbb Make zpool status dedup table support raw bytes -p output
 #18238 -multiple Report space metrics per allocation class
 #18240 5dad9459d Add --no-preserve-encryption flag
 #18257 1eace5906 libzfs: use mount_setattr for selective remount including
                  legacy mounts
 #18259 1e2c94a04 More consistent use of TREE_* macros in AVL comparators
 #18262 c58b8b7dc Fix check for .cfi_negate_ra_state on aarch64
 #18264 f109c7bb9 Add the --file-layout (-f) option to zdb(8)
 #18268 304de7f19 libzfs: handle EDOM error in zpool_create
 #18275 753f1e1e2 zstream: add a drop_record subcommand
 #18276 0f90a797d Fix vdev_rebuild_range() tx commit
 #18277 1e1d64d66 Fix log vdev removal issues
 #18278 06b0abfe6 Fix the send --exclude option to work with encryption
 #18281 e73ada771 libzpool: lift zfs_file ops out to separate source file
 #18284 d97945776 zstream: consolidate shared code
 #18285 -multiple Separate SIMD compile checks for userspace and kernel
 #18288 c5905b2cb Implement lzc_send_progress
 #18289 -multiple L2ARC: Add depth cap and write budget fairness for
                  persistent markers
 #18290 d45c8d648 FreeBSD: Improve dmesg kernel message prefix
 #18294 b403040c4 draid: fix data corruption after disk clear
 #18296 -multiple libzfs: mnttab cleanup
 #18300 d35951b18 zpool clear: remove undocumented rewind flags
 #18301 ae7fcd5f9 fix libzfs diff mem leak in an error path
 #18303 65165df12 zilstat: add man page
 #18314 7f65e04ab libzfs: scrub: only include start and end nv pairs if
                  needed for scrub
 #18315 -multiple Sync ZVOLs block cloning conditions with file systems
 #18330 f80338fac zarcsummary: add man page
 #18337 f259a47c7 zpool-iostat.8: clarify first report shows per-second
                  averages

Obtained from:	OpenZFS
OpenZFS commit:	3ee08abd2f
2026-03-19 21:25:34 +01:00
Pouria Mousavizadeh Tehrani 56dddebc55 ip6_input: Remove unused check for IPv4-compatible IPv6
IPv4-compatible IPv6 addresses are deprecated by RFC 4291.
No functional change intended.

Reviewed by: glebius, emaste
Differential Revision: https://reviews.freebsd.org/D55387
2026-03-19 21:47:53 +03:30
Pouria Mousavizadeh Tehrani 17920f8335 bridge(4): Remove epoch_enter during destruction
bridge doesn't require to enter epoch during destruction.

Reviewed by: zlei, glebius
Differential Revision: https://reviews.freebsd.org/D55935
2026-03-19 21:26:45 +03:30
Pouria Mousavizadeh Tehrani 1c1b494264 ecn.9: Replace non-ASCII characters
Reported by:	maxim
Fixes:		ba4298b055 ("ecn.9: Add ecn(9) manual")
2026-03-19 20:54:49 +03:30
Jose Luis Duran 894992e786 nanobsd: embedded: Time stamp the code image
While there is a function nano_makefs() that already takes care of this
issue, we are not yet ready to consume it.

Just add the time stamp and FFS options to makefs.  This is done
primarily to use UFS2 (UFS version 2).  If the user needs further
customization, the variable NANO_MAKEFS can be overridden.  Timestamping
takes care of making the images bit-for-bit identical.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54980
2026-03-19 17:14:36 +00:00
Jose Luis Duran 5902c1834d nanobsd: Minor cleanup
No functional change intended.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54979
2026-03-19 17:14:24 +00:00
Jose Luis Duran 60f8d36f7e nanobsd: embedded: Fix more regressions from last cleanup
Commit c99bb5747f changed "()" grouping into "{}", but in these cases
we chdir and depended on the subshell not changing the directory for the
caller.  Restore the old behavior.  While things appear to work without
this change, the previous code was intentionally structured this way.

Reviewed by:	imp
Fixes:		c99bb5747f ("nanobsd: minor formatting cleanup")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54978
2026-03-19 17:13:59 +00:00
Jose Luis Duran 21970f2780 nanobsd: embedded: Remove stray comment
Remove an outdated comment about NanoBSD not being able to remove the
firstboot sentinel file.

It was fixed in cb51e2bc3d ("rc: Allow the removal of
firstboot_sentinel on read-only file systems").

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54977
2026-03-19 17:13:29 +00:00
Jose Luis Duran 5de9a54c76 nanobsd: embedded: Remove mtools dependency
Rely on makefs -t msdos to create the MS-DOS partition and remove the
dependency on filesystems/mtools.

Note that NANO_SLICE_FAT_SIZEs defined in sectors (ending with an "s")
are no longer supported, as a workaround the letter "b" (blocks) may be
used instead.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54976
2026-03-19 17:12:51 +00:00
Jose Luis Duran 68f5e5b124 nanobsd: embedded: Calculate FAT type and scheme
Determine the FAT (MS-DOS) type (FAT32, FAT16, or FAT12) and partition
scheme (fat32lba or fat16b) based on partition size.

Accept any (NetBSD) strsuftoll(3)-compatible string, as the value will
be fed to makefs(8) "-s" in a future commit.

NANO_SLICE_FAT_SIZEs defined in sectors (ending with an "s") will not be
supported.  As a workaround, the letter "b" (blocks) may be used.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54975
2026-03-19 17:12:26 +00:00
Pouria Mousavizadeh Tehrani 15ebee7c2e ndp: Accept multiple queued ND for non-GRAND NAs
Multiple delayed NAs on the same ifa can occur simultaneously.
Therefore:
* Differentiate between GRAND and solicited replies.
* Cancel previous pending GRAND NA for same ifa.
* Reuse ndq memory for GRAND.
* Free non-GRAND replies immediately.
* Don't limit non-GRAND NAs.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D55905
2026-03-19 19:50:06 +03:30
Ed Maste d478715a72 llvm: Link cross-tools with static libllvm.a
We generally use TOOLS_PREFIX being set to indicate that we are building
in the cross-build tools stage.  This check was missing for llvm.prog.mk
consumers other than *tblgen, which have not previously been built as
cross tools.

Reviewed by:	dim
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55930
2026-03-19 09:10:24 -04:00
Pouria Mousavizadeh Tehrani ba4298b055 ecn.9: Add ecn(9) manual
Add ecn manual for ip_ecn tunneling functions.

Reviewed by: pauamma_gundo.com, tuexen
Differential Revision: https://reviews.freebsd.org/D53517
2026-03-19 13:55:53 +03:30
Pouria Mousavizadeh Tehrani 32a462ba9c ecn(9): Update ecn tunneling functions to RFC 6040
Update ECN tunneling functions from obsolete RFC 3168 to
newer RFC 6040.
Also, add ECN_COMPLETE to support dangerous packet reporting
without causing extra costs to existing caller functions.
Finally, return values are specified as macro to reduce
confusion, considering extra return values for ECN_WARN
and ECN_ALARM were added.

Reviewed By: glebius, tuexen
Differential Revision: https://reviews.freebsd.org/D53516
2026-03-19 13:48:34 +03:30
Dag-Erling Smørgrav 1aecb32021 realpath: Improve manual page
* Try to make the RETURN VALUES section flow better.

* Add basename(3), dirname(3), free(3) to the SEE ALSO section.

* Drop the CAVEATS section, which was obsolete the moment realpath(3)
  was added to the Single Unix Specification in 1994.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D55928
2026-03-19 02:26:34 +01:00
Dag-Erling Smørgrav 99d295e471 realpath: Improve prev_len logic
* Save prev_len after having checked for and appended a trailing slash,
  not before.  This requires us to back up if we end up returning a
  partial result, but previously we would sometimes return a partial
  result with a trailing slash and sometimes without.

* Replace strlcat() with a faster strlcpy() since we know exactly how
  far into the buffer we are.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D55914
2026-03-19 02:26:34 +01:00
Kirk McKusick dad6e6fc1e Provide more precise error explanations for mmap(2) EINVAL errors.
Reviewed by:  kib
Differential Revision: https://reviews.freebsd.org/D55888
MFC-after:    1 week
Sponsored by: Netflix
2026-03-18 17:52:10 -07:00
Kirk McKusick 51446d33c6 Delete error-check code that can never happen.
Near the top of kern_mmap() that implements the mmap(2) system call,
it sets

	prot = PROT_EXTRACT(prot);

with

So prot can only be the three PROT_ flags.

The following test of the user's mmap(2) parameters (near line 275
in vm/vm_mmap.c):

	if (prot != PROT_NONE &&
            (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) {
		return (EXTERROR(EINVAL, "invalid prot %#jx", prot));
	}

can never fail. This commit deletes it.

No functional change intended.

Reviewed by:  kib
MFC-after:    1 week
Sponsored by: Netflix
2026-03-18 17:45:23 -07:00
Navdeep Parhar 8f41ee95f9 cxgbe(4): decode the T7 MC interrupt correctly
The layout for the main INT_CAUSE is a bit different for T7.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2026-03-18 15:22:57 -07:00