FreeBSD/src 9b7959f — tests/sys/kern ssl_sendfile.c

Revert "tests/sys/kern/ssl_sendfile: double timeouts for :grow and :truncate"

A proper fix is being done in https://reviews.freebsd.org/D61752 .

PR:     299447

This reverts commit 932996069a5343b1d6563e97a12308a81c34d4fe.
DeltaFile
+2-21tests/sys/kern/ssl_sendfile.c
+2-211 files

FreeBSD/src a8fd8a5 — share/man/man9 style.9

style.9: Avoid C++ keywords

Headers may be included by C++ code, and sometimes we might like to
use exinst code as C++.  Encourage authors to avoid C++ keywords as
identifiers.

Reviewed by:    des, imp (earlier version)
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61767
DeltaFile
+15-1share/man/man9/style.9
+15-11 files

FreeBSD/src 8364b6b — sys/netpfil/ipfw ip_fw_sockopt.c ip_fw_compat.c

ipfw: fix off-by-one in the IP_FW_XADD rule count check

Restore the pre-4a77657cbc0 ">=" comparison, otherwise parse_rules_v1()
writes one rule_check_info beyond the allocated buffer.

Do the same in ip_fw_compat.c, which has a copy of the loop but is not
built at the moment.

stable/14 is not affected.

Reviewed by:    ae
Fixes:          4a77657cbc0 ("ipfw: migrate ipfw to 32-bit size rule numbers")
MFC after:      1 week
MFC to:         stable/15
Found with:     Claude Code Opus 5.5
Differential Revision:  https://reviews.freebsd.org/D61727
DeltaFile
+1-1sys/netpfil/ipfw/ip_fw_sockopt.c
+1-1sys/netpfil/ipfw/ip_fw_compat.c
+2-22 files

FreeBSD/src 8651589 — usr.sbin/bhyve bhyve.8, usr.sbin/bhyvectl bhyvectl.8

bhyve.8: mention VM nodes in /dev/vmm

Currently, VM nodes in /dev/vmm are only described in the
EXAMPLES section of bhyvectl.8. Add a FILES section to bhyve.8
to make this information easier to find.

Update the bhyvectl.8 example to say "Existing VMs"
instead of "Running VMs" as the VMs listed in /dev/vmm
are not necessarily running.

Update bhyvectl.8 to refer to vmm(4).

Reviewed by:    ziaee
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61623
DeltaFile
+3-2usr.sbin/bhyvectl/bhyvectl.8
+5-0usr.sbin/bhyve/bhyve.8
+8-22 files

FreeBSD/src 457873b — tests/sys/pmc pmc_rdpmc_test.c pmc_ss_test.c

tests/sys/pmc: Skip pmc_ss and getmsr_refusals without a hardware PMC

In a guest without a PMU, hwpmc(4) registers only the SOFT class, but
the "instructions" alias still resolves from the pmu-events tables, so
pmc_allocate() fails with EINVAL.  pmc_ss_test checked only the alias
and getmsr_refusals required the allocation, so both failed in CI
instead of skipping.

Probe the allocation the tests make and skip if it fails, as
rdpmc_reads_own_counter already does.

PR:             300856 (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300856)
Reported by:    ngie
Reviewed by:    mhorne, ngie
Fixes:          d546356523f3 ("tests/sys/pmc: add PERF, RDPMC, row, sampling and unload tests")
Sponsored by:   Advanced Micro Devices, Inc.
Signed-off-by:  Osvaldo Janeri Filho <ojanerif at amd.com>
Differential Revision:  https://reviews.freebsd.org/D61689
DeltaFile
+8-4tests/sys/pmc/pmc_ss_test.c
+3-1tests/sys/pmc/pmc_rdpmc_test.c
+11-52 files

FreeBSD/src 1768d48 — sys/dev/hwpmc hwpmc_amd.c

hwpmc: keep AMD UMC counters from saturating

UMC counters saturate at 2^48 instead of wrapping, after about a day
and a half of memory clock cycles.  Clear bit 47 on a read once it is
set and count the carries in the per-CPU overflow count of the PMC,
like the arm64 and armv7 drivers do for their 32-bit counters.

