FreeBSD/src 0083a4dtests/sys/kern procdesc.c

tests/procdesc: Add some test cases for pdopenpid()

Reviewed by:    kib
MFC with:       5c32aa785184 ("kern: add pdopenpid(2)")
Differential Revision:  https://reviews.freebsd.org/D58023
DeltaFile
+467-0tests/sys/kern/procdesc.c
+467-01 files

FreeBSD/src 3e3752csys/net if_bridge.c

if_bridge: Remove unused disable parameter in bridge_stop

The ```int disable``` parameter is included in the bridge_stop function
signature but is not used in the function body.

I had noticed this when tracing the driver's path while learning more
about the ifnet library.

This parameter originally appeared when importing the driver from NetBSD.
However, the FreeBSD ifnet library no longer requires an if_stop function.
Meaning that the function signature can be changed to only contain needed
parameters for our bridge driver.

Discussed with: freebsd-net@ mailing list
Signed-off-by:  Acesp25 <acesp25 at freebsd.org>
Reviewed by:    kp
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2290
DeltaFile
+5-5sys/net/if_bridge.c
+5-51 files

FreeBSD/src 07f780csys/dev/mlx5 mlx5_ifc.h driver.h, sys/dev/mlx5/mlx5_core mlx5_srq.c

mlx5: propagate the DEVX uid through SRQ create and destroy

The SRQ command builders never stamped the owning DEVX uid into the
firmware CREATE_SRQ/CREATE_RMP/CREATE_XRC_SRQ commands, so a basic SRQ
was always created with uid 0.  Every modern libmlx5 context runs with a
DEVX uid, and the QPs that reference the SRQ carry that uid, so firmware
rejected CREATE_QP with "bad resource": a uid-owned QP may not reference
a uid-0 SRQ.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah at nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 month
DeltaFile
+27-3sys/dev/mlx5/mlx5_core/mlx5_srq.c
+1-1sys/dev/mlx5/mlx5_ifc.h
+1-0sys/dev/mlx5/driver.h
+29-43 files

FreeBSD/src 284e06dsys/dev/mlx5/mlx5_core mlx5_cq.c

mlx5: guard against a NULL CQ event handler in mlx5_cq_event()

DEVX and mlx5en created CQs are registered without an asynchronous
event handler (mcq.event is NULL).  An asynchronous CQ_ERROR event for
such a CQ made mlx5_cq_event() call through a NULL pointer and panic.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah at nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 month
DeltaFile
+2-1sys/dev/mlx5/mlx5_core/mlx5_cq.c
+2-11 files

FreeBSD/src 0e9bbbdsys/dev/mlx5/mlx5_core mlx5_eq.c

mlx5: pass the full EQE to the DEVX event notifier

The DEVX event notifier and its helpers expect a full struct mlx5_eqe
and read eqe->data from it, but mlx5_eq_int() passed &eqe->data, so the
data offset was applied twice.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah at nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 month
DeltaFile
+1-1sys/dev/mlx5/mlx5_core/mlx5_eq.c
+1-11 files

FreeBSD/src a729866sys/ofed/drivers/infiniband/core ib_uverbs_main.c

ofed/ib_uverbs: release rdma_user_mmap entry ref in rdma_umap_close()

Import Linux upstream commit 3411f9f01b76bd88aa6e0e013847ab6479cb4f24.

rdma_umap_priv_init() takes a reference on the rdma_user_mmap entry for
every VMA it maps, but rdma_umap_close() never dropped it.  The entry
was therefore never freed and lingered in ucontext->mmap_xa, tripping
WARN_ON(!xa_empty(&ucontext->mmap_xa)) at context teardown and leaking
the firmware UAR on every context close.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah at nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 month
DeltaFile
+2-0sys/ofed/drivers/infiniband/core/ib_uverbs_main.c
+2-01 files

FreeBSD/src 80902b8sys/dev/mlx5/mlx5_ib mlx5_ib_main.c

mlx5ib: advertise write-combining support for dynamic BlueFlame UARs

Import Linux upstream commit 1f3db161881b7e21efb149e0ae8152b79a571a8f.

dev->wc_support was never set, so it was always false and the UAR ioctl
refused BlueFlame (write-combining) UAR allocations with EOPNOTSUPP.
That breaks QP creation in pure dynamic-UAR mode, where user space asks
for a BF doorbell UAR.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah at nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 month
DeltaFile
+10-0sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
+10-01 files

