FreeBSD/src 81f86c9 — sys/dev/usb/net if_smsc.c

smsc: Allow 10BASE-T1L/-T1S media

These are Single-Pair Ethernet types (SPE) from 802.3cg. smsc sets the
link flag only if mii_media_active is one of a known set of media types.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60745
DeltaFile
+2-0sys/dev/usb/net/if_smsc.c
+2-01 files

FreeBSD/src b958547 — sbin/sysctl sysctl.8

jail.8: fix a typo, sort Xr

PR:             299990 (typo part)
MFC after:      1 week
DeltaFile
+3-3sbin/sysctl/sysctl.8
+3-31 files

FreeBSD/src e809c7d — usr.sbin/bhyve pci_nvme.c config_schema.h, usr.sbin/bhyve/aarch64 bhyverun_machdep.c

bhyve: add command to list config options

For a software built on top of bhyve(8) and/or managing bhyve(8),
it is very convenient to know what specific features the given binary supports.
Currently, bhyve(8) provides some of this information, and it could be
retrieved by parsing `bhyve -h`, `bhyve -s help`, `bhyve -l help`.

Sometimes it is not enough, for example, the recently added
"oemstrings" feature cannot be fully probed using these commands.
Over time, some workarounds were suggested. Specifically:

 - Mapping features to __FreeBSD_version. I see at least two issues with
   that:

     * __FreeBSD_version does not directly map to bhyve(8) features,
       so this is simply not accurate.
     * bhyve(8) might be updated separately from the system, which
       is not so uncommon, especially for development purposes.
       Then such a probing will be inaccurate.

    [32 lines not shown]
DeltaFile
+202-0usr.sbin/bhyve/config_schema.c
+95-0usr.sbin/bhyve/amd64/bhyverun_machdep.c
+40-0usr.sbin/bhyve/config_schema.h
+22-0usr.sbin/bhyve/aarch64/bhyverun_machdep.c
+20-0usr.sbin/bhyve/pci_nvme.c
+18-0usr.sbin/bhyve/riscv/bhyverun_machdep.c
+397-04 files not shown
+423-110 files

FreeBSD/src a03b051 — usr.bin/locate/locate locate.1

locate.1: clarify bytes vs. characters

The database stores bytes, not characters. Remove the historical
note about 7-bit storage. Also document that -i ignores case only
for ASCII letters.

Reviewed by: ziaee
MFC after: 3 days
DeltaFile
+12-9usr.bin/locate/locate/locate.1
+12-91 files

FreeBSD/src a3d1d4e — sys/arm64/linux linux_sysvec.c

arm64 linux: Allow FUTEX_REQUEUE on arm64 by setting the brand flag

Better change is to provide the dedicated musl brandinfo, as it is done
on amd64/i386, which should be done later.

PR:     299836
MFC after:      1 week
DeltaFile
+2-1sys/arm64/linux/linux_sysvec.c
+2-11 files

FreeBSD/src 9a8d5af — sys/compat/linux linux_misc.c

linux: correct errors from mremap(2)

Linux returns EFAULT when the range to be remapped is not mapped at all,
and ENOMEM only when it is mapped but cannot be grown in place. Callers
depend on that distinction: musl's pthread_getattr_np() measures the
main thread stack by growing a one page mapping and retries while errno
is ENOMEM. Returning ENOMEM for every growth request makes that loop
spin forever.

PR:     299835
MFC after:      1 week
DeltaFile
+5-2sys/compat/linux/linux_misc.c
+5-21 files

FreeBSD/src 30b7087 — sys/conf files, sys/dev/wg if_wg.c

wg: fix the LINT-NOIP build

We don't have anything to tunnel without INET or INET6, so just smack
it with the same config(5) hammer that ovpn uses and exclude it from
such builds.

Reported by:    mjg
Reviewed by:    emaste, markj

(cherry picked from commit 8430de47aa7c004e1330b8f6a3018c360425606e)
DeltaFile
+4-4sys/conf/files
+0-2sys/dev/wg/if_wg.c
+4-62 files

