FreeBSD/src c8af571contrib/pf/authpf authpf.c

authpf(8) read_config() should chop off trailing white space

if administrator mistakenly types into configuration file

anchor=authpf_test

where 'authpf_test' is followed by white space, the authpf(8)
is going to use anchor 'authpf_test ' instead of the 'authpf_test'
which is defined in pf.conf(5) as 'anchor authpf_test/*'

issue kindly reported and patch submitted by

Avinash Duduskar <avinash.duduskar (_at_) gmail (_dot_) com>

OK sashan@

PR:             296958
MFC after:      1 week
Obtained from:  OpenBSD, sashan <sashan at openbsd.org>, 2d12a8e44d

    [3 lines not shown]
DeltaFile
+2-2contrib/pf/authpf/authpf.c
+2-21 files

FreeBSD/src d68de8ccontrib/pf/authpf authpf.c

authpf(8) read_config() should chop off trailing white space

if administrator mistakenly types into configuration file

anchor=authpf_test

where 'authpf_test' is followed by white space, the authpf(8)
is going to use anchor 'authpf_test ' instead of the 'authpf_test'
which is defined in pf.conf(5) as 'anchor authpf_test/*'

issue kindly reported and patch submitted by

Avinash Duduskar <avinash.duduskar (_at_) gmail (_dot_) com>

OK sashan@

PR:             296958
MFC after:      1 week
Obtained from:  OpenBSD, sashan <sashan at openbsd.org>, 2d12a8e44d

    [3 lines not shown]
DeltaFile
+2-2contrib/pf/authpf/authpf.c
+2-21 files

FreeBSD/src b72f9bfsys/kern vfs_syscalls.c

statfs(2): allow to interrupt busying

There are probably more places which could benefit from allowing to
interrupt vfs_busy() calls at syscalls top level.

Requested by:   Peter Eriksson <pen at lysator.liu.se>
Reviewed by:    jah, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58477
DeltaFile
+1-1sys/kern/vfs_syscalls.c
+1-11 files

FreeBSD/src fb4d7bdsys/kern vfs_subr.c, sys/sys mount.h

vfs_busy(): add MBF_PCATCH flag to allow interrupting the sleep

Reviewed by:    jah, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58477
DeltaFile
+16-1sys/kern/vfs_subr.c
+2-1sys/sys/mount.h
+18-22 files

FreeBSD/src 3afa262share/man/man4 mt7921.4

mt76: mt7921: update man page

Adjust the man page to what other LinuxKPI wlan man pages say and look
like as it has been a while since I wrote it.  The man page is not yet
hooked up to the build on purpose as the driver is not yet enabled in
the tree.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    ziaee (earlier version)
Differential Revision: https://reviews.freebsd.org/D58479
DeltaFile
+25-39share/man/man4/mt7921.4
+25-391 files

FreeBSD/src e738164release/scripts make-pkg-package.sh

make-pkg-package.sh: Fix build for pkg 2.8.0

We used to pass CONFIGURE_ARGS to the make command which builds pkg,
but ports/ports-mgmt/pkg/Makefile has its own CONFIGURE_ARGS and the
version we were providing at the command line didn't contain the
--mandir setting which was added to the port with pkg 2.8.0.  This
broke release builds.

Instead of passing --prefix=${LOCALBASE} via CONFIGURE_ARGS, pass
PREFIX=${LOCALBASE}; the port Makefile passes that value through to
its configure script.  We also used to pass a --host parameter, but
that seems to have become unnecessary at some point in the past decade.

MFC after:      1 day
Sponsored by:   Amazon

(cherry picked from commit 8d92f32ae011719b322b9943d01529cebef741f0)
DeltaFile
+1-1release/scripts/make-pkg-package.sh
+1-11 files

FreeBSD/src 434283fcddl/lib/libdtrace mkpriv, cddl/usr.sbin/dwatch/libexec slow lock

dwatch: add nine diagnostic modules; grow errno, io, proc, sched

