Commit Graph
314267 Commits
Author SHA1 Message Date
Konstantin Belousov 40582412d3 x86/mp_x86.c: unbreak COUNT_IPIS
Fixes:	3a0e2ca3ee ("x86: ipi_bitmap_handler(): Account for IPIs correctly on COUNT_IPIS")
2026-10-20 23:55:16 +03:00
Osvaldo Janeri Filho 2d6f961164 ssh: use defaultkey sentinel for ML-DSA-44 default host key
servconf_add_hostkey() compares its file argument to defaultkey by
pointer to skip an unreadable default key; the ML-DSA-44 entry passed
the "[default]" literal, so the skip (and the "No host key files found"
fallback) never applied to it.

MFC after:	1 week
Reviewed by:	emaste
Fixes: bb5c77e9d2 ("OpenSSH: Update to 10.4p1")
Differential Revision:	https://reviews.freebsd.org/D60922
2026-10-20 16:53:25 -04:00
Dag-Erling Smørgrav dd6a1fef0e ObsoleteFiles.inc: Add moved certificates
These two moved from trusted to untrusted.

Fixes:		21ac476142 ("ObsoleteFiles.inc: Add dropped certificates")
2026-10-20 19:55:21 +00:00
Dag-Erling Smørgrav 21ac476142 ObsoleteFiles.inc: Add dropped certificates
Reported by:	michaelo@
Fixes:		82af7f44eb ("caroot: Regenerate")
2026-10-20 19:41:00 +00:00
Dag-Erling Smørgrav 82af7f44eb caroot: Regenerate
Regenerate using certificate data from NSS 3.131.1.

Upstream dropped emSign_ECC_Root_CA_-_G3.pem entirely; we deliberately
move it to untrusted instead to block its reintroduction through e.g.
an outdated copy of security/ca_root_nss.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D60906
2026-10-20 19:24:31 +00:00
Andrew Gallatin ceb575553b arm64: enable ossl accelerated AES-GCM on arm64
Connect the baseline OpenSSL ARMv8 fused AES-GCM kernels to the OCF
ossl driver. Advertise the algorithm only when the system-wide capability set
includes both AES and PMULL.

Note that get_kernel_reg() is used to detect features such as PMULL
because the ossl device attaches before arm64 populates elf_hwcap when
ossl is built into the kernel or pre-loaded at boot.

Prefer OSSL over armv8crypto for AES-GCM sessions while retaining
armv8crypto as a fallback.

This provides about a 50% speedup for a Netflix ktls workload on a small
neoverse N1 board.

Reviewed by: markj
Constructive review feedback from: andrew, ngie
Differential Revision: https://reviews.freebsd.org/D60097
Sponsored by: Netflix
2026-10-20 15:07:39 -04:00
Ed Maste f69099fc0f if_media: Add 100BASE-T1 and 1000BASE-T1 media types
100BASE-T1 (IEEE 802.3bw) and 1000BASE-T1 (IEEE 802.3bp) are Single-Pair
Ethernet (SPE) standards intended for use in automotive and industrial
applications.

Reviewed by:	kbowling
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60864
2026-10-20 15:04:39 -04:00
Andrew Gallatin ef7d7011ce arm64: Fix EFI runtime mappings with 16K pages
Map complete EFI descriptor ranges at the kernel page granularity
and merge compatible entries when 4K EFI regions share a kernel page.
Preserve execution when any sharing region requires it and reject
conflicting mapping attributes without panicing.

This gets my small N1 booting with 16K pages.

Reviewed by: chs, imp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D60749
2026-10-20 14:54:01 -04:00
Christos Longros e48eb1c5c4 mailmap: Add entry for longros
Approved by:	jrm (mentor)
Differential Revision:	https://reviews.freebsd.org/D60912
2026-10-20 19:45:14 +02:00
Enji Cooper ec1754a677 diff: diff regular files when -q is specified again
c30a321a61 accidentally modified the code paths when diffing regular
files to not diff them if `-q` was specified. Call `diffreg(..)` again,
regardless of whether or not `-q` was specified to restore the
functionality pre-c30a321a61ce, while only printing out the result to
the console if `-q` is not specified.

This change unbreaks diff so 2 files which differ are reported again via
the exit code when with `-q` is specified.

