HardenedBSD/src b2b8796sys/net bpf.c, sys/netinet ip_fw.h

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+268-0tests/sys/net/bpf/pcap-test.c
+30-103sys/net/bpf.c
+59-2tests/sys/net/bpf/bpf.sh
+3-1tests/sys/net/bpf/Makefile
+1-1sys/netinet/ip_fw.h
+1-1sys/sys/mbuf.h
+362-1082 files not shown
+362-1108 files

HardenedBSD/src 74111acsys/net bpf.c, sys/netinet ip_fw.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+268-0tests/sys/net/bpf/pcap-test.c
+30-103sys/net/bpf.c
+59-2tests/sys/net/bpf/bpf.sh
+3-1tests/sys/net/bpf/Makefile
+1-1sys/netinet/ip_fw.h
+1-1sys/sys/mbuf.h
+362-1081 files not shown
+362-1097 files

HardenedBSD/src e20e572sys/net bpf.c

bpf: remove DDB code

With modern debugging tools it isn't useful at all and is just a
maintenance burden.
DeltaFile
+0-37sys/net/bpf.c
+0-371 files

HardenedBSD/src fd91012sys/net bpf.c

bpf: leave only locked version of bpf_detachd()

The unlocked one is used only once.  No functional change.
DeltaFile
+10-17sys/net/bpf.c
+10-171 files

HardenedBSD/src ff3ccf6sys/net bpf.c

bpf: refactor buffer pre-allocation for BIOCSETIF

This basically refactors 4f42daa4a326f to use less indentation and
variables.  The code is still not race proof.
DeltaFile
+20-25sys/net/bpf.c
+20-251 files

HardenedBSD/src 5469a34sys/net bpf.c bpf.h

bpf: remove dead code

Should have gone together with 9738277b5c66.
DeltaFile
+0-24sys/net/bpf.c
+0-1sys/net/bpf.h
+0-252 files

HardenedBSD/src fd02961sys/sys mbuf.h

mbuf: allow const pointer for m_rcvif()
DeltaFile
+1-1sys/sys/mbuf.h
+1-11 files

HardenedBSD/src 88b38d4sys/netinet ip_fw.h

ipfw: add extra parenthesis around ACTION_PTR() macro

This allows to immediately dereference ipfw_insn member.
DeltaFile
+1-1sys/netinet/ip_fw.h
+1-11 files

HardenedBSD/src 1ea3edatests/sys/net/bpf pcap-test.c bpf.sh

tests/net: add some bpf(4) tests

A test helper program pcap-test allows to capture, inject and compare.
Build a simple test case on top of it.  More test cases can be easily
constructed.
DeltaFile
+268-0tests/sys/net/bpf/pcap-test.c
+59-2tests/sys/net/bpf/bpf.sh
+3-1tests/sys/net/bpf/Makefile
+330-33 files

HardenedBSD/src 095caf8sys/dev/sound/pci hdspe-pcm.c

HBSD: Remove reference to now-undefined kernel function

In commit 9d18115ca0ab0ef3f34173d4e2bdabec916d0b60, FreeBSD removed some
old mutex wrappers. We carry a diff to an affected file to mitigate a
potential NULL pointer dereference in the sound subsystem.

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
MFC-to:         15-STABLE
MFC-to:         14-STABLE
X-MFC-With:     9d18115ca0ab0ef3f34173d4e2bdabec916d0b60
DeltaFile
+0-1sys/dev/sound/pci/hdspe-pcm.c
+0-11 files

HardenedBSD/src 15e61ebsys/dev/sound/pci via8233.c envy24ht.c, sys/dev/sound/pcm mixer.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+51-54sys/dev/sound/pcm/mixer.c
+50-51sys/dev/sound/pci/via8233.c
+34-35sys/dev/sound/pci/envy24ht.c
+34-34sys/dev/sound/pci/envy24.c
+29-28sys/dev/sound/pci/emu10k1.c
+27-27sys/dev/sound/pci/cmi.c
+225-22950 files not shown
+730-68656 files

HardenedBSD/src d2222f8sys/dev/sound/pci via8233.c envy24ht.c, sys/dev/sound/pcm mixer.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+51-54sys/dev/sound/pcm/mixer.c
+50-51sys/dev/sound/pci/via8233.c
+34-35sys/dev/sound/pci/envy24ht.c
+34-34sys/dev/sound/pci/envy24.c
+29-28sys/dev/sound/pci/emu10k1.c
+27-27sys/dev/sound/pci/cmi.c
+225-22950 files not shown
+730-68656 files

HardenedBSD/src 47d5989sbin/dmesg dmesg.8, sys/netlink netlink_snl.h

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+3-3sys/netlink/netlink_snl.h
+2-2sbin/dmesg/dmesg.8
+5-52 files