Grow the module collection to answer, each with a single command, the
first questions asked when diagnosing a sick system: why is my
application stalling, where is the kernel fighting over locks, what
file could it not find, why is this process getting EPERM, what killed
my process, will that fatal signal actually leave a core behind, what
was my process stuck on, where is my kernel memory going, who is
creating or entering jails, is the network slow because TCP is
resending, how long did my thread wait to run, and is the disk itself
slow.  Every module keeps to the house style: invocation-name
overloading through hard links, predicate-only D with inline lookup
tables (no if-statements), and stable providers only (syscall, proc,
sched, io, dtmalloc, and the lockstat, vfs, priv, and mib SDT
providers), so the modules remain drop-in compatible with older
releases (the one documented exception is noted below).  No kernel
changes: new and extended profiles under cddl/usr.sbin/dwatch/libexec
plus one libdtrace inline table (priv.d).


    [129 lines not shown]
DeltaFile
+210-0cddl/usr.sbin/dwatch/libexec/coredump
+174-0cddl/usr.sbin/dwatch/libexec/hang
+146-0cddl/usr.sbin/dwatch/libexec/dtmalloc
+136-0cddl/usr.sbin/dwatch/libexec/lock
+131-0cddl/usr.sbin/dwatch/libexec/slow
+119-0cddl/lib/libdtrace/mkpriv
+916-011 files not shown
+1,544-1317 files

FreeBSD/src 9540981sys/dev/nvme nvme_private.h nvme_ctrlr.c

nvme: Add quirk for broken namespace-change log

Add a QUIRK_EMPTY_NAMESPACE_CHANGED_LOG quirk which indicates that the
nvme controller may not properly populate the namespace-changed log
page.  If we receive a NVME_LOG_CHANGED_NAMESPACE page for a device
with this quirk and the page is empty, probe all of the namespaces
rather than none of them.

Reviewed by:    imp
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D58231
DeltaFile
+5-0sys/dev/nvme/nvme_ctrlr.c
+1-0sys/dev/nvme/nvme_private.h
+6-02 files

FreeBSD/src 14f5fd2sys/dev/nvme nvme_pci.c

nvme: Add quirk for Amazon EBS NVMe Controller

This controller exhibits QUIRK_EMPTY_NAMESPACE_CHANGED_LOG behaviour.

A bug report has been filed with the vendor.

Reviewed by:    imp
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D58232
DeltaFile
+2-0sys/dev/nvme/nvme_pci.c
+2-01 files

FreeBSD/src 4068f3bsys/cam/nvme nvme_da.c

nda: Don't sleep with non-sleepable lock held

We reach ndaasync with the CAM device lock held, so we must pass
M_NOWAIT to disk_* rather than M_WAITOK.

Reviewed by:    imp
Fixes:  628d7a3270b6 ("nda: AC_GETDEV_CHANGED calls media chanaged for sectorsize change")
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D58230
DeltaFile
+2-2sys/cam/nvme/nvme_da.c
+2-21 files

FreeBSD/src 2d01998sys/netinet tcp_hostcache.c

tcp_hostcache: ensure expire and prune values stay consistent with each other

    When configuring the expire timeout to something short, make sure that the
    prune time runs at least at that interval. Similarly, when adjusting the
    prune interval up, ensure the expire timeout reflect that expected minimum
    time also. Finally, restart the callout timer so that the next pruning
    happens after the new, expected interval.

Reviewed By:            glebius
MFC after:              2 weeks
Sponsored by:           NetApp, Inc.
Differential Revision:  https://reviews.freebsd.org/D58424
DeltaFile
+53-11sys/netinet/tcp_hostcache.c
+53-111 files

FreeBSD/src 5de9161sys/netinet tcp_subr.c tcp_input.c

tcp_hostcache: limit scope of struct hc_metrics_lite and rename with tcp_ prefix

    Restrict the scope of the struct hc_metrics_lite to the kernel only.
    Update the naming to align with other kernel structures and add a tcp_ prefix.

