FreeBSD/src 439b219sbin/devd snd.conf

devd/snd.conf: Handle absent control device properly

If virtual_oss is not enabled when these rules run on startup, dmesg
will show the following messages:

Starting devd.
virtual_oss_cmd: Could not open control device: /dev/vdsp.ctl: No such file or directory
virtual_oss_cmd: Could not open control device: /dev/vdsp.ctl: No such file or directory

Reported by:    olce, Mark Millard <marklmi at yahoo.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+9-6sbin/devd/snd.conf
+9-61 files

FreeBSD/src a7f0ee3usr.sbin/bsdinstall/partedit partedit_efi.c

bsdinstall: Add SPDX-License-Identifier tags

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 80c73c89dc6a156a119350d7c28c6db1f3b741df)
DeltaFile
+2-0usr.sbin/bsdinstall/partedit/partedit_efi.c
+2-01 files

FreeBSD/src 471b1c4sys/dev/usb/net if_smsc.c

smsc: Add missing newline to PHY timeout error printf

(cherry picked from commit 0979bfb0ec804590a782ea33b787ec0989c1f1a4)
DeltaFile
+1-1sys/dev/usb/net/if_smsc.c
+1-11 files

FreeBSD/src 30d9078sys/netlink/route iface_drivers.c

netlink: Check permissions for interface flag changes

Reviewed by:    pouria, melifaro
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57332

(cherry picked from commit 96dbc9a8de105065b6b1e55702aa648319176587)
DeltaFile
+10-1sys/netlink/route/iface_drivers.c
+10-11 files

FreeBSD/src 6c81e76sys/netlink netlink_generic.c

netlink: Avoid potential undefined behaviour

Taking the address of an OOB array element is UB, even if not
dereferenced.

Reviewed by: des, bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57172

(cherry picked from commit 4d125ed6e7d445d574c11dc35c40ec3013559806)
DeltaFile
+3-5sys/netlink/netlink_generic.c
+3-51 files

FreeBSD/src e22716bsys/netlink netlink_message_parser.c, sys/netlink/route rt.c iface_drivers.c

netlink: Check for NULL return from npt_alloc()

Reviewed by: glebius, pouria
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57171

(cherry picked from commit 1dbc104148845434575d1931d47876ae0ca1542f)
DeltaFile
+4-0sys/netlink/route/rt.c
+3-0sys/netlink/route/iface_drivers.c
+2-0sys/netlink/netlink_message_parser.c
+9-03 files

FreeBSD/src 44e81e8sys/netlink/route rt.c

netlink: Fix RTM_GETROUTE loop for RT_TABLE_UNSPEC