MFC after:	3 days
PR:		299643
Reviewed by:	des
Differential Revision: https://reviews.freebsd.org/D60910
Fixes: c30a321a61 ("diff: support -qq to output absolutely nothing")
2026-10-20 10:40:47 -07:00
Vladimir Grebenshchikov e8923c7346 devfs: make persistent controlling terminal an ABI property
Linux leaves the session's controlling terminal in place after the
last file descriptor on the slave is closed, so a later open of
/dev/tty succeeds.  FreeBSD drops the session vnode reference on that
close. /dev/tty then fails, which breaks Linux programs such as xterm
that close the pty slave during startup and expect /dev/tty to keep
working.

When the closer is a Linux process, leave the session reference in
place.  Still pass FLASTCLOSE to the driver so the master sees hangup.
Native close behavior is unchanged.

Add the SV_PERSISTENT_CTTY sysentvec flag for ABIs that retain the
controlling terminal after the last slave descriptor is closed.  This
keeps the devfs behavior ABI-agnostic and allows other ABIs to request
the same semantics if needed.  Use the flag in devfs_close().

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D60701
2026-10-20 20:38:09 +03:00
Vladimir Grebenshchikov 44961edac8 termios.4: clarify the behavior on the last close of controlling terminal
Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D60701
2026-10-20 20:38:09 +03:00
Olivier Certner 07ab87b60d powerpc: powerpc_ipi_handler(): Stop first, preempt last
Preemption should happen last so that other IPIs have a chance to be
executed in due course, in particular hardclockintr().  So, move
handling of IPI_PREEMPT at the end.

An IPI_STOP/IPI_STOP_HARD request should be processed immediately to
avoid risks that further processing changes the system state on panic,
or worse itself causes another panic on corrupted kernel state.

While here, move IPI_AST handling just before IPI_PREEMPT.  We currently
do not need to do anything for it, but if we were to, it is likely that
would have to happen after other IPIs but IPI_PREEMPT.

Reviewed by:    jhibbits
Fixes:          9d5a22b928 ("MFp4: SMP support")
Fixes:          12640815f8 ("MFp4: SMP support")
Fixes:          7ed09a6778 ("powerpc: Rework IPI message processing")
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60863
2026-10-20 18:46:13 +02:00
Olivier Certner 3a0e2ca3ee x86: ipi_bitmap_handler(): Account for IPIs correctly on COUNT_IPIS
A preemption could occur before the updates to the initial CPU's IPI
counters, leading to a potential non-atomic updates of these counters
from another CPU.

Reviewed by:    kib
Fixes:          ff326a1879 ("x86: Restore the critical section (...)")
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60862
2026-10-20 18:46:13 +02:00
Olivier Certner b83bd6fec0 x86: ipi_bitmap_handler(): Preempt last, reduce critical section
Preemption should happen last so that other IPIs have a chance to be
executed in due course, in particular hardclockintr().  So, move
handling of IPI_PREEMPT at the end.

Reduce the critical section to be in force only around hardclockintr(),
which needs it to execute entirely without preemption (because of code
it calls that can enter a critical section; interrupts are already
disabled in this handler, as usual).

The critical_exit() following hardclockintr() may cause preemption if
due.  If that happens, there is no need to preempt again on IPI_PREEMPT,
so make sure sched_preempt() is not called in this case.

This fixes inadvertent removal of the optimization that sched_preempt()
should be called outside of a critical section to perform an immediate
context switch in the case of IPI_HARDCLOCK and IPI_PREEMPT being
handled at the same time.

While here, move IPI_AST handling just before IPI_PREEMPT.  We currently
do not need to do anything for it, but if we were to, it is likely that
would have to happen after other IPIs but IPI_PREEMPT.

Reviewed by:    kib
Fixes:          ff326a1879 ("x86: Restore the critical section around ...")
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60861
2026-10-20 18:46:07 +02:00
Mark Johnston ebf1041fc8 hv_kvp: Fix some bugs and nits
- Use pending_mutex to synchronize several state flags.  In particular,
  ensure that two threads can't race to open the device file at the same
  time.[1]
- Fix an off-by-one in hv_kvp_dev_daemon_read() that would result in a
  one-byte OOB read if the caller supplied a large enough read buffer.[2]
- Change the device permissions to 0600: hv_kvp_dev_daemon_read()
  returns an error until the owning process registers itself with a
  write, so there's no sense in providing read-only access.
- Use bool instead of boolean_t.
- Don't return negative error numbers to userspace.
- Call seldrain() when closing the device.

Reported by:	pixelpop [1][2]
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D60387
2026-10-20 15:30:38 +00:00
Hans Rosenfeld a11b901f5a amd64/vmm: Port vlapic interface changes from illumos (duplicate)
This is a port of the bits related to vlapic-enablement of the following
bhyve improvement from illumos:

  14598 bhyve vlapic should handle APICBASE changes
  https://www.illumos.org/issues/14598

