FreeBSD/src 38edf96tests/sys/netpfil/ipfw log.sh

tests/ipfw: fix log:bpf test flakyness

There were several problems:

o Using 'netstat -B' is not a reliable way to make sure that all tcpdumps
  have attached to bpf(4).  The problem is that tcpdump (via libpcap) does
  several ioctl(2)s after the attach including two BIOCSETF.  Each of them
  flushes the input buffer.  So we can see tcpdump attached in 'netstat -B'
  and start sending packets and the packet will be captured by bpf(4)
  before BIOCSETF and freed and tcpdump won't read anything.  Instead of
  using netstat(1), use ps(1) and make sure each tcpdump is blocked on the
  "bpf" wait channel, which guarantees it is done with ioctl(2)s and is now
  blocked in read(2).
o Using 'nc -w 0' sets timeout not only on the connect(2) (as documented)
  but also on poll(2), which is not documented.  There is a race in shell
  that will make stdin not yet filled by 'echo foo' when nc(1) does
  poll(2).  With zero timeout, this poll(2) will immediately return and nc
  will exit.
o The waiting loop had two errors: using wrong variable name as well as

    [7 lines not shown]
DeltaFile
+11-8tests/sys/netpfil/ipfw/log.sh
+11-81 files

FreeBSD/src d60082fsys/netpfil/pf pf.c

pf: avoid NULL deref on purged states

States can be invalidated and still be present in the state table for a
while (until the pf_purge thread cleans them up). These states might not
have keys set, so we must make sure a state is not purged before we try
to access those keys.

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

FreeBSD/src e1e18ccsys/net if_gre.c if_gre.h, sys/netlink/route interface.h

if_gre: Add netlink support with tests

Migrate to new if_clone KPI and implement netlink support
for gre(4). Also refactor some of the gre specific ioctls.

Reviewed by: glebius, zlei
Differential Revision: https://reviews.freebsd.org/D54443
DeltaFile
+407-66sys/net/if_gre.c
+173-0tests/sys/netlink/test_rtnl_gre.c
+23-0sys/netlink/route/interface.h
+1-0tests/sys/netlink/Makefile
+1-0sys/net/if_gre.h
+605-665 files

FreeBSD/src 07d29f9sbin/conscontrol conscontrol.8, share/man/man4 smb.4 ahd.4

Correct Identifer typo in SPDX tags
DeltaFile
+1-1usr.sbin/kbdcontrol/kbdcontrol.1
+1-1usr.sbin/devinfo/devinfo.8
+1-1usr.bin/man/manpath.1
+1-1share/man/man4/smb.4
+1-1share/man/man4/ahd.4
+1-1sbin/conscontrol/conscontrol.8
+6-66 files

FreeBSD/src 7e31358usr.bin/beep beep.c

beep: Add SPDX-License-Identifier tag

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
DeltaFile
+2-0usr.bin/beep/beep.c
+2-01 files

FreeBSD/src 1e36ee7share/man/man7 mitigations.7

mitigations.7: spell
DeltaFile
+2-2share/man/man7/mitigations.7
+2-21 files

FreeBSD/src ddefff3sys/contrib/openzfs/include/os/freebsd/spl/sys time.h

Merge commit bfb276e55c76 from upstream OpenZFS (by Jessica Clarke)

  Once upon a time, 32-bit PowerPC did indeed have a 32-bit time_t, but
  FreeBSD 12.0 switched to a 64-bit time_t for PowerPC as an ABI break,
  which predates the addition of FreeBSD support to OpenZFS. Moreover,
  64-bit PowerPC has existed since FreeBSD 9.0, where __powerpc__ is also
  defined (alongside __powerpc64__ to disambiguate), which has always had
  a 64-bit time_t. This code has therefore always been wrong for all
  PowerPC variants. Fix this by limiting the 32-bit case to just i386,
  which is the only architecture in FreeBSD to have a 32-bit time_t and
  not have broken ABI, due to its special legacy compatibility status.

  Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
  Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
  Signed-off-by: Jessica Clarke <jrtc27 at jrtc27.com>
  Closes #18217
  Closes #18218

Reported by:    fuz

    [3 lines not shown]
DeltaFile
+1-1sys/contrib/openzfs/include/os/freebsd/spl/sys/time.h
+1-11 files

FreeBSD/src 354cc5esys/contrib/openzfs/include/os/freebsd/spl/sys time.h

