HardenedBSD/src a98b1c9share/man/man4 sg.4, sys/dev/sound/pcm sound.c vchan.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+12-311sys/dev/sound/pcm/sound.c
+184-16sys/dev/sound/pcm/vchan.c
+139-21sys/dev/sound/pcm/channel.c
+28-43sys/dev/sound/pcm/sound.h
+63-0share/man/man4/sg.4
+12-49sys/dev/sound/pcm/dsp.c
+438-44055 files not shown
+657-71161 files

HardenedBSD/src 08b4520share/man/man4 sg.4 Makefile

sg: Add sg(4) man page

Add minimal sg(4) manual page. This implements a subset of the Linux
IOCTL interface for either native FreeBSD programs, or for Linux
binaries in the linuxulator.

Noticed by:     Lexi Winter
Sponsored by:   Netflix
DeltaFile
+63-0share/man/man4/sg.4
+1-0share/man/man4/Makefile
+64-02 files

HardenedBSD/src fadbb6fsys/net if_lagg.c

lagg: remove use of net epoch in the ioctl paths

Rely on LAGG_SLOCK() instead.  The use of network epoch(9) here was added
in 6573d7580b851 (later tidied by 87bf9b9cbeebc) as a large sweep that
blindly substituted blocking kernel primitives with epoch(9).  In these
particular code paths use of epoch(9) is incorrect and doesn't provide any
protection against a stale pointer.  Recent fix 48698ead6ff0, which should
actually have removed the epoch use, created a potential sleeping in epoch
problem.
DeltaFile
+11-22sys/net/if_lagg.c
+11-221 files

HardenedBSD/src 0089d83tests/sys/net if_lagg_test.sh

lagg: enable tests that stress the configuration changes

I wasn't able to reproduce a crash in several runs.  Might be that
48698ead6ff0 or earlier changes have closed the races.  In case crashes
with just enabled tests are registered, I will either work on them or
disable tests again.
DeltaFile
+0-8tests/sys/net/if_lagg_test.sh
+0-81 files

HardenedBSD/src 5706859sys/net if_lagg.c, tests/sys/net if_lagg_test.sh

lagg: propagate up/down to the children

Based on the old submission from asomers@.  With modern state of locking
in lagg(4), the patch got much simplier.  Enable the test that was
waiting for this change.

PR:                     226144
Reviewed by:            asomers
Differential Revision:  https://reviews.freebsd.org/D44605
DeltaFile
+24-0sys/net/if_lagg.c
+0-1tests/sys/net/if_lagg_test.sh
+24-12 files

HardenedBSD/src 1d425efsys/dev/nvmf nvmf_proto.h

nvmf: Add explicit alignment for struct nvmf_fabric_cmd

This avoids -Wcast-align warnings from clang when upcasting from
struct nvmf_fabric_cmd to struct nvmf_fabric_prop_set_cmd.

Reported by:    bapt
Sponsored by:   Chelsio Communications
DeltaFile
+1-1sys/dev/nvmf/nvmf_proto.h
+1-11 files

HardenedBSD/src 2d29d2elib/libsys clock_gettime.2

clock_gettime.2: fix markup

The CLOCK_* constants are "defined variable or preprocessor constants"
and so use .Dv.

Reviewed by:    imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45106
DeltaFile
+22-22lib/libsys/clock_gettime.2
+22-221 files

HardenedBSD/src a7db82clib/libnvmf nvmf_tcp.c, sys/dev/nvmf nvmf_tcp.h

nvmf_tcp: Correct tests for PDU direction

Add parentheses to ensure the correct order of operations.

Reported by:    GCC
DeltaFile
+1-1sys/dev/nvmf/nvmf_tcp.h
+1-1lib/libnvmf/nvmf_tcp.c
+2-22 files

HardenedBSD/src e75a79fsys/dev/nvmf nvmf_proto.h

nvmf: Remove packing pragmas from nvmf_proto.h

