FreeBSD/src a667352usr.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

(cherry picked from commit 5f904cb1b05c94453727abb606d6109fe504b10b)
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 a181c51etc 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

(cherry picked from commit 6024e3f99a1e3f5e52fd50c26789fc2dc98fd9c1)
DeltaFile
+1-0etc/group
+1-0sys/sys/conf.h
+2-02 files

FreeBSD/src 6524505libexec/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

(cherry picked from commit 8532b4a436364d04d5c1feb7af5ecd4b5df71a9f)
DeltaFile
+1-0libexec/rc/rc.d/virtual_oss
+1-01 files

FreeBSD/src 6e2940ausr.sbin/lpr/lpd lpd.8

lpd: Reorder option list in manual page

MFC after:      1 week
Reviewed by:    ziaee, markj
Differential Revision:  https://reviews.freebsd.org/D57182

(cherry picked from commit 8e917789732ae02a480e8756899d3bc6d99fe5d8)
DeltaFile
+18-24usr.sbin/lpr/lpd/lpd.8
+18-241 files

FreeBSD/src 7c11b5fusr.sbin/lpr/lpd printjob.c

lpd: Avoid buffer overflow when sending a job

When forwarding a print job to a remote server, we could overflow the
command buffer if a control or data file had a very long name.

MFC after:      1 week
Reported by:    Joshua Rogers <joshua at joshua.hu>
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57184

(cherry picked from commit f2c7c5f94803b67a9a6af625d4fc8882d2afda6c)
DeltaFile
+20-11usr.sbin/lpr/lpd/printjob.c
+20-111 files

FreeBSD/src 94da67busr.sbin/lpr/lpd printjob.c

lpd: Style and whitespace cleanup

No functional change intended.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57186

(cherry picked from commit 123591e41c559fc2ae0f179f1385df05132881da)
DeltaFile
+92-99usr.sbin/lpr/lpd/printjob.c
+92-991 files

FreeBSD/src 980ead5usr.sbin/lpr/lpd printjob.c

lpd: Fix issues reported by clang-analyzer

Also, unlink our temporary file if we fail to chmod it.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57185

(cherry picked from commit 0f3e14870906da22a7ca821fb2153d375157cac2)
DeltaFile
+20-19usr.sbin/lpr/lpd/printjob.c
+20-191 files

FreeBSD/src 5f10e36usr.sbin/lpr/lpd lpd.8 lpd.c

lpd: Drop deprecated -p option

This alias for the -s option has been deprecated since 2002.  Time to
drop it from the documentation.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57183

(cherry picked from commit 6047f6a21085ae3877228f8df19a0d4bce45905f)
DeltaFile
+1-10usr.sbin/lpr/lpd/lpd.8
+0-3usr.sbin/lpr/lpd/lpd.c
+1-132 files

FreeBSD/src 85852feusr.sbin/lpr/lpd lpd.c lpd.8

lpd: Restore ability to specify a port number

This has been broken since IPv6 support was added in 2000.  We would
validate the port number (which had to be a port number, but can now
also be a service name) and then ignore it.

MFC after:      1 week
Fixes:          08829865f659 ("IPv6 support for lpr.")
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57181

(cherry picked from commit c0cae7d8da50daa87af4cd6d7c9a2043343b506f)
DeltaFile
+9-19usr.sbin/lpr/lpd/lpd.c
+10-9usr.sbin/lpr/lpd/lpd.8
+19-282 files

FreeBSD/src b734006usr.sbin/lpr/chkprintcap chkprintcap.8, usr.sbin/lpr/lp lp.1

lpr: Add deprecation notice

These programs require elevated privileges to work and have not seen
regular maintenance in decades.  Unless someone steps up and overhauls
them, we will have to remove them before 16.0.  Better-maintained
alternatives are available in ports (print/cups, sysutils/LPRng).

MFC after:      3 days

(cherry picked from commit d57dee7ab66f60537b557cb602be194e3eed253d)
DeltaFile
+3-0usr.sbin/lpr/chkprintcap/chkprintcap.8
+3-0usr.sbin/lpr/lp/lp.1
+3-0usr.sbin/lpr/lpc/lpc.8
+3-0usr.sbin/lpr/lpd/lpd.8
+3-0usr.sbin/lpr/lpq/lpq.1
+3-0usr.sbin/lpr/lpr/lpr.1
+18-04 files not shown
+30-010 files

FreeBSD/src 02f9207usr.sbin/lpr/lpd printjob.c

lpd: Avoid buffer overflow when sending a job