Reviewed by:    mhorne
Sponsored by:   Advanced Micro Devices, Inc.
Signed-off-by:  Osvaldo Janeri Filho <ojanerif at amd.com>
Differential Revision:  https://reviews.freebsd.org/D60771
DeltaFile
+21-3sys/dev/hwpmc/hwpmc_amd.c
+21-31 files

FreeBSD/src ed4bad7 — usr.sbin/bhyve bhyve.8

bhyve.8: mention config files for VM parameters

Mention that virtual CPUs, memory and other options can be configured
with a configuration file, and refer to the -k option.

Reviewed by:    ziaee
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61718
DeltaFile
+4-2usr.sbin/bhyve/bhyve.8
+4-21 files

FreeBSD/src 78a69f9 — usr.bin/top display.c

top: fix off-by-one in screenbuf

There is a heap overflow for screenbuf originating from
the top import to the tree. The i_process()/u_process() functions
write a terminating NUL one byte past each screenbuf line slot
when the line fills the slot, which is a 1-byte heap overflow on the last slot.

The display_resize() function allocates screen_width bytes per line.
i_process() and u_process() cut lines to screen_width characters and
then stpcpy() them into the slot, which writes screen_width + 1 bytes.
line_update() can do the same with *old = ch. For inner slots,
the NUL lands in byte 0 of the next slot. This can corrupt the saved
contents used when updating the next line. For the last slot, it writes
one byte past the end of screenbuf.

Fix by allocating (screen_width + 1) bytes per line and updating the
line offsets to fit the terminating NUL.

Reviewed by:    kib

    [5 lines not shown]
DeltaFile
+3-3usr.bin/top/display.c
+3-31 files

FreeBSD/src cd2ec1b — usr.bin/top display.c

top: fix off-by-one in screenbuf

There is a heap overflow for screenbuf originating from
the top import to the tree. The i_process()/u_process() functions
write a terminating NUL one byte past each screenbuf line slot
when the line fills the slot, which is a 1-byte heap overflow on the last slot.

The display_resize() function allocates screen_width bytes per line.
i_process() and u_process() cut lines to screen_width characters and
then stpcpy() them into the slot, which writes screen_width + 1 bytes.
line_update() can do the same with *old = ch. For inner slots,
the NUL lands in byte 0 of the next slot. This can corrupt the saved
contents used when updating the next line. For the last slot, it writes
one byte past the end of screenbuf.

Fix by allocating (screen_width + 1) bytes per line and updating the
line offsets to fit the terminating NUL.

Reviewed by:    kib

    [5 lines not shown]
DeltaFile
+3-3usr.bin/top/display.c
+3-31 files

FreeBSD/src 5165da2 — sys/netpfil/pf pf_lb.c, tests/sys/netpfil/pf Makefile nat46.sh

pf: fix nat46 ICMP handling

When porting from OpenBSD I typo'd the variable where we store the ICMP
type, in the nat46 direction. The nat64 direction was correct. Fix this
so ICMP translation works for nat46.

Add a test case for this, as well as basic TCP and UDP cases because
nat46 was entirely untested.

PR:             300461
MFC after:      1 week
Submitted by:   Charles Marshall <charles at wozi.com> (pf patch)
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+190-0tests/sys/netpfil/pf/nat46.sh
+2-2sys/netpfil/pf/pf_lb.c
+1-0tests/sys/netpfil/pf/Makefile
+193-23 files

FreeBSD/src e536321 — sys/netpfil/pf pf_norm.c

pf: fix sctp normalisation cleanup

If we fail to allocate the dst scrub structure we should free the src
one too, but we passed src rather than src->scrub.

Reported by:    llm-postcr
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+1-1sys/netpfil/pf/pf_norm.c
+1-11 files

FreeBSD/src c589ea8 — tests/sys/netpfil/pf/ioctl Makefile validation.c

pf tests: run the ioctl tests in their own vnet too

Fix the validation:settflags test, because using a NULL buffer succeeds
if there's no table to set tflags in. Create a table to fix the test.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+8-0tests/sys/netpfil/pf/ioctl/validation.c
+4-0tests/sys/netpfil/pf/ioctl/Makefile
+12-02 files

