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
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
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
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
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
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")
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
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
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
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
- 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
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
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
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
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
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
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.
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
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
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")
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")
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
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
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
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")
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
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.
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
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
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
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
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
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
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
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