FreeBSD/src 0a02a47sys/amd64/amd64 machdep.c support.S

x86: for wrmsr_early_safe(), catch all exceptions, not only #GP

Reviewed by:    olce
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57264
DeltaFile
+15-9sys/amd64/amd64/machdep.c
+3-4sys/amd64/amd64/support.S
+18-132 files

FreeBSD/src 95fc64cusr.sbin/ctld kernel.cc

ctld: More consistent error messages

The error messages ctld emits when it finds a port or LUN it did not
create were inconsistent with each other as well as with ctld's other
error messages.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    jhb
Differential Revision:  https://reviews.freebsd.org/D57270
DeltaFile
+5-5usr.sbin/ctld/kernel.cc
+5-51 files

FreeBSD/src a7df326tests/sys/kern ptrace_test.c

ptrace_test: expect PT_STEP tests to fail on riscv

ptrace_single_step currently returns EOPNOTSUPP on riscv.

This temporarily fixes the following CI failures:
https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/16606/testReport/sys.kern/ptrace_test/ptrace__PT_STEP_with_signal/
https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/16606/testReport/sys.kern/ptrace_test/ptrace__step_siginfo/

Reviewed by:    kib
Approved by:    emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D57288
DeltaFile
+8-0tests/sys/kern/ptrace_test.c
+8-01 files

FreeBSD/src 4dfc78eusr.sbin/crashinfo crashinfo.sh

crashinfo: Create core.txt.last symlink

When saving a coredump, savecore(8) maintains .last symlinks for the
info and vmcore artifacts, but not for the crashinfo text report.

Make crashinfo(8) create the link, pointing at the current
core.txt.<bounds> file.

This makes /var/crash/core.txt.last track the same core dump as
info.last and vmcore.last.

[mhorne: I tweaked the submission, such that the link will be created as
soon as the core.txt.X file is generated; not only after a successful
report has been written.]

Signed-off-by:  Ricardo Branco <rbranco at suse.de>
Reviewed by:    mhorne
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2199
DeltaFile
+3-0usr.sbin/crashinfo/crashinfo.sh
+3-01 files

FreeBSD/src 453de99usr.sbin/virtual_oss/virtual_oss virtual_oss.c

virtual_oss(8): Fix buffer overflow in voss_compressor() call

This particular calls swaps the samples and maxchan arguments, which can
cause a buffer overflow in p_ch_chain if maxchan exceeds its bounds
(VMAX_CHAN).

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
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    emaste
DeltaFile
+2-2usr.sbin/virtual_oss/virtual_oss/virtual_oss.c
+2-21 files

FreeBSD/src df5e9e3sys/dev/usb usb_transfer.c

usb: Add missing mtx lock and unlock in pushing dma queue

Accessing usb_xfer_queue requires bus lock, we added this missing lock
in here to prevent racing issue.

Reviewed by:    adrian
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57293
DeltaFile
+2-0sys/dev/usb/usb_transfer.c
+2-01 files

FreeBSD/src 9fb5642sys/dev/sound/pcm sound.c

sound: Centralize and improve hot-swapping

Introduce pcm_hotswap(), which is responsible for sending devctl
SND/CONN notifications.

There are two user-visible improvements with this patch:

First, in pcm_unregister(), instead of just sending a SND/CONN/NODEV
notification when all devices have detached, we also switch to the new
default device if the previously default one has detached, but there are
more left.

Second, in pcm_register(), if the device happens to also be the new
default device, we hot-swap to it. Additionally, if hw.snd.default_auto
is set to 2, then we will essentially be hot-swapping to the newest
attached device.

The latter is especially useful for laptops like the Framework 16, which
comes with a built-in snd_hda(4) speaker-microphone-only device, and

    [16 lines not shown]
DeltaFile
+36-11sys/dev/sound/pcm/sound.c
+36-111 files

FreeBSD/src 803f686libexec/rc/rc.d virtual_oss

rc: virtual_oss: Wait for process to exit

Sometimes virtual_oss processes do not exit immediatelly. If we do not
wait for the processes to fully exit before returning from
virtual_oss_stop(), then the service restart operation might call
virtual_oss_start() too early and fail, because it will think the
service wasn't stopped and is still running.

Reported by:    jrm
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    0mp, jrm
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/33
DeltaFile
+3-1libexec/rc/rc.d/virtual_oss
+3-11 files

FreeBSD/src a576e51libexec/rc rc.conf, libexec/rc/rc.d virtual_oss

rc: virtual_oss: Define some variables in rc.conf

They will now be part of /etc/defaults/rc.conf and be accessible by
sysrc(8).

Fixes:          70e27ecba518 ("virtual_oss: Introduce virtual_oss_default_control_device rc variable")
PR:             295560
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    0mp, jrm
Pull-Reqeust:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/33
DeltaFile
+1-11libexec/rc/rc.d/virtual_oss
+5-1libexec/rc/rc.conf
+6-122 files

FreeBSD/src b2677d0libexec/rc/rc.d virtual_oss

rc: virtual_oss: Handle absent pidfile properly

Instead of throwing errors from the programs that use it, print a
warning if the file does not exist.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    0mp, jrm
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/33
DeltaFile
+11-6libexec/rc/rc.d/virtual_oss
+11-61 files

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 71ec93fshare/man/man4 Makefile, sys/conf files.x86 files.i386

padlock: Restore padlock_rng to the amd64 build

Revert 88a53301e19 and d1ca01059d5 .  They removed padlock_rng from the
amd64 build under the mistaken belief that this device was available on
32-bit processors only.  But it's also available on the 64-bit Via Nano,
Nano X2, and some Zhaoxin CPUs.

PR:             295517
Fixes:          88a53301e19 ("padlock.4: only install on i386")
Fixes:          d1ca01059d5 ("padlock(4)/nehemiah: move i386-only entropy")
Reviewed by:    kib
Differential Revision: https://reviews.freebsd.org/D57215

(cherry picked from commit 14b8531c4ccb836d755ce8a4f1b384164b5d9d94)
DeltaFile
+0-7sys/i386/conf/NOTES
+1-4share/man/man4/Makefile
+1-3sys/modules/Makefile
+1-0sys/x86/conf/NOTES
+1-0sys/conf/files.x86
+0-1sys/conf/files.i386
+4-152 files not shown
+6-158 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