FreeBSD/src e6e4e05 — sys/netpfil/ipfw ip_fw_table_value.c

ipfw: fix value index allocation on shared value storage resize

alloc_table_vidx() treated a successful resize_shared_value_storage()
as complete success and returned an uninitialized vidx instead of
allocating a new index in the grown bitmap. The removed restart
machinery in b0c13e7e2446 used to handle this case by restarting the
whole operation.

Also refresh pval pointer in ipfw_link_table_values() after the resize,
otherwise the new value object is registered against the freed old storage.

PR:             300802, 300803
Reported by:    pouria
Tested by:      pouria
DeltaFile
+21-3sys/netpfil/ipfw/ip_fw_table_value.c
+21-31 files

FreeBSD/src d34baf1 — sys/dev/evdev evdev_utils.c

evdev: Map the HP mic mute and programmable keys

HP laptops send these keys as AT scancodes 0xE0 0x01 and 0x68, which
evdev dropped.  Map 0xE0 0x01 to KEY_MICMUTE, as systemd's hwdb does
for the HP business laptops (EliteBook, ProBook, ZBook, Elite
Dragonfly), and 0x68 to KEY_PROG1, as it does for the Elite
Dragonfly G2.

hwdb maps 0xE0 0x01 to Fn+Esc on the other HP models.  The AT table is
not per machine, so Fn+Esc there now sends KEY_MICMUTE instead of
nothing.

Reviewed by:    wulf
Approved by:    wulf
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/122
DeltaFile
+4-2sys/dev/evdev/evdev_utils.c
+4-21 files

FreeBSD/src ced5806 — sys/dev/pci pci.c

pci: Accept D3hot in pci_set_powerstate_method()

Since D3 was split into D3hot and D3cold, PCI_POWERSTATE_D3 is D3cold
and the switch rejects D3hot with EINVAL.  Devices whose _SxD is 3
(D3hot) then stay in D0 on suspend, and acpi_pci skips their ACPI
transition.  LinuxKPI pci_set_power_state(PCI_D3hot) fails the same way.

The PM register has a single D3 state, so write it for both.

Reviewed by:    kbowling
Approved by:    kbowling
Fixes:          84bbfc32a3f4 ("acpi_powerres: D3cold support")
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/111
DeltaFile
+7-4sys/dev/pci/pci.c
+7-41 files

FreeBSD/src 53a850a — tools/build Makefile

tools/build: also stage machine/cpu_flags.h on powerpc

powerpc's machine/elf.h now includes machine/cpu_flags.h, but only elf.h
gets copied into the legacy include directory. Building world natively
on a powerpc host that doesn't have cpu_flags.h installed yet then fails
in libllvmminimal.

Reviewed by:    jhibbits
Fixes:          90bc40e26c61 ("powerpc: Split CPU flags into separate file...")
MFC with:       90bc40e26c61
Differential Revision:  https://reviews.freebsd.org/D61920
DeltaFile
+4-0tools/build/Makefile
+4-01 files

FreeBSD/src a343fc0 — sys/dev/tpm tpm_crb.c

tpm: crb: Do not attach when no CRB interface answers

Some firmware describes a CRB TPM that is not there: a Protectli FW6
with coreboot 4.12 publishes a TPM2 table at 0xfed40000, but no PTT
answers and the Intel ME interface is absent too.  Every register
reads all-ones, so attach failed only after 0.6 s of state timeouts,
with ready, idle and locality messages that hid the cause.

Check INTF_ID once, as tpm_tis12_probe() does for TPM 1.2.

Reviewed by:    kbowling
Approved by:    kbowling
MFC after:      1 week
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/128
DeltaFile
+9-0sys/dev/tpm/tpm_crb.c
+9-01 files

FreeBSD/src 806d881 — contrib/atf/atf-sh libatf-sh.subr

atf-sh: fix comment typo

Signed-off-by: Igor Ostapenko <pm at igoro.pro>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/895
(cherry picked from commit d4d14d965fb92d2bceb744be41310dc47f27ab80)
DeltaFile
+1-1contrib/atf/atf-sh/libatf-sh.subr
+1-11 files

FreeBSD/src f8dc833 — tests/sys/capsicum capsicum-freebsd.h

capsicum-test: Disable `HAVE_SEND_RECV_MMSG` again

04c4b2084eb9 accidentally added some changes from another WIP commit into that
diff. Instead of wholesale reverting the change, just revert the part that's
currently broken (`HAVE_SEND_RECV_MMSG`). While some of the related tests pass,
one of the testcases (`capmode.cc:AllowedMmsgSendRecv`) doesn't currently pass.

