HardenedBSD/src 9df110btests/sys/netinet socket_afinet.c

tests/netinet: fix tests that depended on connect(in6addr_any)

Fixes:  627e126dbb07b167b028380ef61bb45f10493938
DeltaFile
+2-0tests/sys/netinet/socket_afinet.c
+2-01 files

HardenedBSD/src 56e1cbasys/netinet6 ip6_mroute.c

ip6_mroute: Remove unnecessary casts

No functional change intended.

MFC after:      1 week
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
DeltaFile
+3-4sys/netinet6/ip6_mroute.c
+3-41 files

HardenedBSD/src 34c3e1dusr.bin/netstat mroute6.c mroute.c

netstat: Fix whitespace in libxo output for multicast routes

Also fix some bogus libxo format strings in mroute6.c, and close a
couple of lists instead of opening them twice.

Fixes:          ade9ccfe211a ("Convert netstat to use libxo.")
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
DeltaFile
+6-7usr.bin/netstat/mroute6.c
+5-6usr.bin/netstat/mroute.c
+11-132 files

HardenedBSD/src a8cd7f4lib/virtual_oss Makefile.inc Makefile, lib/virtual_oss/bt Makefile

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+4-5usr.sbin/virtual_oss/virtual_oss/Makefile
+6-2lib/virtual_oss/Makefile.inc
+1-5lib/virtual_oss/sndio/Makefile
+1-5lib/virtual_oss/bt/Makefile
+2-3lib/virtual_oss/Makefile
+0-5lib/virtual_oss/null/Makefile
+14-256 files not shown
+21-3412 files

HardenedBSD/src 245157fsys/kern kern_synch.c kern_ktrace.c, sys/sys ktrace.h

ktrcsw(): should not be called when the thread is owning interlock or on sleepq

The issue is that for ktrcsw() we lock the ktrace_mtx mutex while owning
the interlock from a subsystem that called msleep().  In particular, the
VM subsystem might call msleep() if page allocation failed.  This
establishes order VM locks (e.g. domain free queue lock) -> ktrace_mtx.
Calling free() while owning ktrace_mtx gives the reverse order.

Worse, msleep_spin_sbt() call s ktrcsw() while the thread is put on
sleep queue.  Then, since the mutex might be contested, the thread needs
to be put on turnstil, which cannot work.

Move the ktrcsw() call for switch-out after the wakeup, when the thread
does not yet re-obtained any locks.  From there, we call a special
version of ktrcsw(), which is passed the actual time when the context
switch occured.

The drawback is that the switch-out record is only written in the
ktrace.out file after the switch-in occurred, but this is probably not

    [7 lines not shown]
DeltaFile
+11-15sys/kern/kern_synch.c
+16-2sys/kern/kern_ktrace.c
+1-0sys/sys/ktrace.h
+28-173 files

HardenedBSD/src bda8028release/pkg_repos release-dvd.conf, release/scripts pkg-stage.sh

release: Ship firmware from kmods repo on DVD

The packages for X.Y-RELEASE are a snapshot of the quarterly branch
for stable/X, i.e. typically built on X.(Y-1)-RELEASE.  (The case of
Y=0 is an exception for obvious reasons.)  This works for most ports
but not for kernel modules, which may need to be built on the release
in question; this is why we have a separate "kmods" repository.

Make sure that we put the packages from the kmods repository onto the
mini-pkg-repo on the DVD rather than shipping unusable firmware.

Reviewed by:    bz
MFC after:      1 week
Sponsored by:   https://www.patreon.com/cperciva
Differential Revision:  https://reviews.freebsd.org/D52581
DeltaFile
+18-7release/scripts/pkg-stage.sh
+7-0release/pkg_repos/release-dvd.conf
+25-72 files

HardenedBSD/src 93d3ac1sys/arm64/arm64 vfp.c

arm64: Fix kernel panic in get_arm64_sve during core dump

The coredump logic calls get_arm64_sve twice: once to get the note size,
and once to get the data. The note size calculation depended on the
volatile `PCB_FP_SVEVALID` flag. If this flag was cleared between the
two calls (e.g., due to a context switch clearing the flag to comply
with the ABI), the second call would expect a smaller buffer size than
the first, triggering a KASSERT panic ("invalid size").

Fix this by ensuring the SVE state is saved to the PCB before we decide
whether to use SVE or VFP.