Reviewed by:            glebius
MFC after:              2 weeks
Sponsored by:           NetApp, Inc.
Differential Revision:  https://reviews.freebsd.org/D58440
DeltaFile
+35-34sys/netinet/tcp_hostcache.c
+5-5sys/netinet/tcp_input.c
+6-4sys/netinet/tcp_var.h
+1-1sys/netinet/tcp_subr.c
+47-444 files

FreeBSD/src 2d0b733tests/sys/net/routing test_routing.sh

routing: Add tests for prefsrc route attribute

Add tests for both IPv4 and IPv6 routes with the prefsrc attribute.
Also test IPv4 routes over IPv6 nexthops and borrow their IPv4
addresses from the loopback interface.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D58326
DeltaFile
+154-0tests/sys/net/routing/test_routing.sh
+154-01 files

FreeBSD/src dd235f0sbin/route route.c keywords

route(8): Add prefsrc option in netlink

Add prefsrc option that is frequently used on unnumbered interfaces
or L3 multi-homed network hosts.
This option uses RTA_PREFSRC.
Now you can add a static route by specifying the prefsrc option
with the loopback IP.

PR:             285422
Reviewed by:    glebius
Differential Revision: https://reviews.freebsd.org/D58294
DeltaFile
+2-0sbin/route/route_netlink.c
+1-0sbin/route/route.c
+1-0sbin/route/keywords
+4-03 files

FreeBSD/src be5994cshare/man/man4 rtnetlink.4, sys/net/route nhop_ctl.c

netlink: Add RTA_PREFSRC support

Add the ability to select source ip address of outgoing packets
even when the source ip address is configured on another interface.
Also add this new rtnetlink attribute to manual.

PR:             285422
Reviewed by:    glebius, ziaee (manpages)
Tested by:      ivy, Marek Zarychta <zarychtam at plan-b.pwste.edu.pl>
Relnotes:       yes
Differential Revision: https://reviews.freebsd.org/D58294
DeltaFile
+47-0sys/netlink/route/rt.c
+22-0sys/netlink/route/nexthop.c
+4-3sys/net/route/nhop_ctl.c
+3-2sys/netlink/route/route.h
+4-1share/man/man4/rtnetlink.4
+2-0sys/netlink/netlink_snl_route_parsers.h
+82-62 files not shown
+84-68 files

FreeBSD/src 788400esys/netinet6 nd6_rtr.c

nd6: Do not enter net_epoch under nd6_prelist_add

nd6_prefix_onlink will enter net_epoch when necessary.
Also, exit net_epoch earlier in nd6_prefix_onlink,
Because we acquired a reference to ifa, and we got our ifa
from the pr->ndpr_ifp, we don't need to stay under epoch.
While here, style it.

Reviewed by:    markj, glebius
Discussed with: zlei
Differential Revision: https://reviews.freebsd.org/D56129
DeltaFile
+2-7sys/netinet6/nd6_rtr.c
+2-71 files

FreeBSD/src 053d95esys/netinet6 nd6_rtr.c

nd6: Set ip6 after m_pullup() in nd6_ra_input()

nd6_ra_input() reads the IPv6 header pointer ip6 before m_pullup(), then
uses that pointer afterwards to set nd_ra.

When m_pullup() relocates the chain it frees the original first mbuf and
returns a new one, leaving ip6 dangling; the subsequent access may be a
use-after-free read.

The fix writes ip6 from the returned mbuf after m_pullup() inside the
conditional if.

Reviewed by: pouria
Differential Revision: https://reviews.freebsd.org/D58229
DeltaFile
+1-0sys/netinet6/nd6_rtr.c
+1-01 files

FreeBSD/src 52b7cbcsys/netinet tcp_timer.c

tcp: improve handling of stopped timers

When a TCP timer is stopped, t_timers[] is set to SBT_MAX. Adding the
corresponding t_precisions[], if it is not zero, would result in
overflows in tcp_timer_next(). To avoid this, skip stopped timers.

The problem was identified while debugging uperf by Lukas Book and
an initial patch was provided by him. The committed patch was
suggested by glebius.