A LAPIC can be enabled/disabled in two ways:
  - by the global-enable bit in the APICBASE MSR
  - by the software-enable bit in the APIC's SVR register

This change allows distinguishing between both forms of enablement where
that matters. The more involved changes to allow guests to modify the
APICBASE MSR are not included at this time.

Reviewed by:	corvink, markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D56347
2026-10-20 15:24:53 +00:00
Dag-Erling Smørgrav 0ce9d6e240 auditdistd: Fix build failure
Fixes:		4f19e4aca4 ("auditdistd: Use void pointers for opaque data")
Reported by:	garga@
2026-10-20 16:59:46 +02:00
Dag-Erling Smørgrav dff56e8118 hastd: Fix build failure
Fixes:		a5e6bee5a0 ("hastd: Use void pointers for opaque data")
Reported by:	garga@
2026-10-20 16:58:45 +02:00
Kyle Evans 8430de47aa wg: fix the LINT-NOIP build
We don't have anything to tunnel without INET or INET6, so just smack
it with the same config(5) hammer that ovpn uses and exclude it from
such builds.

Reported by:	mjg
Reviewed by:	emaste, markj
Differential Revision:	https://reviews.freebsd.org/D60896
2026-10-20 09:34:03 -05:00
Dag-Erling Smørgrav a5e6bee5a0 hastd: Use void pointers for opaque data
Use void, not char, for pointers to opaque data in our send and receive
functions.

Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D60729
2026-10-20 15:28:42 +02:00
Dag-Erling Smørgrav 4f19e4aca4 auditdistd: Use void pointers for opaque data
Use void, not char, for pointers to opaque data in our send and receive
functions.

Sponsored by:	Klara, Inc.
Sponsored by:	Qualys, Inc.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D60728
2026-10-20 15:28:37 +02:00
R. Christian McDonald a317317519 pf: Keep every chunk of a table that a ruleset defines
libpfctl sends a table definition in chunks of 256 addresses, each as
its own PFNL_CMD_INA_DEFINE.  The kernel treated every chunk as a new
definition and replaced the shadow table, so only the last chunk
survived.

Mark the chunks after the first with PF_ID_APPEND and have the kernel
add them to the shadow table in progress.  A request without the
attribute still replaces the shadow; one with it and no definition in
progress fails with EINVAL.  Old kernels ignore the attribute, so both
halves are needed; the ioctl sends all addresses at once and is not
affected.  Mask the flags userland passes to PFR_FLAG_ALLMASK, as
PFR_FLAG_APPEND is kernel-internal.

Add a test that defines a table of 1,000 addresses, also in an anchor.

Reviewed by:		kp
Fixes:			219ce30638 ("pf: convert DIOCRINADEFINE to netlink")
Sponsored by:		Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D60876
2026-10-20 08:52:00 -04:00
Emmanuel Vadot 6aa2c651df rk_spi: Do not change the clock with the driver lock held
The clock framework can sleep, it takes the clock topology sx lock.  Calling
clk_set_freq() and clk_get_freq() from rk_spi_hw_setup() with the driver
mutex held triggers a witness warning about a sleepable lock acquired after
a non-sleepable one, on the first transfer that raises the clock.

Set the clock in a new function that is called before taking the lock, and
only keep the register setup under the lock.
2026-10-20 13:47:20 +02:00
Wolfram Schneider d3bad289df bsd-family-tree: polish grammar and style
Reviewed by:	ziaee
2026-10-20 07:41:17 +00:00
Mateusz Guzik e6fb3b518a vfs: unbreak builds when MAC is not defined
Sorts out powerpc.QORIQ64 build failure.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-10-20 05:49:18 +00:00
Mateusz Guzik dbbff47e27 Retire bogus predicts on case statements.
They are ignored by clang.

No functional changes (nor .o changes).

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-10-20 05:24:13 +00:00
Colin Percival 93c05b743e OCI: Remove dead code
We don't need to pick a repository URL when all we're doing is enabling
one which was specified in /etc/pkg/.

Reviewed by:	dch, imp
Fixes:	c73ae67348 ("release/tools: use same pkg settings ...")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D60868
2026-10-19 19:38:28 -07:00
Sergey A. Osokin 97b9e96a7f bsd-family-tree: add OpenBSD 8.0 2026-10-19 21:16:44 -04:00
Enji Cooper e45c7bc611 linux: implement sched_getattr()
This change adds the necessary glue to translate Linux scheduler policy
and priority from FreeBSD so this information is available to Linux
applications.

