FreeBSD/src 28ddd11usr.sbin/bsnmpd/modules/snmp_hostres hostres_fs_tbl.c

bsnmpd/snmp_hostres: fix hrFSTable remoteMountPoint leak

Free the previous value before re-strdup'ing, and initialise
remoteMountPoint to NULL in fs_entry_create() so the free() is safe on
the newly-created path

Observed via a dtrace leak snapshot on 15.0-RELEASE-p4:
  data leaked = 1983, count = 1683
    libc.so.7`malloc+0xa8
    snmp_hostres.so.6`fs_tbl_process_statfs_entry+0x276
    snmp_hostres.so.6`refresh_storage_tbl+0x502
    snmp_hostres.so.6`op_hrStorageTable+0x1a
    libbsnmp.so.7`0x2a2b1892ba3d
    libbsnmp.so.7`snmp_getbulk+0x37f

Reviewed by:    sjg, ngie
Differential Revision:  https://reviews.freebsd.org/D57604
DeltaFile
+4-0usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c
+4-01 files

FreeBSD/src 63442cecontrib/ldns configure configure.ac, contrib/ldns/ldns config.h util.h

lsnd: Update to 1.9.2

Merge commit '3750aed65c1f5a610b44d29c92236ca119b62780'
DeltaFile
+13-12contrib/ldns/configure
+4-3contrib/ldns/configure.ac
+2-2contrib/ldns/ldns/config.h
+2-2contrib/ldns/ldns/util.h
+4-0contrib/ldns/Changelog
+25-195 files

FreeBSD/src 4593470contrib/ldns configure config.guess, contrib/ldns/ldns config.h

ldns: Update to 1.9.1

Merge commit '026e5b88eb0cde54d9fc22b9a1ebc79ea0f67aec'
DeltaFile
+15-13contrib/ldns/configure
+11-6contrib/ldns/config.guess
+6-5contrib/ldns/config.sub
+6-4contrib/ldns/configure.ac
+2-2contrib/ldns/ldns/config.h
+4-0contrib/ldns/Changelog
+44-301 files not shown
+46-327 files

FreeBSD/src 3750aed. configure configure.ac, doc ldns_manpages

import ldns 1.9.2
DeltaFile
+371-371doc/ldns_manpages
+13-12configure
+4-3configure.ac
+4-0Changelog
+392-3864 files

FreeBSD/src 026e5b8. net.c configure, doc ldns_manpages

import ldns 1.9.1
DeltaFile
+409-409doc/ldns_manpages
+147-36examples/ldns-testns.c
+90-2net.c
+15-13configure
+21-2examples/ldns-testns.1
+18-2examples/ldns-testpkts.c
+700-4647 files not shown
+744-48113 files

FreeBSD/src f757fdcshare/man/man7 d.7

d.7: Correct a few typos in the manual page

- s/occurance/occurrence/
- s/Univeristy/University/

(cherry picked from commit 8a13adf80cb0dffb9fa7ca515664171c2362ad5e)
DeltaFile
+3-3share/man/man7/d.7
+3-31 files

FreeBSD/src 59bd484sys/compat/linux linux_socket.c linux_socket.h

linux: implement SO_PASSRIGHTS

We have a native version now, plumb it through to the Linuxolator.

Reviewed by:    glebius, markj
Differential Revision:  https://reviews.freebsd.org/D57427
DeltaFile
+2-0sys/compat/linux/linux_socket.c
+1-0sys/compat/linux/linux_socket.h
+3-02 files

FreeBSD/src 2f363fetests/sys/kern unix_passfd_test.c

tests: unix: pull a recvfd_payload_cmsg out of recvfd_payload

This is almost a trivial factoring, but it's still a bit of boilerplate
that we don't care to rewrite- the SO_PASSRIGHTS test will still receive
some data, so the iovec construction still saves us a few lines.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57544
DeltaFile
+16-8tests/sys/kern/unix_passfd_test.c
+16-81 files

FreeBSD/src c08a86etests/sys/kern unix_passfd_test.c

tests: unix: add SCM_RIGHTS tests for SO_PASSRIGHTS

We test both the standard case where we want to reject any SCM_RIGHTS
message, as well as the case where the kernel discards the unwanted file
upon receipt.

Reviewed by:    glebius (previous version), markj
Differential Revision:  https://reviews.freebsd.org/D57426
DeltaFile
+150-0tests/sys/kern/unix_passfd_test.c
+150-01 files

FreeBSD/src 0ae7df3sys/kern uipc_socket.c

sockets: plumb SO_PASSRIGHTS into *sockopt(2)

