HardenedBSD/src 066fdcd — bin/pkill/tests pkill-j_test.sh, lib/libthr/thread thr_exit.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+8-2sys/vm/vm_page.c
+1-1sys/conf/kern.post.mk
+1-1lib/libthr/thread/thr_exit.c
+1-1bin/pkill/tests/pkill-j_test.sh
+11-54 files

HardenedBSD/src 138aa56 — bin/pkill/tests pkill-j_test.sh, lib/libthr/thread thr_exit.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+8-2sys/vm/vm_page.c
+1-1sys/conf/kern.post.mk
+1-1lib/libthr/thread/thr_exit.c
+1-1bin/pkill/tests/pkill-j_test.sh
+11-54 files

HardenedBSD/src 44062d2 — sys/conf kern.post.mk

kern.post.mk: Really fix ports module build

The package target was never needed; we install directly from the
staging directory.

Fixes:          b393df657811 ("kern.post.mk: Fix unprivileged ports module build")
DeltaFile
+1-1sys/conf/kern.post.mk
+1-11 files

HardenedBSD/src 59b06a9 — bin/pkill/tests pkill-j_test.sh

pkill: Fix typo in test

The cleanup function for pkill -j <jname> had the wrong name.

PR:             301350
Fixes:          93f8c45c0314 ("pkill: Convert pgrep / pkill -j tests to ATF")
DeltaFile
+1-1bin/pkill/tests/pkill-j_test.sh
+1-11 files

HardenedBSD/src 18f4c84 — lib/libthr/thread thr_exit.c

libthr: Unblock signal using correct variable

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D62262
DeltaFile
+1-1lib/libthr/thread/thr_exit.c
+1-11 files

HardenedBSD/src d394c17 — sys/vm vm_page.c

vm_page: Make every shared unbusy a release

vm_page_sunbusy() and vm_page_busy_release() drop a shared busy that
other threads still hold with a relaxed atomic_fcmpset_int().  Only the
last sharer's update is a release, but any sharer can modify the page.
The next thread to busy the page exclusively synchronizes with the last
sharer's release, so on weakly ordered CPUs it need not see the changes
by a sharer that was not the last.

Found by:       Claude Code (Opus 5.5)
Reviewed by:    kib, markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D62391
DeltaFile
+8-2sys/vm/vm_page.c
+8-21 files

HardenedBSD/src de691fa — etc/mtree BSD.tests.dist, sys/dev/vmm vmm_dev.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+55-0tests/sys/netpfil/ipfw/nat44_config.c
+11-6sys/netpfil/ipfw/ip_fw_nat.c
+2-0etc/mtree/BSD.tests.dist
+0-1sys/dev/vmm/vmm_dev.c
+68-74 files

HardenedBSD/src f1daca6 — etc/mtree BSD.tests.dist, sys/dev/vmm vmm_dev.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+55-0tests/sys/netpfil/ipfw/nat44_config.c
+11-6sys/netpfil/ipfw/ip_fw_nat.c
+2-0etc/mtree/BSD.tests.dist
+0-1sys/dev/vmm/vmm_dev.c
+68-74 files

HardenedBSD/src 512f019 — sys/dev/vmm vmm_dev.c

vmm: Fix double free with devmem_create_cdev error

devmem_create_cdev() does not allocate name storage and should not free
it in the error path.  It is already freed by the caller on error.

Reviewed by:    markj
Fixes:          cef5f43f819c
MFC after:      1 day
MFC to:         stable/15
Differential Revision:  https://reviews.freebsd.org/D61529
DeltaFile
+0-1sys/dev/vmm/vmm_dev.c
+0-11 files

HardenedBSD/src de89d4a — etc/mtree BSD.tests.dist

BSD.tests.dist: Add entry for bsdconfig

Fixes:          9ffe2919e6b6 (bsdconfig: Resolve GEOM ids and names without scanning)
Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-0etc/mtree/BSD.tests.dist
+2-01 files

HardenedBSD/src f260c85 — sys/netpfil/ipfw ip_fw_nat.c, tests/sys/netpfil/ipfw nat44_config.c

ipfw_nat: Report a redirect that cannot be set up

