FreeBSD/src e4bca1blib/libc/stdtime ctime.3

libc/ctime.3: timegm() is in C23.

See also:       D53951, https://wiki.freebsd.org/C23
MFC after:      1 week

(cherry picked from commit 68251761c77b2f5ff927cf19bba7d4efa88799de)
DeltaFile
+4-3lib/libc/stdtime/ctime.3
+4-31 files

FreeBSD/src e2fb604lib/libc/gen timespec_getres.3 timespec_get.3

libc/timespec_get*.3: expose STANDARDS section

We now have .St -isoC-2023, so the STANDARDS section can go live.

Fixes:          9b5d724cad10087e34165199e55f15f2df744ed5
MFC after:      1 week

(cherry picked from commit aa92784fcb8a375231058d67f7ccaeaa3e42ed33)
DeltaFile
+6-6lib/libc/gen/timespec_getres.3
+5-5lib/libc/gen/timespec_get.3
+11-112 files

FreeBSD/src dcd2fedetc/mtree BSD.tests.dist

BSD.tests.dist: Add the new sys/mac/do directory

Without that, 'make distributeworld' fails ('make buildworld' and 'make
installworld' do not need it).

Fixes:          cba191e291c1 ("MAC/do: Add basic tests on setting rules")
MFC after:      1 minute
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit ad3d7666e00bb0261dd2b80f5f2d56ceeb84aba7)
DeltaFile
+2-0etc/mtree/BSD.tests.dist
+2-01 files

FreeBSD/src ad3d766etc/mtree BSD.tests.dist

BSD.tests.dist: Add the new sys/mac/do directory

Without that, 'make distributeworld' fails ('make buildworld' and 'make
installworld' do not need it).

Fixes:          cba191e291c1 ("MAC/do: Add basic tests on setting rules")
MFC after:      1 minute
Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-0etc/mtree/BSD.tests.dist
+2-01 files

FreeBSD/src bc2055bsbin/devd snd.conf

sbin/devd/snd.conf: Add missing -n options to sysrc calls

Reviewed by:    christos
Fixes:          70e27ecba518 (virtual_oss: Introduce virtual_oss_default_control_device rc variable)
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/36
DeltaFile
+3-3sbin/devd/snd.conf
+3-31 files

FreeBSD/src f5433e7sys/kern vfs_mount.c

vfs_domount(): handle the case when vn_lock_pair() only locked once

Reviewed by:    jah, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57035
DeltaFile
+6-2sys/kern/vfs_mount.c
+6-21 files

FreeBSD/src ace4a3esys/kern vfs_vnops.c, sys/sys vnode.h

vn_lock_pair(): handle the case of vp1->v_vnlock == vp2->v_vnlock

It is not enough to check vp1 == vp2 to detect lock recursion, since
vnodes might share the locks.  This might happen for e.g. stacked
filesystems (nullfs and other), and for FFS snapshots.

Switch from checking vnode equiality to check v_vnlock equiality, and
recheck the condition after vnode relock since reclamation or otner
parallel operation might change the vnode locks under us.

Return a value (not really an error) indicating the case that vnodes
share the lock, to simplify the unlock in caller.

Reviewed by:    jah, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57035
DeltaFile
+25-7sys/kern/vfs_vnops.c
+1-1sys/sys/vnode.h
+26-82 files

FreeBSD/src 03c410bshare/man/man9 copy.9

man: Stop referring to non-existing manpage strlcpy(9)

Reviewed by: ziaee, mhorne, kevans
DeltaFile
+3-2share/man/man9/copy.9
+3-21 files

FreeBSD/src 115256fsys/sys elf_common.h

elf_common.h: Add SHT_LLVM_ADDRSIG

Reported by:    bz
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 22c054c4cce719662d503685138433eb27d40001)
DeltaFile
+1-0sys/sys/elf_common.h
+1-01 files

FreeBSD/src a05c4fbtests/sys/mac Makefile, tests/sys/mac/do valid_configs.sh invalid_configs.sh

MAC/do: Add basic tests on setting rules

MFC after:      1 minute
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit cba191e291c17b32247e12d6f94dcde56994bfe6)
DeltaFile
+135-0tests/sys/mac/do/valid_configs.sh
+86-0tests/sys/mac/do/invalid_configs.sh
+72-0tests/sys/mac/do/common.sh
+14-0tests/sys/mac/do/Makefile
+1-0tests/sys/mac/Makefile
+308-05 files

FreeBSD/src 51b48d3share/man/man4 mac_do.4

mac_do.4: Jail parameter takes 'new', not 'enable'; uid_t/gid_t are 32-bit

MFC after:      1 minute
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 21df76d01fce35b0398cf38c31928c6f47111d55)
DeltaFile
+4-4share/man/man4/mac_do.4
+4-41 files

FreeBSD/src cba191etests/sys/mac Makefile, tests/sys/mac/do valid_configs.sh invalid_configs.sh

MAC/do: Add basic tests on setting rules