This is a little different than the others in that it's not valid for
anything but unix(4) sockets.  New cases were added that jump into the
more standard case out of a light preference for not taking advantage of
case FALLTHROUGH with the additional logic- it doesn't scale very well
for new cases added that might be slightly special, so we might as well
just add the labels up-front.

Reviewed by:    glebius, markj
Differential Revision:  https://reviews.freebsd.org/D57424
DeltaFile
+18-0sys/kern/uipc_socket.c
+18-01 files

FreeBSD/src 8a3d283sys/kern uipc_socket.c

socket: remove tautological condition in so_unsplice()

so2rele was introduced in 1000cc4a0d3 and it was necessary there, but
the cleanup in a837d1fe49e0255 rendered it redundant if our own KASSERT
is to be believed: we've asserted that `so2->so_splice_back == sp` and
`sp` has been dereferenced above, so there's no condition left where
we shouldn't release the socket reference at the end.  Indeed, the
change in so_splice() to NULL out sp->dst removes that possible state of
a partially constructed splice: if sp->dst is set, it has been ref'd.

Reviewed by:    gallatin, markj
Differential Revision:  https://reviews.freebsd.org/D57558
DeltaFile
+2-4sys/kern/uipc_socket.c
+2-41 files

FreeBSD/src 9b16399lib/libsys send.2 getsockopt.2, share/man/man4 unix.4

unix: implement basic SO_PASSRIGHTS functionality

With exception to sockopt functionality, implement the so_options flag
in unix(4) itself.  The general argument for the flag is that SCM_RIGHTS
can be used maliciously for, e.g., a DoS that the receiving side can't
avoid if it is expecting other control messages.

This option gives the receiver a way to disable SCM_RIGHTS on the
sender-side, surfacing an EPERM to them instead.  This seems to match
the semantics that Linux offers.

If an SCM_RIGHTS was already sent before we disabled SO_PASSRIGHTS, then
a subsequent recvmsg(2) will silently discard any in-flight files.  This
has the downside of punting a file with the potential to hang over to
the deferred-close task, but perhaps usage of the option would
discourage folks from attempting to take advantage of that possibility
anyways.

Various manpages updated to describe the new behavior.

    [10 lines not shown]
DeltaFile
+47-15sys/kern/uipc_usrreq.c
+12-2lib/libsys/send.2
+12-1share/man/man4/unix.4
+2-1lib/libsys/getsockopt.2
+1-0sys/sys/socket.h
+74-195 files

FreeBSD/src 92bdcb0sys/amd64/conf GENERIC

thunderbolt: do not enable in GENERIC

The thunderbolt implementation is not 100% complete and causes some
suspend/resume issues. Comment out the device until it is better
fleshed out and some of the core issues with it are resolved.

MFC after:      1 week
Requested by:   obiwac
Differential Revision:  https://reviews.freebsd.org/D57650
DeltaFile
+3-1sys/amd64/conf/GENERIC
+3-11 files

FreeBSD/src 32da2f2stand/common gfx_fb.c gfx_fb.h, stand/ficl gfx_loader.c

stand: Bulk operations on each gfxfb_blt if shadow buffer enabled

Previously, gfxfb_blt flushed the framebuffer on every call. Since a
single drawing operation may invoke gfxfb_blt multiple times, this can
result in unnecessary flushes.

Instead, write updates to the shadow buffer (when present) and mark the
affected area as dirty. Flushing is deferred so multiple gfxfb_blt calls
can be coalesced into a single update. As before, only the dirty region
is flushed.

This fixes the slow bootloader problem in some platforms.

Reviewed by:    imp, adrian, obiwac
Tested by:      obiwac, jrm
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57373
DeltaFile
+203-22stand/common/gfx_fb.c
+7-0stand/common/gfx_fb.h
+4-3stand/ficl/gfx_loader.c
+2-1stand/liblua/gfx_utils.c
+216-264 files

FreeBSD/src 943bfadusr.sbin/autofs log.c common.h

autofs: remove dead code

log_set_peer_name() and log_set_peer_addr() were never used

Differential Revision:  https://reviews.freebsd.org/D57164
DeltaFile
+5-61usr.sbin/autofs/log.c
+0-2usr.sbin/autofs/common.h
+5-632 files

FreeBSD/src ac00683usr.sbin/virtual_oss/virtual_oss main.c int.h

virtual_oss(8): Make sndstat FD global

There is no reason to have per-profile copies, plus this way we open
/dev/sndstat multiple times if more than 1 profile is created.

Also close the FD on exit to avoid leaking.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    jrm
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/41