Revert the change to make the CI run more green again.

MFC after:      1 week
Fixes:  04c4b2084eb9 ("capsicum-test: make the code WARNS=6 clean")

(cherry picked from commit 71eddb44d7dfa60e43f77c90b51bd091f0693f85)
DeltaFile
+4-0tests/sys/capsicum/capsicum-freebsd.h
+4-01 files

FreeBSD/src 70a30af — contrib/kyua config.h

contrib/kyua: update config.h for 0.15.1 -> 0.15.2

This was accidentally missed in the prior commit.

This commit addresses a largely cosmetic issue.

MFC after:      6 days
MFC with:       c16da33701d0
Fixes:          c16da33701d0 contrib/kyua: update to 0.15.2

(cherry picked from commit d9daf5ae796518af1793f919156fb6feba05959d)
DeltaFile
+3-3contrib/kyua/config.h
+3-31 files

FreeBSD/src 62664f2 — contrib/kyua/utils datetime.cpp auto_array.hpp, contrib/kyua/utils/signals timer_test.cpp

contrib/kyua: update to 0.15.2

This change contains a few bugfixes to the test executor.

MFC after:      1 week
Merge commit 'dab80d5deaf7d998d587b99f7941890237960638'

(cherry picked from commit c16da33701d07751bbe6871ad39582006d5281fc)
DeltaFile
+0-312contrib/kyua/utils/auto_array_test.cpp
+0-227contrib/kyua/utils/auto_array.ipp
+117-0contrib/kyua/utils/datetime_test.cpp
+92-19contrib/kyua/utils/signals/timer_test.cpp
+0-102contrib/kyua/utils/auto_array.hpp
+88-0contrib/kyua/utils/datetime.cpp
+297-66014 files not shown
+442-77020 files

FreeBSD/src e39fcd5 — tests/sys/capsicum fcntl.cc

tests/sys/capsicum: Fix -Wshadow issue with `fd_set`

`fd_set` is defined in `sys/select.h`, and prior to this change, was in fcntl.cc as well.

This change renames `fd_set` to `fd_set_` to avoid the name collision.

MFC after:      1 week
Reported by:    gcc 14
Fixes:          04c4b2084eb9 ("capsicum-test: make the code WARNS=6 clean")

(cherry picked from commit a479301abb2c7b384f574fcc641e502f70654835)
DeltaFile
+5-5tests/sys/capsicum/fcntl.cc
+5-51 files

FreeBSD/src 90bdd1e — tests/sys/capsicum capability-fd.cc fexecve.cc

capsicum-test: make the code WARNS=6 clean

Make the code WARNS=6 clean by doing the following:
- Renaming variables (-Wshadow).
- Use memcpy instead of assigning the result of CMSG_DATA to a variable
  (-Wcast-align).
- Wrap some macros with do-while(0) to avoid variable collisions
  (-Wshadow).
- Push one of the TRACE statements up by 1 layer to avoid a collision
  between 2 calls of TRACE via the same overarching macro.

This was needed in order for the code to build properly with D61066,
since the code was not compiling with WARNS set to 3 at the testcase
level.

MFC after: 1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D61080

(cherry picked from commit 04c4b2084eb93fc2374dbb89f343f3941585a640)
DeltaFile
+35-35tests/sys/capsicum/socket.cc
+26-10tests/sys/capsicum/capsicum-test.h
+15-15tests/sys/capsicum/sctp.cc
+8-7tests/sys/capsicum/capsicum-freebsd.h
+6-6tests/sys/capsicum/fexecve.cc
+6-4tests/sys/capsicum/capability-fd.cc
+96-773 files not shown
+107-829 files

FreeBSD/src da8acc2 — contrib/kyua/engine googletest_helpers.cpp googletest.cpp

contrib/kyua: update to 0.15.1

This new release contains multiple bugfixes. Please see the release
notes mentioned in the merge commit for more details.

MFC after:      2 weeks
Merge commit '3e05143b80d1537cdd51a5dcf742da31f400507e'

(cherry picked from commit b68969979d6b590247290b4fe26212d201c3ad96)
DeltaFile
+134-63contrib/kyua/engine/googletest_result.cpp
+111-30contrib/kyua/engine/googletest_result_test.cpp
+5-26contrib/kyua/engine/googletest_result.hpp
+3-25contrib/kyua/engine/googletest_test.cpp
+2-25contrib/kyua/engine/googletest_helpers.cpp
+2-25contrib/kyua/engine/googletest.cpp
+257-19416 files not shown
+317-26122 files