Merge commit bfb276e55c76 from upstream OpenZFS (by Jessica Clarke)

  Once upon a time, 32-bit PowerPC did indeed have a 32-bit time_t, but
  FreeBSD 12.0 switched to a 64-bit time_t for PowerPC as an ABI break,
  which predates the addition of FreeBSD support to OpenZFS. Moreover,
  64-bit PowerPC has existed since FreeBSD 9.0, where __powerpc__ is also
  defined (alongside __powerpc64__ to disambiguate), which has always had
  a 64-bit time_t. This code has therefore always been wrong for all
  PowerPC variants. Fix this by limiting the 32-bit case to just i386,
  which is the only architecture in FreeBSD to have a 32-bit time_t and
  not have broken ABI, due to its special legacy compatibility status.

  Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
  Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
  Signed-off-by: Jessica Clarke <jrtc27 at jrtc27.com>
  Closes #18217
  Closes #18218

Reported by:    fuz

    [3 lines not shown]
DeltaFile
+1-1sys/contrib/openzfs/include/os/freebsd/spl/sys/time.h
+1-11 files

FreeBSD/src a82128dsys/contrib/openzfs/include/os/freebsd/spl/sys time.h

Merge commit bfb276e55c76 from upstream OpenZFS (by Jessica Clarke)

  Once upon a time, 32-bit PowerPC did indeed have a 32-bit time_t, but
  FreeBSD 12.0 switched to a 64-bit time_t for PowerPC as an ABI break,
  which predates the addition of FreeBSD support to OpenZFS. Moreover,
  64-bit PowerPC has existed since FreeBSD 9.0, where __powerpc__ is also
  defined (alongside __powerpc64__ to disambiguate), which has always had
  a 64-bit time_t. This code has therefore always been wrong for all
  PowerPC variants. Fix this by limiting the 32-bit case to just i386,
  which is the only architecture in FreeBSD to have a 32-bit time_t and
  not have broken ABI, due to its special legacy compatibility status.

  Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
  Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
  Signed-off-by: Jessica Clarke <jrtc27 at jrtc27.com>
  Closes #18217
  Closes #18218

Reported by:    fuz

    [3 lines not shown]
DeltaFile
+1-1sys/contrib/openzfs/include/os/freebsd/spl/sys/time.h
+1-11 files

FreeBSD/src 45c1e44sys/contrib/openzfs/include/os/freebsd/spl/sys time.h

Merge commit bfb276e55c76 from upstream OpenZFS (by Jessica Clarke)

  Once upon a time, 32-bit PowerPC did indeed have a 32-bit time_t, but
  FreeBSD 12.0 switched to a 64-bit time_t for PowerPC as an ABI break,
  which predates the addition of FreeBSD support to OpenZFS. Moreover,
  64-bit PowerPC has existed since FreeBSD 9.0, where __powerpc__ is also
  defined (alongside __powerpc64__ to disambiguate), which has always had
  a 64-bit time_t. This code has therefore always been wrong for all
  PowerPC variants. Fix this by limiting the 32-bit case to just i386,
  which is the only architecture in FreeBSD to have a 32-bit time_t and
  not have broken ABI, due to its special legacy compatibility status.

  Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
  Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
  Signed-off-by: Jessica Clarke <jrtc27 at jrtc27.com>
  Closes #18217
  Closes #18218

Reported by:    fuz
MFC after:      1 day
DeltaFile
+1-1sys/contrib/openzfs/include/os/freebsd/spl/sys/time.h
+1-11 files

FreeBSD/src 589cef5lib/libfetch common.c

libfetch: Restore timeout functionality

PR:             293124
MFC after:      1 week
Fixes:          792ef1ae7b94 ("Refactor fetch_connect() and fetch_bind() to improve readability and avoid repeating the same DNS lookups.")
Reverts:        8f8a7f6fffd7 ("libfetch: apply timeout to SSL_read()")
Reviewed by:    eugen, imp
Differential Revision:  https://reviews.freebsd.org/D55293

(cherry picked from commit 73b82d1b0a2f09224e6d0f7a13dd73c66d740207)
(insta-mfc requested by re@)
DeltaFile
+8-11lib/libfetch/common.c
+8-111 files

FreeBSD/src d97c824lib/libfetch common.c

libfetch: Restore timeout functionality

PR:             293124
MFC after:      1 week
Fixes:          792ef1ae7b94 ("Refactor fetch_connect() and fetch_bind() to improve readability and avoid repeating the same DNS lookups.")
Reverts:        8f8a7f6fffd7 ("libfetch: apply timeout to SSL_read()")
Reviewed by:    eugen, imp
Differential Revision:  https://reviews.freebsd.org/D55293

(cherry picked from commit 73b82d1b0a2f09224e6d0f7a13dd73c66d740207)
(insta-mfc requested by re@)
DeltaFile
+3-8lib/libfetch/common.c
+3-81 files

FreeBSD/src ae12f0flib/libfetch common.c

libfetch: Restore timeout functionality

