FreeBSD/src f19206c — sys/dev/acpica acpi_spmc.c

acpi_spmc: Make Intel device-specific state optional

The Intel Low Power S0 Idle _DSM specification marks the minimum
device-specific state of a constraint package as optional, and its own
example returns {0xFF, 0}.  Requiring three elements rejected such
constraints, with one boot message each.

Reviewed by:    olce
Approved by:    olce
Fixes:          508efe35e577 ("acpi_spmc: Check Intel constraint packages")
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/134
DeltaFile
+4-2sys/dev/acpica/acpi_spmc.c
+4-21 files

FreeBSD/src 3fe8d76 — sys/geom geom_ctl.c

geom: Restore group operator

Traditionally, in BSD, the operator group has been intended for backup
operators and has been granted read-only access to disks and related
devices.  This includes geom.ctl, because backup operators need to be
able to dump partition tables.

Unfortunately, the geom.ctl device previously lacked proper access
control, and anyone with read access to it was able to modify GEOM
configuration, including modifying or destroying partitions, RAID
volumes, etc.  As a workaround, the ownership of geom.ctl was changed to
root:wheel so that only users who presumably already have root
privileges were able to access it.

Now that access control has been implemented, we can restore the
original ownership so backup operators can once more dump partition
tables.

This reverts commit 7d576f1d657fc21f97cedc28cc971621ee2490a7.
DeltaFile
+1-1sys/geom/geom_ctl.c
+1-11 files

FreeBSD/src 96c5451 — sys/netpfil/pf pf_ioctl.c

pf: don't allow any ioctl calls until we're fully initialised

We create the /dev/pf node before we're fully initialised, leaving a
(very small) gap where ioctl calls could be made before we're ready
for them.

PR:             301074
MFC after:      2 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+4-0sys/netpfil/pf/pf_ioctl.c
+4-01 files

FreeBSD/src ba70b70 — sys/netpfil/pf pf.c

pf: include orig_kif in the mark-and-sweep cleanup mechanism

As part of the purge process we mark all kifs referenced by states, so
that at the end of the sweep we know which ones are no longer referenced
and can be safely cleaned up.
We forgot to mark the orig_kif, so it was possible for a kif to be
referenced only by a state's orig_kif field, and if the interface itself
then went away we might end up freeing the kif while a state still
referenced it.

Reported by:    llm-postcr
Fixes:          d0fdf2b28f9b ("pf: Track the original kif for floating states")
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+2-0sys/netpfil/pf/pf.c
+2-01 files

FreeBSD/src d5f0768 — sys/dev/acpica acpi_ec.c

acpi_ec: Interpret a relative ECDT's EC_ID as an absolute namepath

This commit makes the Elan touchpad (ELAN06FA) on the Lenovo Thinkbook
14 6G attach at boot by resolving the ECDT's relative EC_ID path from
the namespace root.

The motherboard supports multiple touchpad models (Synaptics, Elan, ...)
As a result, the firmware defers the selection until runtime:
 - touchpad device _INI method queries the embedded controller (EC),
 - determines the actual model installed
 - writes the correct _HID and I²C slave address

In acpi_ec_ecdt_probe(), the ECDT's EC_ID string is resolved with a NULL
scope. However ACPICA only accepts absolute paths in this context, while
the EC_ID provided by this machine's firmware is relative.

Although this is not specification-compliant, this change interprets
the relative EC_ID as an absolute namepath from the namespace root.


    [3 lines not shown]
DeltaFile
+1-1sys/dev/acpica/acpi_ec.c
+1-11 files

FreeBSD/src 73929d1 — sys/netinet tcp_input.c tcp_var.h, sys/netinet/tcp_stacks rack.c bbr.c

tcp: improve consistency

Use an inline function tcp_adapt_iss_check() to perform the check
consistently instead of replicating the code multiple times. These
checks already became inconsistent.
A fix for PR 298560 requires more calls to tcp_adapt_iss_check().