Please note that this change does not fill in the `.sched_nice` property: this
will be handled in a follow up commit (see bug 299617 for more details).

This unbreaks using the Linux version of Chromium on FreeBSD.

PR:	297468
Signed-off-by:	Joao Bonifacio <[email protected]>
Pull Request: https://github.com/freebsd/freebsd-src/pull/2370
Reviewed by:	olce
Differential Revision:	https://reviews.freebsd.org/D60214
2026-10-19 13:27:24 -07:00
R. Christian McDonald c91539772b pflow: Destroy exporters on module unload
Since 83641335f9 only jail removal destroys exporters.  Unloading
pflow with one left trips the assertion in vnet_pflowdetach() or,
without INVARIANTS, leaves pf calling into the freed module the next
time it removes a state that pflow exports.

Reviewed by:	kp
Fixes:		83641335f9 ("pf: clean up pflow sockets on jail removal")
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-10-19 16:25:40 -04:00
R. Christian McDonald 96944ab79a pfctl: Report why a table definition failed
pfctl_ina_define() returns an error number instead of setting errno, but
both of its callers print errno.  A table that failed to load was
reported as "cannot define table t: No error: 0", or with a stale errno,
both in the main ruleset (process_tabledef()) and in anchors
(pfctl_load_tables()).

Reviewed by:	kp
Fixes:		219ce30638 ("pf: convert DIOCRINADEFINE to netlink")
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-10-19 16:24:36 -04:00
Alexander Ziaee 067c6da5ce ossl.4: Canonicalize HARDWARE and add powerpc64
This driver now supports powerpc64, so add that to the list of supported
hardware. Further, rewrite that list into the canonical HARDWARE section
for inclusion in the FreeBSD 16.0 Hardware Release Note.

markj notes that it would be useful to list the CPU features required
for this driver to be usable on these platforms. ngie notes that this
would be good as a table.

Fixes:	5daf8ed625 ("Add GCM support on powerpc64/powerpc64le")
MFC after:		the above was scheduled to but has not mfc yet
Reviewed by:		ngie
Differential Revision:	https://reviews.freebsd.org/D59770
2026-10-19 16:02:05 -04:00
Alexander Ziaee 36804775d3 armv8crypto: Canonicalize document description
MFC after:		3 days
Reported by:		fuz
Reviewed by:		fuz
Differential Revision:	https://reviews.freebsd.org/D59730
2026-10-19 16:02:05 -04:00
Alexander Ziaee d2df0d4eb5 networking.7: Scope netif to wlan0
I recently learned that you can restart just wlan0 instead of the entire
netif, which will save you when doing on-device networking like bhyve,
or activting wlan0 when it is booted parked via rc.conf's NOAUTO.

MFC after:		3 days
Reviewed by:		bz, bcr
Discussed with:		emaste
Differential Revision:	https://reviews.freebsd.org/D59586
2026-10-19 16:02:05 -04:00
Alexander Ziaee daca1e12bb pmc.perf.3: Mark only for amd64 architecture
Manual pages have an optional architecture specifier after the section
number in the document title macro. I highly recommend using it when
expedient, the extra information is available programmatically and it
uses no extra lines in the rendered page.

MFC after:		No, pmc.perf.3 is not MFCing
Reviewed by:		Anderson Nascimento <[email protected]>
Differential Revision:	https://reviews.freebsd.org/D60714
2026-10-19 16:02:04 -04:00
Gleb Smirnoff 4488a4f048 inpcb: make ipport_randomized static 2026-10-19 12:42:15 -07:00
R. Christian McDonald 1594fbd7f2 pfctl: Report the error of a failed fingerprint flush
pfctl_flush_fingerprints() returns an error number instead of setting
errno, so a failed flush was reported with whatever errno held: "No
error: 0" on a kernel with ALTQ, ENODEV from the ALTQ probe on one
without.  Every "pfctl -f" flushes the fingerprints first, so on a
kernel that predates PFNL_CMD_OSFP_FLUSH every ruleset load fails this
way without saying why.

Reviewed by:	kp
Fixes:		75c0a83762 ("pf: convert DIOCOSFPFLUSH DIOCOSFPGET DIOCOSFPADD to netlink")
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-10-19 15:14:04 -04:00
Osvaldo Janeri Filho 5ce0ab7355 bhyve: fix integer overflow in qXfer packet parser
doff + dlen overflows unsigned int when both values are close to UINT_MAX,
causing the wrong branch to execute and passing an unbounded length to
append_binary_data().  Rewrite the comparison to avoid the addition.