Reviewed by: bz, pouria
Fixes: 7e5bf68495cc ("netlink: add netlink support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57234

(cherry picked from commit 33acf0f26b490ea4887d820a3f45c56e3913a17d)
DeltaFile
+1-1sys/netlink/route/rt.c
+1-11 files

FreeBSD/src bbf0198sys/netlink/route iface_drivers.c

netlink: Use early exit pattern in _nl_modify_ifp_generic

No functional change.

Reviewed by:    pouria, melifaro
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57349

(cherry picked from commit 9ddb6064f815ebdd0cfea4b2e0d3b6f0c98ea072)
DeltaFile
+25-28sys/netlink/route/iface_drivers.c
+25-281 files

FreeBSD/src beee132sys/netlink/route iface.c

netlink: Fix interface type match

Reviewed by: bz, glebius, pouria
Fixes: 7e5bf68495cc ("netlink: add netlink support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57167

(cherry picked from commit eff5f220c379d4173fdc0e5ec00380888bf7649a)
DeltaFile
+1-1sys/netlink/route/iface.c
+1-11 files

FreeBSD/src 65e0e06usr.bin/elfdump elfdump.c

elfdump: Decode SHT_LLVM_ADDRSIG section header type

Reported by:    bz
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 3c07cfb25283d93f03cdac51158289853d0e17a8)
DeltaFile
+1-0usr.bin/elfdump/elfdump.c
+1-01 files

FreeBSD/src 90c1189sys/netlink netlink_generic.c

netlink: Avoid undefined behaviour

Even though it is not dereferenced, it is UB to take the address of an
out of bounds array element.

Reviewed by: pouria, bz, des, adrian
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57158

(cherry picked from commit 1a4ad649cb135501f0bee56a4214e8c904ca402e)
DeltaFile
+2-2sys/netlink/netlink_generic.c
+2-21 files

FreeBSD/src 2caaf8csbin/route route_netlink.c

route: Fix `flush` w/o specified address family

PR:             291867
Reported by:    gavin
Reviewed by:    pouria, melifaro
Sponsored by:   The FreeBSD Foundation
Fixes: c597432e2297 ("route(8): convert to netlink")
Differential Revision: https://reviews.freebsd.org/D57336

(cherry picked from commit 32a7ba251acbfb442665eed40fb4f48c8f2bd710)
DeltaFile
+2-1sbin/route/route_netlink.c
+2-11 files

FreeBSD/src 8011f6bsys/dev/usb/net if_axgereg.h

if_axge: remove AXGE_RX_MII_ERR from packet dropping criteria

Packets received with the following configuration are associated with
AXGE_RX_MII_ERR, which looks legit since there's no AXGE_RX_CRC_ERR
or AXGE_RX_DROP_PKT attached:

        axge0: <ASIX Elec. Corp. AX88179, rev 2.10/1.00, addr 3> on usbus0
        miibus0: <MII bus> on axge0
        rgephy0: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 3 on miibus0
        rgephy0: OUI 0x00e04c, model 0x0011, rev. 5
        rgephy0:  none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow

Without this, 'dhclient ue0' never gets valid lease as all the DHCP
replies are dropped by the driver.

This behaviour is align with the reference driver provided by the
vendor(ASIX_USB_NIC_Linux_Driver_Source_v3.5.0.tar.bz2).

MFC after:      2 weeks
DeltaFile
+1-1sys/dev/usb/net/if_axgereg.h
+1-11 files

FreeBSD/src 97edd37lib/libcasper/services/cap_net/tests net_test.c

cap_net: add tests for limits drop

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56992
DeltaFile
+235-0lib/libcasper/services/cap_net/tests/net_test.c
+235-01 files

FreeBSD/src 2ab18d3share/examples/etc make.conf

examples: Update COPTFLAGS in make.conf

We've been using -O2 for about fifteen years.

Reported by:    Jan Stary <hans at stare.cz>
MFC after:      1 week
DeltaFile
+1-1share/examples/etc/make.conf
+1-11 files

FreeBSD/src 2934783sys/dev/usb/serial uchcom.c

usb: Add missing unsetup while detaching uchcom

Reviewed by:    christos
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57329
DeltaFile
+1-0sys/dev/usb/serial/uchcom.c
+1-01 files

FreeBSD/src 9c04895lib/msun/aarch64 fenv.h, lib/msun/arm fenv.h

libc: Use slow path in fenv in C++

C++ exposes cfenv functions via using ::func. Our name-mangling
mechanism rewrites all function calls causing symbols such as
std::feclearexcept to be transformed into std::__feclearexcept_int.
Since no such function exists, compilation fails.

The using ::feclearexpect declarations themselves are unaffected because
they are not function calls, which further exposes the mismatch

As a result, enable the fast path only for C and fall back to the slow
path in C++.

Reviewed by:    kib
Fixes:          5bc64b7d417d
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57450
DeltaFile
+12-0lib/msun/powerpc/fenv.h
+12-0lib/msun/riscv/fenv.h
+10-0lib/msun/aarch64/fenv.h
+10-0lib/msun/arm/fenv.h
+10-0lib/msun/x86/fenv.h
+54-05 files

FreeBSD/src 81b3a79usr.sbin/virtual_oss/virtual_oss_cmd command.c

virtual_oss_cmd(8): Improve error messages

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week

(cherry picked from commit 4f7092eeb22d3882f54d67a35149533fef8376ca)
DeltaFile
+4-13usr.sbin/virtual_oss/virtual_oss_cmd/command.c
+4-131 files

FreeBSD/src b896c15usr.sbin/bsdinstall/scripts services

bsdinstall: Add virtual_oss service option

Since virtual_oss is now part of base, there is no reason not to provide
an installer option to enable it, and make it more visible to new users,
who might also benefit from the devd rules in /etc/devd/snd.conf, which
use virtual_oss, as well as 8532b4a43636 ("rc: virtual_oss: Create a
loopback device in the default configuration").

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

(cherry picked from commit eb5aa5c337c8d52fc1a7e867f526ca770bbe6612)
DeltaFile
+5-0usr.sbin/bsdinstall/scripts/services
+5-01 files

FreeBSD/src c0ec8ffshare/man/man7 stats.7

stats: Reference zpool-iostat(8) instead of zpool(8)

MFC after:      3 days
DeltaFile
+2-2share/man/man7/stats.7
+2-21 files

FreeBSD/src 233ece1usr.bin/stat stat.c, usr.bin/stat/tests stat_test.sh

stat: fix use of devname(3)

Besides being a little hard to parse through visually, this had its own
bug of inspecting st->st_mode to determine what to pass to devname(3),
which is only correct for st_rdev.

For st_dev, you're likely to be looking at files or directories and
attempting to assess what device they're located on, so the mode is
meaningless- we just have to assume that our filesystems are on
character devices and attempt to resolve st_dev as such.

Reviewed by:    des, kib (previous version)
Differential Revision:  https://reviews.freebsd.org/D56565

(cherry picked from commit 4d4acdbfc22c84081037f31cff4fb03d18373036)

stat: The devname test case requires root

Fixes:          4d4acdbfc22c ("stat: fix use of devname(3)")

    [24 lines not shown]
DeltaFile
+38-2usr.bin/stat/tests/stat_test.sh
+11-3usr.bin/stat/stat.c
+49-52 files

FreeBSD/src 7062e42usr.bin/stat/tests stat_test.sh

stat: Nits in stat tests

* Use ourselves as test file instead of /COPYRIGHT, which may or may not
  be present in the test environment.

* atf-check understands \n in strings, use it.

* Some file systems don't like creating small holes, so create large ones
  instead.  This means we need two variables: ps (page size) is the
  minimum size of a data region and the alignment for a hole, while hs
  (hole size) is the minimum size of the holes we create.  This makes no
  difference on FreeBSD but makes it easier to port the test to other
  platforms.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D56304

(cherry picked from commit 8cbd3949297d56e3960dcde73bd7e2277ac4bee8)
DeltaFile
+13-12usr.bin/stat/tests/stat_test.sh
+13-121 files

FreeBSD/src 12f8971usr.bin/stat stat.c stat.1, usr.bin/stat/tests stat_test.sh

stat: Add option to list holes

Add a new -h option that causes stat to print a list of holes for each
file argument.

Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D52481

(cherry picked from commit 1a7a067da456f8962ef87bfdf75c94cd12988615)
DeltaFile
+135-41usr.bin/stat/stat.c
+72-0usr.bin/stat/tests/stat_test.sh
+43-2usr.bin/stat/stat.1
+250-433 files

FreeBSD/src 6c2ea48usr.bin/stat/tests readlink_test.sh

stat: Nits in readlink tests

* The f_flag test may fail if a component of the full path to the
  temporary directory is a symbolic link.

* The n_flag test had an empty head; give it a description.

* Use consistent quoting.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D56293

(cherry picked from commit 1c793e7cbe2ecded388fd51fb20274891620a6f4)
DeltaFile
+6-3usr.bin/stat/tests/readlink_test.sh
+6-31 files

FreeBSD/src 62c1865sys/net80211 ieee80211_crypto.h

net80211: delete the deprecated ieee80211_wepkey struct

This hasn't been used in a long time, and since I am shuffling around
the net80211 crypto API a bunch, let's just delete it instead of
leaving it here and trying to figure out how to support it if it's
used by userland somehow.

Reviewed by:    guest-seuros
Differential Revision:  https://reviews.freebsd.org/D57312
DeltaFile
+0-8sys/net80211/ieee80211_crypto.h
+0-81 files

FreeBSD/src a653fd5sys/dev/malo if_malo.h, sys/dev/mwl if_mwl.c

net80211: create IEEE80211_KEYBUF_128_SIZE / IEEE80211_MICBUF_128_SIZE

The IEEE80211_KEYBUF_SIZE and IEEE80211_MICBUF_SIZE are sprinkled
throughout the net80211 stack, ioctl API and drivers.  This makes it
challenging to (eventually) up IEEE80211_KEYBUF_SIZE to support 256 /
384 bit encryption as, well, it'll break every single driver and the
ioctl API in doing so.

So as part of this, let's start to separate out the current key/mic
buffer size from what drivers and the ioctl layer are using.
Drivers especially shouldn't be using these definitions as their
key sizes are hardware / firmware API limits, not net80211 limits.
Ideally drivers would define their own key buffer / mic buffer
sizes and only copy in keys up to that length (and fail keys
that are too large) but the current net80211 API isn't there yet.

This doesn't yet change what defines / buffer sizes are used in the
ioctl layer.  I'm going to plan out some subsequent work to
separate out those defines and ioctl APIs so they maintain using

    [4 lines not shown]
DeltaFile
+18-2sys/net80211/ieee80211_crypto.h
+3-3sys/dev/malo/if_malo.h
+2-2sys/net80211/ieee80211_crypto_wep.c
+2-2sys/dev/mwl/if_mwl.c
+2-2sys/dev/ral/rt2560reg.h
+2-2sys/dev/usb/wlan/if_rsureg.h
+29-135 files not shown
+37-2111 files

FreeBSD/src c3d8acasys/net80211 DEFERRED_WORK.md README.md

net80211: add DEFERRED_WORK.md

Describe the ieee80211_task API, why its used and some of
its shortcomings.

Differential Revision:  https://reviews.freebsd.org/D57261
DeltaFile
+180-0sys/net80211/DEFERRED_WORK.md
+1-1sys/net80211/README.md
+181-12 files

FreeBSD/src 6a1e761release Makefile.vm

Makefile.vm: Split error condition

Make it clear which of two possible cases applies.

Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D56837

(cherry picked from commit 76d756eaa6823aad282cc53ec4e41a9777d89adc)
DeltaFile
+4-3release/Makefile.vm
+4-31 files

FreeBSD/src d09b42alibexec/rc rc, share/man/man8 rc.8

rc: Bail if /dev/null is not a device

On startup, check that /dev/null exists and is a character device.
Otherwise, one of two things will happen: either /dev is a writable
directory and we will immediately create /dev/null as a regular file
and dump garbage into it, or it does not and we will spit out a stream
of error messages about failing to create /dev/null.

PR:             295782
MFC after:      1 week
Reviewed by:    jhb, emaste
Differential Revision:  https://reviews.freebsd.org/D57447

(cherry picked from commit b5a96894f67a92f78f0641763eff1e0a46f2e036)
DeltaFile
+11-2share/man/man8/rc.8
+5-0libexec/rc/rc
+16-22 files

FreeBSD/src c8b81d5usr.sbin/etcupdate etcupdate.sh

etcupdate: Make diff -l actually work

While here, remove unnecessary blank lines.

MFC after:      1 week
Fixes:          6d65c91b9a47 ("etcupdate: fix arguments order of diff command")
Reviewed by:    Boris Lytochkin <lytboris at gmail.com>
Differential Revision:  https://reviews.freebsd.org/D57330

(cherry picked from commit a85e39030f8c7faa3d5a33373389440de6f0fff7)
DeltaFile
+4-14usr.sbin/etcupdate/etcupdate.sh
+4-141 files