FreeBSD/src 5131335 — tests/sys/netpfil/pf snmp.sh

pf tests: test pfTablesTblCount in snmp_pf

This works fine on main, but not on stable/15 so add a test.

PR:     300818
MFC after:      3 days
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+13-0tests/sys/netpfil/pf/snmp.sh
+13-01 files

FreeBSD/src 670bad0 — sys/kern kern_fail.c

pause fail point: affirm sleeping without a lock

The previous patch to fail_point_pause removed a lock wrapping a sleep.
INVARIANTS assertions require we affirm we are deliberately sleeping
without a lock or timeout via the PNOLOCK flag.

Reported by:    netchild
Reviewed by:    netchild
Fixes:  331613ddd8a5 ("Pause failpoint: replace mtx_sleep with tsleep")
Differential Revision:  https://reviews.freebsd.org/D61730
DeltaFile
+1-1sys/kern/kern_fail.c
+1-11 files

FreeBSD/src 4d8501e — sys/dev/acpica acpi_pci_link.c

acpi_pci_link: Handle IRQ values > 255

Some systems use a stub PCI link device for hardwired interrupts
instead of static _PRT entries.  These link devices can use an IRQ >
255.  The current driver was designed to handle PCI link devices on
x86 used for legacy INTx IRQs which were < 255.  These changes handle
larger IRQ values while making a few tradeoffs.

- Expand most IRQ fields from 8 bits to 32-bits.  The BIOS IRQ
  (read from the PCIR_INTLINE config register which is an 8-bit register)
  remains 8 bits.

- Add a wrapper API for managing interrupt weights and avoid tracking
  weights for IRQs > 255 and instead report a constant weight of 0 for
  IRQs > 255.

Approved by:    re (cperciva)
PR:             300476
Reported by:    Aviv Bakal <avivb at amazon.com>

    [4 lines not shown]
DeltaFile
+44-15sys/dev/acpica/acpi_pci_link.c
+44-151 files

FreeBSD/src e3589b7 — sys/dev/acpica acpi_pci_link.c

acpi_pci_link: Factor out some duplicated code into a single copy

Approved by:    re (cperciva)
Tested by:      cperciva

(cherry picked from commit 6c1b6f7cf81447315fc0c7a294ed1467c62832bd)
(cherry picked from commit b898d97abd96a31c1e26fb15779d35daf7b6ac97)
DeltaFile
+3-4sys/dev/acpica/acpi_pci_link.c
+3-41 files

FreeBSD/src 2f98fd7 — sys/dev/acpica acpi_pci_link.c

acpi_pci_link: Remove a helper variable from _PRS parsing

Approved by:    re (cperciva)
Tested by:      cperciva

(cherry picked from commit df10f7b7500c129c48a477e94039c4e0d2711b54)
(cherry picked from commit 0af24d1fe82f1161cab8f10ba7f23cc3bee7dc11)
DeltaFile
+3-5sys/dev/acpica/acpi_pci_link.c
+3-51 files

FreeBSD/src 0421a24 — sys/dev/acpica acpi_pci_link.c

acpi_pci_link: Ignore tunables with negative values

IRQ values are unsigned and negative values do not make sense.  The
invalid IRQ value (255) is already ignored, so ignoring other invalid
values is consistent with that behavior.

Approved by:    re (cperciva)
Reported by:    cperciva

(cherry picked from commit 81dab94a5452f996a063bdba2103eda4aa32b3d1)
(cherry picked from commit 1b71cb09074be51a87a2eb84acb46ee77fceec45)
DeltaFile
+4-2sys/dev/acpica/acpi_pci_link.c
+4-21 files

FreeBSD/src 109acce — usr.sbin/ctld nvmf.cc

ctld: Fix namespace IDs for exported NVMe namespaces part 2

This is the same fix as in commit
9c8be6518e2e5f396055ecdab8098ce19c4b2218 just applied to another
method that also accepts namespace IDs.  The original commit handled
configuration statements assigning a named LUN to a namespace.  This
change handles anonymous namespaces configured within a controller
context.