Reviewed by:	markj
Fixes:		f81cdf24ba ("bhyve: Add support for XML register definitions")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D60847
2026-10-19 18:53:53 +00:00
Gleb Smirnoff f2bba01921 ipfw: keep flag(s) definition next to member that holds them 2026-10-19 10:32:21 -07:00
Gleb Smirnoff bc9e66886a ipfw: gc disabled old hashing code
This code was disabled for 8 years already.  It used to produce very
predictable hash without a salt, and that made the dynamic state engine an
easy DoS attack vector.  No chance we will ever use it again.
2026-10-19 10:32:15 -07:00
Gleb Smirnoff 41356c8017 net*: use inlined m_pullup()
Leverage the fact that m_pullup() in an inline function in mbuf.h and let
compiler to do all optimizations.

Mostly mechanical changes, but in few cases surrounding lines are brought
to style(9).  In netinet6, a few input functions changed to set the
input/output `struct mbuf **` pointer to NULL at a single place.

Reviewed by:		pouria, zlei, gallatin
Differential Revision:	https://reviews.freebsd.org/D60689
2026-10-19 10:32:00 -07:00
Gleb Smirnoff 671babc794 mbuf: make m_pullup() an inline over most expected case
Implement a most typical use of m_pullup() as an inline and leave only the
heavy part as a function.  A sweeping change to make benefit of the new
version follows.

Reviewed by:		pouria, zlei, gallatin
Differential Revision:	https://reviews.freebsd.org/D60688
2026-10-19 10:31:50 -07:00
Gleb Smirnoff 4c72b1c36d ng_pppoe: fix m_pullup() logic
The clear intent here is to do m_pullup() if we _don't_ have two bytes.
Before the fix: a) m_pullup() was always called and did nothing; b) if a
node was ever supplied with a fragmented but otherwise correct mbuf, then
it would not handle PROT_LCP as intended.

Noticed by:		zlei
Reviewed by:		zlei, eugen_grosbein.net
Differential Revision:	https://reviews.freebsd.org/D60788
Fixes:			28903f396a
2026-10-19 10:30:43 -07:00
Mark Johnston 32f7bddb44 amd64: Don't probe MSR_IRPERF when running under bhyve
vmm doesn't implement it, and bhyve simply aborts.  I fixed this in
commit c83e075d72, but it'll still be impossible to boot newer FreeBSD
guests on older hosts without this workaround.

Reviewed by:	adrian
Fixes:		2272fac218 ("hwpmc: Add support for AMD-only IRPERF in hwpmc PERF class")
Differential Revision:	https://reviews.freebsd.org/D60730
2026-10-19 15:29:13 +00:00
Mark Johnston f1986e5b88 bhyve: Fix virtio-input event array resizing
Use the new array size when calling realloc().  Note that this queue
stores events read from a host evdev device, i.e., it is not
guest-controlled.

While here, use the cdefs.h __unused macro and use them correctly, i.e.,
don't mark "arg" as unused when it isn't.

Reported by:	Brian Delgado from Intel using Anthropic Opus 4.8
Fixes:		054accac71 ("Add a virtio-input device emulation.")
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D60679
2026-10-19 15:29:13 +00:00
Mark Johnston 55d0e022fb bhyveload: Factor global variables into a software context
This will make it easier to port bhyveload's functionality into the main
bhyve executable.

No functional change intended.

Reviewed by:	novel
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D60481
2026-10-19 15:29:13 +00:00
Mark Johnston de80428118 inotify: Open target the directory when adding a watch
When an application uses inotify to watch a directory,
vn_inotify_add_watch() reads the directory entries and does a name
lookup so as to induce the filesystem to create namecache entries.
Some filesystems expect the directory to be opened before VOP_READDIR
can be called, so do that.

PR:		299239
Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D60782
2026-10-19 15:29:13 +00:00
Mark Johnston ad37abf653 kmsan: Add a required forward type declaration
MFC after:	1 week
2026-10-19 15:29:13 +00:00
Abdelkader Boudih 6690cbdc64 intel: add a shared header for the LPSS private registers
The Intel Low Power Subsystem wraps its I2C, SPI and UART functions in a
block of private registers that control the functional clock and the
function and DMA resets.

Refactored to use a single header

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D60859
2026-10-19 16:15:09 +01:00