]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
tests: Add ktrace capability violation test cases
authorJake Freeland <jfree@FreeBSD.org>
Sat, 6 Apr 2024 18:31:30 +0000 (13:31 -0500)
committerJake Freeland <jfree@FreeBSD.org>
Sun, 7 Apr 2024 23:52:51 +0000 (18:52 -0500)
commit2f39a986641ecebaa9080ca28118903bd9707a1f
treef6eba719e650ddf9b80410cba6ef9b62aadc2957
parentaa32d7cbc92c818622462635641d240ae4342eb2
tests: Add ktrace capability violation test cases

Introduce regression tests for ktrace(2) that target capability
violations.

These test cases ensure that ktrace(2) records these violations:
- CAPFAIL_NOTCAPABLE
- CAPFAIL_INCREASE
- CAPFAIL_SYSCALL
- CAPFAIL_SIGNAL
- CAPFAIL_PROTO
- CAPFAIL_SOCKADDR
- CAPFAIL_NAMEI
- CAPFAIL_CPUSET

A portion of these test cases create processes that do NOT enter
capability mode, but raise violations. This is intended behavior.
Users may run `ktrace -t p` on non-Capsicumized programs to detect
violations that would occur if the process were in capability mode.

Reviewed by: markj
Approved by: markj (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D40682
tests/sys/kern/Makefile
tests/sys/kern/ktrace_test.c [new file with mode: 0644]