The problem can be observed by running netstat -nxptcp and looking for
negative timer values and by observing very long running timers in
some cases.

Reported by:            Lukas Book <lkbook at outlook.de>
Reviewed by:            glebius
Differential Revision:  https://reviews.freebsd.org/D58484
DeltaFile
+2-0sys/netinet/tcp_timer.c
+2-01 files

FreeBSD/src 2e259c2sys/kern kern_exit.c

kern_pdwait(): print the process pointer through pd

to avoid using uninitialized value in the KASSERT() statement on the first
iteration.

Also, do the assert under the proctree_lock, which is not critical but
satisfies the invariants.

Noted and reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58505
DeltaFile
+2-2sys/kern/kern_exit.c
+2-21 files

FreeBSD/src 8cef3c9sys/kern kern_exit.c

proc_realparent(): assert that an orphaned child has real parent != parent

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58504
DeltaFile
+3-0sys/kern/kern_exit.c
+3-01 files

FreeBSD/src ce6ab51usr.sbin/pmc Makefile cmd_pmc.h

pmc: enable the new pmc commands

This change hooks everything up to the pmc command and improves the
usage to document all functions.  There are a couple older commands that
are currently broken that I have hidden from the usage, but left in the
code for those using it.  I won't remove those until we have our
replacements upstreamed that depend on the AMD PMC multiplexing patches.

Sponsored by: Netflix
Reviewed by:    adrian, imp
Differential Revision:  https://reviews.freebsd.org/D57780
DeltaFile
+37-15usr.sbin/pmc/pmc.c
+5-2usr.sbin/pmc/cmd_pmc.h
+4-2usr.sbin/pmc/Makefile
+46-193 files

FreeBSD/src 3adde0eusr.sbin/pmc cmd_pmc_info.cc

pmc: pmc info command

Prints the log header including machine, cpu and kernel details along
with what counters were selected.

Sponsored by: Netflix
Reviewed by:    adrian, imp
Differential Revision:  https://reviews.freebsd.org/D57778
DeltaFile
+186-0usr.sbin/pmc/cmd_pmc_info.cc
+186-01 files

FreeBSD/src cc94d1busr.sbin/pmc cmd_pmc_frontend.cc

pmc: pmc frontend stall analysis based on IBS

The frontend command uses AMD IBS frontend events to analyze the major
sources of frontend stalls.  It displays a table breakind down the major
causes of front end stalls.  This is a simple demonstration of the tools
as you can use the filtering tools to limit the analysis to a subset of
the samples including filtering by fetch latencies.

Sponsored by: Netflix
Reviewed by:    adrian, imp
Differential Revision:  https://reviews.freebsd.org/D57779
DeltaFile
+242-0usr.sbin/pmc/cmd_pmc_frontend.cc
+242-01 files

FreeBSD/src a79a051usr.sbin/pmc headers.hh cmd_pmc_record.cc

pmc: pmc record command

The record command is designed around the idea of predefined studies.
While you can still select individual counters, the predefined studies
are meant to enable the best hardware options for a given generation.
It implements all of the base studies that I have built so far.

Sponsored by: Netflix
Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57777
DeltaFile
+750-0usr.sbin/pmc/cmd_pmc_record.cc
+1-0usr.sbin/pmc/headers.hh
+751-02 files

FreeBSD/src 93da997usr.sbin/pmc util.hh util.cc

pmc: new pmc log processing framework

View is a class for building PMC log processing tools it is designed to
work with the new PMC record command that adds a header with additional
CPU information.  The new framework processes PMC logs about 2.5 times
faster and in about half the code as libpmcstat.

Sponsored by: Netflix
Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57776
DeltaFile
+960-0usr.sbin/pmc/view.cc
+411-0usr.sbin/pmc/view.hh
+82-0usr.sbin/pmc/util.cc
+82-0usr.sbin/pmc/headers.hh
+39-0usr.sbin/pmc/util.hh
+1,574-05 files

FreeBSD/src a53d2e4usr.sbin/pmc display.hh display.cc

