FreeBSD/src 4007d91usr.sbin/boot0cfg boot0cfg.8 boot0cfg.c

boot0cfg: Also allow a file as a trailing argument

Modify the disk check to allow arbitrary files as the trailing argument
instead of requiring a live GEOM disk provider.

This enables modifying a boot0 binary file in-place before flashing it
to a disk via gpart bootcode, or using it directly as an argument to
mkimg's partition specification, as these tools cannot directly adjust
the parameters of the boot0 boot manager.

Reviewed by:    imp, jhb
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57310
DeltaFile
+34-6usr.sbin/boot0cfg/boot0cfg.c
+26-6usr.sbin/boot0cfg/boot0cfg.8
+60-122 files

FreeBSD/src 728b3b7tools/tools/nanobsd legacy.sh

nanobsd: Restore boot0cfg functionality

The need for this step is fading, now is mostly used to allow the
selection of just the two code partitions in the boot0 boot manager,
instead of the default of allowing all four MBR slices (the other two
being cfg and data, which cannot boot).

Reviewed by:    imp
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57311
DeltaFile
+4-0tools/tools/nanobsd/legacy.sh
+4-01 files

FreeBSD/src 1e39a31sys/kern link_elf.c

link_elf: Make phdrs first page check actually fatal

Otherwise we'll print an error but carry on regardless, presumably
destined to walk off the end of the mapping.

Reported by:    thebugfixers at pm.me
MFC after:      1 week
DeltaFile
+4-1sys/kern/link_elf.c
+4-11 files

FreeBSD/src b6823a9sys/netipsec ipsec.c

ipsec: Fix a lock leak in ipsec_chkreplay()

Reported by:    Chris Jarrett-Davies of the OpenAI Codex Security Team
Reviewed by:    pouria, kp
Fixes:          0361f165f219 ("ipsec: replace SECASVAR  mtx by rmlock")
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58521
DeltaFile
+3-1sys/netipsec/ipsec.c
+3-11 files

FreeBSD/src 1d7b051sys/netinet6 in6_pcb.c

netinet6: Handle unspecified foreign addresses in in6_pcbconnect()

Prior to commit 90ea8e89d9b751e8b5ae90ef3397883b035788e5, this was
handled by calling in6_pcbladdr().

Reported by:    syzkaller
Reviewed by:    pouria, glebius
Fixes:          90ea8e89d9b7 ("netinet6: refactor in6_pcbconnect()")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58518
DeltaFile
+4-4sys/netinet6/in6_pcb.c
+4-41 files

FreeBSD/src 9a9349esys/kern kern_event.c

kqueue: Associate marker knotes with a queue

Otherwise the assertion in KQ_FLUX_SLEEP_WMESG may fail.

kqueue_fork_copy() already handles this.

Fixes:          1f4b0ea4f3eb ("kqueue: Add a helper macro for sleeping on in-flux knotes")
Reported by:    syzkaller
Reported by:    kbowling
Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58516
DeltaFile
+1-0sys/kern/kern_event.c
+1-01 files

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