(cherry picked from commit 93a234a694f37d373acf303a247d129dda28044e)
DeltaFile
+9-7usr.sbin/virtual_oss/virtual_oss/main.c
+0-1usr.sbin/virtual_oss/virtual_oss/int.h
+9-82 files

FreeBSD/src 013af29usr.sbin/virtual_oss/virtual_oss main.c int.h

virtual_oss(8): Properly cleanup cuse(3)

virtual_oss(8) does not currently keep track of the cuse(3) it creates,
nor does it destroy any of them on exit, except for the control device.
This is harmless if virtual_oss(8) is killed after all audio streams
have been shut down, but if it's killed during I/O, the process hangs
and/or goes into uninterruptible sleep state.

To fix this, have pointers to all cuse(3) devices, and explicitly
destroy them on exit. Also make sure we don't leak memory in
dup_profile().

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    jrm
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/41

(cherry picked from commit 0bd5ef6b43633a3cf77495a087a9376b2b3b11c9)
DeltaFile
+35-4usr.sbin/virtual_oss/virtual_oss/main.c
+2-0usr.sbin/virtual_oss/virtual_oss/int.h
+37-42 files

FreeBSD/src ea130fasys/dev/virtio/network if_vtnet.c if_vtnetvar.h

virtio_net: Use bus_dma for command/ack buffers

While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.

The virtio buffers are marked as coherent; this should ensure that sync
calls are no-ops in the common cases.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55564
DeltaFile
+285-65sys/dev/virtio/network/if_vtnet.c
+6-0sys/dev/virtio/network/if_vtnetvar.h
+291-652 files

FreeBSD/src 8193fa3sys/dev/virtio/network if_vtnet.c if_vtnetvar.h

virtio_net: Use bus_dma for rxq/txq buffers

While the majority of virtio platforms will be fully coherent, some may
require cache maintenance or other specific device memory handling (eg for
secure partitioning). Using bus_dma allows for these usecases.

The virtio buffers are marked as coherent; this should ensure that sync
calls are no-ops in the common cases.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55492
DeltaFile
+281-17sys/dev/virtio/network/if_vtnet.c
+10-0sys/dev/virtio/network/if_vtnetvar.h
+291-172 files

FreeBSD/src 8fdaa1bsys/kern subr_busdma_bounce.c

busdma_bounce: Allocate bounce buffers as unprotected

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56519
DeltaFile
+3-3sys/kern/subr_busdma_bounce.c
+3-31 files

FreeBSD/src b1af054sys/fs/nfsserver nfs_nfsdserv.c

nfs_nfsdserv.c: Fix setting of birthtime for some ZFS pools

Some ZFS pools do not support va_birthtime and will return
EINVAL when a VOP_SETATTR() of it is attempted.  The MacOS
NFSv4 client sets va_birthtime (TimeCreate) in the same
Setattr with ctime/mtime and other attributes after a new
file is created.  The EINVAL failure leaves these new files
messed up (mode == 0).

This patch pretends the setting of TimeCreate succeeded if
ctime/mtime were also set in the same Setattr RPC, which
resolves the problem for the MacOS client.

If this fix is not sufficient, a new pathconf name to detect
if a file system supports birthtime may be needed.

PR:     296066
Tested by:      Will <freebsd.geography231 at slmails.com>
MFC after:      2 weeks
DeltaFile
+10-0sys/fs/nfsserver/nfs_nfsdserv.c
+10-01 files

FreeBSD/src 06d64eesys/arm64/arm64 gicv5_its.c, sys/conf files.arm64

arm64: Add an initial GICv5 ITS driver

Add a driver to support the GICv5 interrupt translation service (ITS).
The ITS is responsible to handling ITS events & translating them to an
interrupt to be delivered to the interrupt routing service (IRS).

An example event is a MSI or MSI-X is delivered. The ITS will generate
an LPI depending on which device sent the interrupt and the value the
device wrote.

This is a similar concept to the GICv3 ITS, however the implementation
details are different so it needs a new driver.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54251
DeltaFile
+1,239-0sys/arm64/arm64/gicv5_its.c
+1-0sys/conf/files.arm64
+1,240-02 files

FreeBSD/src cbef29bsys/arm64/arm64 gicv5_iwb.c, sys/conf files.arm64

arm64: Add an initial GICv5 IWB driver

Add a driver to support the GICv5 interrupt wire bridge (IWB). The IWB
translates the change in state of an input wire and sends a MSI to
the interrupt translation service (ITS) to be translated to an LPI.

Unlike other MSI sources each wire has a fixed Event ID value it will
write in the MSI data.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54252
DeltaFile
+561-0sys/arm64/arm64/gicv5_iwb.c
+1-0sys/conf/files.arm64
+562-02 files