FreeBSD/src ea041ed — stand/efi/loader main.c

loader.efi: devinit() just after parsing args instead

c4640126f1160 ("loader.efi: Apply command-line DHCP overrides earlier")
was really good, but moving it just one statement earlier is even
better.  polarian on Libera describes a GELI setup on a system that
doesn't advertise a serial console via ConOut.  They don't have serial
input at the point that they would get prompted for the GELI passphrase,
but if we parse args just before devinit() then he can override the
console with `efibootmgr -e`.  This gives UEFI one advantage over BIOS
loader, as /boot.config isn't available to provide that kind of override
if your impediment is GELI.

We also considered reading loader.env earlier, but we have a chicken/egg
problem in that we must have probed for the ESP to be able to open() it.
We would instead need a devinit_early() and devinit_late() scheme that
allows GELI probing to be deferred until the later pass, after reading
loader.env to pick up the console override.  That's an idea I'd still
like to discuss because it's more robust than hoping that firmware won't
wipe out our efibootmgr(8) entries.

    [5 lines not shown]
DeltaFile
+6-2stand/efi/loader/main.c
+6-21 files

FreeBSD/src 5245187 — etc/mtree BSD.var.dist, libexec/rc rc.conf

rc: add a backlight service to save/restore backlight levels

The default on my laptop is annoyingly bright, and this is a useful
feature to mitigate that.  The backlight script is largely a copy of the
mixer service which provides the same value for mixers, but this one is
specifically dependant on kld to allow DRM drivers a chance to attach.

Note that it's off by default to avoid interference with DEs, and
document the capability in backlight(8).  Set backlight_enable=YES in
rc.conf(5) to enable save/restore.

Relnotes:       maybe
Reviewed by:    bapt, ivy, manu, ziaee

(cherry picked from commit c45bdb39fe985b43afc63b7cbd989fe7a61673b7)
DeltaFile
+88-0libexec/rc/rc.d/backlight
+10-1usr.bin/backlight/backlight.8
+6-1share/man/man5/rc.conf.5
+2-0etc/mtree/BSD.var.dist
+1-0libexec/rc/rc.d/Makefile
+1-0libexec/rc/rc.conf
+108-26 files

FreeBSD/src 84ec2d3 — stand/userboot userboot.h, stand/userboot/userboot main.c

iuserboot: bump the interface to v6, add an accept_interpreter callback

If an explicit loader wasn't requested, then bhyveload(8) maintains a
/boot handle that it can use for swapping to a different flavor.  This
means that we expose all of the host /boot to the sandbox for the
duration of script execution.

Add a callback to ack that we're OK with the interpreter so that
bhyveload(8) can release the bootfd.  This is worth doing because it's
prior to guest script execution, so we're still running a reasonably
untainted process.

Reviewed by:    imp, jhb

(cherry picked from commit 619d09217720cb82f562b51e98576438dc11c830)
DeltaFile
+18-5usr.sbin/bhyveload/bhyveload.c
+12-0stand/userboot/userboot.h
+2-0stand/userboot/userboot/main.c
+32-53 files

FreeBSD/src 77f8982 — sys/dev/sound/usb uaudio.c

snd_uaudio: recognize hardware sidetone as a monitor

The Logitech H390, for instance, has the following interface layout:

~~
7 INPUT              34 INPUT            10 INPUT
  Mic (0x201)          Mic (0x201)         USB Stream (0x101)
   |                    |                     |
   v                    v                     |
 19 FEATURE           35 FEATURE              |
   |                    |                     |
   v                    v                     |
 25 EXTENSION           +------> 36 MIXER <---+
   |                              |
   v                              v
 13 OUTPUT                     22 FEATURE
 USB Stream (0x101)               |
                                  v
                               16 OUTPUT

    [30 lines not shown]
DeltaFile
+20-2sys/dev/sound/usb/uaudio.c
+20-21 files

FreeBSD/src cb77c4e — sys/dev/amdsmu amdsmu.c