PR: 292195
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D54532
DeltaFile
+3-3sys/arm64/arm64/vfp.c
+3-31 files

HardenedBSD/src 78274fd. Makefile.inc1

native-xtools: use static LLVM libraries

Set the MK_LLVM_LINK_STATIC_LIBRARIES knob to "yes" when building the
native-xtools target. This reverts to the behaviour prior to
2e47f35be5dc.

This avoids a build failure that occurs otherwise, where compilation
fails looking for a libllvmprivate.so that was not built.

It is unclear if this addresses the issue in all instances---some
replies in the PRs indicate otherwise. Still, some report success, and
in my own testing this fixed creation of a cross-compiled poudriere
jail. Commit this while we continue to investigate...

PR:             286710, 291409
Tested by:      marck, rdunkle at smallcatbrain.com
Reviewed by:    emaste
MFC after:      3 days
Fixes:  2e47f35be5dc ("Convert libllvm, libclang and liblldb into private shared libraries").

    [4 lines not shown]
DeltaFile
+1-0Makefile.inc1
+1-01 files

HardenedBSD/src 3eac385share/man/man5 src.conf.5

src.conf.5: Regen after addition of MK_SOUND

A description for WITHOUT_SOUND is still missing though.

(cherry picked from commit 3f2f3c52e6f192df435bdb5861018402ec1167d0)
DeltaFile
+6-0share/man/man5/src.conf.5
+6-01 files

HardenedBSD/src 33c49c3libexec/rc rc.conf

Set virtual_oss_enable="NO" in /etc/defaults/rc.conf

This prevents 'service -e' from emitting (/var/log/messages):

/usr/sbin/service: WARNING: $virtual_oss_enable is not set properly - see rc.conf(5)

Pull Request:   https://github.com/freebsd/freebsd-src/pull/1987
Reviewed by:    christos
Signed-off-by:  eborisch at gmail.com
MFC after:      1 week

(cherry picked from commit 1b2d495a24c36d81b14178a2f898025946bff2d8)
DeltaFile
+1-0libexec/rc/rc.conf
+1-01 files

HardenedBSD/src dcdb18bsys/netgraph/bluetooth/include ng_hci.h

bluetooth: Don't use a non-string to initialize NG_HCI_BDADDR_ANY

Explicitly use an array of 6 zeroes instead of a C string containing
nul characters.  GCC 15 warns about the truncation, but this is
cleaner regardless.

In file included from /usr/obj/.../amd64.amd64/tmp/usr/include/bluetooth.h:51,
                 from usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c:45:
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c: In function 'register_sdp':
usr.sbin/virtual_oss/virtual_bt_speaker/bt_speaker.c:96:13: error: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (7 chars into 6 available) [-Werror=unterminated-string-initialization]
   96 |             NG_HCI_BDADDR_ANY, (const uint8_t *)&record, sizeof(record),
      |             ^~~~~~~~~~~~~~~~~

Reviewed by:    dim
Differential Revision:  https://reviews.freebsd.org/D54869

(cherry picked from commit 72a6991b80c6e6c47a3b84337f62f0a02bd30391)
DeltaFile
+2-2sys/netgraph/bluetooth/include/ng_hci.h
+2-21 files

HardenedBSD/src f388826lib/virtual_oss Makefile.inc, lib/virtual_oss/bt Makefile

lib/virtual_oss: don't (over)link to libsamplerate

These plugins require samplerate.h due to virtual_oss's int.h including
it, but don't use any symbols directly so don't link to the library.

Centralize adding the include path.

Reviewed by:    christos
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D54705

(cherry picked from commit d78291b0e9736f39f22c55c163978c1b92e601e4)
(cherry picked from commit c88f012faa13c39f13efdcef88d3141253a300ab)
DeltaFile
+1-3lib/virtual_oss/sndio/Makefile
+1-2lib/virtual_oss/bt/Makefile
+0-3lib/virtual_oss/null/Makefile
+0-3lib/virtual_oss/oss/Makefile
+2-0lib/virtual_oss/Makefile.inc
+4-115 files

HardenedBSD/src 00964aalib/virtual_oss Makefile, usr.sbin/virtual_oss Makefile

virtual_oss: build commands/libs in parallel

Reviewed by:    christos
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D54703

(cherry picked from commit adab1dd6a70e9f2d7ac4500b186e7231afd02e04)
DeltaFile
+2-0lib/virtual_oss/Makefile
+2-0usr.sbin/virtual_oss/Makefile
+4-02 files