FreeBSD/src 631e57dsys/dev/mlx5/mlx5_ib mlx5_ib_main.c mlx5_ib.h

mlx5ib: encode dynamic UAR mmap offsets in the reserved command range

The UAR ioctl handed user space a raw mmap offset, so the first dynamic
UAR landed at page offset 0.  mlx5_ib_mmap() decodes offset 0 as the
legacy regular-page command and routed the mapping through the old bfreg
path, which rejects dynamic-UAR contexts, so mmap() failed with EINVAL
and mlx5dv_devx_alloc_uar() returned NULL.

Follow the upstream scheme: reserve the mmap command range [9, 255] for
rdma_user_mmap entries and return command-encoded offsets, so the
dynamic-UAR mappings decode to the intended mlx5_ib_mmap() path.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah at nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 month
DeltaFile
+21-3sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
+11-0sys/dev/mlx5/mlx5_ib/mlx5_ib.h
+32-32 files

FreeBSD/src 412aa22sys/dev/mlx5/mlx5_ib mlx5_ib_main.c

mlx5ib: allocate IB queue counters as a shared resource

A QP owned by a DEVX uid references the port's queue counter.  The
counter was allocated with uid 0, so RST2INIT_QP on a uid-owned QP
failed with "bad resource state".

Allocate and free the IB queue counters directly and, on devices that
support user contexts, stamp them with MLX5_SHARED_RESOURCE_UID so
uid-owned QPs can use them.

The code follows the Linux commit d2c8a1554c10d5e0443b1f97f480d7dacd55cf55
("IB/mlx5: Enable UAR to have DevX UID").

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah at nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 month
DeltaFile
+26-6sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
+26-61 files

FreeBSD/src bfe14bfsys/dev/mlx5 mlx5_ifc.h, sys/dev/mlx5/mlx5_core mlx5_eq.c

mlx5: mark completion EQs as a shared resource for DEVX uids

A firmware object owned by a DEVX uid may only reference resources owned
by the same uid or ones explicitly marked as shared.  Completion EQs
were created with uid 0, so a CQ owned by a DEVX uid could not attach to
its EQ and CREATE_CQ failed with "bad resource".

Create completion EQs with MLX5_SHARED_RESOURCE_UID on devices that
support user contexts, so uid-owned CQs can use them.

The code follows the Linux commit d2c8a1554c10d5e0443b1f97f480d7dacd55cf55
("IB/mlx5: Enable UAR to have DevX UID").

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah at nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 month
DeltaFile
+8-0sys/dev/mlx5/mlx5_core/mlx5_eq.c
+7-1sys/dev/mlx5/mlx5_ifc.h
+15-12 files

FreeBSD/src b7ca46bsys/dev/mlx5 mlx5_ifc.h, sys/dev/mlx5/mlx5_ib mlx5_ib_main.c

mlx5ib: implement the MLX5_IB_OBJECT_UAR ioctl object

Import Linux upstream commit 342ee59de98a2ecdf15a46849a2534e7c808eb1f.

The dynamic UAR object was declared in the ABI headers but had no handler,
so the ioctl was rejected and dynamic-UAR contexts could not allocate a
doorbell UAR at all.

Implement the alloc and destroy methods following the upstream driver:
grab a UAR stamped with the caller's DEVX uid, expose it to user space
through an rdma_user_mmap entry (write-combining or non-cached as
requested), and free it on destroy.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah at nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 month
DeltaFile
+162-1sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
+2-2sys/dev/mlx5/mlx5_ifc.h
+164-32 files

FreeBSD/src 705d6cfsys/dev/mlx5/mlx5_ib mlx5_ib_main.c mlx5_ib.h

mlx5_ib: register DEVX objects in the uverbs ioctl parse tree

Import Linux upstream commits a8b92ca1b0e5ce620e425e9d2f89ce44f1a82a82
and c59450c463695a016e823175bac421cff219935d.

The DEVX object and method definitions were already present, but nothing
pointed ib_device.driver_def at them.  ibcore therefore never merged
them into the uverbs uapi tree and every DEVX ioctl came back as
EPROTONOSUPPORT.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah at nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 month
DeltaFile
+20-2sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
+1-0sys/dev/mlx5/mlx5_ib/mlx5_ib.h
+21-22 files