Reviewed by:            Peter Lei
Fixes:                  fa2ad70a4511 ("tcp: make ghost ACK handling more conformant")
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61685

(cherry picked from commit e3483dbc91b59b5b2c73a4bc792fbb834c3dc111)
DeltaFile
+10-0sys/netinet/tcp_var.h
+1-4sys/netinet/tcp_stacks/rack.c
+1-4sys/netinet/tcp_stacks/bbr.c
+1-4sys/netinet/tcp_input.c
+13-124 files

FreeBSD/src a170546 — sys/netinet tcp_input.c

tcp: make ghost ACK handling more conformant

The latest version of draft-ietf-tcpm-tcp-ghost-acks changed
a condition. This should make no substantial difference, but makei
it compliant to the latest version of the specification.

Reviewed by:            rscheff, Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D58411

(cherry picked from commit fa2ad70a4511e7b379e81de82c9e51b2e0994295)
DeltaFile
+1-1sys/netinet/tcp_input.c
+1-11 files

FreeBSD/src 13357c1 — sys/netinet tcp_output.c

tcp: improve sender side SWS avoidance

When checking for a full sized segment, take all TCP options that will
be included into account. This fixes a bug which can trigger the
"sent too much" KASSERT related to limited transmit.

Reported by:            olivier
Reviewed by:            rscheff, Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61605

(cherry picked from commit d174085f9f895ed444bd95120da3eff481a58f1a)
DeltaFile
+1-13sys/netinet/tcp_output.c
+1-131 files

FreeBSD/src cbd17b6 — sys/netinet/tcp_stacks bbr.c

tcp bbr: improve handling of retransmissions in LAST-ACK

When performing a timer based retransmission, clear the
BBR_RWND_COLLAPSED flag. If it sticks, t_rxtshift is never incremented
resulting in unlimited retransmissions in the LAST-ACK state.

Reported by:            Illia Vynohradov
Reviewed by:            Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61586

(cherry picked from commit 3c6fd437b1824caeddb5f0d4570d43cf0c999c14)
DeltaFile
+1-1sys/netinet/tcp_stacks/bbr.c
+1-11 files

FreeBSD/src 3e74519 — sys/netinet/tcp_stacks bbr.c

tcp bbr: improve persits timeout computation

t_srtt and t_rttvar use different lengths of fractions, therefore use
the appropriate shift value.

Reviewed by:            Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61600

(cherry picked from commit 751882926dc0bb1f7a4834c4b5e8d951cee61c7c)
DeltaFile
+1-1sys/netinet/tcp_stacks/bbr.c
+1-11 files

FreeBSD/src ccf8e37 — sys/netinet/tcp_stacks bbr.c

tcp bbr: improve retransmit timout calculation

The retransmission timeout should the srtt + 4 * rttvar.
The srtt is using 5 bits of fractions and rttvar is using 4 bits of
fractions, some specific shifting is required.

Reviewed by:            Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61581

(cherry picked from commit 2f98793a13fe3e69cf6b698fa469550b4ba0fea1)
DeltaFile
+1-2sys/netinet/tcp_stacks/bbr.c
+1-21 files

FreeBSD/src 158dcb8 — sys/netinet/tcp_stacks bbr.c

tcp bbr: improve invalidating rtt

Invalidate the rtt based on t_rxtshift instead of resetting t_srtt to 0,
because using the latter also affects the retransmission timeout.

Reviewed by:            Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61585

(cherry picked from commit 8018d75601dfe804a8d70f4f08bdb0e4e3a8c5c9)
DeltaFile
+2-4sys/netinet/tcp_stacks/bbr.c
+2-41 files

FreeBSD/src c8ca5fa — sys/netinet/tcp_stacks bbr.c

tcp bbr: cleanup

No functional change intended.

Sponsored by:   Netflix, Inc.

(cherry picked from commit 34436bb7cf971dba1c0dcdb1d45f22fff1a4b6c1)
DeltaFile
+3-4sys/netinet/tcp_stacks/bbr.c
+3-41 files