Approved by:    re (cperciva)
Fixes:          66b5296f1b29 ("ctld: Add support for NVMe over Fabrics")
Sponsored by:   Chelsio Communications
(cherry picked from commit 9a99fa3932ddd794234becc6eab6519d56ae6947)
(cherry picked from commit 469ac5a9c05f21526f81cb34833bfff53b07a7d5)
DeltaFile
+2-2usr.sbin/ctld/nvmf.cc
+2-21 files

FreeBSD/src 38c1b30 — usr.sbin/ctld nvmf.cc

ctld: Fix namespace IDs for exported NVMe namespaces

NVMe namespace IDs are 1-based, but CTL LUN IDs are 0-based.  The
in-kernel NVMe ctl(4) target accounts for this by adding one to the
LUN ID to compute a namespace ID.  ctld was attempting to handle this
by translating namespace IDs from config files to internal LUN IDs,
but it did this incorrectly resulting in the namespace configured for
as namespace N actually showing up as namespace N + 1.

Approved by:    re (cperciva)
Fixes:          66b5296f1b29 ("ctld: Add support for NVMe over Fabrics")
Sponsored by:   Chelsio Communications
(cherry picked from commit 9c8be6518e2e5f396055ecdab8098ce19c4b2218)
(cherry picked from commit 033c0cd3e89ba87f3d66ceea6436cf2a37148051)
DeltaFile
+2-2usr.sbin/ctld/nvmf.cc
+2-21 files

FreeBSD/src ab7815d — sys/cam/ctl ctl_ioctl.h

nvmft: Document all CTL_NVMF status codes

Sponsored by:   Chelsio Communications

(cherry picked from commit 02c0eefc4e0ba2208d97fb4a80cd9bc4ec0dc47f)
DeltaFile
+8-0sys/cam/ctl/ctl_ioctl.h
+8-01 files

FreeBSD/src 469ac5a — usr.sbin/ctld nvmf.cc

ctld: Fix namespace IDs for exported NVMe namespaces part 2

This is the same fix as in commit
9c8be6518e2e5f396055ecdab8098ce19c4b2218 just applied to another
method that also accepts namespace IDs.  The original commit handled
configuration statements assigning a named LUN to a namespace.  This
change handles anonymous namespaces configured within a controller
context.

Fixes:          66b5296f1b29 ("ctld: Add support for NVMe over Fabrics")
Sponsored by:   Chelsio Communications
(cherry picked from commit 9a99fa3932ddd794234becc6eab6519d56ae6947)
DeltaFile
+2-2usr.sbin/ctld/nvmf.cc
+2-21 files

FreeBSD/src 0af24d1 — sys/dev/acpica acpi_pci_link.c

acpi_pci_link: Remove a helper variable from _PRS parsing

Tested by:      cperciva

(cherry picked from commit df10f7b7500c129c48a477e94039c4e0d2711b54)
DeltaFile
+3-5sys/dev/acpica/acpi_pci_link.c
+3-51 files

FreeBSD/src 1b71cb0 — sys/dev/acpica acpi_pci_link.c

acpi_pci_link: Ignore tunables with negative values

IRQ values are unsigned and negative values do not make sense.  The
invalid IRQ value (255) is already ignored, so ignoring other invalid
values is consistent with that behavior.

Reported by:    cperciva

(cherry picked from commit 81dab94a5452f996a063bdba2103eda4aa32b3d1)
DeltaFile
+4-2sys/dev/acpica/acpi_pci_link.c
+4-21 files

FreeBSD/src 033c0cd — usr.sbin/ctld nvmf.cc

ctld: Fix namespace IDs for exported NVMe namespaces

NVMe namespace IDs are 1-based, but CTL LUN IDs are 0-based.  The
in-kernel NVMe ctl(4) target accounts for this by adding one to the
LUN ID to compute a namespace ID.  ctld was attempting to handle this
by translating namespace IDs from config files to internal LUN IDs,
but it did this incorrectly resulting in the namespace configured for
as namespace N actually showing up as namespace N + 1.

