FreeBSD/src 4bcc5a3lib/libc/db/btree bt_seq.c

btree/bt_seq.c: Fix two NULL pointer dereferences

This change fixes two NULL pointer dereferences caused by the
__bt_first function.

The first was caused by returning 0 (i.e., RET_SUCCESS) when a key
was not found, causing the caller to dereference an uninitalized
or NULL pointer. The second one was caused by an if statment clobbering
a local variable with a function call result that might be NULL.

Reported by:    clang-tidy
Sponsored by:   Klara, Inc.
Reviewed by:    markj
Obtained from:  https://github.com/apple-oss-distributions/libc (partially)
Differential Revision:  https://reviews.freebsd.org/D54905
DeltaFile
+4-4lib/libc/db/btree/bt_seq.c
+4-41 files

FreeBSD/src af9d113.github CODEOWNERS

CODEOWNERS: Add myself to WPA
DeltaFile
+2-0.github/CODEOWNERS
+2-01 files

FreeBSD/src 19a913c.github CODEOWNERS

CODEOWNERS:     Add myself to Heimdal and MIT KRB5
DeltaFile
+4-0.github/CODEOWNERS
+4-01 files

FreeBSD/src 5b036b2.github CODEOWNERS

CODEOWNERS: Add myself to capsicum-test
DeltaFile
+1-1.github/CODEOWNERS
+1-11 files

FreeBSD/src eda3cd3share/man/man4 vt.4

vt.4: Document that hw.vga.textmode does not apply for UEFI(8) boot

PR:             292598
Approved by:    ziaee, imp
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54842

(cherry picked from commit 28764001b504c3588fd9f8dd6e4c08144d20571c)
DeltaFile
+5-1share/man/man4/vt.4
+5-11 files

FreeBSD/src 051d781share/man/man4 vt.4

vt.4: Document that hw.vga.textmode does not apply for UEFI(8) boot

PR:             292598
Approved by:    ziaee, imp
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54842

(cherry picked from commit 28764001b504c3588fd9f8dd6e4c08144d20571c)
DeltaFile
+5-1share/man/man4/vt.4
+5-11 files

FreeBSD/src 4d36d18share/man/man4 vt.4

vt.4: Document that hw.vga.textmode does not apply for UEFI(8) boot

PR:             292598
Approved by:    ziaee, imp
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54842

(cherry picked from commit 28764001b504c3588fd9f8dd6e4c08144d20571c)
DeltaFile
+5-1share/man/man4/vt.4
+5-11 files

FreeBSD/src a265c8bsys/netinet ip_mroute.c ip_mroute.h

ip_mroute: Convert to using a regular mutex

The multicast routing code was using spin mutexes for packet counting,
but there is no reason to use them instead of regular mutexes, given
that none of this code runs in an interrupt context.  Convert to using
default mutexes.

Reviewed by:    glebius
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54603
DeltaFile
+18-17sys/netinet/ip_mroute.c
+5-5sys/netinet/ip_mroute.h
+23-222 files

FreeBSD/src ef389b7tests/atf_python atf_pytest.py

atf_python: Fix a typo in a type annotation

No functional change intended.

MFC after:      1 week
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
DeltaFile
+1-1tests/atf_python/atf_pytest.py
+1-11 files

FreeBSD/src 0f1e135sys/netinet ip_mroute.c

ip_mroute: EVENTHANDLER_REGISTER does not fail

No functional change intended.

MFC after:      1 week
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
DeltaFile
+0-6sys/netinet/ip_mroute.c
+0-61 files

FreeBSD/src 18d1e67sys/arm64/broadcom/genet if_genet.c

genet: Add a detach routine

PR:             288309
Co-authored by: Mike Belanger <mibelanger at qnx.com>
MFC after:      2 weeks

(cherry picked from commit 96a550e9dd892f24a479da00ead93fbfaafb7733)
DeltaFile
+35-0sys/arm64/broadcom/genet/if_genet.c
+35-01 files

FreeBSD/src d76fb46sys/kern link_elf.c link_elf_obj.c, sys/vm vm_kern.c

linker: Reset DMAP protections in link_elf_unload_file()

On x86, when a preloaded kernel module is unloaded, we free the backing
(physically contiguous) pages.  The ET_REL linker will have adjusted
protections on segments of the preloaded file, which updates the direct
map, so the original protections must be restored when unloading the
module.

Previously this was handled in kmem_bootstrap_free(), but there is no
apparent reason not to handle this within the kernel linker.  Moreover,
we were not resetting permissions in the kernel map on arm64.