HardenedBSD/src 727f3dbshare/man/man4 vt.4, stand/man loader.8 loader_simp.8

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+47-1stand/man/loader.8
+29-0tests/sys/kern/unix_passfd_test.c
+9-9sys/kern/uipc_usrreq.c
+8-1share/man/man4/vt.4
+8-0usr.bin/fortune/datfiles/freebsd-tips
+2-2stand/man/loader_simp.8
+103-133 files not shown
+111-149 files

HardenedBSD/src 513b9dbstand/man loader.8

loader.8: Document module commands

Begin documenting module loader commands in loader(8), where the reader
would look for them. Segregate them by their availability in individual
loader implementations, like build(7) targets.
These details were graciously donated by kevans.

MFC after:              3 days
Reviewed by:            kevans
Co-authored-by:         Kyle Evans <kevans at freebsd.org>
Differential Revision:  https://reviews.freebsd.org/D50727

(cherry picked from commit 6fb0d67819f730e8def56e139f780eff3c0cab0f)
DeltaFile
+47-1stand/man/loader.8
+47-11 files

HardenedBSD/src 3035855stand/defaults loader.conf.5, stand/man loader_simp.8

loader manuals: Clarify console and boot_serial

console=comconsole is for the loader and boot_serial is for the kernel.

I think we should centralize documentation on the loader settings in one
manual, such a loader.8. The current proliferation is not obvious where
to find the documentation. To the user, these are all set in loader.conf
or at the loader prompt.

MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D53695

(cherry picked from commit 09ffaa4e07d749c83cc1db13829505f21b025f29)
DeltaFile
+2-2stand/man/loader_simp.8
+3-0stand/defaults/loader.conf.5
+5-22 files

HardenedBSD/src f0bb9d2usr.bin/fortune/datfiles freebsd-tips

freebsd-tips: Add a shell function for laptops

MFC after:              3 days
Reviewed by:            pauamma_gundo.com
Differential Revision:  https://reviews.freebsd.org/D53748

(cherry picked from commit 42d9ae4945f281d12f3ef96cdbd7356e067f8b18)
DeltaFile
+8-0usr.bin/fortune/datfiles/freebsd-tips
+8-01 files

HardenedBSD/src 2da71eeshare/man/man4 vt.4

vt.4: Document increasing scrollback size

MFC:                    immediately as 2 llms say this is impossible
Reviewed by:            adrian, emaste
Differential Revision:  https://reviews.freebsd.org/D53860

(cherry picked from commit a8740ba860bfc35879f886b80b30327d0d3b16bd)
DeltaFile
+8-1share/man/man4/vt.4
+8-11 files

HardenedBSD/src a8740bashare/man/man4 vt.4

vt.4: Document increasing scrollback size

MFC:                    immediately as 2 llms say this is impossible
Reviewed by:            adrian, emaste
Differential Revision:  https://reviews.freebsd.org/D53860
DeltaFile
+8-1share/man/man4/vt.4
+8-11 files

HardenedBSD/src cf95eabsys/netlink netlink_snl.h

netlink: in snl_init_writer() don't overwrite error in case of failure

PR:     290050
(cherry picked from commit 488718ff42346888243496c00cbeb42ba004171e)
DeltaFile
+3-3sys/netlink/netlink_snl.h
+3-31 files

HardenedBSD/src 9d18115sys/dev/sound/pci via8233.c envy24ht.c, sys/dev/sound/pcm mixer.c

sound: Retire snd_mtx* wrappers

Do not create mutexes with snd_mtxcreate(). It doesn't provide any
value, plus it first allocates the mutex with malloc(9). Allocate
mutexes in the stack and use mtx_* functions directly instead of the
snd_mtx* wrappers.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D53855
DeltaFile
+51-54sys/dev/sound/pcm/mixer.c
+50-51sys/dev/sound/pci/via8233.c
+34-35sys/dev/sound/pci/envy24ht.c
+34-34sys/dev/sound/pci/envy24.c
+29-28sys/dev/sound/pci/emu10k1.c
+27-27sys/dev/sound/pci/cmi.c
+225-22931 files not shown
+537-58137 files

HardenedBSD/src e254ef8sys/dev/sound/pcm channel.c channel.h

sound: Merge chn_intr() with chn_intr_locked()

There is no scenario where chn_intr() is called with the channel lock
already held.

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D53854
DeltaFile
+2-18sys/dev/sound/pcm/channel.c
+0-1sys/dev/sound/pcm/channel.h
+2-192 files

HardenedBSD/src 3107b95sys/dev/sound/pcm sound.h sound.c

sound: Merge PCM_ALIVE() with PCM_REGISTERED()