FreeBSD/src 906dced — lib/googletest/tests/gmock Makefile, lib/googletest/tests/gtest Makefile

GoogleTest: run several tests as plain C++ tests

Some of the tests provided by GoogleTest don't play well with the kyua
GoogleTest engine available in 0.15.0, in part because they test
edgecases that the kyua GoogleTest engine does not expect or handle
gracefully.

Treat the tests as plain C++ tests to keep parity (result-wise) before
switching the testcase type from `plain` (what it is today under the
covers) to `googletest`.

MFC after:      1 month
MFC with:       3fb03fb35b20 ("[tests] switch GoogleTest tests to ...")

(cherry picked from commit eecc84de3572d1ee6caac1fa14dd3140c9601c9c)
DeltaFile
+14-7lib/googletest/tests/gtest/Makefile
+12-5lib/googletest/tests/gtest_main/Makefile
+2-1lib/googletest/tests/gmock/Makefile
+28-133 files

FreeBSD/src 2ca11a1 — tests/sys/capsicum capsicum-test-main.cc Makefile

tests/sys/capsicum: restore test coverage with root user

This change builds capsicum_test and installs/runs it as an unprivileged
user ("tests" in vanilla FreeBSD) and root.

This required adjusting logic in the Makefile in order to build two
binaries with the same sources and running them as separate binaries.

Moreover, in order to restore coverage and ensure that some tests which
require `other_uid` (typically specified via `-u` on the CLI with the
test program) don't fail, become the "tests" user when run as root. This
technically doesn't honor unprivileged_user property in kyua.conf: the
property needs to be passed via a command-line parameter to the test
program.

MFC after:      1 week
Reported by:    markj
Fixes:          3fb03fb35b20 ("[tests] switch GoogleTest tests ...")


    [4 lines not shown]
DeltaFile
+18-9tests/sys/capsicum/Makefile
+24-0tests/sys/capsicum/capsicum-test-main.cc
+42-92 files

FreeBSD/src 0fb56a7 — share/mk googletest.test.mk, tests/sys/capsicum Makefile functional.sh

[tests] switch GoogleTest tests to `googletest` interface

The new `googletest` kyua test interface--added in 0.15.0 and fixed in
0.15.1--allows tests to be executed and handled in a more fine-grained
manner than the way it was prior to this commit.

This change deletes the `capsicum-test` ATF wrapper script,
`functional.sh`, and all supporting logic in `googletest.test.mk` as
well as this change makes that logic unnecessary.

MFC after:      1 month
MFC with:       b68969979d6b ("contrib/kyua: update to 0.15.1")

(cherry picked from commit 3fb03fb35b20d259e0a3a07fc48f2ecc3c5da6e8)
DeltaFile
+0-60tests/sys/capsicum/functional.sh
+1-10share/mk/googletest.test.mk
+0-1tests/sys/capsicum/Makefile
+1-713 files

FreeBSD/src 5e5687a — lib/clang llvm.build.mk, lib/libc/tests/stdlib Makefile

src: Use gnu++17 as the default C++ standard

Previously the compiler's default C++ standard was used unlike C where
bsd.sys.mk explicitly sets a default language version.  Setting an
explicit default version will give a more uniform experience across
different compilers and compiler versions.

gnu++17 was chosen to match the default C standard.  It is well
supported by a wide range of clang (5+) and GCC (9+) versions.

gnu++17 is also the default C++ standard in recent versions of clang
(16+) and GCC (11+).  As a result, many of the explicit CXXSTD
settings in Makefiles had the effect of lowering the C++ standard
instead of raising it as was originally intended and are removed.

Note that the remaining explicit CXXSTD settings for atf and liblutok
explicitly lower the standard to C++11 due to use of the deprecated
auto_ptr<> template which is removed in later versions.


    [4 lines not shown]
DeltaFile
+0-2usr.bin/dtc/Makefile
+0-2share/mk/googletest.test.inc.mk
+0-2lib/libc/tests/stdlib/Makefile
+2-0share/mk/bsd.sys.mk
+0-1lib/libclang_rt/Makefile.inc
+0-1lib/clang/llvm.build.mk
+2-87 files not shown
+2-1513 files

FreeBSD/src a84a3e2 — tests/sys/capsicum procdesc.cc capability-fd.cc

capsicum-tests: remove Linux support

