FreeBSD/src f9f4629usr.sbin/bsdinstall/distextract distextract.c

bsdinstall: Use libarchive secure flags for extract

This doesn't really matter, as we trust that the installer tarballs are
not malicious, but it doesn't hurt to set these flags.

Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57274
DeltaFile
+2-0usr.sbin/bsdinstall/distextract/distextract.c
+2-01 files

FreeBSD/src fc9dc84sys/dev/sound/usb uaudio.c

snd_uaudio: Lock usbd_transfer_start() in uaudio_mixer_ctl_set()

This section would be previously locked by sound(4)'s mixer lock (see
e87654db5a09 ("snd_uaudio: Stop using mixer_get_lock()")), but
snd_uaudio(4) no longer uses it. This particular code path was missed
during testing, because my sound card does not reach it.

Fixes:          9a00e0b8ca56 ("snd_uaudio: Do not use snd_mixer->lock as mixer_lock")
Reported by:    netchild
Tested by:      netchild
Sponsored by:   The FreeBSD Foundation
MFC after:      6 days
DeltaFile
+6-4sys/dev/sound/usb/uaudio.c
+6-41 files

FreeBSD/src 7b2702esys/amd64/amd64 machdep.c, sys/sys systm.h

sys: add safe_read(9)

The MD function with MI interface to provide a way to read arbitrary
(canonical) KVA.  amd64 only for now.

Reviewed by:    markj
Tested by:      aokblast
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D49566
DeltaFile
+18-0sys/amd64/amd64/machdep.c
+8-0sys/sys/systm.h
+26-02 files

FreeBSD/src 67d61d1sys/amd64/amd64 mem.c uio_machdep.c, sys/amd64/include md_var.h

amd64: extract uiomove_mem() from memrw()

Reviewed by:    markj
Tested by:      aokblast
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D49566
DeltaFile
+11-92sys/amd64/amd64/mem.c
+96-0sys/amd64/amd64/uio_machdep.c
+6-0sys/amd64/include/md_var.h
+113-923 files

FreeBSD/src 39f23afusr.sbin/certctl certctl.c

certctl: Style nits

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57298
DeltaFile
+3-2usr.sbin/certctl/certctl.c
+3-21 files

FreeBSD/src 05039fdtests/sys/acl tools-posix.test run

tests: Fix reliability issues in POSIX ACL tests

The ACL tests use UIDs and GIDs 41 through 49 and expect them to be
unassigned.  Since GID 43 is now assigned to the audio group, some
tests have begun to fail.

While here, also fix a benign Perl syntax issue in the test runner.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57297
DeltaFile
+7-7tests/sys/acl/tools-posix.test
+1-1tests/sys/acl/run
+8-82 files

FreeBSD/src 45aaba5sys/netpfil/pf pf_nl.c

pf: fix incorrect table decoding in netlink

We used nla_p_table for pfr_table structures, but this netlink decoder
was intended for pfioc_table and decoded an extra field, outside
of pfr_table. This allowed userspace to write (slightly) outside of
pfr_table.

Use a separate nlattr_parser for pfr_table.

PR:             295218
Reported by:    Robert Morris <rtm at lcs.mit.edu>
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 64327f769cee0c26e1b81e6195a5092498b10403)
DeltaFile
+8-1sys/netpfil/pf/pf_nl.c
+8-11 files

FreeBSD/src b298426sys/dev/ffec if_ffec.c

if_ffec: correctly trim 2 bytes from the beginning

PR:             283315
Tested by:      tuexen
MFC after:      3 days
DeltaFile
+1-1sys/dev/ffec/if_ffec.c
+1-11 files

FreeBSD/src ff87356sbin/ping/tests ping_test.sh

ping: fix test timestamp_origin when tstamprepl is disabled

The timestamp_origin test sends an ICMP Timestamp Request (ping -Mt) and parses
the tso/tsr fields out of the reply.
When the sysctl net.inet.icmp.tstamprepl is 0, the kernel silently drops the
request, ping receives no reply, and the sed extraction yields an empty $tso.
The test then fails inside atf_check test -n "$tso" with the unhelpful message

Approved by:    maxim
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D57287
DeltaFile
+15-1sbin/ping/tests/ping_test.sh
+15-11 files

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