PR:             293124
MFC after:      1 week
Fixes:          792ef1ae7b94 ("Refactor fetch_connect() and fetch_bind() to improve readability and avoid repeating the same DNS lookups.")
Reverts:        8f8a7f6fffd7 ("libfetch: apply timeout to SSL_read()")
Reviewed by:    eugen, imp
Differential Revision:  https://reviews.freebsd.org/D55293

(cherry picked from commit 73b82d1b0a2f09224e6d0f7a13dd73c66d740207)
(insta-mfc requested by re@)
DeltaFile
+3-8lib/libfetch/common.c
+3-81 files

FreeBSD/src d379432sys/kern kern_event.c, sys/sys event.h

kqueue: Make kn_sfflags unsigned

This is used to hold a copy of the original fflags, which is unsigned.

MFC after:      3 days
Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D55348
DeltaFile
+1-1sys/kern/kern_event.c
+1-1sys/sys/event.h
+2-22 files

FreeBSD/src d540446usr.bin/diff diffreg_new.c

diff: Drop unnecessary casts, fix none algo

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55349
DeltaFile
+7-6usr.bin/diff/diffreg_new.c
+7-61 files

FreeBSD/src 009be09bin/sh sh.1

sh.1: Reference editline(7)

Key bindings for command line editing are documented in editline(7).

MFC after:              3 days
Reviewed by:            jilles, ziaee
Differential Revision:  https://reviews.freebsd.org/D54767
DeltaFile
+14-3bin/sh/sh.1
+14-31 files

FreeBSD/src 59b7f3esbin/devd devd.conf.5

devd.conf.5: Fix cross-references to devfs(4)

Fixes:          1687d77197c0 (man filesystems: move driver pages)
MFC after:      3 days
Reviewed by:    ziaee
Sponsored by:   Defenso
Signed-off-by:  Quentin Thébault <quentin.thebault at defenso.fr>
Closes:         https://github.com/freebsd/freebsd-src/pull/2015
DeltaFile
+4-4sbin/devd/devd.conf.5
+4-41 files

FreeBSD/src d685228sbin/ifconfig ifipsec.c ifstf.c

ifconfig: Add SPDX-License-Identifier tags

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55272
DeltaFile
+2-0sbin/ifconfig/ifipsec.c
+2-0sbin/ifconfig/ifstf.c
+2-0sbin/ifconfig/sfp.c
+6-03 files

FreeBSD/src 835813csbin/devmatch devmatch.c

devmatch: Add SPDX-License-Identifier tag

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55271
DeltaFile
+2-0sbin/devmatch/devmatch.c
+2-01 files

FreeBSD/src 4dc38e7sys/netgraph ng_ksocket.c

ng_ksocket: use new macros to lock socket buffers

PR:             292885
Reported by:    Walker R. Thompson <walker.thompson at urz.uni-heidelberg.de>

(cherry picked from commit 1a3d1be4965afddded0b2582b9c4969c1e6a4129)
DeltaFile
+8-8sys/netgraph/ng_ksocket.c
+8-81 files

FreeBSD/src 8aa5604sys/dev/nvme nvme_sim.c

nvme: Fix sim unit number to match nvme device

The CAM sim unit numbner should match the nvme device number. We need
this to match unit numbers in some wiring scenarios. For example:

hint.nvme.0.at="UEFI:PciRoot(0x3)/Pci(0x1,0x1)/Pci(0x0,0x0)"
hint.nvme.1.at="UEFI:PciRoot(0x3)/Pci(0x1,0x2)/Pci(0x0,0x0)"
hint.nvme.2.at="UEFI:PciRoot(0x3)/Pci(0x1,0x3)/Pci(0x0,0x0)"
hint.nvme.3.at="UEFI:PciRoot(0x3)/Pci(0x1,0x4)/Pci(0x0,0x0)"
hint.scbus.33.at="nvme0"
hint.nda.0.at="scbus33"
hint.scbus.34.at="nvme1"
hint.nda.1.at="scbus34"
hint.scbus.35.at="nvme2"
hint.nda.2.at="scbus35"
hint.scbus.36.at="nvme3"
hint.nda.3.at="scbus36"

If the devices that are nvme0 and nvme3 are the only ones populated, you

    [6 lines not shown]
DeltaFile
+1-1sys/dev/nvme/nvme_sim.c
+1-11 files

FreeBSD/src 8e593a1usr.bin/fortune/datfiles freebsd-tips

fortune: fix netstat tip

netstati <mumble> 8 reports in bytes per second (averaged over 8
seconds) rather than bits per second because it reports the total
in bits over the 8 seconds...

Sponsored by:           Netflix
DeltaFile
+1-1usr.bin/fortune/datfiles/freebsd-tips
+1-11 files

FreeBSD/src 4fb507ctools/tools/git git-arc.sh

git-arc: Tweak heuristic for email address