Reviewed by:    alc, kib
MFC after:      3 weeks
Differential Revision:  https://reviews.freebsd.org/D54438

(cherry picked from commit 203e5a1eeec1153b0bcb230ccfb90531fa8cbeb5)
DeltaFile
+33-13sys/kern/link_elf.c
+14-0sys/kern/link_elf_obj.c
+0-8sys/vm/vm_kern.c
+47-213 files

FreeBSD/src 196a0ebsys/netinet6 nd6_rtr.c in6.c

in6: Add a helper function to compute expiry times

Tidy up a bunch of places that have the same duplicated logic.  Simplify
callers of in6_init_prefix_ltimes().  No functional change intended.

Reviewed by:    pouria, zlei, tuexen, glebius
MFC after:      2 weeks
Sponsored by:   OPNsense
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54561

(cherry picked from commit fb08f80eaf90eb7ace202d8604634fc181be8980)
DeltaFile
+7-31sys/netinet6/nd6_rtr.c
+13-10sys/netinet6/in6.c
+2-0sys/netinet6/in6.h
+22-413 files

FreeBSD/src a30def1sys/netinet6 in6.c, tests/sys/netinet6 ndp.sh

in6: Modify address prefix lifetimes when updating address lifetimes

When one uses SIOCAIFADDR_IN6 to add a v6 address, it's possible to set
the preferred and valid lifetimes of the address.  If the address
already exists, this ioctl will recalculate and update the expiry times
based on the provided timestamps.

When adding a new address, the lifetimes are inherited by the prefix as
well, but only if we create a new prefix.  If the prefix already exists,
as it will in the case where an address is being updated rather than
being added, we do not touch the prefix lifetimes at all.  This means
that the original address lifetime still applies to the route associated
with that prefix, so when the prefix expires, the route goes away.

This behaviour doesn't make a lot of sense: if the admin updates an
address lifetime, we should ensure that the prefix lifetime is updated
too.  Make that change, ensuring that we do not shorten the prefix
lifetime, as the prefix might be shared among multiple interface
addresses.

    [11 lines not shown]
DeltaFile
+76-0tests/sys/netinet6/ndp.sh
+22-0sys/netinet6/in6.c
+98-02 files

FreeBSD/src 0dba362. RELNOTES

RELNOTES: Document a pf enhancement
DeltaFile
+4-0RELNOTES
+4-01 files

FreeBSD/src b0d9970sys/netpfil/pf pf.c, tests/sys/netpfil/common divapp.c

pf: Pass v6 packets to the divert socket

There is no particular limitation of divert sockets with respect to
IPv6, and the pf.conf man page does not mention the restriction to IPv4.

Extend the divert-to regression tests to exercise the v6 case.

Reviewed by:    igoro, kp, glebius
MFC after:      3 weeks
Sponsored by:   OPNsense
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54847
DeltaFile
+187-62tests/sys/netpfil/pf/divert-to.sh
+1-5sys/netpfil/pf/pf.c
+1-1tests/sys/netpfil/common/divapp.c
+189-683 files

FreeBSD/src 120c0bbshare/man/man4 divert.4

divert: Update divert.4 to mention pf

pf's divert-to action can be used to pass packets to a divert socket,
but divert.4 didn't mention this, only referencing ipfw.  Try to make
the text a bit more general.

Reviewed by:    igoro, kp, glebius
MFC after:      2 weeks
Sponsored by:   OPNsense
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54848
DeltaFile
+15-13share/man/man4/divert.4
+15-131 files

FreeBSD/src 1e233e3lib/libc/db/btree bt_split.c

btree/bt_split.c: Fix a misaligned if statement

Sponsored by:   Klara, Inc.
DeltaFile
+1-1lib/libc/db/btree/bt_split.c
+1-11 files

FreeBSD/src 069a673sys/netinet ip6.h, sys/netinet6 ip6_input.c ip6_output.c

ip6: Remove support for RFC2675 (Jumbo Payload Option)

The Jumbo Payload option was intended to allow the deployment of IPv6 on
networks with a link MTU in excess of 65,735 octets.

Speaking to one of the authors of RFC2675 the networks which motivated
the Jumbo Payload option no longer exist.

FreeBSD does not currently support any links with this capacity and
discussion when this change was first proposed suggested that the loop
back interface had to be patched to test implementation.

As there are no known devices that can carry Jumbo Payloads remove
support.

Reviewed by:    glebius, teuxen, kp
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D19960
DeltaFile
+23-87sys/netinet6/ip6_input.c
+4-106sys/netinet6/ip6_output.c
+14-8sys/netinet6/udp6_usrreq.c
+11-1sys/netinet/ip6.h
+1-2sys/netinet6/ip6_var.h
+53-2045 files