FreeBSD/src a82c042 — lib/libvmmapi vmmapi.c

libvmmapi: Size the guard reservation from existing memory

When the VM's memory already exists, as it does after bhyveload(8),
vm_setup_memory_domains() maps the existing segment but sizes its
address space reservation from the requested size.  If the existing
segment is larger, the mapping runs past the reservation and replaces
the guard region after it, and anything else mapped there.

Look for existing memory before sizing the reservation.

Reviewed by:    bnovkov, markj
Approved by:    markj
Fixes:          08c7dd2fbe4f (libvmmapi: Add support for setting up and configuring guest NUMA domains)
MFC after:      1 week
Sponsored by:   Alchemilla Ventures Private Limited
Differential Revision:  https://reviews.freebsd.org/D61917
DeltaFile
+28-20lib/libvmmapi/vmmapi.c
+28-201 files

FreeBSD/src d431c80 — sys/amd64/vmm/intel vmx_msr.h vmx.c

amd64/vmm: Validate guest MSRs restored from a snapshot

vmx_vcpu_snapshot() copies the saved guest MSR array from userspace
without checking it.  vmx_msr_guest_enter() and
vmx_msr_guest_enter_tsc_aux() write these values to the host's MSRs
before guest entry, so a non-canonical LSTAR, CSTAR or KGSBASE, or a
TSC_AUX with reserved bits set, raises #GP in the host and panics it.

Check the values on restore and fail with EINVAL, leaving the vCPU's
MSRs unchanged.  STAR and SF_MASK need no check, since the CPU accepts
any value for them.  PAT is not written to a host MSR, but apply the
check used for guest writes to it as well.

Reported by:    llm-postcr
Reviewed by:    markj
Approved by:    markj
Fixes:          483d953a86a2 (Initial support for bhyve save and restore.)
Fixes:          f5f5f1e7d6de (Support guest rdtscp and rdpid instructions on Intel VT-x)
MFC after:      1 week

    [2 lines not shown]
DeltaFile
+38-0sys/amd64/vmm/intel/vmx_msr.c
+8-2sys/amd64/vmm/intel/vmx.c
+4-0sys/amd64/vmm/intel/vmx_msr.h
+50-23 files

FreeBSD/src 408af93 — sys/modules Makefile

aq: build the module on arm64

The driver has no x86 dependency.  It attaches and passes traffic on a
Raspberry Pi 5 with an AQC100 in its PCIe slot.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D60462
Signed-off-by:  Nick Price <nprice at FreeBSD.org>
DeltaFile
+1-1sys/modules/Makefile
+1-11 files

FreeBSD/src 873a495 — sys/dev/aq aq_device.h aq_ring.c

aq: support a legacy INTx interrupt

aq(4) attached only with MSI-X.  Without an MSI controller iflib falls
back to INTx, and attach failed with EOPNOTSUPP.

Accept IFLIB_INTR_LEGACY, program the controller for INTx, and add a
legacy filter.  INTx is level-triggered and nothing auto-masks, so the
filter masks the vector before acknowledging it; iflib unmasks it via
IFDI_INTR_ENABLE once the queues are drained.  All causes already map
to vector 0 in this mode.  MSI stays unsupported: iflib never selects
it here, since these controllers advertise 32 messages.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D60461
Signed-off-by:  Nick Price <nprice at FreeBSD.org>
DeltaFile
+19-0sys/dev/aq/aq_irq.c
+1-5sys/dev/aq/aq_main.c
+1-1sys/dev/aq/aq_ring.c
+1-1sys/dev/aq/aq_hw.c
+1-0sys/dev/aq/aq_device.h
+23-75 files

FreeBSD/src d888f02 — tests/sys/fs/fdescfs fdescfs_test.c

tests/fdescfs: add a license header