amdsmu: Don't rely on s0i3_last_entry_status metric

This metric seems unreliable and I have observed it occasionally report
1 (successful entry to S0i3) when the time_last_in_s0i3 metric was 0 on
Phoenix, which does not make sense.

So just rely on time_last_in_s0i3 instead.

Sponsored by:   The FreeBSD Foundation
DeltaFile
+5-1sys/dev/amdsmu/amdsmu.c
+5-11 files

FreeBSD/src 020adbc — crypto/openssl patch, crypto/openssl/crypto/bio bio_sock2.c

openssl: build libcrypto and libssl from upstream's source set

Compared the bmake source lists of libcrypto and libssl with upstream's
own build of 3.5.8 (configured with the options in
crypto/openssl/BSDmakefile), and fix the differences that are not
intentional.

libcrypto:
- aarch64: build bsaes-armv8.S and md5-aarch64.S, and define BSAES_ASM
  and MD5_ASM, as upstream does.  Both files have been generated into
  sys/crypto/openssl/aarch64 since the 3.5.1 import, but were never
  compiled.
- Stop compiling der_digests_gen.c, der_dsa_key.c and der_ec_key.c.
  Upstream keeps them in libcommon.a, but the linker does not extract
  them into libcrypto (checked with --why-extract) as nothing in
  libcrypto references them.

libssl:
- Fix the "SRSC" typo that left out ssl3_cbc.c and tls_pad.c.

    [17 lines not shown]
DeltaFile
+8-5secure/lib/libcrypto/Makefile
+0-11crypto/openssl/crypto/bio/bio_sock2.c
+7-2secure/lib/libssl/Makefile
+2-1secure/lib/libcrypto/Makefile.common
+0-0crypto/openssl/patch
+17-195 files

FreeBSD/src 2ada950 — crypto/openssl BSDmakefile, crypto/openssl/tools c_rehash

openssl: configure with --openssldir=/etc/ssl

BSDmakefile passed --openssldir=etc.  A relative openssldir is taken
relative to the prefix, so the generated files described /usr/etc.
FreeBSD has always used /etc/ssl (OPENSSLDIR in
secure/lib/libcrypto/Makefile.common), so configure with that.

Regenerate tools/c_rehash, the only committed generated file that
depends on openssldir.  It is not installed.  No compiled code changes.

Reviewed by:    ngie, markj
Differential Revision:  https://reviews.freebsd.org/D60396

(cherry picked from commit cb3d3e5bb0c6bbb1f6ef3efe67e7a6e71bc20f0b)
DeltaFile
+1-1crypto/openssl/tools/c_rehash
+1-1crypto/openssl/BSDmakefile
+2-22 files

FreeBSD/src 10cedda — sys/dev/usb/net if_smsc.c

smsc: Use read-modify-write to configure LEDs

After reset the driver enables three LED outputs by writing 1s to
the appropriate GPIO/LED configuration bits in the LED & GPIO
configuration register LED_GPIO_CFG.

The LED Select (LED_SEL) bit in LED_GPIO_CFG chooses between two LED
modes:

0: Speed, Link+Activity, Full Duplex
1: Speed, Link, Activity

If an EEPROM is present LED_SEL is initialized from bit 1 in the
EEPROM's configuration flags value.  If no EEPROM is present this bit
defaults to zero.

Previously we wrote to all bits in the register, clearing LED_SEL.  A
device with LED_SEL set by the EEPROM would thus not have correct LEDs.


    [6 lines not shown]
DeltaFile
+3-1sys/dev/usb/net/if_smsc.c
+3-11 files

FreeBSD/src dc4c75c — sys/dev/usb/net if_smscreg.h if_smsc.c

smsc: Support external PHY

SMSC_HW_CFG_PSEL indicates that an external PHY is present. Skip the
internal PHY initialization when set and store the ID of the detected
PHY.

Reviewed by:    br
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60744
DeltaFile
+31-8sys/dev/usb/net/if_smsc.c
+1-0sys/dev/usb/net/if_smscreg.h
+32-82 files