When forwarding a print job to a remote server, we could overflow the
command buffer if a control or data file had a very long name.

MFC after:      1 week
Reported by:    Joshua Rogers <joshua at joshua.hu>
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57184

(cherry picked from commit f2c7c5f94803b67a9a6af625d4fc8882d2afda6c)
DeltaFile
+20-11usr.sbin/lpr/lpd/printjob.c
+20-111 files

FreeBSD/src 966ed82usr.sbin/lpr/lpd lpd.8

lpd: Reorder option list in manual page

MFC after:      1 week
Reviewed by:    ziaee, markj
Differential Revision:  https://reviews.freebsd.org/D57182

(cherry picked from commit 8e917789732ae02a480e8756899d3bc6d99fe5d8)
DeltaFile
+18-24usr.sbin/lpr/lpd/lpd.8
+18-241 files

FreeBSD/src eb5bab2usr.sbin/lpr/lpd lpd.c lpd.8

lpd: Restore ability to specify a port number

This has been broken since IPv6 support was added in 2000.  We would
validate the port number (which had to be a port number, but can now
also be a service name) and then ignore it.

MFC after:      1 week
Fixes:          08829865f659 ("IPv6 support for lpr.")
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57181

(cherry picked from commit c0cae7d8da50daa87af4cd6d7c9a2043343b506f)
DeltaFile
+9-19usr.sbin/lpr/lpd/lpd.c
+10-9usr.sbin/lpr/lpd/lpd.8
+19-282 files

FreeBSD/src a895394usr.sbin/lpr/lpd lpd.8 lpd.c

lpd: Drop deprecated -p option

This alias for the -s option has been deprecated since 2002.  Time to
drop it from the documentation.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57183

(cherry picked from commit 6047f6a21085ae3877228f8df19a0d4bce45905f)
DeltaFile
+1-10usr.sbin/lpr/lpd/lpd.8
+0-3usr.sbin/lpr/lpd/lpd.c
+1-132 files

FreeBSD/src b3a76abusr.sbin/lpr/lpd printjob.c

lpd: Fix issues reported by clang-analyzer

Also, unlink our temporary file if we fail to chmod it.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57185

(cherry picked from commit 0f3e14870906da22a7ca821fb2153d375157cac2)
DeltaFile
+20-19usr.sbin/lpr/lpd/printjob.c
+20-191 files

FreeBSD/src c4a0289usr.sbin/lpr/lpd printjob.c

lpd: Style and whitespace cleanup

No functional change intended.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57186

(cherry picked from commit 123591e41c559fc2ae0f179f1385df05132881da)
DeltaFile
+92-99usr.sbin/lpr/lpd/printjob.c
+92-991 files

FreeBSD/src 3d6c733libexec/talkd announce.c, usr.bin/wall ttymsg.c wall.c

ttymsg: Overhaul

* Instead of an error string, return the usual 0 or -1 and let the caller
  figure out what, if anything, to tell the user.

* Avoid string manipulations by opening /dev first and using openat()
  with O_RESOLVE_BENEATH.

* Add a boolean argument which, if false, causes ttymsg() to return
  without sending the message if the tty's group-writable bit is not
  set.  This saves programs that respect this setting (like syslogd(8))
  from having to check before calling ttymsg().

* Update all callers.

The observable effect of this change is minimal except for slightly
different error messages when ttymsg() fails.  However, syslogd(8) will
no longer print spurious error messages on the console after trying and
failing to write a log message to an X11 session.

    [7 lines not shown]
DeltaFile
+64-54usr.bin/wall/ttymsg.c
+9-39usr.sbin/syslogd/syslogd.c
+3-3usr.bin/wall/wall.c
+2-1libexec/talkd/announce.c
+1-1usr.bin/wall/ttymsg.h
+79-985 files

FreeBSD/src cf5cb2clibexec/talkd announce.c, usr.bin/wall ttymsg.c wall.c

ttymsg: Overhaul

* Instead of an error string, return the usual 0 or -1 and let the caller
  figure out what, if anything, to tell the user.

* Avoid string manipulations by opening /dev first and using openat()
  with O_RESOLVE_BENEATH.

* Add a boolean argument which, if false, causes ttymsg() to return
  without sending the message if the tty's group-writable bit is not
  set.  This saves programs that respect this setting (like syslogd(8))
  from having to check before calling ttymsg().

* Update all callers.

The observable effect of this change is minimal except for slightly
different error messages when ttymsg() fails.  However, syslogd(8) will
no longer print spurious error messages on the console after trying and
failing to write a log message to an X11 session.

    [7 lines not shown]