PCM_ALIVE() is used only in pcm_unregister(), but it does not hurt to
use PCM_REGISTERED(), which uses PCM_ALIVE() internally. In fact, it's
more robust this way.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+2-2sys/dev/sound/pcm/sound.h
+1-1sys/dev/sound/pcm/sound.c
+3-32 files

HardenedBSD/src 4e8eb77sys/dev/sound/midi midi.c mpu401.c

sound: Clean up midi/ includes

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D53841
DeltaFile
+11-16sys/dev/sound/midi/midi.c
+2-9sys/dev/sound/midi/mpu401.c
+13-252 files

HardenedBSD/src b4c32d6sys/dev/sound/pcm dsp.c

sound: Simplify logic in dsp_io_ops()

Use CHN_LOCK()/CHN_UNLOCK() directly, instead of
dsp_lock_chans()/dsp_unlock_chans(). These functions are useful when we
want to potentially lock both channels. Here we know which channel we
are locking, so we can just lock it directly. This way we get rid of the
prio variable as well.

Related to runpid again, there is no reason to assign it when
CHN_F_RUNNING is not set. channel->pid (as well as channel->comm) is
always assigned in dsp_chn_alloc().

Get rid of runpid. I do not see how we can end up with channel->pid
(td->td_proc->p_pid) not matching buf->uio_td->td_proc->p_pid.

Also improve errno values.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week

    [2 lines not shown]
DeltaFile
+10-22sys/dev/sound/pcm/dsp.c
+10-221 files

HardenedBSD/src 6ceab1csbin/dmesg dmesg.8

dmesg.8: Index kern.msgbuf_show_timestamp

This is the only place this important debugging tunable is documented.
Mark it up with the Va macro according to style.mdoc(5) so that people
can find it via `apropos Va=kern.msg`, the standard syntax to search
the FreeBSD manual for sysctls and tunables.

Fixes:  6910fee62e77 (dmesg: Document kern.msgbuf_show_timestamp)
(cherry picked from commit e13664f6a44b4970ea5e8378b8e1a4879fa5d5a0)
DeltaFile
+2-2sbin/dmesg/dmesg.8
+2-21 files

HardenedBSD/src 1c0668csbin/dmesg dmesg.8

dmesg.8: Index kern.msgbuf_show_timestamp

This is the only place this important debugging tunable is documented.
Mark it up with the Va macro according to style.mdoc(5) so that people
can find it via `apropos Va=kern.msg`, the standard syntax to search
the FreeBSD manual for sysctls and tunables.

Fixes:  6910fee62e77 (dmesg: Document kern.msgbuf_show_timestamp)
(cherry picked from commit e13664f6a44b4970ea5e8378b8e1a4879fa5d5a0)
DeltaFile
+1-1sbin/dmesg/dmesg.8
+1-11 files

HardenedBSD/src e13664fsbin/dmesg dmesg.8

dmesg.8: Index kern.msgbuf_show_timestamp

This is the only place this important debugging tunable is documented.
Mark it up with the Va macro according to style.mdoc(5) so that people
can find it via `apropos Va=kern.msg`, the standard syntax to search
the FreeBSD manual for sysctls and tunables.

Fixes:  6910fee62e77 (dmesg: Document kern.msgbuf_show_timestamp)
DeltaFile
+1-1sbin/dmesg/dmesg.8
+1-11 files

HardenedBSD/src 7dedc3csys/netpfil/pf pf_lb.c, tests/sys/netpfil/pf nat.sh

pf: fix another endpoint-independent crash

In c12013f5bb38 we fixed udp_mapping cleanup issues in pf_get_sport(), but
missed the static-port case (i.e. low == 0 && high == 0). We could still exit
pf_get_sport() without either inserting the udp_mapping or freeing it.

Address this and add a test case to provoke the problem.

Reviewed by:    thj
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D53856
DeltaFile
+30-0tests/sys/netpfil/pf/nat.sh
+12-4sys/netpfil/pf/pf_lb.c
+42-42 files

HardenedBSD/src b9fc762sys/vm vm_page.c vm_extern.h

vm_page_free_prep(): convert PG_ZERO zeroed page check to use sf_buf

Make the check MI by allocating sf_buf in non-blockable manner. For
DMAP arches, this should be nop since sf_buf allocation cannot fail
trivially. For non-DMAP arches, we get the checks activated unless there
is serious sf_buf pressure, which typically should be not.

The context for vm_page_free_prep() should be ready to block on some VM
mutexes, which should make it reasonable to block on sf_buf list lock.

Move the code to INVARIANTS build from DIAGNOSTIC, and control its activation
with the sysctl debug.vm_check_pg_zero.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D53850
DeltaFile
+25-7sys/vm/vm_page.c
+3-0sys/vm/vm_extern.h
+28-72 files