FreeBSD/src 2e3b3cesys/dev/mlx5/mlx5_core mlx5_eq.c, sys/dev/mlx5/mlx5_ib mlx5_ib_devx.c

mlx5_ib: do not consume CMD/PAGE_REQUEST events in the DEVX notifier

DEVX event notifier returned true for the command-completion and
page-request events. This is causing mlx5_eq_int() to skip the core EQ
handler, so the firmware command interface and the page supply stop
being serviced and the device wedges.

This commit also make notifier registration and dispatch safe against
the EQ interrupt running concurrently: publish the table pointer before
the callback and load it with acquire semantics. run the callback under
RCU, and drain it with synchronize_rcu() on teardown. Otherwise the
interrupt handler could observe a half-initialized notifier or race with
cleanup.

Reviewed by:    kib
Tested by:      Wafa Hamzah <wafah at nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 month
DeltaFile
+28-7sys/dev/mlx5/mlx5_ib/mlx5_ib_devx.c
+30-3sys/dev/mlx5/mlx5_core/mlx5_eq.c
+58-102 files

FreeBSD/src 716bb8dsys/ofed/include/uapi/rdma mlx5-abi.h

mlx5: extend mlx5_ib_create_cq struct with fields from the current Linux ABI

This is backward ABI-compatible, because the only place in kernel that
uses the structure, namely the mlx5_ib_cq.c:mlx5_ib_create_cq()
function, copies in as much structure members as provided by userspace.

Tested by:      Wafa Hamzah <wafah at nvidia.com>
Sponsored by:   Nvidia networking
MFC after:      1 month
DeltaFile
+4-0sys/ofed/include/uapi/rdma/mlx5-abi.h
+4-01 files

FreeBSD/src 77a6696libarchive/test test_read_format_rar_newsub_rr_over_1m.rar.uu test_read_format_zip_winzip_aes256_large_zstd.zip.uu

Update vendor/libarchive to 3.8.8

New features in 3.8.8:
 #2685 add support for reading encrypted zipx formats
       (bzip2, lzma, ppmd, xz, zstd)

Bugfixes between 3.8.7 and 3.8.8:

Core:
 #2905 Fix NULL pointer increment in archive_acl_from_text_nl
 #2927 archive_match: Prevent call stack overflow
 #2928 pathmatch: Treat anchors not special without flags
 #2942 fix `archive_entry_set_mode` & `archive_entry_set_perm`
 #2957 Fix a double-free in the link resolver
 #2971 Fix mem leaks found with ASAN-enabled test suites
 #2988 Fix buffer overrun and wrong output for NULL-name ACL entries
 #2998, §3009: archive_read: FATAL should be sticky for all API calls
 #3010 Date parsing: reject dates with numbers of more than 4 digits
 #3011 acl: parser out-of-bounds read

    [111 lines not shown]
DeltaFile
+23,307-0libarchive/test/test_read_format_rar_newsub_rr_over_1m.rar.uu
+2,053-0libarchive/test/test_read_format_zip_winzip_aes256_large_zstd.zip.uu
+1,898-0libarchive/test/test_read_format_zip_winzip_aes256_large_xz.zip.uu
+1,893-0libarchive/test/test_read_format_zip_winzip_aes256_large_lzma.zip.uu
+1,616-0libarchive/test/test_read_format_zip_winzip_aes256_large_bzip2.zip.uu
+1,399-0libarchive/test/test_read_format_zip_winzip_aes256_large_ppmd.zip.uu
+32,166-0353 files not shown
+43,965-3,364359 files

FreeBSD/src 849a51alib/libsys pdfork.2

pdfork.2: grammar

Submitted by:   des
MFC after:      1 week
DeltaFile
+3-1lib/libsys/pdfork.2
+3-11 files

FreeBSD/src 134a4c7gnu COPYING.LIB COPYING, gnu/lib/tests Makefile.depend

Retire the GNU subtree

With GNU diff and cdialog gone, this is now an empty shell.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D55425
DeltaFile
+0-481gnu/COPYING.LIB
+0-339gnu/COPYING
+0-10gnu/tests/Makefile.depend
+0-10gnu/usr.bin/tests/Makefile.depend
+0-10gnu/Makefile
+0-10gnu/lib/tests/Makefile.depend
+0-86014 files not shown
+11-90520 files