In the email address heuristic, assume guest-* are external
contributors. It's a new convention, apparently.

Sponsored by:           Netflix
DeltaFile
+1-0tools/tools/git/git-arc.sh
+1-01 files

FreeBSD/src c8d63d6sys/dev/nvme nvme_sim.c

nvme: fix panic if we boot w/o a namespace

If we format a drive, and then crash, we'll come back up. nvme_sim_ns
device won't attach because we don't have a namespace. Some drives (all?
I couldn't find it in the standard) send an AER with a namespace change,
which causes a NULL dereference because s_sim wasn't initialized because
we didn't attach. So, if we get into the ns_changed routine, bail early
if we didn't attach. We'll attach later, and deal with the ns correctly
if it's really there, or not attach one if it's not.

Sponsored by:           Netflix
DeltaFile
+10-0sys/dev/nvme/nvme_sim.c
+10-01 files

FreeBSD/src 9fa21f6lib/libnv/tests nvlist_send_recv_test.c

libnv/tests: unskip nvlist_send_recv__send_many_fds__dgram

The test passes consistently for 1000+ consecutive iterations.

PR:             260891
Reviewed by:    oshogbo
Approved by:    lwhsu (mentor)
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55223

(cherry picked from commit fbe6da7f7592169ad7c26aa563f4c6305de1e345)
DeltaFile
+0-2lib/libnv/tests/nvlist_send_recv_test.c
+0-21 files

FreeBSD/src 7f1e9f9usr.sbin/pw pw.8

pw: make manual page more friendly for uid/gid search

pw.8 structure is quite different from usual manual page, especially in
describing -o option usage.  Specifically, these paragraphs do not
contain "uid/gid" terms, and have "user id"/"group id" instead,
making searching for "override duplicate safety belt" difficult.
Try to simplify such searches.

Also, clarify uid/gid space between 100 and 1000 as "somewhat special",
as it actually is.

Discussed on:   russian telegram FreeBSD group
Reviewed by:    eugen, novel
MFC after:      1 week

(cherry picked from commit e89454417b2bfecce9daee10dece2f49632640d3)
(cherry picked from commit 8a2d04cf8c866ff3a6f358257d7aeeefbdd84455)
DeltaFile
+7-4usr.sbin/pw/pw.8
+7-41 files

FreeBSD/src b2ba413sys/kern subr_intr.c

intrng: Shuffle unhandled interrupts too

When interrupt vectors are first allocated, they get assigned to
CPU #0; at SI_SUB_SMP / SI_ORDER_SECOND (aka once we have multiple
CPUs), the intr_irq_shuffle SYSINIT clears their CPU sets with the
effect of forcing them to be assigned to new CPUs later.

In case where interrupt vectors were allocated *but not yet bound*
this code did not run, with the effect that those interrupts would
remain pinned to CPU #0 forever.  This affected the ena(4) driver,
which allocates interrupts for I/O when the device is attached but
doesn't set them up until the interface is brought up much later in
the boot process (and, crucially, long after intr_irq_shuffle runs).

Adjust intr_irq_shuffle to clear the CPU set for an interrupt source
even if it currently has no handlers, so that it will be properly
assigned to a CPU when it is used later.

Reviewed by:    andrew, mhorne

    [3 lines not shown]
DeltaFile
+13-1sys/kern/subr_intr.c
+13-11 files

FreeBSD/src 349808dsys/dev/pci pci_pci.c

pcib: Assume a window where both the base and limit are 0 is uninitialized

Since the low bits of a window's limit are hardwired to 1, this
configuration looks like a minimally sized window at address 0.
However, PCI resources are not generally at address 0 (see the
__PCI_BAR_ZERO_VALID macro that was only defined on sparc64), and some
PCI-PCI bridges report these register values after a reset.  The
result today is a lot of spam in dmesg as the minimally-sized windows
fail to allocate.  By ignoring these windows and treating them as
closed the end result is the same, but there is less spam during boot.

Reported by:    jrtc27
Differential Revision:  https://reviews.freebsd.org/D43922
DeltaFile
+18-0sys/dev/pci/pci_pci.c
+18-01 files

FreeBSD/src 3a96042sys/arm64/include elf.h

arm64: Add more HWCAP values

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55219
DeltaFile
+21-0sys/arm64/include/elf.h
+21-01 files

FreeBSD/src 743a7f9bin/stty cchar.c extern.h

stty: Add SPDX-License-Identifier tags

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55217
DeltaFile
+2-0bin/stty/cchar.c
+2-0bin/stty/extern.h
+2-0bin/stty/gfmt.c
+2-0bin/stty/key.c
+2-0bin/stty/modes.c
+2-0bin/stty/print.c
+12-03 files not shown
+18-09 files