FreeBSD/src 823f158contrib/ofed/libbnxtre verbs.c, sys/dev/bnxt/bnxt_re ib_verbs.c qplib_fp.c

bnxt_re/libbnxtre: Add support for Variable WQE on BCM576xx controllers

Variable size WQE means that each send Work Queue Entry to
HW can use different WQE sizes as opposed to the static WQE
size on the current devices. Set variable WQE mode for BCM576xx
devices. Depth of the Queue will be a multiple of slot which
is 16 bytes. The number of slots should be a multiple of 256
as per the HW requirement.
Initialize the Software shadow queue to hold requests equal to
the number of slots.

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D54525
MFC after: 3 days
DeltaFile
+76-45sys/dev/bnxt/bnxt_re/ib_verbs.c
+59-15sys/dev/bnxt/bnxt_re/qplib_fp.c
+23-8contrib/ofed/libbnxtre/verbs.c
+9-11sys/dev/bnxt/bnxt_re/main.c
+7-9sys/dev/bnxt/bnxt_re/qplib_sp.c
+8-4sys/dev/bnxt/bnxt_re/bnxt_re-abi.h
+182-927 files not shown
+226-9613 files

FreeBSD/src 3a9565csys/dev/bnxt/bnxt_en if_bnxt.c bnxt_ulp.h, sys/dev/bnxt/bnxt_re main.c

bnxt_re: Add support to display board_id in ibv_devinfo output

Added support to display board_id in ibv_devinfo output.
ibv_devinfo util reads the board_id from below sysctl
attribute, so added this sysctl attribute.

sys.class.infiniband.bnxt_reX.board_id

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D54524
MFC after: 3 days
DeltaFile
+20-1sys/dev/bnxt/bnxt_re/main.c
+7-0sys/dev/bnxt/bnxt_en/if_bnxt.c
+2-0sys/dev/bnxt/bnxt_en/bnxt_ulp.h
+1-0sys/dev/bnxt/bnxt_en/bnxt_ulp.c
+1-0sys/dev/bnxt/bnxt_en/bnxt.h
+31-15 files

FreeBSD/src b7d6334sys/dev/bnxt/bnxt_en bnxt_hwrm.c if_bnxt.c, sys/dev/bnxt/bnxt_re ib_verbs.c ib_verbs.h

bnxt_re: Fix active_speed value when two ports are aggregated

Currently driver is not considering the active_lanes while
displaying the speed & width of port and hence it showing
invalid active_speed and active_width values in the ibv_devinfo
command output when two ports are aggregated at hardware level.
Fixed the driver to consider the active_lanes while determining
the active_speed & active_width values.

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D54523
MFC after: 3 days
DeltaFile
+79-29sys/dev/bnxt/bnxt_re/ib_verbs.c
+12-0sys/dev/bnxt/bnxt_re/ib_verbs.h
+6-2sys/dev/bnxt/bnxt_en/bnxt_hwrm.c
+3-1sys/dev/bnxt/bnxt_en/if_bnxt.c
+2-0sys/dev/bnxt/bnxt_en/bnxt.h
+1-0sys/dev/bnxt/bnxt_en/bnxt_ulp.h
+103-322 files not shown
+105-328 files

FreeBSD/src 913e454sys/dev/bnxt/bnxt_en if_bnxt.c bnxt.h, sys/dev/bnxt/bnxt_re qplib_sp.c qplib_res.h

bnxt_en/re: Use FW defined resource limit for RoCE

Check FW flags for status of Resource Limits. If bit
FUNC_QCAPS_RESP_FLAGS_EXT2_SW_MAX_RESOURCE_LIMITS_SUPPORTED
is set, that means FW set the resource limit for L2 and RoCE.
We'll then do the following:

L2 driver would allocate context memory based on what FW reported.
RoCE driver uses FW reported values without capping. These values
are the total FW reported value minus L2 and other components shares.

For example:

FW reported max_qps = 137217 in L2 query, this includes:
5120 for L2
1025 for QP1
131072 for RoCE
L2 will allocate backing store memory for the total.
In RoCE query, we'll get max_qp = 131072 and use it

    [5 lines not shown]
DeltaFile
+17-14sys/dev/bnxt/bnxt_re/qplib_sp.c
+7-2sys/dev/bnxt/bnxt_en/if_bnxt.c
+7-0sys/dev/bnxt/bnxt_re/qplib_res.h
+4-0sys/dev/bnxt/bnxt_en/bnxt.h
+3-0sys/dev/bnxt/bnxt_en/bnxt_hwrm.c
+2-0sys/dev/bnxt/bnxt_en/bnxt_ulp.h
+40-161 files not shown
+42-167 files