Differential Revision:  https://reviews.freebsd.org/D61230
Signed-off-by:  Nick Price <nprice at FreeBSD.org>
DeltaFile
+6-0tests/sys/fs/fdescfs/fdescfs_test.c
+6-01 files

FreeBSD/src 2679104 — libexec/bootpd bootpd.c

bootpd: clamp the DHCP reply length to the packet buffer

A client could set the DHCP maximum-message-size option to a large
value; dovend_rfc1048() derived the reply length from it with no upper
bound, so the trailing bzero() of the vendor area ran far past the
MAX_MSG_SIZE packet buffer.  A value >= 0x8000 read into a signed short
instead went negative and slipped past the length clamps, leaving
sendto() to read a huge length from the buffer.

Read msgsz unsigned and clamp the reply length to the buffer size.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D61009
Signed-off-by:  Nick Price <nprice at FreeBSD.org>
DeltaFile
+5-1libexec/bootpd/bootpd.c
+5-11 files

FreeBSD/src 2bcf574 — sys/dev/acpica acpi.c

acpi: set up the sysctl tree before acpi_machdep_init()

On amd64 and i386, acpi_machdep_init() adds hw.acpi.reset_video under
acpi_sysctl_tree.  Since the tree moved to the end of attach, it no
longer exists at that point, so sysctl_add_oid() drops the node and the
sysctl documented in acpi(4) is missing.  Found with KUBSAN.

acpi_machdep_init() cannot fail, so calling it after the tree does not
leave knobs behind on a failed attach.

Fixes: 7f031c9f6b9f ("acpi: Move sysctl tree set up at end of initialization")
Signed-off-by: Nick Price <nprice at FreeBSD.org>

Reviewed by:    olce
Differential Revision:  https://reviews.freebsd.org/D60797
DeltaFile
+5-3sys/dev/acpica/acpi.c
+5-31 files

FreeBSD/src 50bbc49 — sys/amd64/vmm/io ppt.c

vmm: don't hold the global PPT lock while resetting a device

`ppt_assign_device()` holds the global PPT lock across the save/reset/restore. `pcie_flr()` can wait up to the reset timeout, and every PPT operation on every VM stalls behind it.

Reserve the function with `resetting` and drop the lock for the reset, as `ppt_reset_device()` already does (D58864). Set `ppt->vm` first so a competing assign or `ppt_detach()` gets EBUSY at once instead of sleeping out the reset. Clear it if the assign fails.

Apply matching changes to `ppt_unassign_device()` which may actually take longer on properly-functioning hardware due to teardown duration.

Reviewed by:    adrian, markj
Differential Revision:  https://reviews.freebsd.org/D60188
Signed-off-by:  Nick Price <nprice at FreeBSD.org>
DeltaFile
+29-9sys/amd64/vmm/io/ppt.c
+29-91 files

FreeBSD/src d0754fe — sys/netinet in_pcb.c

inpcb: reject a reversed ephemeral port range

vxlan, geneve and the RDMA CM take portrange.first and last as an
ordered pair and divide by zero when first == last + 1.

Refuse a write that would put first above last or hifirst above hilast.

Reviewed by:    glebius
Differential Revision:  https://reviews.freebsd.org/D61010
Signed-off-by:  Nick Price <nprice at FreeBSD.org>
DeltaFile
+17-9sys/netinet/in_pcb.c
+17-91 files

FreeBSD/src e584648 — sys/netinet in_pcb.c

inpcb: treat the ephemeral port range as inclusive

in_pcb_lport_dest() sizes [first, last] as last - first, so the random
start never picks last and the search tries one port too few.

With first == last the random start divides by zero: once root sets the
range, any user's connect() panics the host.

Reviewed by:    glebius
Differential Revision:  https://reviews.freebsd.org/D61010
Signed-off-by:  Nick Price <nprice at FreeBSD.org>
DeltaFile
+2-2sys/netinet/in_pcb.c
+2-21 files

FreeBSD/src e035f27 — sys/dev/snp snp.c

