libbsdconf: independent version macros
sysconf(8) --version now prints the library version alongside its
own so each can move on its own clock. Assigning a bitmask to
bool already converts zero/nonzero; drop the redundant != 0 (fuz).
Reviewed by: fuz, kfv
Differential Revision: https://reviews.freebsd.org/D59720
Add sysconf(8) and libbsdconf(3)
Complete the native configuration trinity: sysctl(8) for live kernel
state, sysrc(8) for rc.conf(5), and sysconf(8) for the remaining base
configuration -- loader.conf(5), sysctl.conf(5), and the make.conf(5)
family -- atop libbsdconf(3).
libbsdconf resurrects figpar as a unified reader/writer. Callbacks own
semantics; statements may span multiple lines via backslash continuation;
non-seekable input is spooled; writes are atomic (mkstemp, fsync, rename)
with mode/owner preservation. Format descriptors name each target, its
files, and quoting rules without private parsers. Multi-file targets
follow boot sourcing order; loader chases loader_conf_files as the boot
loader does.
sysconf(8) is the operator-facing tool: name / name=value on a required
target, sysrc-style list edits, make append and list-strike where they
belong, jail/altroot, and a capsicum sandbox for read-only use.
[21 lines not shown]
igbv: Recover disabled Hyper-V transmit queues
The Windows PF can disable a VF transmit queue while continuing to
report carrier up. Link polling alone then leaves the VF operationally
up even though it cannot transmit. The reproduced VLAN failure shows
this state with PF driver 14.1.5.0 and an MDD indication in the host trace.
Check queue zero from the admin path only while the Hyper-V VF is
running with sanitized queues and a completed host handshake. Report
operational link down and invalidate the statistics baseline when the
queue is disabled. Request recovery through the normal iflib stop/init
path only when a fresh, accessible STATUS read reports carrier up.
Rate limit requests if the host continues to hold the queue disabled,
and leave recovery pending while carrier is down.
Document the recovery behavior and clarify why the Hyper-V reset retains
the VF-local software reset before its host reset/MAC exchange.
Sponsored by: BBOX.io
HBSD: Add plumbing for bounds safety
clang/llvm is working on `-fbounds-safety`. This feature isn't available
in the version of llvm currently in base, but should be available in a
future release. Get ready for that release by adding a new src.conf(5)
knob: MK_BOUNDS_SAFETY (disabled by default).
Note that enabling this feature is effectively a no-op. Just like with
Capsicum, this feature requires manual integration.
Given that the bounds safety feature is still experimental, we enable
the feature with `-Xclang -fexperimental-bounds-safety`. Once clang/llvm
determines the feature to be production-ready (and that version of llvm
has been imported into base) we will update share/mk/bsd.sys.mk to take
into account the switch from the experimental flag to the actual
`-fbounds-safety` flag.
Signed-off-by: Shawn Webb <shawn.webb at hardenedbsd.org>
See-Also: https://clang.llvm.org/docs/BoundsSafety.html
See-Also: https://clang.llvm.org/docs/BoundsSafetyImplPlans.html
cxgbe: Use the correct GHASH offset for a GMAC from a full TLS record
If a TLS request transmits all but a part of the GMAC at the end of a
TLS record, the work request asks the crypto engine to return the
calculated GMAC to the driver so it can be sent in a simple TCP packet
when the rest of the TLS record is transmitted in the future.
However, the offset of the returned GHASH offset was calculated
incorrectly in this case causing the driver to not recognize the
cached GMAC and instead use a more wasteful work request in the future
that encrypted the entire TLS record discarding all but the needed
bytes of the trailer.
Note that this does not effect correctness, just efficiency.
Reviewed by: np
Fixes: 9e269eafebfc ("cxgbe: Use partial GCM mode for partial TLS records on T7")
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D59711
vlan: Notify the parent when replacing a VLAN ID
Changing the VID of an existing VLAN interface rehashes the interface and
announces the new VID, but does not unregister the old VID. Parent
drivers and VLAN event consumers can consequently retain stale filter
membership.
After successfully inserting the new VID, emit vlan_unconfig for the old
VID before the existing vlan_config notification. Do not unregister
anything if insertion fails and the old VID is restored.
MFC after: 2 weeks
Sponsored by: BBOX.io
igbv: Support Hyper-V virtual functions
Use the Hyper-V reset/MAC exchange for 82576 and I350 VFs instead of the
native posted mailbox protocol, which the Windows PF does not service.
Read the host assigned address through configuration bytes 0x201 through
0x206 only during reset, and use it to identify the matching synthetic
hn(4) interface. The operations are local to the VF frontend.
Poll hardware link status rather than retaining a native mailbox link
handshake. Leave MAC, multicast, promiscuous-mode, and VLAN membership
policy with the host. Disable guest VLAN registration and native receive
limit requests, and limit the VF to an MTU of 1500 bytes.
Preserve accumulated statistics across host resets without counting a
counter clear as a wrap. Reject inaccessible register samples and rebase
after a reset indication or a disabled transmit queue, including when the
PF blocks the queue for malicious driver detection.
Document single queue support and host assigned access VLANs. Guest VLAN
[9 lines not shown]
man: Link mlx5en.4 also to if_mce.4
For consistency, create a symbolic link from mlx5en.4 to also if_mce.4
Reviewed by: ziaee, #manpages
Event: EuroBSDCon 2026
Differential Revision: https://reviews.freebsd.org/D59610
MFC after: 3 days
(cherry picked from commit e46a7d842a7572cc7ccef88a463a9af1a725fefc)
acpi: Don't compile CPU_VENDOR_{AMD,HYGON} cases on non-x86_64
Fixes build on aarch64.
Fixes: 5f68acc931a4 ("acpi: Warn if no amdsmu(4) loaded after suspend-to-idle resume")
Sponsored by: The FreeBSD Foundation
iflib: add a new global tunable "prefer_mpring"
net.iflib.prefer_mpring can be used to control whether or
not all iflib driver instances default to mp_ring or simple_tx.
This is intended to be temporary, to allow easy testing (now) of
simple_tx, and to allow an easy fallback to the legacy path
(later) once the default is switched to simple_tx
acpi: Warn if no amdsmu(4) loaded after suspend-to-idle resume
If amdsmu(4) is not loaded when entering suspend-to-idle and on an AMD
CPU, emit a warning.
FreeBSD currently only supports S0ix on AMD CPUs through the SMU. When
Intel support is completed, we should check the equivalent for Intel
(intelpmc).
Reviewed by: olce
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59672
iflib: implement driver-provided queue selection for simple tx
Until now, simple tx has used its own queue selector, and has
ignored isc_txq_select and isc_txq_select_v2 (not this only
seems to matter for ice(4) with dcb enabled). This change
makes simple-tx use isc_txq_select* when present.
The implementation is defined to be efficient, with a
transmit routine chosen up-front that hard-codes the
queue selection and calls an always-inlined body. This
avoids a useless test per packet in the hotpath, and
also may avoid speculation into header parsing.
Note that this was designed for readability and efficiency
in the common case (interface up, not ALTQ). That's why
we do queue selection without duplicating nic-running and
altq checks, leaving them to the common implmentation.
Sponsored by: Netflix
[2 lines not shown]
proc: free kstack buffers when debug permission changes
The kern.proc.kstack handler allocates its output and stack buffers
before deliberately checking p_candebug again under the process lock.
If trace-control state changes between authorization checks, the failure
path balances the process and exec state but leaks both buffers.
Submitted by calif.io for the OpenAI Patch The Planet program
Signed-off-by: Andrew Griffiths <andrew at calif.io>
Fixes: 8b5abd9027b8 ("kern_proc.c: disallow execve around sysctl kern.proc.kstacks")
Reviewed by: markj
MFC after: 1 week
mac_bsdextended: reject negative rule indices in sysctl_rule()
The security.mac.bsdextended.rules.<N> node handler takes N as
`index = name[0]` (a signed int) and only checks
`index >= MAC_BSDEXTENDED_MAXRULES`. A negative index is caught on
the read branch, but the write-only add and delete
branches proceed to `rules[index]` unconditionally.
Reject `index < 0` alongside the existing upper-bound check.
Submitted by calif.io for the OpenAI Patch The Planet program
Signed-off-by: Andrew Griffiths <andrew at calif.io>
Reviewed by: markj
MFC after: 2 weeks
truss(1): capsicumize
The new ptrace(2) features allow to change truss(1) to systematically
operate on the process descriptors instead of pids.
Allocate the global kqueue that tracks all noted children
by pdopenpid()-ing them and adding to the kqueue with
EVFILT_PROCDESC/NOTE_PDSIGCHLD. The activated knote triggers the
pdwait() call to return the child tracing info. This replaces the
waitid(P_ALL) call in the non-capsicumized truss(1) eventloop.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D58094
verbs/mlx5: Add GRE and MPLS flow specification filter
[PATCH 30/31] FreeBSD OFED support for DPDK MLX5 PMD
a) Allow verbs applications packet steering of GRE tunneled traffic.
Adding GRE flow specification based on RFC 2890.
GRE consists of flags, protocol and key fields.
IPv4 protocol 47 (IPPROTO_GRE) can be used when GRE packets are
encapsulated in IPv4.
b) verbs: Add MPLS flow specification filter
Add MPLS flow specification based on RFC 3032.
MPLS spec defined with label field which includes the
label value and additional parameters such as: BoS, TC and TTL.
MPLS allows stacking multiple labels in sequence.
In addition, the MPLS header can be encapsulated on top of different
layers, e.g.: ETH, IP (rfc4023), UDP (rfc7510), GRE (rfc4023).
Therefore, when using the flow creation verb, the application should
[14 lines not shown]