FreeBSD/src 92ba9b2contrib/ofed/libbnxtre verbs.c db.c, sys/dev/bnxt/bnxt_re qplib_fp.c main.c

bnxt_re/libbnxtre: Add RoCE support for BCM576xx controllers

Added RoCE support for BCM576xx controllers with below changes,

1. Update the BAR offsets for handling BCM576xx controllers.
Use the values populated by the L2 driver for getting the
Doorbell offsets.

2. Use msn index instead of tail to pull psn table entry.

3. Temporarily disable dbr pacing feature untill it is
fully implemented.

4. Add support for 400G speed.

Reviewed by: ssaxena
Differential Revision: https://reviews.freebsd.org/D54521
MFC after: 3 days
DeltaFile
+30-11sys/dev/bnxt/bnxt_re/qplib_fp.c
+22-15sys/dev/bnxt/bnxt_re/main.c
+11-8sys/dev/bnxt/bnxt_re/ib_verbs.c
+11-2contrib/ofed/libbnxtre/verbs.c
+9-3sys/dev/bnxt/bnxt_re/qplib_res.h
+7-2contrib/ofed/libbnxtre/db.c
+90-4111 files not shown
+113-4317 files

FreeBSD/src 77d71f5sys/dev/cxgbe t4_netmap.c

cxgbe(4): Fix netmap rx behavior with nm_split_rss

The driver should look for active queues and one potential default-queue
in both halves of the split instead of stopping at the first valid
default-queue.

Fixes:          a9f476580eb0 cxgbe(4): fixes for netmap operation with only some queues active
MFC after:      1 week
Sponsored by:   Chelsio Communications
DeltaFile
+1-3sys/dev/cxgbe/t4_netmap.c
+1-31 files

FreeBSD/src 9a5baa9sys/powerpc/aim moea64_native.c

powerpc: disable the TLBIE lock, it's not needed for POWER8

According to POWER8_UM_v1.3_16MAR2016 3.8.3 Translation Lookaside
Buffer (TLB), POWER8 supports lockless TLBIE operations.

Locally Tested:

* IBM POWER8 Revision 2.0, dual socket, 160 threads

Differential Revision:  https://reviews.freebsd.org/D54855
Approved by:    jhibbits
DeltaFile
+5-0sys/powerpc/aim/moea64_native.c
+5-01 files

FreeBSD/src 422c871sys/powerpc/powermac platform_powermac.c

powerpc: add a best-effort SMP time base sync for G5's that need it

There's no timebase freeze platform routine registered on my dual 2.3GHz
G5 PPC970FX Apple PowerMac.

For platforms without an explicit timebase freeze/unfreeze, we'll have to
make do with what we have - which for now is an explicit hand-crafted
spinlock/rendezvous method.

* For existing platforms, they'll still continue to clock freeze /
  rendezvous; albeit with some stronger atomic bits now (from jhibbits@.)
* Instead of the fallback being "no timesync", implement a
  best-effort one which does a similar rendezvous barrier between
  BSP and APs, but instead of freeze/unfreeze the first instruction
  after the CPUs all register they're ready is to set the timebase.

This has resulted in many reboots of my Powermac G5 dual-socket device
correctly starting and running in SMP mode.


    [2 lines not shown]
DeltaFile
+90-9sys/powerpc/powermac/platform_powermac.c
+90-91 files

FreeBSD/src d47c1c2sbin/setkey setkey.c

sbin/setkey: add -Z option to disable receive timeouts

Sponsored by:   NVidia networking
MFC after:      1 week
DeltaFile
+15-9sbin/setkey/setkey.c
+15-91 files

FreeBSD/src 96e697bsys/amd64/include ifunc.h, sys/i386/include ifunc.h

x86: add machine/ifunc.h

(cherry picked from commit 2b1db07bec92e9447e6574a74366d4dd606e80a6)
DeltaFile
+5-0sys/amd64/include/ifunc.h
+5-0sys/i386/include/ifunc.h
+10-02 files

FreeBSD/src a984c23sys/compat/freebsd32 freebsd32.h, sys/sys abi_compat.h

compat32: provide a type and a macro for (u)int64_t handling on non-x86 arches

(cherry picked from commit 96acaa960023c20e852e04e7cc5c6a5faca36c67)
DeltaFile
+10-1sys/compat/freebsd32/freebsd32.h
+8-0sys/sys/abi_compat.h
+18-12 files