FreeBSD/src af202a5contrib/dialog configure aclocal.m4

Retire dialog

This is the last remaining piece of GPL software in the base system.
The installer transitioned to bsddialog four years ago, and the last
remaining dialog consumer, dpv, was turned off more than two years ago.
Retire dpv, libdpv, libfigpar (used only by dpv), and dialog itself.

Reviewed by:    dteske
Differential Revision:  https://reviews.freebsd.org/D55424
DeltaFile
+0-27,284contrib/dialog/configure
+0-7,150contrib/dialog/aclocal.m4
+0-3,823contrib/dialog/dialog.3
+0-3,047contrib/dialog/util.c
+0-2,461contrib/dialog/CHANGES
+0-2,144contrib/dialog/dialog.c
+0-45,909384 files not shown
+28-95,078390 files

FreeBSD/src aad298ccontrib/openresolv resolvconf.in

openresolv: Trim leading dot from domain name

Merge upstream change d9f6b1a2d292

PR:             296305
MFC after:      1 week

(cherry picked from commit 4b26ea54713941243b3a0d4263bebbf192ee68c7)
DeltaFile
+3-0contrib/openresolv/resolvconf.in
+3-01 files

FreeBSD/src ec02e4alibexec/rc rc.firewall

rc.firewall: Use checkyesno for boolean variables

Use the checkyesno function from rc.subr instead of hardcoded checks for
boolean variables.  Also drop an incorrect comment about the default
logamount value; the actual default is zero (unlimited).

MFC after:      1 week
Reviewed by:    kevans, allanjude
Differential Revision:  https://reviews.freebsd.org/D57678

(cherry picked from commit a3c077c1ccbe57ffad6317879bc1e49291892414)
DeltaFile
+19-34libexec/rc/rc.firewall
+19-341 files

FreeBSD/src 973d1f2usr.sbin/unbound/setup local-unbound-setup.sh

local-unbound-setup: Support IPv6-only systems

* In the server configuration, disable protocols not supported by the
  kernel.

* In resolv.conf, instead of only using 127.0.0.1, use either 127.0.0.1,
  ::1, or both depending on which protocols the kernel supports.

MFC after:      1 week
Reviewed by:    jlduran
Differential Revision:  https://reviews.freebsd.org/D57840

(cherry picked from commit f0a861efbafeb81428d5e8c23dac9da73fe14007)
DeltaFile
+40-10usr.sbin/unbound/setup/local-unbound-setup.sh
+40-101 files

FreeBSD/src 10075balibexec/rc rc.firewall rc.conf

rc.firewall: Support on-disk lists

For firewall_allowservices and firewall_trusted, if an element of the
list looks like an absolute path, read the file, skipping comments and
blank lines, and treat the first word on each line as an address or
subnet to be added to the list.

We should probably be using tables instead, but this is still an
improvement over the status quo ante.

MFC after:      1 week
Relnotes:       yes
Reviewed by:    allanjude
Differential Revision:  https://reviews.freebsd.org/D57679

(cherry picked from commit a71abf38e2b46c02965f3224c62bb6ef1971996e)
DeltaFile
+32-11libexec/rc/rc.firewall
+7-4libexec/rc/rc.conf
+39-152 files

FreeBSD/src 546b456libexec/rc/rc.d tmp

rc.d/tmp: Fix dupe mount check

Before mounting a new mfs on /tmp, we check if there already is one.
However, the dupe check only takes /dev/md[0-9]* into account, while the
default mfs type these days is tmpfs.  Rewrite it to look for tmpfs as
well.

Note that the dupe check is redundant in the tmpmfs=auto case, but we
leave moving it for later.

PR:             182035
MFC after:      1 week
Reviewed by:    kevans, allanjude
Differential Revision:  https://reviews.freebsd.org/D57682

(cherry picked from commit 45efa4e61623e3eeee7fd0a3f4436616e24c8e98)
DeltaFile
+9-4libexec/rc/rc.d/tmp
+9-41 files

FreeBSD/src 25a3e50libexec/rc/rc.d ddb

rc.d/ddb: Really silently exit

The comment says “silently exit if ddb is not enabled”, but we'd exit
with an error message.