MFC after:      1 minute
Sponsored by:   The FreeBSD Foundation
DeltaFile
+135-0tests/sys/mac/do/valid_configs.sh
+86-0tests/sys/mac/do/invalid_configs.sh
+72-0tests/sys/mac/do/common.sh
+14-0tests/sys/mac/do/Makefile
+1-0tests/sys/mac/Makefile
+308-05 files

FreeBSD/src 21df76dshare/man/man4 mac_do.4

mac_do.4: Jail parameter takes 'new', not 'enable'; uid_t/gid_t are 32-bit

MFC after:      1 minute
Sponsored by:   The FreeBSD Foundation
DeltaFile
+4-4share/man/man4/mac_do.4
+4-41 files

FreeBSD/src 8532b4alibexec/rc/rc.d virtual_oss

rc: virtual_oss: Create a loopback device in the default configuration

The loopback device allows us to record desktop sound by reading from
it, or even use it as an input device, for example during a call.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    emaste
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/16
DeltaFile
+1-0libexec/rc/rc.d/virtual_oss
+1-01 files

FreeBSD/src 5f904cbusr.sbin/virtual_oss/virtual_oss main.c virtual_oss.8

virtual_oss(8): Create loopback devices with GID_AUDIO

Make sure the user is part of the audio group to avoid unintended
snooping of loopback audio by unprivileged users.

While here, retire voss_dsp_perm, since we don't use the same value
everywhere now.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    emaste
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/26
DeltaFile
+22-5usr.sbin/virtual_oss/virtual_oss/main.c
+3-1usr.sbin/virtual_oss/virtual_oss/virtual_oss.8
+25-62 files

FreeBSD/src 6024e3fetc group, sys/sys conf.h

Add audio group

To be initially used by virtual_oss(8) loopback devices.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    emaste
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/26
DeltaFile
+1-0etc/group
+1-0sys/sys/conf.h
+2-02 files

FreeBSD/src 8c90d1eshare/man/man4 p9fs.4 Makefile

p9fs.4: MLINK to virtio_p9fs.4

Technically, virtio_p9fs is an emulated device that masquerades
as a p9fs mount, but it does not make sense to have two separate manual
pages.

Reviewed by:    bnovkov, dfr
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57013

(cherry picked from commit 30f500e97b57d36ebb8483cb8b8921507350cd0f)
DeltaFile
+3-2share/man/man4/p9fs.4
+1-0share/man/man4/Makefile
+4-22 files

FreeBSD/src a8c74d6tests/sys/netinet6 ndp.sh

tests/ndp: fix ndp_routeinfo_option testcase flakiness

Since we are sleeping for an indefinite period of time waiting
for the default route to appear, the expire times may be gone
past 1+ seconds, causing the Expire column to show <1800 or <600.

Fixes:  f6bcc0925f0ea838da5183dc503f847e56d15cc8

Reviewed by:    pouria
Approved by:    lwhsu (mentor)
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D56712
DeltaFile
+10-5tests/sys/netinet6/ndp.sh
+10-51 files

FreeBSD/src c170a96. Makefile

universe: emit warning instead of error for bad/missing KERNCONF

When doing a large `make universe` build with multiple KERNCONFS,
it should not be an error when a particular target has a missing
KERNCONF.

In this example,

```
$ make universe TARGETS='arm64 riscv' KERNCONFS='QEMU VIRT'
```

Currently, arm64 does not have a QEMU conf, and riscv
does not have a VIRT conf. However, this command should still
succeed instead of failing with the following message:

```
make[2]: /usr/src/Makefile:767: Target architecture for riscv/conf/VIRT unknown.  config(8) likely too old.
        in .for loop from /usr/src/Makefile:761 with kernel = VIRT

    [13 lines not shown]
DeltaFile
+5-1Makefile
+5-11 files

FreeBSD/src 02ef0b6. Makefile, share/man/man7 build.7

universe: allow moving build logs to UNIVERSE_LOGDIR

This allows `make universe` or `make tinderbox`
to build from a read-only src tree.

Reviewed by:    ziaee, imp, delphij
Approved by:    lwhsu (mentor), emaste (mentor)
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55566
DeltaFile
+8-9Makefile
+6-1share/man/man7/build.7
+14-102 files

FreeBSD/src d7cde43sys/net if_loop.c

Revert "loopback: Clear hash unconditionally."

This reverts commit 2fe37927d41990abe8d1c336e75fd75873285e90.

This turns out to have been misguided.  First, clearing the
hash results in all loopback ip/ip6 traffic being hashed
to the netisr queue associated with the if_index of the loopback
interface.  Eg, it bottlenecks loopback traffic. When the
hash is kept, traffic is spread evenly among netisrs.

Also, it is safe to keep the hash here.  The clearing was only
needed when RSS core selection is enabled; we only enabled the
consistent hashing parts of RSS globally, not the cpuid mapping
stuff.  So there is no need to clear it.

Reviewed by: glebius
Sponsored by: Netflix
DeltaFile
+2-0sys/net/if_loop.c
+2-01 files

FreeBSD/src 198379dsys/netpfil/ipfw ip_fw_nat.c

ipfw: fix checksum after NAT

When checksum offloading is used, IPFW needs to fix the checksum
after libalias has done NAT. The ipfw_nat() function does so, but
only for mbufs without a receiving interface. However, if, for example,
the packet was sent inside a jail that used checksum offloading over
an epair, ipfw still needs to fix the checksum even though the mbuf
has set a receiving interface (epair).
This patch just removes the check whether a receiving interface is set.

PR:                     295057
Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D57091

(cherry picked from commit 81b47a7c604f1d563283759572fa7a1f9d4dc56f)
DeltaFile
+7-8sys/netpfil/ipfw/ip_fw_nat.c
+7-81 files

FreeBSD/src 81b47a7sys/netpfil/ipfw ip_fw_nat.c

ipfw: fix checksum after NAT

When checksum offloading is used, IPFW needs to fix the checksum
after libalias has done NAT. The ipfw_nat() function does so, but
only for mbufs without a receiving interface. However, if, for example,
the packet was sent inside a jail that used checksum offloading over
an epair, ipfw still needs to fix the checksum even though the mbuf
has set a receiving interface (epair).
This patch just removes the check whether a receiving interface is set.

PR:                     295057
Reviewed by:            tuexen
MFC after:              immediately
Differential Revision:  https://reviews.freebsd.org/D57091
DeltaFile
+7-8sys/netpfil/ipfw/ip_fw_nat.c
+7-81 files

FreeBSD/src e9cbbf0lib/libc/gen nlist.c

nlist: Decrement nent on match

PR:             295336
MFC after:      1 week
Fixes:          4617a6cb82a6 ("nlist: Handle multiple symbol tables")
DeltaFile
+3-1lib/libc/gen/nlist.c
+3-11 files

FreeBSD/src 151d5f6sys/netpfil/ipfw ip_fw_nat.c

ipfw: fix checksum after NAT

When checksum offloading is used, IPFW needs to fix the checksum
after libalias has done NAT. The ipfw_nat() function does so, but
only for mbufs without a receiving interface. However, if, for example,
the packet was sent inside a jail that used checksum offloading over
an epair, ipfw still needs to fix the checksum even though the mbuf
has set a receiving interface (epair).
This patch just removes the check whether a receiving interface is set.

PR:                     295057
Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D57091

(cherry picked from commit 81b47a7c604f1d563283759572fa7a1f9d4dc56f)
DeltaFile
+7-8sys/netpfil/ipfw/ip_fw_nat.c
+7-81 files

FreeBSD/src 6eba055sbin/ipfw nat.c ipfw.8, tests/sys/netpfil/common nat.sh

ipfw: fix parsing error in nat config port_range

Also fix the corresponding tests.

PR:             263240
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57010
DeltaFile
+16-13sbin/ipfw/nat.c
+14-12tests/sys/netpfil/common/nat.sh
+2-1sbin/ipfw/ipfw.8
+32-263 files

FreeBSD/src 1d0410fsbin/ping ping6.c

ping6: convert receive loop from pselect(2) to ppoll(2)

pselect(2) might overflow if the desciptor number is above
FD_SETSIZE and silently corrupt the stack. Switch to ppoll(2) so
the receive socket fd is no longer constrained by FD_SETSIZE.

Reported by:    Joshua Rogers of AISLE Research Team
Reviewed by:    markj
MFC after:      7 days
Differential Revision:  https://reviews.freebsd.org/D56721
DeltaFile
+6-4sbin/ping/ping6.c
+6-41 files

FreeBSD/src 8759a34sys/conf newvers.sh

15.1: Bump version to BETA3-p1

Since we had a conveniently timed batch of security issues, I'm going
to use this opportunity to test pkgbase update tooling.

Approved by:    re (cperciva)
DeltaFile
+1-1sys/conf/newvers.sh
+1-11 files

FreeBSD/src 8f715c6crypto/openssh freebsd-configure.sh

openssh: Fix SIZEOF_TIME_T in freebsd-configure.sh

Sponsored by:   The FreeBSD Foundation
Reviewed by:    jlduran
Differential Revision: https://reviews.freebsd.org/D57053

(cherry picked from commit 0b0e5daf4333a0faf93133f7d2c7b3743eead9d8)
(cherry picked from commit b718f7d88157f4d5827e3639c1e0ba7e5383ed04)
DeltaFile
+7-0crypto/openssh/freebsd-configure.sh
+7-01 files

FreeBSD/src bc301fetests/sys/net/routing test_routing.sh Makefile

routing: Add tests for metric

Add tests to make sure:
* Default metric is enforced.
* Lowest metric wins.
* Deleting routes by specifying gateway/metric works.

Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D57016
DeltaFile
+231-0tests/sys/net/routing/test_routing.sh
+3-0tests/sys/net/routing/Makefile
+234-02 files