DeltaFile
+64-56usr.bin/wall/ttymsg.c
+21-37usr.sbin/syslogd/syslogd_cap_log.c
+10-37usr.sbin/syslogd/syslogd.c
+4-4usr.sbin/syslogd/syslogd_cap.h
+3-3usr.bin/wall/wall.c
+2-1libexec/talkd/announce.c
+104-1382 files not shown
+106-1408 files

FreeBSD/src ea10118sys/kern vfs_mount.c

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

(cherry picked from commit f5433e784078ee139a37eb43ffa1d9e0e1f4f217)
DeltaFile
+6-2sys/kern/vfs_mount.c
+6-21 files

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

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

(cherry picked from commit ace4a3e177c0da5efd9ceee0d9f46068562e3f5e)
DeltaFile
+25-7sys/kern/vfs_vnops.c
+1-1sys/sys/vnode.h
+26-82 files

FreeBSD/src d62e8c5sys/netinet6 in6_pcb.c

inpcb: update inpcb multipath routing information only on success

This is very similar to IPv4 change 24e5c2ee2a18.  Don't modify inpcb
until we are sure connect(2) will be successful.

Fixes:  0c325f53f16731f608919a4489f96fbbe28d2344
DeltaFile
+10-9sys/netinet6/in6_pcb.c
+10-91 files

FreeBSD/src ca91300sys/netinet in_pcb.c

inpcb: a pcb may travel only from the wild hash to exact, not vice versa

The only possible way to exercise in_pcbrehash() is to bind(2) and then
connect(2).  The second branch was a dead code since fdb987bebddf.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D57241
DeltaFile
+6-17sys/netinet/in_pcb.c
+6-171 files

FreeBSD/src efe2878sys/fs/nfs nfsproto.h, sys/fs/nfsserver nfs_nfsdport.c

nfsd: Allow vfs.nfsd.srvmaxio to be up to 4Mbytes

Without this patch, the maximum setting for
vfs.nfsd.srvmaxio was 1Mbyte.  This patch increases
that to 4Mbytes.

The same as for any setting above 128Kbytes, settings up to
4Mbytes require that kern.ipc.maxsockbuf be increased.
(A message generated after setting vfs.nfsd.srvmaxio via
the /etc/rc.conf variable nfs_server_maxio will indicate
the minimum setting, which will be somewhat greater than
four times the setting of vfs.nfsd.srvmaxio.)

(cherry picked from commit b92b9da3300655c86dcd42ea8a5ba45badd90847)
DeltaFile
+3-2sys/fs/nfsserver/nfs_nfsdport.c
+3-0sys/fs/nfs/nfsproto.h
+6-22 files

FreeBSD/src 947dd1csys/kern subr_uio.c

subr_uio.c: Remove a KASSERT() for large NFS server I/O