Now that this project is part of freebsd-src, it no longer needs to be
portable.  Remove Linux-only tests, cross-os compatibility code, and
compatibility with older FreeBSD versions.  Leave in place some
originally Linux-only tests that could now be ported to FreeBSD, like the
pipe2 tests.

Sponsored by:   ConnectWise
Reviewed by:    oshogbo
Differential Revision: https://reviews.freebsd.org/D54985

(cherry picked from commit fba81b33aabff74ad03d5f9f9663c176cf060fa6)
DeltaFile
+4-144tests/sys/capsicum/capsicum.h
+0-144tests/sys/capsicum/syscalls.h
+0-140tests/sys/capsicum/capability-fd-pair.cc
+0-103tests/sys/capsicum/capsicum-rights.h
+5-65tests/sys/capsicum/capability-fd.cc
+15-51tests/sys/capsicum/procdesc.cc
+24-64716 files not shown
+55-93722 files

FreeBSD/src 78dba31 — tests/sys/capsicum Makefile

tests: sys/capsicum/functional requires mqueuefs

Skip this test if mqueuefs isn't loaded.  Unfortunately, that will skip
the entire googletest test program, including test cases that don't
require mqueuefs.  But the test's own skipping logic doesn't work, and
we don't yet have a googletest-compatible require_kmods() function.

MFC after:      2 weeks
Sponsored by:   ConnectWise
Reviewed by:    emaste, ngie
Differential Revision: https://reviews.freebsd.org/D54902

(cherry picked from commit df68a09ea2ec18ee975fb937d46a18250d4663c8)
DeltaFile
+1-0tests/sys/capsicum/Makefile
+1-01 files

FreeBSD/src 952a75f — . MAINTAINERS, .github CODEOWNERS

MAINTAINERS, CODEOWNERS: Update capsicum-test

Fixes: 670b568ec1c3 ("capsicum-test: Move out of contrib")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b773da180e02c0c27de48dbba72f3fb7a64656da)
DeltaFile
+1-1MAINTAINERS
+1-1.github/CODEOWNERS
+2-22 files

FreeBSD/src 01d8317 — contrib/capsicum-test procdesc.cc capability-fd.cc, tests/sys/capsicum procdesc.cc capability-fd.cc

capsicum-test: Move out of contrib

Google developed the Capsicum unit test suite[1] as part of the
Capsicum-Linux[2] project, based on unit tests that existed in FreeBSD
and unit tests developed as part of the initial Capsicum-Linux port.

Capsicum-Linux was archived as of October 31, 2022 and is no longer
being maintained.  FreeBSD is currently the only consumer of and
contributor to the test suite.  Move the src into tests/sys/capsicum to
simplify ongoing maintenance.

The makefiles were deleted as we (continue to) use the existing bespoke
FreeBSD Makefile, and CONTRIBUTING.md was removed as the Google CLA is
no longer applicable.

[1] https://github.com/google/capsicum-test
[2] https://github.com/google/capsicum-linux

Reviewed by:    asomers, oshogbo

    [4 lines not shown]
DeltaFile
+0-1,500contrib/capsicum-test/linux.cc
+1,500-0tests/sys/capsicum/linux.cc
+0-1,359contrib/capsicum-test/capability-fd.cc
+1,359-0tests/sys/capsicum/capability-fd.cc
+0-1,097contrib/capsicum-test/procdesc.cc
+1,097-0tests/sys/capsicum/procdesc.cc
+3,956-3,95662 files not shown
+8,922-9,08168 files

FreeBSD/src 5f1cc74 — .github CODEOWNERS

CODEOWNERS: Add myself to capsicum-test

(cherry picked from commit 5b036b25853349cd3cf26495e628276f79f29c42)
DeltaFile
+1-1.github/CODEOWNERS
+1-11 files

FreeBSD/src 318895d — sys/security/audit audit_bsm.c

pdptrace(2): handle audit

Reported by:    llm-postcr
Fixes:  b2f300ee8fc0 ("sys/bsm/audit_kevents.h: add AUE_PDPTRACE")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+16-0sys/security/audit/audit_bsm.c
+16-01 files

FreeBSD/src d50b928 — sys/compat/freebsd32 freebsd32_sysent.c, sys/kern init_sysent.c

Regen
DeltaFile
+1-1sys/sys/sysproto.h
+1-1sys/kern/init_sysent.c
+1-1sys/compat/freebsd32/freebsd32_sysent.c
+3-33 files

FreeBSD/src c7b2fd6 — sys/kern syscalls.master vfs_syscalls.c, sys/security/audit audit_bsm.c