Note that I switched the sysctl variable used to test for the presence
of ddb from debug.ddb.scripting.scripts to d.d.s.script, which has a
smaller value if set.

While here, drop a pointless fork-exec, and use ${SYSCTL_N} for
consistency.

PR:             177217
MFC after:      1 week
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57686

(cherry picked from commit b0d3a2889a1b8e4b73ad1f396884224e1442b214)
DeltaFile
+2-2libexec/rc/rc.d/ddb
+2-21 files

FreeBSD/src ba40331usr.sbin/unbound/setup local-unbound-setup.sh

local-unbound-setup: Support IPv6-only systems

* In the server configuration, disable protocols not supported by the
  kernel.

* In resolv.conf, instead of only using 127.0.0.1, use either 127.0.0.1,
  ::1, or both depending on which protocols the kernel supports.

MFC after:      1 week
Reviewed by:    jlduran
Differential Revision:  https://reviews.freebsd.org/D57840

(cherry picked from commit f0a861efbafeb81428d5e8c23dac9da73fe14007)
DeltaFile
+40-10usr.sbin/unbound/setup/local-unbound-setup.sh
+40-101 files

FreeBSD/src 7d350f5libexec/rc/rc.d tmp

rc.d/tmp: Fix dupe mount check

Before mounting a new mfs on /tmp, we check if there already is one.
However, the dupe check only takes /dev/md[0-9]* into account, while the
default mfs type these days is tmpfs.  Rewrite it to look for tmpfs as
well.

Note that the dupe check is redundant in the tmpmfs=auto case, but we
leave moving it for later.

PR:             182035
MFC after:      1 week
Reviewed by:    kevans, allanjude
Differential Revision:  https://reviews.freebsd.org/D57682

(cherry picked from commit 45efa4e61623e3eeee7fd0a3f4436616e24c8e98)
DeltaFile
+9-4libexec/rc/rc.d/tmp
+9-41 files

FreeBSD/src fcbe16dlibexec/rc/rc.d ddb

rc.d/ddb: Really silently exit

The comment says “silently exit if ddb is not enabled”, but we'd exit
with an error message.

Note that I switched the sysctl variable used to test for the presence
of ddb from debug.ddb.scripting.scripts to d.d.s.script, which has a
smaller value if set.

While here, drop a pointless fork-exec, and use ${SYSCTL_N} for
consistency.

PR:             177217
MFC after:      1 week
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D57686

(cherry picked from commit b0d3a2889a1b8e4b73ad1f396884224e1442b214)
DeltaFile
+2-2libexec/rc/rc.d/ddb
+2-21 files

FreeBSD/src 4fff1e9contrib/openresolv resolvconf.in

openresolv: Trim leading dot from domain name

Merge upstream change d9f6b1a2d292

PR:             296305
MFC after:      1 week

(cherry picked from commit 4b26ea54713941243b3a0d4263bebbf192ee68c7)
DeltaFile
+3-0contrib/openresolv/resolvconf.in
+3-01 files

FreeBSD/src 90244a3libexec/rc rc.firewall

rc.firewall: Use checkyesno for boolean variables

Use the checkyesno function from rc.subr instead of hardcoded checks for
boolean variables.  Also drop an incorrect comment about the default
logamount value; the actual default is zero (unlimited).

MFC after:      1 week
Reviewed by:    kevans, allanjude
Differential Revision:  https://reviews.freebsd.org/D57678

(cherry picked from commit a3c077c1ccbe57ffad6317879bc1e49291892414)
DeltaFile
+19-34libexec/rc/rc.firewall
+19-341 files

FreeBSD/src 3aec740libexec/rc rc.firewall rc.conf

rc.firewall: Support on-disk lists

For firewall_allowservices and firewall_trusted, if an element of the
list looks like an absolute path, read the file, skipping comments and
blank lines, and treat the first word on each line as an address or
subnet to be added to the list.

We should probably be using tables instead, but this is still an
improvement over the status quo ante.

MFC after:      1 week
Relnotes:       yes
Reviewed by:    allanjude
Differential Revision:  https://reviews.freebsd.org/D57679

(cherry picked from commit a71abf38e2b46c02965f3224c62bb6ef1971996e)
DeltaFile
+32-11libexec/rc/rc.firewall
+7-4libexec/rc/rc.conf
+39-152 files