When the NFS server is set to allow an I/O size greater
than 1Mbyte (not allowed in FreeBSD's main yet), a
KASSERT() in allocuio() can fail when:
zfs_freebsd_write()->zfs_write()->zfs_uiocopy()
->cloneuio()->allocuio()
is called for a large NFS server write.

Since the userland API callers to allocuio() already
check that the size does not exceed UIO_MAXIOV,
there does not seem to be a need to a KASSERT()
here.

Removing the KASSERT() allows NFS server writes
of greater than 1Mbyte to work, once the NFS code
is patched to allow them.

(cherry picked from commit 13d3bd165e225eec9af91b6e3361c2482931f95b)
DeltaFile
+0-2sys/kern/subr_uio.c
+0-21 files

FreeBSD/src 97cad01usr.bin/xinstall xinstall.c install.1

install: add -z <max_cmp_size> option

Introduces the -z <max_cmp_size> flag, enabling users to set a custom file
size limit for pre-installation change checks and avoiding future hard-coded
limit modifications.

Reviewed by:    glebius
Approved by:    glebius (mentor)
Obtained from:  Fudo Security
MFC after:      2 weeks
Sponsored by:   Fudo Security
Differential Revision:  https://reviews.freebsd.org/D57230
DeltaFile
+14-4usr.bin/xinstall/xinstall.c
+11-2usr.bin/xinstall/install.1
+1-1usr.bin/xinstall/Makefile
+26-73 files

FreeBSD/src 5a8e0e0usr.bin/xinstall xinstall.c

install: Bump compare size limit (128MB) to support large binaries

Preserve metadata and prevent redundant disk writes during builds with
the install's -C (compare) flag.

The previous historical comparison limit of 16MB is insufficient for
modern toolchains, frequently choked or bypassed by a large base
components like LLVM/Clang, kernels, Rust apps, and large runtime
libraries.

By leaving matching files alone, install keeps their modification timestamps
intact. make(1) safely ignores those files on subsequent runs.

Base examples: 15.0 amd64 GENERIC kernel - 28MB, clang - 105MB, lldb - 97MB, etc.

Reviewed by:    glebius
Approved by:    glebius (mentor)
Obtained from:  Fudo Security
MFC after:      2 weeks

    [2 lines not shown]
DeltaFile
+1-1usr.bin/xinstall/xinstall.c
+1-11 files

FreeBSD/src 2018defusr.sbin/syslogd syslogd.c, usr.sbin/syslogd/tests syslogd_test.sh

syslogd: Fix ereregex property filters and add test

This change fixes Bug 293879, where ereregex filters in syslogd
did not handle alternation correctly.

The issue appears to come from mixing up two different kinds of
flags: syslogd's internal serialized filter flags in
usr.sbin/syslogd/syslogd.h, and the regex compilation flags from
include/regex.h. ereregex was storing REG_EXTENDED in cmp_flags,
even though cmp_flags is meant to carry syslogd's own FILT_FLAG_*
values for configuration serialization and reconstruction.

REG_EXTENDED has the same bit value as FILT_FLAG_EXCLUDE, so the
filter could be reconstructed with the wrong semantics.

The fix stores FILT_FLAG_EXTENDED instead, allowing syslogd to
correctly REG_EXTENDED when compiling the regex.

A test was also added for both ereregex and !ereregex filters.

    [8 lines not shown]
DeltaFile
+22-0usr.sbin/syslogd/tests/syslogd_test.sh
+1-1usr.sbin/syslogd/syslogd.c
+23-12 files

FreeBSD/src 5d64055sys/dev/netmap netmap_kloop.c

netmap: silence -Wdefault-const-init-field-unsafe warning

The netmap_ring struct starts with various const members and rencent
clang warns about leaving them uninitialized. Having them const in the
first place is highly suspicious since they are updated with various
macros but using hand-coded __DECONST(). But fixing that is a more
invasive change that I am unable to test.

```
.../freebsd/sys/dev/netmap/netmap_kloop.c:320:21: error: default initialization of an object of type 'struct netmap_ring' with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe]
  320 |         struct netmap_ring shadow_ring; /* shadow copy of the netmap_ring */
      |                            ^
.../freebsd/sys/net/netmap.h:290:16: note: member 'buf_ofs' declared 'const' here
  290 |         const int64_t   buf_ofs;
      |                         ^
```

Test Plan: Compiles


    [5 lines not shown]
DeltaFile
+4-2sys/dev/netmap/netmap_kloop.c
+4-21 files

FreeBSD/src 1ebf5f5sys/net if_ovpn.c

if_ovpn.c: fix use of uninitialized variable

In case we use OVPN_CIPHER_ALG_NONE, the memcpy will attempt to copy 0
bytes from an uninitialized pointer. While the memcpy() implementation
will treat this as a no-op and not actually dereferece the undefined
variable it is still undefined behaviour to the compiler and should be
fixed. Found by building with clang HEAD

Reviewed by:    kp
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D52543

(cherry picked from commit 969be39fb3caf4272f128dbf3267ceba5966a6ce)
DeltaFile
+4-2sys/net/if_ovpn.c
+4-21 files

FreeBSD/src 3c3a201sys/dev/netmap netmap_kloop.c

netmap: silence -Wdefault-const-init-field-unsafe warning

The netmap_ring struct starts with various const members and rencent
clang warns about leaving them uninitialized. Having them const in the
first place is highly suspicious since they are updated with various
macros but using hand-coded __DECONST(). But fixing that is a more
invasive change that I am unable to test.

```
.../freebsd/sys/dev/netmap/netmap_kloop.c:320:21: error: default initialization of an object of type 'struct netmap_ring' with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe]
  320 |         struct netmap_ring shadow_ring; /* shadow copy of the netmap_ring */
      |                            ^
.../freebsd/sys/net/netmap.h:290:16: note: member 'buf_ofs' declared 'const' here
  290 |         const int64_t   buf_ofs;
      |                         ^
```

Test Plan: Compiles


    [5 lines not shown]
DeltaFile
+4-2sys/dev/netmap/netmap_kloop.c
+4-21 files