FreeBSD/src 7e3c7deusr.sbin/tzsetup tzsetup.c

tzsetup: be explicit about *timezone* abbreviation

During the install process tzsetup asks a question like

    Does the abbreviation `EDT' look reasonable?

The installer asks lots of questions, some that relate to the previous
screen or topic and some that do not.  A new user installed FreeBSD for
the first time and was confused by this question, not realizing that it
was asking whether the abbreviation is correct for the selected
timezone.

Reviewed by:    bapt, brooks, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44500

(cherry picked from commit 40b57cb616ca19aee3de104acd058da289c936bb)
DeltaFile
+1-1usr.sbin/tzsetup/tzsetup.c
+1-11 files

FreeBSD/src 26a09dbtools/build depend-cleanup.sh

Fix incremental build with WITH_NVME newly enabled

rescue.mk doesn't get updated when options change so nvme_util.o is now
missing on architectures were NVME was previously marked BROKEN.

Reviewed by:    imp
Fixes:          2fda3ab0ac19 WITH_NVME: Remove from broken.
Differential Revision:  https://reviews.freebsd.org/D44826
DeltaFile
+7-0tools/build/depend-cleanup.sh
+7-01 files

FreeBSD/src dc16f5fcontrib/tcpdump print-pfsync.c

tcpdump: cope with incorrect packet lengths

It's possible for the capture buffer to be smaller than indicated by the
header length. However, pfsync_print() only took the header length into
account. As a result we could read outside of the buffer.

Check that we have at least the expected amount of data before we start
parsing.

PR:             278034
MFC after:      2 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D44580

(cherry picked from commit 4848eb3af2a91b133c4b70cb9b71dd92ffec7f46)
DeltaFile
+1-1contrib/tcpdump/print-pfsync.c
+1-11 files

FreeBSD/src 5abbbb7sys/dev/sound unit.c

sound: Remove leftover references to snd_clone

The snd_clone framework does not exist as of
e8c0d15a64fadb4a330f2da7244becaac161bb70 ("sound: Get rid of snd_clone
and use DEVFS_CDEVPRIV(9)"), so remove leftover references to it from
unit.c.

Sponsored by:   The FreeBSD Foundation
MFC after:      2 months
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D44758

(cherry picked from commit 068c675ca7aec11d3546c3f908e842a7eca2ccae)
DeltaFile
+5-15sys/dev/sound/unit.c
+5-151 files

FreeBSD/src 51abcd0sys/dev/sound/pcm dsp.c sndstat.c

sound: Update some LICENSE headers

The following commits introduced substantial changes to pcm/dsp.c,
pcm/sndstat.c and pcm/sound.c.

9da3b645dbaaad724d524727d003fed7be05ff7c ("sound: Move
sndstat_prepare_pcm() to pcm/sndstat.c and remove
sndstat_entry->handler")
e8c0d15a64fadb4a330f2da7244becaac161bb70 ("sound: Get rid of snd_clone
and use DEVFS_CDEVPRIV(9)")

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D44757

(cherry picked from commit 4f854658c5d6ca98c822491991052574d948617d)
DeltaFile
+4-0sys/dev/sound/pcm/dsp.c
+4-0sys/dev/sound/pcm/sndstat.c
+4-0sys/dev/sound/pcm/sound.c
+12-03 files

FreeBSD/src d692c31share/man/man4 snd_uaudio.4, sys/dev/sound/pcm sound.c mixer.c

sound: Implement asynchronous device detach

Hot-unplugging a sound device, such as a USB sound card, whilst being
consumed by an application, results in an infinite loop until either the
application closes the device's file descriptor, or the channel
automatically times out after hw.snd.timeout seconds. In the case of a
detach however, the timeout approach is still not ideal, since we want
all resources to be released immediatelly, without waiting for N seconds
until we can use the bus again.

The timeout mechanism works by calling chn_sleep() in chn_read() and
chn_write() (see pcm/channel.c) in order to send the thread to sleep,
using cv_timedwait_sig(). Since chn_sleep() sets the CHN_F_SLEEPING flag
while waiting for cv_timedwait_sig() to return, we can test this flag in
pcm_unregister() (called during detach) and wakeup the sleeping
thread(s) to immediately kill the channel(s) being consumed.

Sponsored by:   The FreeBSD Foundation
MFC after:      2 months

    [5 lines not shown]
DeltaFile
+10-14sys/dev/sound/pcm/sound.c
+3-10sys/dev/sound/usb/uaudio.c
+0-11sys/dev/sound/pcm/mixer.c
+1-10share/man/man4/snd_uaudio.4
+1-1sys/dev/sound/pcm/dsp.c
+15-465 files

FreeBSD/src e6c51f6share/man/man4 pcm.4, sys/dev/sound clone.c clone.h

sound: Get rid of snd_clone and use DEVFS_CDEVPRIV(9)

Currently the snd_clone framework creates device nodes on-demand for
every channel, through the dsp_clone() callback, and is responsible for
routing audio to the appropriate channel(s). This patch gets rid of the
whole snd_clone framework (including any related sysctls) and instead
uses DEVFS_CDEVPRIV(9) to handle device opening, channel allocation and
audio routing. This results in a significant reduction in code size as
well as complexity.

Behavior that is preserved:

- hw.snd.basename_clone.
- Exclusive access of an audio device (i.e VCHANs disabled).
- Multiple processes can read from/write to the device.
- A device can only be opened as many times as the maximum allowed
  channel number (see SND_MAXHWCHAN in pcm/sound.h).
- OSSv4 compatibility aliases are preserved.


    [16 lines not shown]
DeltaFile
+347-770sys/dev/sound/pcm/dsp.c
+0-705sys/dev/sound/clone.c
+2-192sys/dev/sound/pcm/sound.c
+0-127sys/dev/sound/clone.h
+12-41share/man/man4/pcm.4
+2-5sys/dev/sound/pcm/dsp.h
+363-1,8403 files not shown
+365-1,8479 files

FreeBSD/src bf07007contrib/tcpdump print-pfsync.c

tcpdump: cope with incorrect packet lengths

It's possible for the capture buffer to be smaller than indicated by the
header length. However, pfsync_print() only took the header length into
account. As a result we could read outside of the buffer.

Check that we have at least the expected amount of data before we start
parsing.

PR:             278034
MFC after:      2 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D44580

(cherry picked from commit 4848eb3af2a91b133c4b70cb9b71dd92ffec7f46)
DeltaFile
+1-1contrib/tcpdump/print-pfsync.c
+1-11 files

FreeBSD/src da013f1sys/x86/isa atrtc.c

atrtc(4): Fix a typo in a sysctl description

- s/emtpy/empty/

(cherry picked from commit 38cc6c3d95d4d1156960a9c5ba69c360e36f9976)
DeltaFile
+1-1sys/x86/isa/atrtc.c
+1-11 files

FreeBSD/src cfa4bd5sys/x86/isa atrtc.c

atrtc(4): Fix a typo in a sysctl description

- s/emtpy/empty/

(cherry picked from commit 38cc6c3d95d4d1156960a9c5ba69c360e36f9976)
DeltaFile
+1-1sys/x86/isa/atrtc.c
+1-11 files

FreeBSD/src 40631b7sys/fs/nfsclient nfs_clvnops.c

nfscl: Purge name cache when readdir_plus is done

The author reported that this patch was needed to avoid
crashes on a fairly busy RISC-V system.  The author did not
provide details w.r.t. the crashes.  Although I
have not seen any such crash, the patch looks reasonable
and I have not found any regressions when testing it.

Since "rdirplus" is not a default option, the patch is
only needed if you are doing NFS mounts with the "rdirplus"
mount option and seeing crashes related to the name cache.

(cherry picked from commit d00c64bb2347cc620d31a178c7755aa7e594f065)
DeltaFile
+10-0sys/fs/nfsclient/nfs_clvnops.c
+10-01 files

FreeBSD/src ee632fblib/libc/sys openat.c setcontext.c, lib/libsys Symbol.sys.map

lib{c,sys}: normalize export of openat, setcontext, and swapcontext

List them in the symbol map rather than using the __sym_default to
expose them.  This will allow later improvements in the stub
implementations in libc.so.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D44113
DeltaFile
+4-0lib/libsys/Symbol.sys.map
+0-1lib/libc/sys/openat.c
+0-1lib/libc/sys/setcontext.c
+0-1lib/libc/sys/swapcontext.c
+4-34 files

FreeBSD/src df1a09blib/libsys Symbol.map

libsys: expose a few more symbols for libc's use

These private symbols are used by libc so expose as we do with
auxargs bits rather then relying on duplicate implementations in libc.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D44114
DeltaFile
+9-0lib/libsys/Symbol.map
+9-01 files

FreeBSD/src f276adclib/libcompiler_rt Makefile.inc

libcompiler_rt Makefile.inc: update _Float16/__bf16 checks

Clang supports __bf16 for riscv from version 18.0 onwards, so update the
checks for it. While here, rewrite the checks so they are hopefully more
readable, and also handle gcc a little better.

In addition, define COMPILER_RT_HAS_FLOAT16 and COMPILER_RT_HAS_BFLOAT16
when these features should be available, since there are some parts in
compiler-rt that check for these defines.

PR:             276104
MFC after:      1 month
DeltaFile
+28-5lib/libcompiler_rt/Makefile.inc
+28-51 files

FreeBSD/src f122045usr.sbin/crunch/crunchgen crunched_main.c crunchgen.c

crunchgen: add --list option

"bsdbox --list" will print all tools in the binary, one per line. The
main use case for this is to make it easier to create links:

        for t in $(bsdbox --list); do
                ln -s bsdbox $t
        done

The name --list was taken from busybox.

This just adds a new "program" with the name "--list". I don't think we
need to do real argument parsing here, and this is also how busybox does
it.

An additional minor change is that just "bsdbox" will no longer print
the binary name itself ("bsdbox" in this case). Before it would do:

        % bsdbox

    [44 lines not shown]
DeltaFile
+40-18usr.sbin/crunch/crunchgen/crunched_main.c
+8-2usr.sbin/crunch/crunchgen/crunchgen.c
+48-202 files

FreeBSD/src 219b6e4crypto/heimdal/lib/asn1 gen.c

heimdal: asn1: Use unsigned bitfields for named bitsets

Import upstream 6747e1628:

  asn1: Use unsigned bitfields for named bitsets

  Signed 1-bit bitfields are undefined in C.

This should fix the following warnings, which for unknown reasons are
errors in CI:

  /usr/src/crypto/heimdal/lib/hx509/ca.c:1020:22: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
   1020 |         ku.digitalSignature = 1;
        |                             ^ ~
  /usr/src/crypto/heimdal/lib/hx509/ca.c:1021:21: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
   1021 |         ku.keyEncipherment = 1;
        |                            ^ ~
  /usr/src/crypto/heimdal/lib/hx509/ca.c:1028:17: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
   1028 |         ku.keyCertSign = 1;

    [8 lines not shown]
DeltaFile
+2-2crypto/heimdal/lib/asn1/gen.c
+2-21 files

FreeBSD/src 1b74875crypto/heimdal/lib/asn1 check-gen.c der_put.c

heimdal: Add 64-bit integer support to ASN.1 compiler

Import upstream 19d378f44:

  ASN.1 INTEGERs will now compile to C int64_t or uint64_t, depending
  on whether the constraint ranges include numbers that cannot be
  represented in 32-bit ints and whether they include negative
  numbers.

  Template backend support included.  check-template is now built with
  --template, so we know we're testing it.

  Tests included.

Also adjusts the generated files:
* asn1parse.c, asn1parse.h (not strictly necessary, but nice to have)
* der-protos.h, which needs a bunch of new prototypes. I copied these
  from a der-protos.h generated by the upstream build system, which
  uses a perl script for this.

    [31 lines not shown]
DeltaFile
+120-0crypto/heimdal/lib/asn1/check-gen.c
+72-0crypto/heimdal/lib/asn1/der_put.c
+57-0crypto/heimdal/lib/asn1/der_length.c
+50-0crypto/heimdal/lib/asn1/der-protos.h
+42-3crypto/heimdal/lib/asn1/der_get.c
+13-9crypto/heimdal/lib/asn1/gen_template.c
+354-1215 files not shown
+446-5221 files

FreeBSD/src 75eda00share/man/man7 networking.7 Makefile

networking.7 : create network quickstart guide

Now that the handbook has been moved to ports, I think it's very nice to
have a network quickstart guide in-band, in base, in the system manual.
If the user uses any of the following terms "man -k
{network,networking,wifi,quickstart}" this page will come up, which is I
think a very common use case for new users.

Currently, this document explains connecting to a basic Ethernet
network, a basic wifi network, scanning for wifi networks, and airplane
mode, as well as linking to other sections, including the handbook

Co-authored-by: Graham Perrin <grahamperrin at gmail.com>
Reviewed by: imp, bcr, freebsd at igalic.co
Pull Request: https://github.com/freebsd/freebsd-src/pull/833
DeltaFile
+101-0share/man/man7/networking.7
+5-0share/man/man7/Makefile
+106-02 files

FreeBSD/src b7e4666sys/fs/nfsserver nfs_nfsdkrpc.c

nfsserver: Rate-limit messages about requests from unprivileged ports

If access from unreserved ports is disabled, then a remote host can
cause an NFS server to log a message by sending a packet.  This is
useful for diagnosing problems but bad for resiliency in the case where
the server is being spammed with a large number of rejected requests.

Limit prints to once per second (racily).

Reviewed by:    rmacklem, emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D44819
DeltaFile
+14-4sys/fs/nfsserver/nfs_nfsdkrpc.c
+14-41 files

FreeBSD/src ca8e2e4sys/netinet tcp_var.h

tcp: Make tcp_var.h more self-contained

struct tcpcb embeds a struct osd and a struct callout.  Rather than
forcing all consumers to pull in the same headers, include the headers
directly.

No functional change intended.

Reviewed by:    glebius
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D44685

(cherry picked from commit 1d14e88e5332cfddbec1893f6b5332f81d378d61)
DeltaFile
+3-0sys/netinet/tcp_var.h
+3-01 files

FreeBSD/src 1f85f06sys/vm vm_reserv.c

vm_reserv_reclaim_contig: Return NULL not false

Reviewed by:    dougm, zlei
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D44667

(cherry picked from commit 989a2cf19d053954f0bad28790114a374b05c9c1)
DeltaFile
+2-2sys/vm/vm_reserv.c
+2-21 files

FreeBSD/src b6a4776libexec/rc/rc.d nuageinit

nuageinit: start the script after zfs

It prevents the home directory for the new users to be hidden
by late mount of the home directory
DeltaFile
+1-1libexec/rc/rc.d/nuageinit
+1-11 files

FreeBSD/src 994f9c9sys/netinet/tcp_stacks rack.c

tcp rack: fix sending

In rack_output(), idle is used as a boolean variable. So don't use it
as an int and don't clear it afterwards.
This avoids setting idle to false, when it is not intended.

Reported by:            olivier
Reviewed by:            rrs, rscheff
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D44610

(cherry picked from commit 7df0ef5f48e1c67b3f1df7c7964bfa59bc56f4e4)
DeltaFile
+3-3sys/netinet/tcp_stacks/rack.c
+3-31 files

FreeBSD/src 1348844sys/netinet/tcp_stacks rack.c

Revert "tcp rack: fix sending"

This reverts commit b5ee7411bfabaf85f226fdfc4f2d8e0515d66691.
DeltaFile
+3-6sys/netinet/tcp_stacks/rack.c
+3-61 files

FreeBSD/src b5ee741sys/netinet/tcp_stacks rack.c

tcp rack: fix sending

In rack_output(), idle is used as a boolean variable. So don't use it
as an int and don't clear it afterwards.
This avoids setting idle to false, when it is not intended.

Reported by:            olivier
Reviewed by:            rrs, rscheff
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D44610

(cherry picked from commit 7df0ef5f48e1c67b3f1df7c7964bfa59bc56f4e4)
DeltaFile
+6-3sys/netinet/tcp_stacks/rack.c
+6-31 files

FreeBSD/src 14d7784sys/netinet/tcp_stacks bbr.c

tcp bbr: improve code consistency

Improve code consistency with the RACK stack.
Reviewed by:            gallatin, rscheff
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D44800

(cherry picked from commit 605a00660eadb210ed76d49df551f3f33bbb4da7)
DeltaFile
+3-3sys/netinet/tcp_stacks/bbr.c
+3-31 files

FreeBSD/src 5344772sys/netinet tcp_input.c

tcp: add some debug output

Also log, when dropping text or FIN after having received a FIN.
This is the intended behavior described in RFC 9293.
A follow-up patch will enforce this behavior for the base stack
and the RACK stack.
Reviewed by:            rscheff
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D44669

(cherry picked from commit e8c149ab85c7834f76325864f22ca89298e65f75)
DeltaFile
+29-0sys/netinet/tcp_input.c
+29-01 files

FreeBSD/src 90cde57sys/netinet tcp_input.c tcp_timewait.c

tcp: improve consistency

No functional change intended.

Reported by:            Coverity Scan
CID:                    1523781
Reviewed by:            rscheff
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D44645

(cherry picked from commit 3e1c8a35f741a5d114d0ba670b15191355711fe9)
DeltaFile
+1-1sys/netinet/tcp_input.c
+1-1sys/netinet/tcp_timewait.c
+2-22 files

FreeBSD/src c6770e8sys/netinet/tcp_stacks rack.c

tcp rack: fix memory corruption

When in rack_output() jumping to the label out, don't write errno into
the log buffer, since the pointer is not initialized.

Reported by:            Coverity Scan
CID:                    1523773
Reviewed by:            rscheff
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D44647

(cherry picked from commit d902c8f55b8da6902ab45e67ed756cc99f5a9d5a)
DeltaFile
+2-2sys/netinet/tcp_stacks/rack.c
+2-21 files

FreeBSD/src 7a01956sys/kern uipc_socket.c

uipc_socket: handle socket buffer locks in sopeeloff

PR:                     278171
Reviewed by:            markj
Fixes:                  a4fc41423f7d ("sockets: enable protocol specific socket buffers")
Differential Revision:  https://reviews.freebsd.org/D44640

(cherry picked from commit 681711b77cde2cf3d64dc1e4951ec8287bc4f3e8)
DeltaFile
+4-0sys/kern/uipc_socket.c
+4-01 files