fchroot(2): audit

The AUE_FCHROOT identifier was already added, but not used to audit the
fchroot(2) syscall.

Reported by:    llm-postcr
Fixes:  b165e9e3ea4e ("Add fchroot(2)")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+1-1sys/kern/syscalls.master
+2-0sys/kern/vfs_syscalls.c
+1-0sys/security/audit/audit_bsm.c
+4-13 files

FreeBSD/src a6da18f — contrib/openbsm/etc audit_event

contrib/openbsm/etc/audit_event: add entries for {f,}chaltroot

Reported by:    llm-postcr
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+2-0contrib/openbsm/etc/audit_event
+2-01 files

FreeBSD/src 951dcca — contrib/openbsm/etc audit_event

contrib/openbsm/etc/audit_event: add entries for pdopenpid and pdptrace

Fixes:  606061ea463d ("sys: add AUE_PDOPENPID")
Fixes:  b2f300ee8fc0 ("sys/bsm/audit_kevents.h: add AUE_PDPTRACE")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+2-0contrib/openbsm/etc/audit_event
+2-01 files

FreeBSD/src a0e5c02 — tools/build/mk OptionalObsoleteFiles.inc

Remove CDDL and ctfconvert tests when their controlling knobs are disabled

In the event someone specified MK_CDDL == no prior to this change, all
tests under `/usr/tests/cddl` would stick around after the change,
resulting in errors. Similarly, MK_DTRACE == no removed ctfconvert,
which the ctfconvert tests relied on (but remained around after the knob
was disabled).

Remove the tests under the respective blocks now so they don't linger
around on systems where these knobs are disabled, resulting in false
positives when running the complete test suite.

The ctfconvert tests weren't specifically put under
`${MK_DTRACE_TESTS}` == no because ctfconvert was bundled separately
from the upstream provided Dtrace test suite.

MFC after:      2 weeks
MFC with:       30c20ca26 ("Remove Dtrace/ZFS tests if their knobs are disabled")

(cherry picked from commit df6131e2b74d9f334c16387e9a46cafd6e27eb78)
DeltaFile
+22-0tools/build/mk/OptionalObsoleteFiles.inc
+22-01 files

FreeBSD/src 6109c35 — tools/build/mk OptionalObsoleteFiles.inc

Don't some prune empty dirs created by BSD.tests.dist

Before this change, directories needed when MK_DTRACE_TESTS != no and
MK_ZFS_TESTS != no but not MK_TESTS != no, were being created via
`BSD.tests.dist` as part of the standard build/install process with the
top-level `hierarchy` target. This behavior resulted in `make check-old`
flagging a lot of issues after 30c20ca26e105c, even after `make
delete-old` was run and the directories were removed.

Remove the logic which pruned these empty directories; this "fixes" the
issue with `make check-old`, et al and allows a proper technical solution to
`OptionalObsoleteFiles.inc` to be implemented by pkgbase in an unimpeded
manner without introducing additional complexity.

See the review for more details.

PR:             299650
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60928

    [2 lines not shown]
DeltaFile
+18-6tools/build/mk/OptionalObsoleteFiles.inc
+18-61 files

FreeBSD/src 3926aba — tools/build/mk OptionalObsoleteFiles.inc

Remove Dtrace/ZFS tests if their knobs are disabled

Prior to this change, Dtrace and ZFS tests and their respective
directories would remain installed even if `${MK_DTRACE_TESTS}` == no or
`${MK_ZFS_TESTS}` == no.

This change enhances the logic to remove the tests when the respective
knobs are disabled so the tests will be removed when `make delete-old`
is run.

MFC after:      2 weeks

(cherry picked from commit 30c20ca26e105cffc5f37a95964cd9b2cad1b6cd)
DeltaFile
+25-0tools/build/mk/OptionalObsoleteFiles.inc
+25-01 files

FreeBSD/src a1c9248 — tools/build/mk OptionalObsoleteFiles.inc

Remove Dtrace/ZFS tests if their knobs are disabled

Prior to this change, Dtrace and ZFS tests and their respective
directories would remain installed even if `${MK_DTRACE_TESTS}` == no or
`${MK_ZFS_TESTS}` == no.

This change enhances the logic to remove the tests when the respective
knobs are disabled so the tests will be removed when `make delete-old`
is run.

MFC after:      2 weeks

(cherry picked from commit 30c20ca26e105cffc5f37a95964cd9b2cad1b6cd)
DeltaFile
+25-0tools/build/mk/OptionalObsoleteFiles.inc
+25-01 files