FreeBSD/src 13011cb — sys/dev/usb/net if_smsc.c

smsc: Remove phy address check in smsc_miibus_writereg

The driver only allowed writes to the expected phy (i.e., sc->sc_phyno),
and reads were never filtered.  sc_phyno is already passed to
mii_attach() as phyloc, so nothing tries to issue MDIO writes to other
addresses and the check is not required.

Remove the check in advance of supporting external PHYs at arbitrary
addresses.

Tested on Microchip's EVB-LAN9500A-LC LAN9500A evaluation board.

Sponsored by:   The FreeBSD Foundation
Sponsored by:   Microchip (Hardware)
Differential Revision: https://reviews.freebsd.org/D60743
DeltaFile
+0-3sys/dev/usb/net/if_smsc.c
+0-31 files

FreeBSD/src 335bee0 — sys/netinet tcp_subr.c tcp_var.h, usr.bin/sockstat sockstat.1 main.c

sockstat: provide more BBLog information

When using -b, provide in addition to the BBLog state also the number
of entries stored at the endpoint, the corresponding upper limit and
the next sequence number to be assigned.

Reviewed by:            rrs
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D59131

(cherry picked from commit 209668726c2fff047b27a13c6add7e9820696651)
DeltaFile
+44-3usr.bin/sockstat/main.c
+15-2usr.bin/sockstat/sockstat.1
+4-1sys/netinet/tcp_var.h
+3-0sys/netinet/tcp_subr.c
+66-64 files

FreeBSD/src 91bff7d — sys/netinet in_pcb_var.h in_pcb.h, sys/netinet6 in6_pcb.c

Revert "inpcb: add single peer local port caching"

This reverts commit 289082428c764ed282623cc6f7ee9b7448fddad1.

Requested by:   markj
DeltaFile
+1-243sys/netinet/in_pcb.c
+1-1sys/netinet/in_pcb.h
+0-1sys/netinet6/in6_pcb.c
+0-1sys/netinet/in_pcb_var.h
+2-2464 files

FreeBSD/src f172668 — sys/net iflib.c

iflib: Do not pull up trailing IPv4 fragments to the L4 header

iflib_parse_header() pulls every IPv4 packet up to the end of the TCP or
UDP header, including fragments at a non-zero offset, which carry no L4
header at all.  A trailing fragment shorter than that header (1-7 bytes
of UDP, 1-19 bytes of TCP) makes m_pullup() fail and the frame is freed
without a trace in the interface counters.

Only parse the L4 header on the first fragment.  TSO never produces
fragments, so assert that.

With a 1500-byte MTU every UDP datagram of 1473-1479 bytes is lost
behind a forwarding host whose ingress NIC sets receive checksum flags,
or on any VLAN with hardware tagging.  SIP over UDP is a common victim.

Reported by:    Alex Roberts
Reviewed by:    gallatin
Fixes:          c224b2ce7de0 ("iflib: don't pullup UDP payloads to the TCP header size")
See also:       https://redmine.pfsense.org/issues/17196

    [2 lines not shown]
DeltaFile
+11-4sys/net/iflib.c
+11-41 files

FreeBSD/src c31cc43 — usr.bin/sockstat main.c

sockstat: improve consistency

Include the entries of the BBLOG STATE column in the computation
of the column width as done also for other columns.
Also set first to falso only when needed.

Sponsored by:   Netflix, Inc.

(cherry picked from commit 732c8d2a1a0e169bad1c02b1e54a4306861bde4a)
DeltaFile
+5-1usr.bin/sockstat/main.c
+5-11 files

FreeBSD/src a949836 — usr.bin/sockstat main.c

Revert "sockstat: improve consistency"

This reverts commit 2001681da17920216251a4dd35c6778bcabb25bd.
DeltaFile
+1-5usr.bin/sockstat/main.c
+1-51 files

FreeBSD/src 2001681 — usr.bin/sockstat main.c

sockstat: improve consistency