Fixes:          66b5296f1b29 ("ctld: Add support for NVMe over Fabrics")
Sponsored by:   Chelsio Communications
(cherry picked from commit 9c8be6518e2e5f396055ecdab8098ce19c4b2218)
DeltaFile
+2-2usr.sbin/ctld/nvmf.cc
+2-21 files

FreeBSD/src 6c1a74d — sys/dev/cxgbe/crypto t7_kern_tls.c

cxgbe: Don't cache nsegs for KTLS requests

KTLS mbufs are initially parsed when they are first enqueued to
estimate the number of transmit descriptors needed so that the mbuf is
queued until enough descriptors are available.  As part of this
estimate, the number of DSGL segments required by each KTLS mbuf is
calculated.  Originally, the count for the first TLS record in a chain
was cached in the header mbuf to avoid having to recalculate it when
writing out the actual work request for the first TLS record, but this
requires duplicating fairly complex logic both when parsing and
transmitting requests.

Sponsored by:   Chelsio Communications

(cherry picked from commit 6d587ff04b71cb82a1e98fd84b5e0257dd65fec9)
DeltaFile
+5-22sys/dev/cxgbe/crypto/t7_kern_tls.c
+5-221 files

FreeBSD/src 5afba77 — sys/dev/cxgbe offload.h t4_main.c, sys/dev/cxgbe/crypto t7_kern_tls.c t6_kern_tls.c

cxgbe: Add a sysctl/tunable to control KTLS offload of AES-CBC cipher suites

Disable these by default as they are less efficient and rarely used.

Sponsored by:   Chelsio Communications

(cherry picked from commit 9cf774a577abbe28e03a849d1ec25f47827f07e6)
DeltaFile
+10-1sys/dev/cxgbe/t4_main.c
+4-3sys/dev/cxgbe/crypto/t7_kern_tls.c
+4-3sys/dev/cxgbe/crypto/t6_kern_tls.c
+1-0sys/dev/cxgbe/offload.h
+19-74 files

FreeBSD/src 0c064ad — sys/dev/cxgbe t4_main.c adapter.h, sys/dev/cxgbe/crypto t7_kern_tls.c

cxgbe tls: Send final data as immediate when trailing waste is trimmed

When a request needs to drop data from the crypto output (via a split
mode request), send the last 16 bytes of input as immediate data
instead of via DSGL.  Requests with small payloads (16 bytes or fewer)
are now sent as immediate data only without any DSGL at all.

Sponsored by:   Chelsio Communications

(cherry picked from commit 1bc81d3bb05505d1facc6884ee875ccb56e42977)
DeltaFile
+175-26sys/dev/cxgbe/crypto/t7_kern_tls.c
+8-0sys/dev/cxgbe/t4_sge.c
+2-0sys/dev/cxgbe/t4_main.c
+2-0sys/dev/cxgbe/adapter.h
+187-264 files

FreeBSD/src 2135419 — sys/dev/acpica acpi_pci_link.c

acpi_pci_link: Handle IRQ values > 255

Some systems use a stub PCI link device for hardwired interrupts
instead of static _PRT entries.  These link devices can use an IRQ >
255.  The current driver was designed to handle PCI link devices on
x86 used for legacy INTx IRQs which were < 255.  These changes handle
larger IRQ values while making a few tradeoffs.

- Expand most IRQ fields from 8 bits to 32-bits.  The BIOS IRQ
  (read from the PCIR_INTLINE config register which is an 8-bit register)
  remains 8 bits.

- Add a wrapper API for managing interrupt weights and avoid tracking
  weights for IRQs > 255 and instead report a constant weight of 0 for
  IRQs > 255.

PR:             300476
Reported by:    Aviv Bakal <avivb at amazon.com>
Tested by:      cperciva

    [2 lines not shown]
DeltaFile
+44-15sys/dev/acpica/acpi_pci_link.c
+44-151 files

FreeBSD/src b898d97 — sys/dev/acpica acpi_pci_link.c

acpi_pci_link: Factor out some duplicated code into a single copy

Tested by:      cperciva

(cherry picked from commit 6c1b6f7cf81447315fc0c7a294ed1467c62832bd)
DeltaFile
+3-4sys/dev/acpica/acpi_pci_link.c
+3-41 files