pmc: console configuration and table rendering for new PMC tools

Initializes the terminal rendering code used by the new pmc tools.  Then
provides a table abstraction for collecting, sorting and rendering
tables.  It provides pretty printed results with typed fields that print
several types used throughout the new PMC tools.  By default the fields
are formatted in engineering notation.

Sponsored by: Netflix
Reviewed by:    adrian, imp
Differential Revision:  https://reviews.freebsd.org/D57775
DeltaFile
+571-0usr.sbin/pmc/display.cc
+105-0usr.sbin/pmc/display.hh
+676-02 files

FreeBSD/src 285c749sys/dev/e1000 igb_txrx.c em_txrx.c

e1000: report UDP RSS hash type on igb/em

{em,igb}_determine_rsstype() mapped only the TCP and bare-IP RSS descriptor
types; the UDP types returned M_HASHTYPE_NONE.
The hardware does hash UDP, but with a NONE hashtype iflib skips its
flowid-based TX queue spread, so all forwarded UDP egressed on a single queue
and serialized transmit on one core.

Add the three UDP cases (IPV4_UDP, IPV6_UDP, IPV6_UDP_EX) so egress spreads
across all TX queues.

Reviewed by:    kbowling, gallatin
Approved by:    kbowling
MFC after:      1 week
MFC to:         stable/14, stable/15
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D58513
DeltaFile
+6-0sys/dev/e1000/igb_txrx.c
+6-0sys/dev/e1000/em_txrx.c
+12-02 files

FreeBSD/src 6c4d9b9sys/dev/hwpmc hwpmc_amd.c

hwpmc: fix event allocation on pre-Zen AMD CPUs

amd_allocate_pmc() chose the pmu-events code path whenever pmc_cpuid was
non-empty, and rejected any allocation lacking PMC_F_EV_PMU.
But pmc_cpuid is set for every AMD CPU, while the pmu-events tables only cover
Zen and later.
On older families (K8, Bobcat, Jaguar/16h, Bulldozer) libpmc finds no
pmu-events entry and falls back to the legacy path, which never sets
PMC_F_EV_PMU.

Reviewed by:    mhorne
Approved by:    mhorne
MFC after:      1 week
MFC to:         stable/14, stable/15
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D58468
DeltaFile
+2-4sys/dev/hwpmc/hwpmc_amd.c
+2-41 files

FreeBSD/src f884e82sys/netinet6 ip6_input.c in6.h

netinet6: Tear down IPv6 source address selection policies with rest of IPv6.

This may plug minor leaks which no-one has reported. The default IPv6 source
address selection policy list in FreeBSD is usually limited to 9 entries,
and can be readily inspected with ip6addrctl(8). The policy table is
however instantiated for each VNET.

The leak of a pol instance in delete_addrsel_policyent() was already
plugged by @ae in commit-id ecc5c73, so that change has not been merged.

Do not tear down the sxlocks as glebius has requested, and move the
addrsel_policyent{} declarations further up to avoid redundant forward
declarations as glebius requested for stylistic reasons.

Reviewed by:    ae, pouria
Sponsored by:   Cisco Systems, Inc.
Differential Revision: https://reviews.freebsd.org/D55599
DeltaFile
+28-16sys/netinet6/in6_src.c
+1-0sys/netinet6/ip6_input.c
+1-0sys/netinet6/in6.h
+30-163 files

FreeBSD/src f7c08d8crypto/openssh servconf.h

openssh: Move back UseBlocklist to global config

Revert UseBlocklist from SSHCFG_ALL to SSHCFG_GLOBAL (with
SSHCFG_COPY_NONE), ensuring it can only be set globally in sshd_config
rather than within conditional Match blocks, matching historical
behavior.

Reviewed by:    emaste
Fixes:          bb5c77e9d281 ("OpenSSH: Update to 10.4p1")
Differential Revision:  https://reviews.freebsd.org/D58520
DeltaFile
+1-1crypto/openssh/servconf.h
+1-11 files