HardenedBSD/src 9be3ccdlib/virtual_oss Makefile.inc, lib/virtual_oss/bt Makefile

virtual_oss: build system tidying

general:
 - find libsamplerate's headers in the temporary sysroot instead of
   digging in the source tree.
 - use LIBADD where possible

lib/virtual_oss:
 - centralize SHLIBDIR define
 - centralize include path for internal headers
 - don't try to find libsamplerate directly in .OBJDIR

No functional changes.

Reviewed by:    christos
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D54704

(cherry picked from commit 373c72ad5044d5f84b7f3fa169d37e7214729f74)
DeltaFile
+4-5usr.sbin/virtual_oss/virtual_oss/Makefile
+2-5lib/virtual_oss/bt/Makefile
+4-2lib/virtual_oss/Makefile.inc
+1-3lib/virtual_oss/null/Makefile
+1-3lib/virtual_oss/oss/Makefile
+1-3lib/virtual_oss/sndio/Makefile
+13-212 files not shown
+14-248 files

HardenedBSD/src 352d405lib/virtual_oss Makefile, usr.sbin/virtual_oss Makefile

virtual_oss: remove needless .include in intermediate Makefile

It doesn't define anything we use.

Reviewed by:    christos
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D54702

(cherry picked from commit 497a13601fb74c264e28eff7cd3f9ac74f0f212b)
DeltaFile
+0-1lib/virtual_oss/Makefile
+0-1usr.sbin/virtual_oss/Makefile
+0-22 files

HardenedBSD/src c88f012lib/virtual_oss/sndio Makefile

lib/virtual_oss/sndio: Remove trailing backslash

Fixes:          d78291b0e973 ("lib/virtual_oss: don't (over)link to libsamplerate")
Reported by:    pkg-fallout
Sponsored by:   The FreeBSD Foundation
MFC after:      2 days
DeltaFile
+1-1lib/virtual_oss/sndio/Makefile
+1-11 files

HardenedBSD/src b928974share/mk src.opts.mk

src.opts: Remove MK_SOUND artifact

Fixes:          f74f891581bc ("src.opts: Introduce MK_SOUND")
PR:             291853
Sponsored by:   The FreeBSD Foundation
MFC after:      4 days
DeltaFile
+0-5share/mk/src.opts.mk
+0-51 files

HardenedBSD/src 1539a65tests/sys/netinet6 test_ip6_output.py

ip6_output tests: Remove an unused import

No functional change intended.

MFC after:      1 week
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
DeltaFile
+0-1tests/sys/netinet6/test_ip6_output.py
+0-11 files

HardenedBSD/src a03eabfsys/netinet6 ip6_mroute.c

ip6_mroute: Mark functions as static

No functional change intended.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
DeltaFile
+10-10sys/netinet6/ip6_mroute.c
+10-101 files

HardenedBSD/src 4139a8dshare/man/man4 epair.4, sys/dev/dpaa2 dpaa2_ni.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+16-12sys/net/if_epair.c
+19-1share/man/man4/epair.4
+14-0sys/dev/dpaa2/dpaa2_ni.c
+49-133 files

HardenedBSD/src 0d71922share/man/man4 epair.4, sys/dev/dpaa2 dpaa2_ni.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+16-12sys/net/if_epair.c
+19-1share/man/man4/epair.4
+14-0sys/dev/dpaa2/dpaa2_ni.c
+49-133 files

HardenedBSD/src 574d46bshare/man/man4 epair.4, sys/net if_epair.c

epair: add VLAN_HWTAGGING

Add capability VLAN_HWTAGGING to the epair interface and enable it by
default.
When sending a packet over a VLAN interface that uses an epair
interface, the flag M_VLANTAG and the ether_vtag (which contains the
VLAN ID and/or PCP) are set in the mbuf to inform the hardware that
the VLAN header has to be added. The sending epair end does not need
to actually add a VLAN header. It can just pass the mbuf with this
setting to the other epair end, which receives the packet. The
receiving epair end can just pass the mbuf with this setting to the
upper layer. Due to this setting, the upper layer believes that there
was a VLAN header that has been removed by the interface.
If the packet later leaves the host, the outgoing physical interface
can add the VLAN header in hardware if it supports VLAN_HWTAGGING.
If not, the implementation of Ethernet or bridge adds the VLAN header
in software.

