HomeFreeBSD

tests: Add ktrace capability violation test cases

Description

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

(cherry picked from commit 2f39a986641ecebaa9080ca28118903bd9707a1f)

Details

Provenance
jfreeAuthored on Apr 6 2024, 6:31 PM
Reviewer
markj
Differential Revision
D40682: tests: Add ktrace capability violation test cases
Parents
rGc3ee50b705b8: ktrace: Record socket violations with KTR_CAPFAIL
Branches
Unknown
Tags
Unknown