Include the entries of the BBLOG STATE column in the computation
of the column width as done also for other columns.
Also set first to falso only when needed.

Sponsored by:   Netflix, Inc.

(cherry picked from commit 732c8d2a1a0e169bad1c02b1e54a4306861bde4a)
DeltaFile
+5-1usr.bin/sockstat/main.c
+5-11 files

FreeBSD/src 3b09a93 — usr.bin/sockstat main.c

Revert "sockstat: improve consistency"

This reverts commit 71b1f005a56ea11bea1588f2b215f8714a36e71b.
It  breaks compilation.
DeltaFile
+1-5usr.bin/sockstat/main.c
+1-51 files

FreeBSD/src 86a925f — share/man/man4 ptnet.4

ptnet.4: Fix typo

MFC after:      3 days
Reviewed by:    ziaee
Signed-off-by:  Seth Hoffert <seth.hoffert at gmail.com>
Closes:         https://github.com/freebsd/freebsd-src/pull/2480
DeltaFile
+1-1share/man/man4/ptnet.4
+1-11 files

FreeBSD/src cf63e3f — lib/libsys pdfork.2

pdfork.2: improve markup

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+1-1lib/libsys/pdfork.2
+1-11 files

FreeBSD/src 2b6479e — sys/dev/ice if_ice_iflib.c ice_lib.c

ice(4): Fix link bringup on driver load

Patch adding Total Port Shutdown support incorrectly
handled a case when this feature was not enabled in the NVM.
When TPS bit is not set driver should apply link configuration
according to user settings and update the status. Those steps
were mistakenly omitted, while the state flag was still set
to prevent link renegotation and status update on first
attempt to bring interface up with ifconfig.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>

Reported by:    kbowling
Reviewed by:    kbowling
Fixes:          0011cd9f8863 ("ice(4): Support Total Port Shutdown on E830 devices")
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D59578

(cherry picked from commit dcb84ddcfe89d358a66cffb45196e6b45b45502c)
DeltaFile
+22-4sys/dev/ice/ice_lib.c
+2-4sys/dev/ice/if_ice_iflib.c
+24-82 files

FreeBSD/src 8b5c666 — sys/dev/ice ice_lib.h ice_strings.c

ice(4): Support Total Port Shutdown on E830 devices

When 'Permit Total Port Shutdown' feature in BIOS is enabled then Port
Disable bit is set in the Link Default Override Mask TLV PFA module
in the NVM. In this mode, the driver acts as if the link_active_on_if_down
flag is always disabled and disallow any change to that flag.
This feature applies for E830 and E835 NIC series.

Signed-off-by: Pawel Sobczyk <pawel.sobczyk at intel.com>

Tested by:      Mateusz Moga <mateusz.moga at intel.com>
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D58149

(cherry picked from commit 0011cd9f8863fce3743bfd9920b7924162bb6410)
DeltaFile
+10-5sys/dev/ice/ice_lib.c
+9-0sys/dev/ice/if_ice_iflib.c
+2-0sys/dev/ice/ice_strings.c
+1-0sys/dev/ice/ice_lib.h
+22-54 files

FreeBSD/src bbd9741 — sys/netinet sctp_indata.c

sctp: improve locking validation

Ensure that the TCB lock is hold in sctp_calc_rwnd().

Reviewed by:    tuexen

(cherry picked from commit 38479a4832789c239eb1ff097ee51e93e8084315)
DeltaFile
+2-0sys/netinet/sctp_indata.c
+2-01 files

FreeBSD/src 0b3f85d — sys/netinet sctputil.c

sctp: hold tcp lock when calling sctp_calc_rwnd()

This was done in all code paths except one. Fix this to avoid
race conditions.

Reported by:    syzbot+2e2dc35c0e24a74663a7 at syzkaller.appspotmail.com
Reviewed by:    tuexen

(cherry picked from commit 429f2fb48b92011d07798e681d96aa628fd8e387)
DeltaFile
+14-21sys/netinet/sctputil.c
+14-211 files