Reviewed by:            zlei, tuexen

    [2 lines not shown]
DeltaFile
+16-12sys/net/if_epair.c
+19-1share/man/man4/epair.4
+35-132 files

HardenedBSD/src 33596d9sys/dev/dpaa2 dpaa2_ni.c

dpaa2: add support for several interface counters

Add support for IFCOUNTER_IPACKETS, IFCOUNTER_OPACKETS,
IFCOUNTER_OBYTES, IFCOUNTER_OMCASTS, IFCOUNTER_OERRORS, and
IFCOUNTER_OQDROPS.
This allows tools like systat to report the incoming and outgoing
bandwidth.

Reviewed by:            dsl, Timo Völker
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D54893
DeltaFile
+14-0sys/dev/dpaa2/dpaa2_ni.c
+14-01 files

HardenedBSD/src e6da1d2bin/sh sh.1, release/tools vmimage.subr

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+252-157sys/kern/sched_ule.c
+214-183sys/kern/sched_4bsd.c
+234-0sys/kern/sched_shim.c
+83-113release/tools/vmimage.subr
+182-9bin/sh/sh.1
+103-7sys/sys/sched.h
+1,068-46942 files not shown
+1,259-67248 files

HardenedBSD/src 03912e0share/man/man7 tuning.7, share/man/man9 intro.9

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+26-0share/man/man7/tuning.7
+19-2sys/kern/sched_4bsd.c
+8-8sys/powerpc/powermac/platform_powermac.c
+7-0tools/tools/nanobsd/embedded/common
+5-1share/mk/src.opts.mk
+1-3share/man/man9/intro.9
+66-145 files not shown
+74-1611 files

HardenedBSD/src 5051544lib/libc/net getnetbydns.c, sys/powerpc/aim moea64_native.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+90-9sys/powerpc/powermac/platform_powermac.c
+5-0sys/powerpc/aim/moea64_native.c
+3-0lib/libc/net/getnetbydns.c
+98-93 files

HardenedBSD/src 10a0132sys/powerpc/powermac platform_powermac.c

powerpc: explicitly cast the timebase printfs

This is causing compilation issues on powerpc:powerpc GENERIC.

(cherry picked from commit 03e4cc9fdeb2a6445f13cd41b471927a0f722fff)
DeltaFile
+8-8sys/powerpc/powermac/platform_powermac.c
+8-81 files

HardenedBSD/src 03e4cc9sys/powerpc/powermac platform_powermac.c

powerpc: explicitly cast the timebase printfs

This is causing compilation issues on powerpc:powerpc GENERIC.
DeltaFile
+8-8sys/powerpc/powermac/platform_powermac.c
+8-81 files

HardenedBSD/src 0a45c88sys/powerpc/aim moea64_native.c

powerpc: disable the TLBIE lock, it's not needed for POWER8

According to POWER8_UM_v1.3_16MAR2016 3.8.3 Translation Lookaside
Buffer (TLB), POWER8 supports lockless TLBIE operations.

Locally Tested:

* IBM POWER8 Revision 2.0, dual socket, 160 threads

Differential Revision:  https://reviews.freebsd.org/D54855
Approved by:    jhibbits

(cherry picked from commit 9a5baa9c585652fb7bd4ccd45d567204caf349f2)
DeltaFile
+5-0sys/powerpc/aim/moea64_native.c
+5-01 files

HardenedBSD/src b30d064sys/powerpc/powermac platform_powermac.c

powerpc: add a best-effort SMP time base sync for G5's that need it

There's no timebase freeze platform routine registered on my dual 2.3GHz
G5 PPC970FX Apple PowerMac.

For platforms without an explicit timebase freeze/unfreeze, we'll have to
make do with what we have - which for now is an explicit hand-crafted
spinlock/rendezvous method.

* For existing platforms, they'll still continue to clock freeze /
  rendezvous; albeit with some stronger atomic bits now (from jhibbits@.)
* Instead of the fallback being "no timesync", implement a
  best-effort one which does a similar rendezvous barrier between
  BSP and APs, but instead of freeze/unfreeze the first instruction
  after the CPUs all register they're ready is to set the timebase.

This has resulted in many reboots of my Powermac G5 dual-socket device
correctly starting and running in SMP mode.


    [4 lines not shown]
DeltaFile
+90-9sys/powerpc/powermac/platform_powermac.c
+90-91 files