FreeBSD/src cd94485sys/arm64/arm64 cpu_feat.c, sys/arm64/include cpu_feat.h

arm64: Add FEAT_ALWAYS_ENABLE to cpu_feat

A use for it has been found in the GICv5 driver where we need to read
the Interrupt Affinity ID early in the boot on the secondary CPUs.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D54249
DeltaFile
+12-10sys/arm64/arm64/cpu_feat.c
+6-1sys/arm64/include/cpu_feat.h
+18-112 files

FreeBSD/src c84261dsys/arm64/arm64 gicv5.c gicv5reg.h, sys/conf files.arm64

arm64: Add an initial GICv5 driver

Add an initial driver for the GICv5 interrupt controller.

This provides host-only support for the GICv5 interrupt controller. It
is specified in the ARM-AES-0070 document & based on version 00eac0.

In the GICv5 there are 3 interrupt spaces: PPI, SPI, and LPI. Unlike
previous interrupt controllers they don't share a single interrupt
ID range, so PPI IRQ 1 and SPI IRQ 1 are different interrupts. There
is a common irqsrc stricture that encodes this information as it is
common across the interrupt types.

Unlike previous GIC versions there are no software generated interrupts
that can target a configurable collection of CPUs. These have been
replaced with LPIs, where each CPU will have one allocated for each
IPI type.

This driver handles the CPU interface and interrupt routing service

    [6 lines not shown]
DeltaFile
+1,611-0sys/arm64/arm64/gicv5.c
+711-0sys/arm64/arm64/gicv5reg.h
+300-0sys/arm64/arm64/gicv5_fdt.c
+71-0sys/arm64/arm64/gicv5var.h
+2-0sys/conf/files.arm64
+2,695-05 files

FreeBSD/src a9e12d3sys/arm64/include _armreg.h

arm64: Support building sys/sysl instructions

Add support to build system instructions from a macro. These are based
on the existing support for msr/mrs instructions with adjustments for
the different instruction format.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D57017
DeltaFile
+28-0sys/arm64/include/_armreg.h
+28-01 files

FreeBSD/src fd1ee28share/man/man4 uvideo.4 Makefile

uvideo.4: Initial manual page

Fixes:                  b711ef9c75ba (import uvideo)
Reviewed by:            0mp, bapt, kevans
Differential Revision:  https://reviews.freebsd.org/D57622
DeltaFile
+39-0share/man/man4/uvideo.4
+1-0share/man/man4/Makefile
+40-02 files

FreeBSD/src 1db695eshare/man/man5 style.mdoc.5

style.mdoc.5: Document Nd style

The Nd macro takes the rest of the line as an argument,
so there is no need for extra quoting.

MFC after:      3 days

(cherry picked from commit 4ef1a73c22f8cd07f733bdeb6ff49da28ea8aa93)
DeltaFile
+9-2share/man/man5/style.mdoc.5
+9-21 files

FreeBSD/src ca8a1c3sys/kern subr_witness.c

witness: add tunables debug.witness.lock_order_{data_count,hash_size}

Add tunable debug.witness.lock_order_data_count to allow adjusting the
number of witness lock order data entries (stacks) without recompiling
the kernel.  This may help to display stacks when a lock order reversal
is reported but the number of entries is exhausted before recording the
first lock order, by allowing the user to reboot with an adjusted
tunable and try again.

Tunable debug.witness.lock_order_hash_size is also provided to allow the
hash table load factor to be managed, though that is not required.

Also tweak witness_lock_order_add to avoid computing a hash when it
won't be needed because the lock order data entries are exhausted.

Reviewed by:    kib, markj
Sponsored by:   Dell Inc.
Differential Revision:  https://reviews.freebsd.org/D57600
DeltaFile
+32-7sys/kern/subr_witness.c
+32-71 files

FreeBSD/src 08180f1sys/kern subr_witness.c

witness: actually set read-only tunables in time for witness_startup

SYSCTL_XXX with CTLFLAG_RDTUN and without CTLFLAG_NOFETCH should not be
used for values that are needed before SI_SUB_KLD.  Otherwise they are
tuned after they are needed.  Set CTLFLAG_RDTUN | CTLFLAG_NOFETCH for
the debug.witness.witness_count and debug.witness.skipspin sysctls and
add separate tunables for them, which run at SI_SUB_TUNABLES time, i.e.,
in time for witness_startup.

Reviewed by:    kib, markj
Sponsored by:   Dell Inc.
Differential Revision:  https://reviews.freebsd.org/D57613
DeltaFile
+13-7sys/kern/subr_witness.c
+13-71 files