nat44_config() ignores the error from add_redir_spool_cfg(), which
stops at the first redirect it cannot set up: one with an unknown mode,
a port redirect without ports or with a protocol other than TCP, UDP or
SCTP, or one for which libalias cannot allocate a link.  That redirect
and the ones after it are dropped silently, but the instance keeps the
redirect count of the request, so "ipfw nat N show config" reports more
redirects than it returns and ipfw(8) misreads the reply ("unknown redir
mode").  A port range that runs out of memory partway also leaves its
first links in libalias.

Return the error, count only the redirects that are set up, and delete
the links of a port range that fails.  As before, the instance stays
installed with the redirects ahead of the failed one.  Add a
nat44_config test case for a redirect without ports.

Reviewed by:            maxim
Fixes:                  d6164b77f8b7 ("Make ipfw_nat module use IP_FW3 codes.")

    [3 lines not shown]
DeltaFile
+55-0tests/sys/netpfil/ipfw/nat44_config.c
+11-6sys/netpfil/ipfw/ip_fw_nat.c
+66-62 files

HardenedBSD/src cd83081 — bin/pkill/tests pkill-j_test.sh, sys/powerpc/linux linux_machdep.c linux_systrace_args.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+219-125sys/powerpc/linux/linux_systrace_args.c
+336-0tests/sys/netpfil/ipfw/nat44_config.c
+324-0usr.sbin/bsdconfig/tests/geom_subr_test.sh
+316-3usr.sbin/bsdconfig/share/geom.subr
+189-99bin/pkill/tests/pkill-j_test.sh
+254-9sys/powerpc/linux/linux_machdep.c
+1,638-236301 files not shown
+4,376-2,007307 files

HardenedBSD/src ca4015d — sys/dev/ixgbe if_ix.c, tests/sys/netpfil/ipfw nat44_config.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+336-0tests/sys/netpfil/ipfw/nat44_config.c
+324-0usr.sbin/bsdconfig/tests/geom_subr_test.sh
+316-3usr.sbin/bsdconfig/share/geom.subr
+209-0usr.sbin/sysrc/tests/sysrc_test.sh
+36-40sys/dev/ixgbe/if_ix.c
+54-6usr.sbin/sysrc/sysrc
+1,275-4915 files not shown
+1,429-11021 files

HardenedBSD/src f5c22a9 — sys/dev/ixgbe if_sriov.c if_ix.c

ixgbe: Restore PF multicast reception with SR-IOV

The PF and VFs share the multicast table. With VMDq replication
enabled, the PF pool needs ROMPE to receive frames matching that
table. A VF accepting multicast can otherwise receive the PF's IPv6
Neighbor Discovery traffic while the PF misses it.

Program the PF pool receive mode when the multicast list or interface
flags change and when initialization restores the filters after reset.
Enable ROMPE for a nonempty PF list and MPE for promiscuous mode,
all-multicast mode, or a full PF address list. Build the pool mode
from the PF settings so a reused pool cannot retain stale VF flags.

Serialize the flag-change callback with multicast updates and SR-IOV
reconfiguration before selecting the pool and writing the registers.

Reported by:    llm-postcr
Fixes:          48056c88e19e ("Delta D2489 - Add SRIOV support to the Intel 10G driver.")
MFC after:      1 week
Sponsored by:   BBOX.io
DeltaFile
+36-40sys/dev/ixgbe/if_ix.c
+1-6sys/dev/ixgbe/if_sriov.c
+37-462 files

HardenedBSD/src 02f3565 — sys/amd64/vmm vmm.c, sys/arm64/vmm vmm.c

vmm: Refactor VM reinitialization code a bit

We can avoid the bool parameter to vm_init() by moving a bit of code
around.  This makes the VM (re)initialization code easier to read.

No functional change intended.

Reviewed by:    bnovkov
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61043
DeltaFile
+8-12sys/amd64/vmm/vmm.c
+7-12sys/riscv/vmm/vmm.c
+7-12sys/arm64/vmm/vmm.c
+22-363 files

HardenedBSD/src 7830318 — contrib/atf NEWS COPYING, contrib/atf/atf-c macros.h macros_test.c

contrib/atf: update to 0.27.0

This release contains the upstreamed version of the wchar_t macros,
provided by des@ in https://reviews.freebsd.org/D61616.

MFC after:      1 week
Merge commit '9e2097a19a9dad81dcd8e7074283b8126464f310'

(cherry picked from commit 704c30247527f46e7dd49e79bf32049436eb85ee)
DeltaFile
+816-0contrib/atf/atf-sh/libatf-sh/common.subr
+189-8contrib/atf/atf-c/macros_test.c
+28-22contrib/atf/COPYING
+36-0contrib/atf/atf-c/macros.h
+33-0contrib/atf/NEWS
+24-0contrib/atf/atf-sh/libatf-sh/FreeBSD.subr
+1,126-308 files not shown
+1,185-5414 files

HardenedBSD/src 4fc4970 — contrib/atf/atf-c macros.h tc.c, contrib/atf/atf-c/detail fs_test.c process_test.c

contrib/atf: upgrade to 0.26.1

This is a bugfix release. Please see the related merge commit for more
details.

MFC after:      1 week
Merge commit 'bd8d548676ba2235320c105e0683a758ac742e8e'

(cherry picked from commit 87fac2e0c07327a02791fef5d01123abd3e590fe)
DeltaFile
+273-282contrib/atf/atf-c/macros_test.c
+250-222contrib/atf/atf-c/tc.c
+177-171contrib/atf/atf-c/macros.h
+144-176contrib/atf/atf-c/detail/process_test.c
+190-122contrib/atf/atf-c/detail/fs_test.c
+147-157contrib/atf/atf-sh/atf-check.cpp
+1,181-1,13097 files not shown
+3,883-3,757103 files

HardenedBSD/src 7a21615 — contrib/atf/atf-sh atf-check_test.sh atf-check.cpp

atf-check: Add shortcut for not-exit:0

Allow the command to be preceded by an exclamation point, which changes
the default expected result to a clean exit with a non-zero exit code.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D58099

(cherry picked from commit 76797b9b6ed4f2fe4ebb08fede0f19a88f985494)
DeltaFile
+16-2contrib/atf/atf-sh/atf-check.1
+12-0contrib/atf/atf-sh/atf_check_test.sh
+9-1contrib/atf/atf-sh/atf-check.cpp
+6-0contrib/atf/atf-sh/atf-check_test.sh
+43-34 files

HardenedBSD/src ebaa1f1 — sys/dev/acpica/Osd OsdDebug.c

acpi: OsdDebug.c: Include 'acdebug.h' on ACPI_DEBUGGER

On ACPI_DEBUGGER (defined by 'acfreebsd.h' on ACPI_DEBUG_OUTPUT and DDB
defined), OsdDebug.c defines acpi_EnterDebugger() which uses
AcpiDbUserCommands().  Include 'acdebug.h' to provide a declaration for
it.

Reported by:    llm-postcr
Fixes:          d6fd89254a91 ("acpi: acpivar.h: Include ACPICA's acpi.h, remove the latter in consumers")
Sponsored by:   The FreeBSD Foundation
DeltaFile
+4-0sys/dev/acpica/Osd/OsdDebug.c
+4-01 files

HardenedBSD/src 43c2e0f — sys/dev/acpica acpivar.h

acpi: acpivar.h: Include 'accommon.h' on ACPI_DEBUG_OUTPUT

ACPICA's public interface ('acpi.h') exports debug macros like
ACPI_FUNCTION_TRACE(), return_VOID, return_*(), and a lot of our
implementation files use them.  Unfortunately, on ACPI_DEBUG_OUTPUT,
they expand to calls to functions (such as AcpiUtTrace(), AcpiUtExit(),
etc.) that are declared only in 'acutils.h', which is to be included via
'accommon.h', the header to use for ACPICA internals, breaking the
compilation if not included.

Include 'accommon.h' from <dev/acpica/acpivar.h> on ACPI_DEBUG_OUTPUT.

Reported by:    llm-postcr
Fixes:          d6fd89254a91 ("acpi: acpivar.h: Include ACPICA's acpi.h, remove the latter in consumers")
Sponsored by:   The FreeBSD Foundation
DeltaFile
+8-0sys/dev/acpica/acpivar.h
+8-01 files

HardenedBSD/src d93bcb6 — sys/dev/ixgbe if_sriov.c

ixgbe: Restore broadcast and VF-to-PF unicast reception with SR-IOV

Enable broadcast and untagged reception in the PF pool. With VMDq
replication enabled, the global broadcast setting alone does not deliver
LAN ARP requests to the PF when a VF also accepts them.

Hardware initialization clears the RAR[0] pool selection. Program the
PF MAC and pool together after reset so the internal switch can deliver
VF unicast to the PF. This follows the VMDq initialization sequence in
section 4.6.10.1.1 of the Intel X550 datasheet.

Based on FreeBSD Bugzilla attachments 277574 and 277575.

PR:             301018, 301019
Reviewed by:    kgalazka
MFC after:      1 week
Sponsored by:   BBOX.io

Co-authored-by: Kevin Bowling <kbowling at FreeBSD.org>
DeltaFile
+12-1sys/dev/ixgbe/if_sriov.c
+12-11 files

HardenedBSD/src e601eb9 — sys/netpfil/ipfw ip_fw_nat.c, tests/sys/netpfil/ipfw Makefile nat44_config.c

ipfw_nat: check spool entries in NAT44 config requests

nat44_cfg() only checked that the redirs of an IP_FW_NAT44_XCONFIG
request fit into it, not the spool (LSNAT) entries that follow each
redir.  add_redir_spool_cfg() then walked up to 65535 spool entries
per redir past the end of the request buffer and stored what it read
as LSNAT servers, which IP_FW_NAT44_XGETCONFIG later copied out to
the caller.  The request needs PRIV_NETINET_IPFW, which root in a
VNET jail has.

Add nat44_check_cfg(), which walks all redirs and their spool entries
and rejects a request that does not hold them, and call it before the
instance is touched.  This also replaces the redir_cnt multiplication,
which could wrap on 32-bit platforms.

Do the same in the legacy IP_FW_NAT_CFG path, which does not convert
spool entries at all, and make its redir_cnt check overflow-safe.
That path is no longer reachable on main, but it is on stable/14.


    [15 lines not shown]
DeltaFile
+336-0tests/sys/netpfil/ipfw/nat44_config.c
+47-3sys/netpfil/ipfw/ip_fw_nat.c
+2-0tests/sys/netpfil/ipfw/Makefile
+385-33 files

HardenedBSD/src f74e018 — sys/dev/hwpmc hwpmc_mod.c hwpmc_logging.c

hwpmc: Size and walk per-CPU state by CPU ID

pm_pcpu_state is indexed by CPU ID but sized by mp_ncpus, and the log
code walks CPUs 0 to mp_ncpus - 1.  CPU IDs can have holes, for example
on riscv when a hart fails to start, so the array is too short and the
loops bind to an absent CPU and skip the last ones.

Size the array with pmc_cpu_max() and walk with CPU_FOREACH().

Reviewed by:    mhorne
MFC after:      3 days
Sponsored by:   Advanced Micro Devices, Inc.
Signed-off-by:  Osvaldo Janeri Filho <ojanerif at amd.com>
Differential Revision:  https://reviews.freebsd.org/D62377
DeltaFile
+4-3sys/dev/hwpmc/hwpmc_logging.c
+2-2sys/dev/hwpmc/hwpmc_mod.c
+6-52 files

HardenedBSD/src a562157 — sys/kern sys_process.c

HBSD: Fixup bad merge conflict resolution

I accidentally left some code.

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+0-5sys/kern/sys_process.c
+0-51 files

HardenedBSD/src b6ad17a — lib/libpam/modules/pam_xdg pam_xdg.c, sys/i386/linux linux_sysvec.c

HBSD: Resolve merge conflicts

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+0-44sys/i386/linux/linux_sysvec.c
+2-38lib/libpam/modules/pam_xdg/pam_xdg.c
+0-8sys/kern/sys_process.c
+2-903 files

HardenedBSD/src 2f238a4 — crypto/openssl/crypto/objects obj_dat.h, crypto/openssl/test sslapitest.c safe_math_test.c

Merge remote-tracking branch 'rad/freebsd/15-stable/main' into hardened/15-stable/main

Conflicts:
        lib/libpam/modules/pam_xdg/pam_xdg.c (unresolved)
        sys/i386/linux/linux_sysvec.c (unresolved)
        sys/kern/sys_process.c (unresolved)
DeltaFile
+2,523-2,523crypto/openssl/crypto/objects/obj_dat.h
+846-1crypto/openssl/test/radix/quic_tests.c
+649-3crypto/openssl/test/quicapitest.c
+583-3crypto/openssl/test/evp_extra_test.c
+402-46crypto/openssl/test/safe_math_test.c
+420-0crypto/openssl/test/sslapitest.c
+5,423-2,576406 files not shown
+11,076-3,758412 files

HardenedBSD/src 92b42ef — bin/pkill/tests pgrep-j_test.sh pkill-j_test.sh, lib/libdevdctl/tests libdevdctl_unittest.cc

Merge remote-tracking branch 'rad/freebsd/current/main' into hardened/current/master
DeltaFile
+189-99bin/pkill/tests/pkill-j_test.sh
+164-95bin/pkill/tests/pgrep-j_test.sh
+190-0tests/sys/pmc/amd/pmu_event_neg_test.c
+16-86libexec/rc/rc.subr
+34-24lib/libdevdctl/tests/libdevdctl_unittest.cc
+35-14usr.sbin/bsdinstall/scripts/checksum
+628-31826 files not shown
+798-38832 files

HardenedBSD/src a61ec24 — release/tools gce.conf

GCE: Switch to using kvmclock timecounter on GCE VMs

Currently, GCE VMs are configured to use the "ACPI-safe" timecounter,
which does not exist on modern VM hardware. The system then falls back
to TSC-low because it has a higher quality rating than kvmclock.
However, TSC-low may report incorrect time after a VM migrates to a
different host system.

Instruct GCE VMs to use the kvmclock timecounter so that timekeeping
remains accurate across live migrations.

Reported by:    delphij
Reviewed by:    delphij
Approved by:    delphij (mentor)
Approved by:    re (cperciva)
Differential Revision:  https://reviews.freebsd.org/D62121

(cherry picked from commit 141e74291075785c7898763d33288b7fd8b9f06d)
DeltaFile
+1-1release/tools/gce.conf
+1-11 files

HardenedBSD/src 9ffe291 — usr.sbin/bsdconfig Makefile, usr.sbin/bsdconfig/share geom.subr

bsdconfig: Resolve GEOM ids and names without scanning

f_device_get_all probes every DEV geom. Each probe calls
f_geom_find_by to turn a provider ref into a struct, and
f_geom_find for the gpt, geli, and nop parent names. Those walks
cover every class and geom, so a machine with a large disk set
spends its time in sh at "Probing devices".

Record each struct by id, and each geom by name, while
f_geom_get_all parses kern.geom.confxml. f_geom_find_by resolves
property id from the id map. f_geom_find resolves a non-empty name
from the name map. The same name can appear in more than one class,
so the name map stores a list of structs. A name that is still not
a shell identifier after rewriting is left for the linear scan.
f_geom_reset drops both maps.

Add an ATF test that times id and name lookups at 100 and 200
disks, and checks names that are not shell identifiers.


    [3 lines not shown]
DeltaFile
+324-0usr.sbin/bsdconfig/tests/geom_subr_test.sh
+316-3usr.sbin/bsdconfig/share/geom.subr
+3-0usr.sbin/bsdconfig/Makefile
+3-0usr.sbin/bsdconfig/tests/Makefile
+646-34 files

HardenedBSD/src e109c8d — usr.sbin/bhyve pci_emul.c

bhyve: fix bootorder for PCI slots >= 10

Currently, bhyve writes slots as decimals. Firmware such as EDK2
interprets them as hexadecimals, so slot 10 becomes 16, breaking
the configured boot order.

Reviewed by:    markj
Fixes:          6632a0a4e3ab ("bhyve: add helper to create a bootorder")
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61997

(cherry picked from commit 653c5d3b5f9f3f157c043c0acdcfc2ba85718016)
DeltaFile
+1-1usr.sbin/bhyve/pci_emul.c
+1-11 files