The protocol structures do not need explicit packing and static
assertions verify the size of all the structures as well as the
offsets of several key fields.  The pragma triggers warnings when
building with GCC.

Sponsored by:   Chelsio Communications
DeltaFile
+0-4sys/dev/nvmf/nvmf_proto.h
+0-41 files

HardenedBSD/src 0b1c562release/scripts mk-vmimage.sh, release/tools vmimage.subr gce.conf

release: Rework vm_extra_pre_umount

The vm_extra_pre_umount function in vmimage.subr served two purposes:
It removed /etc/resolv.conf and /qemu (if cross-building), and it
provided a function for cloudware to override in order to make cloud
specific changes to the filesystem before constructing a disk image.

This resulted in a number of bugs:
1. When cross-building, the emulator binary was left as /qemu in the
Azure, GCE, Openstack and Vagrant images.
2. The build host's resolv.conf was left as /etc/resolv.conf in the
basic-ci and basic-cloudinit images.
3. When building GCE images, a Google-specific resolv.conf file was
constructed, and then deleted before the disk image was created.

Move the bits needed for running code inside a VM staging directory
from vm_install_base into a new vm_emulation_setup routine, and move
the corresponding cleanup bits from vm_extra_pre_umount to a new
vm_emulation_cleanup routine.

    [14 lines not shown]
DeltaFile
+11-12release/tools/vmimage.subr
+9-1release/tools/gce.conf
+0-5release/tools/ec2.conf
+0-5release/tools/oci.conf
+2-1release/scripts/mk-vmimage.sh
+0-2release/tools/azure.conf
+22-263 files not shown
+22-309 files

HardenedBSD/src 99b0270sys/conf NOTES options, sys/kern uipc_socket.c

sockets: hide socket hhook(9)s under SOCKET_HHOOK

There are no in-tree consumers of these hooks.

Reviewed by:            stevek
Differential Revision:  https://reviews.freebsd.org/D44928
DeltaFile
+37-15sys/kern/uipc_socket.c
+2-0sys/conf/NOTES
+1-0sys/conf/options
+40-153 files

HardenedBSD/src a351399sys/arm/allwinner a10_codec.c, sys/arm/broadcom/bcm2835 bcm2835_audio.c

arm: Remove stray references to dev/sound/chip.h

Fixes:          923e0040a59a ("sound: Move chip.h contents to pcm/sound.h")
Reported by:    Jenkins CI
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+0-1sys/arm/freescale/vybrid/vf_sai.c
+0-1sys/arm/broadcom/bcm2835/bcm2835_audio.c
+0-1sys/arm/allwinner/a10_codec.c
+0-1sys/arm/freescale/imx/imx6_ssi.c
+0-44 files

HardenedBSD/src e9b411dtests/sys/fs/fusefs utils.cc bmap.cc

tests/fusefs: fix all tests that depend on kern.maxphys

The tests try to read kern.maxphys sysctl into int value, while
unsigned long is required.  Not sure when this was broken, seems like
since cd8537910406e.

Reviewed by:            asomers
Differential Revision:  https://reviews.freebsd.org/D45053
DeltaFile
+6-7tests/sys/fs/fusefs/utils.cc
+6-6tests/sys/fs/fusefs/bmap.cc
+3-2tests/sys/fs/fusefs/write.cc
+1-1tests/sys/fs/fusefs/read.cc
+1-1tests/sys/fs/fusefs/utils.hh
+17-175 files

HardenedBSD/src 2b14465sys/dev/sound/pcm vchan.c

sound: Update pcm/vchan.c LICENSE header

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+4-0sys/dev/sound/pcm/vchan.c
+4-01 files

HardenedBSD/src 5295e89sys/netinet in_fib_dxr.c

fib_dxr: update comment.

MFC after:      1 week
DeltaFile
+1-1sys/netinet/in_fib_dxr.c
+1-11 files