snp(4): do not ignore errors from devfs_set_cdevpriv()

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+5-3sys/dev/snp/snp.c
+5-31 files

FreeBSD/src f6bd65e — sys/dev/snp snp.c

snp(4): drain snp_outpoll before destroying the open data

kib' note: comparing to the original submission, seldrain() is called
before cv_destroy().

PR:     301062
MFC after:      1 week
DeltaFile
+1-0sys/dev/snp/snp.c
+1-01 files

FreeBSD/src 5c0715d — sys/fs/ext2fs ext2_balloc.c ext2_alloc.c

ext2fs: fix post-commit review issues in multi-block allocator

Fix 8 issues identified in post-commit review of e590490:

POSTCR-1: ext2_clusteralloc() asserted MA_NOTOWNED while holding
EXT2_LOCK, causing INVARIANTS panic on successful cluster lookup.
Changed assertion to MA_OWNED.

POSTCR-2: ext2_balloc() IO_SYNC and ext4_ext_split() error paths freed
blocks after bwrite() failure, but brelse() had redirtied the buffer
which still named the freed block. Added B_INVALONERR flag before
bwrite() to invalidate buffers on error (4 locations in ext2_balloc.c,
3 in ext2_extents.c).

POSTCR-3: ext4_ext_get_blocks() freed new run when ext4_ext_dirty()
failed, but extent remained in i_data or cached leaf buffer. Simplified
ext4_ext_dirty() error handling to use B_INVALONERR instead of manual
getblk/bundirty/brelse.


    [24 lines not shown]
DeltaFile
+32-22sys/fs/ext2fs/ext2_extents.c
+20-5sys/fs/ext2fs/ext2_alloc.c
+4-0sys/fs/ext2fs/ext2_balloc.c
+56-273 files

FreeBSD/src 49e8ec6 — secure/libexec/sftp-server Makefile, secure/usr.bin/scp Makefile

secure: Add ssh-sk-client to all consumers of libssh

These all failed to link with ld.bfd used by GCC due to
Fssh_sshsk_sign being an unresolved symbol.

Fixes:          65d8491719bb ("secure: Adapt Makefile to ssh-sk-client everywhere")
(cherry picked from commit a098111a28ed59e1ab1101ad09913f0235ebd28f)
DeltaFile
+1-1secure/usr.bin/sftp/Makefile
+1-1secure/usr.bin/scp/Makefile
+1-1secure/libexec/sftp-server/Makefile
+3-33 files

FreeBSD/src f3d13e0 — tests/sys/fs/tarfs tarfs_test.sh

tarfs: tests: Increase timeout (again)

Bump the timeout value (a little more), to avoid cutoff on emulated
architectures on ci.freebsd.org.

Reported by:    Jenkins
Fixes:          47015e454661 ("tests: Increase timeout")
MFC after:      3 days

(cherry picked from commit a551b0524953cbfa4f1035c6d968623e64f4436a)
DeltaFile
+1-1tests/sys/fs/tarfs/tarfs_test.sh
+1-11 files

FreeBSD/src 8976206 — tests/sys/fs/tarfs tarfs_test.sh

tarfs: tests: Increase timeout (again 2)

Bump the timeout value (for the third time), to avoid cutoff on emulated
architectures on ci.freebsd.org.  One of the runners will take
considerably more time to complete this test.

Reported by:    Jenkins
Fixes:          a551b0524953 ("tarfs: tests: Increase timeout (again)")
MFC after:      3 days

(cherry picked from commit a4f0a60e05293f3f517324f3ebc41046a79a9feb)
DeltaFile
+1-1tests/sys/fs/tarfs/tarfs_test.sh
+1-11 files

FreeBSD/src b308cbd — tests/sys/netpfil/pf rules_counter.sh

pf tests: give rules_counter:4G more time

Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 8217075f9ecb12fa9a4cf746541b9d3e1dc57e79)
DeltaFile
+1-0tests/sys/netpfil/pf/rules_counter.sh
+1-01 files