| 22e27e30 | 03-Sep-2026 |
Mitchell Horne <mhorne@FreeBSD.org> |
pmc_exterr_test: add MACHINE_ARCH check
The tests manipulate MD structure fields directly. Build these tests for amd64 only.
Fixes: e555692d1bb ("hwpmc: Add ATF regression tests for hwpmc EXTERROR
pmc_exterr_test: add MACHINE_ARCH check
The tests manipulate MD structure fields directly. Build these tests for amd64 only.
Fixes: e555692d1bb ("hwpmc: Add ATF regression tests for hwpmc EXTERROR diagnostics")
show more ...
|
| 8f0789be | 25-Aug-2026 |
Alexander Leidinger <netchild@FreeBSD.org> |
hwpmc tests: the sampling log file
Nine ATF cases covering PMC_OP_CONFIGURELOG and the descriptor-less log operations: which descriptors are accepted, when a log is required in the first place, and
hwpmc tests: the sampling log file
Nine ATF cases covering PMC_OP_CONFIGURELOG and the descriptor-less log operations: which descriptors are accepted, when a log is required in the first place, and what the log operations do without one.
MFC after: 1 month MFC to: stable/15 MFC to: stable/14 Assisted-by: Claude Code (Opus 5)
show more ...
|
| bea7b932 | 25-Aug-2026 |
Alexander Leidinger <netchild@FreeBSD.org> |
hwpmc: add credential-transition exec tests (keep and drop)
The companion to pmc_exec_test.c, which covers only the drop side of a credential-changing exec. Three cases cover what the drop must not
hwpmc: add credential-transition exec tests (keep and drop)
The companion to pmc_exec_test.c, which covers only the drop side of a credential-changing exec. Three cases cover what the drop must not overreach into: an exec that changes no credentials keeps the PMC, a set-id exec whose credential change the kernel suppresses for a traced target keeps it too, and a set-id fexecve(2) drops it. They exercise the permission logic FreeBSD-SA-26:56.hwpmc reworked, not the defect it fixed.
All three pass on a debug (INVARIANTS+WITNESS) kernel. The two keep-cases were each observed to fail on a kernel mutated to detach unconditionally.
MFC after: 1 month MFC to: stable/15 MFC to: stable/14 Assisted-by: Claude Code (Opus 4.8)
show more ...
|
| d00da145 | 25-Aug-2026 |
Alexander Leidinger <netchild@FreeBSD.org> |
hwpmc tests: process-attachment lifecycle and ownership cases
Seven ATF cases covering process-attachment teardown orderings: a target that exits before it is detached, the owner that exits before i
hwpmc tests: process-attachment lifecycle and ownership cases
Seven ATF cases covering process-attachment teardown orderings: a target that exits before it is detached, the owner that exits before its target (hwpmc's other unlink path), releasing a still-running attached PMC, row exhaustion with out-of-order release, and PMC_F_DESCENDANTS inheritance including a fork storm.
All pass on a debug (INVARIANTS+WITNESS) and a KASAN kernel.
MFC after: 1 month MFC to: stable/15 MFC to: stable/14 Assisted-by: Claude Code (Opus 5)
show more ...
|
| 17fca802 | 25-Aug-2026 |
Alexander Leidinger <netchild@FreeBSD.org> |
hwpmc: add tests for handle validation and the privilege boundaries
A pmc_id_t is a packed integer that the driver hands to userland and accepts back on eleven operations, and nothing tested what ha
hwpmc: add tests for handle validation and the privilege boundaries
A pmc_id_t is a packed integer that the driver hands to userland and accepts back on eleven operations, and nothing tested what happens when one comes back forged, stale, or belonging to another process. Neither was there a test that an unprivileged caller is refused the operations that need a privilege.
The cases use a SOFT-class PMC wherever the counter itself does not matter, so they run on a machine with no PMU.
MFC after: 1 month MFC to: stable/15 MFC to: stable/14 Assisted-by: Claude Code (Opus 5)
show more ...
|
| 068957e0 | 25-Aug-2026 |
Alexander Leidinger <netchild@FreeBSD.org> |
hwpmc: add regression tests for a credential-changing exec
This tests what FreeBSD-SA-26:56.hwpmc fixed.
exec_setgid_drops_pmc asserts the kernel takes a process-mode PMC away when its target execs
hwpmc: add regression tests for a credential-changing exec
This tests what FreeBSD-SA-26:56.hwpmc fixed.
exec_setgid_drops_pmc asserts the kernel takes a process-mode PMC away when its target execs a set-gid program its owner is not entitled to trace.
exec_setuid_no_double_unlink lets the target exec a set-uid program; the teardown must unlink the process descriptor exactly once, and completing at all is the assertion.
Both need an unprivileged owner and must not drop privileges themselves, since p_candebug() would then refuse the target to its own owner; they ask for require.user instead.
MFC after: 1 month MFC to: stable/15 MFC to: stable/14 Assisted-by: Claude Code (Opus 5)
show more ...
|
| 3c3f886e | 19-Jul-2026 |
Alexander Leidinger <netchild@FreeBSD.org> |
hwpmc: add regression tests for detaching a live process-mode PMC
Attach a process-mode counting PMC to the current process, start it, then detach and release it while it is still loaded on the hard
hwpmc: add regression tests for detaching a live process-mode PMC
Attach a process-mode counting PMC to the current process, start it, then detach and release it while it is still loaded on the hardware - the case that previously leaked the PMC's runcount reference and wedged pmc_wait_for_pmc_idle() at release. A second case does the same from a multi-threaded process so the sibling threads' references have to be drained too.
The tests need an allocatable process-mode counting event and skip where none is available (hwpmc(4) not loaded, or a VM without a vPMU).
Reviewed by: adrian MFC after: 2 weeks Assisted-by: Claude Code (Fable 5) Differential Revision: https://reviews.freebsd.org/D58343
show more ...
|