HardenedBSD/src 8580106sys/netinet in_fib_dxr.c

fib_dxr: free() does nothing if arg is NULL, so remove a redundant check.

MFC after:      1 week
DeltaFile
+2-5sys/netinet/in_fib_dxr.c
+2-51 files

HardenedBSD/src 72cbd38sys/dev/sound/pcm dsp.c sound.h

sound: Remove unused dsp_cdevs[] fields and devices

These fields and devices are unused as of e8c0d15a64fa ("sound: Get rid
of snd_clone and use DEVFS_CDEVPRIV(9)").

While here, remove unused SND_DEV_* defines from pcm/sound.h and convert
the list to an enum.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    dev_submerge.ch, markj
Differential Revision:  https://reviews.freebsd.org/D45013
DeltaFile
+10-47sys/dev/sound/pcm/dsp.c
+11-39sys/dev/sound/pcm/sound.h
+21-862 files

HardenedBSD/src 3af2bebsys/dev/sound/pcm vchan.c channel.c

sound: Remove unused "num" argument from chn_init() and related callers

It is always -1 (i.e unused).

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    dev_submerge.ch
Differential Revision:  https://reviews.freebsd.org/D45095
DeltaFile
+12-15sys/dev/sound/pcm/vchan.c
+2-9sys/dev/sound/pcm/channel.c
+2-2sys/dev/sound/pcm/sound.c
+2-2sys/dev/sound/pcm/vchan.h
+1-1sys/dev/sound/pcm/channel.h
+19-295 files

HardenedBSD/src 77ab426sys/dev/sound/pcm vchan.c

sound: Rename pcm_getparentchannel() to vchan_getparentchannel()

Follow the rest of the vchan.c naming convention.

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D45016
DeltaFile
+7-7sys/dev/sound/pcm/vchan.c
+7-71 files

HardenedBSD/src 923e004sys/dev/sound chip.h, sys/dev/sound/pci solo.c csa.c

sound: Move chip.h contents to pcm/sound.h

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D44997
DeltaFile
+0-47sys/dev/sound/chip.h
+16-0sys/dev/sound/pcm/sound.h
+0-1sys/dev/sound/pci/solo.c
+0-1sys/dev/sound/pci/csa.c
+0-1sys/dev/sound/pci/csamidi.c
+0-1sys/dev/sound/pci/csapcm.c
+16-517 files not shown
+16-5813 files

HardenedBSD/src c597c55sys/dev/sound/pci ich.c, sys/dev/sound/pci/hda hdaa.c

sound: Use nitems() where possible

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj, emaste
Differential Revision:  https://reviews.freebsd.org/D45014
DeltaFile
+6-9sys/dev/sound/pcm/feeder_format.c
+7-4sys/dev/sound/pci/hda/hdaa.c
+3-2sys/dev/sound/pcm/sound.c
+2-2sys/dev/sound/pci/ich.c
+2-2sys/dev/sound/pcm/feeder_matrix.c
+2-2sys/dev/sound/pcm/mixer.c
+22-214 files not shown
+29-2810 files

HardenedBSD/src 7ad5f38sys/dev/sound/pcm sound.c vchan.c

sound: Move vchan-related code to pcm/vchan.*

pcm/sound.* contains code that should be part of pcm/vchan.*.

Changes:
- pcm_setvchans() -> vchan_setnew()
- pcm_setmaxautovchans() -> vchan_setmaxauto()
- hw.snd.maxautovchans moved to pcm/vchan.c
- snd_maxautovchans declaration moved to pcm/vchan.h and definition to
  pcm/vchan.c

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    dev_submerge.ch, markj
Differential Revision:  https://reviews.freebsd.org/D45015
DeltaFile
+2-174sys/dev/sound/pcm/sound.c
+172-1sys/dev/sound/pcm/vchan.c
+5-0sys/dev/sound/pcm/vchan.h
+0-2sys/dev/sound/pcm/sound.h
+1-0sys/dev/sound/pcm/feeder.c
+180-1775 files

HardenedBSD/src 5224825. RELNOTES

RELNOTES: Mention hw.snd.version being removed

Sponsored by:   The FreeBSD Foundation
DeltaFile
+3-0RELNOTES
+3-01 files

HardenedBSD/src 7398d1esys/dev/sound version.h, sys/dev/sound/pcm sound.c sndstat.c

sound: Remove hw.snd.version and SND_DRV_VERSION

hw.snd.version and SND_DRV_VERSION define the sound driver version and
are meant to be used in bug reports, but because these values are
constant, there is not much useful information we can extract from them.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    dev_submerge.ch, emaste
Differential Revision:  https://reviews.freebsd.org/D44996
DeltaFile
+0-42sys/dev/sound/version.h
+0-10sys/dev/sound/pcm/sound.c
+2-6sys/dev/sound/pcm/sndstat.c
+2-583 files

HardenedBSD/src 139bcecsys/dev/sound/pcm sound.c vchan.c

sound: Convert pcm_chn_add() to void

It always returns 0.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj, emaste
Differential Revision:  https://reviews.freebsd.org/D44998
DeltaFile
+3-11sys/dev/sound/pcm/sound.c
+2-6sys/dev/sound/pcm/vchan.c
+1-1sys/dev/sound/pcm/sound.h
+6-183 files

HardenedBSD/src 76f95basys/dev/sound/pcm sound.c

sound: Add __assert_unreachable() to default cases in pcm_chn_add() and pcm_chn_remove()

We should normally never enter these cases.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj, emaste
Differential Revision:  https://reviews.freebsd.org/D44994
DeltaFile
+2-2sys/dev/sound/pcm/sound.c
+2-21 files

HardenedBSD/src 2e9962esys/dev/sound/pcm channel.c sound.c

sound: Merge pcm_chn_create() and chn_init()

Follow-up of b3ea087c05d8c75978a302cbb3fa92ce1afa3e49 ("sound: Merge
pcm_chn_destroy() and chn_kill()")

While here, add device_printf()'s to all failure points. Also fix an
existing bug where we'd unlock an already unlocked channel, in case we
went to "out" (now "out2") before locking the channel.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    dev_submerge.ch
Differential Revision:  https://reviews.freebsd.org/D44993
DeltaFile
+146-21sys/dev/sound/pcm/channel.c
+2-112sys/dev/sound/pcm/sound.c
+2-1sys/dev/sound/pcm/channel.h
+1-1sys/dev/sound/pcm/vchan.c
+0-1sys/dev/sound/pcm/sound.h
+151-1365 files

HardenedBSD/src 308caa3sys/netinet in_fib_dxr.c

fib_dxr: log malloc() failures.

MFC after:      1 week
DeltaFile
+38-7sys/netinet/in_fib_dxr.c
+38-71 files

HardenedBSD/src 34a998einclude endian.h, tools/tools/git git-arc.sh git-arc.1

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+38-10usr.sbin/pw/pw_user.c
+28-9tools/tools/git/git-arc.sh
+28-7usr.sbin/pw/pw_group.c
+25-1include/endian.h
+12-10usr.sbin/pw/pw.h
+16-3tools/tools/git/git-arc.1
+147-406 files not shown
+187-4712 files

HardenedBSD/src 2f68f64tools/tools/git git-arc.sh git-arc.1

git-arc: Add list mode support for the update command

This can be particularly useful to do bulk-updates of multiple commits
using the same message, e.g.

  git arc update -lm "Move function xyz to libfoo" main..myfeature

Similar to the list mode for the create command, git arc will list all
the candidate revisions with a single prompt.  Once that is confirmed,
all the revisions are updated without showing the diffs or pausing
further prompts.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D45050
DeltaFile
+28-9tools/tools/git/git-arc.sh
+16-3tools/tools/git/git-arc.1
+44-122 files