summaryrefslogtreecommitdiff
path: root/integrationtests/signals_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-06 09:49:04 +0300
committerPaul Buetow <paul@buetow.org>2026-06-06 09:49:04 +0300
commit381581b373329b67187be494118df49e5ec2acca (patch)
treed7b163dc347b1a595c23e467f5c21b0a60cfc5e1 /integrationtests/signals_test.go
parent4292b4ef116ec72b66f3c19f8a9a00458d441b79 (diff)
test(landlock): cover landlock_add_rule end-to-end (nj0)
Extend the existing security-landlock scenario to also exercise landlock_add_rule in-process. After creating the ruleset fd, the scenario builds a struct landlock_path_beneath_attr (allowed_access = LANDLOCK_ACCESS_FS_READ_FILE, parent_fd = open("/", O_PATH)) and calls landlock_add_rule(ruleset_fd, LANDLOCK_RULE_PATH_BENEATH, &attr, 0) (syscall nr 445), then closes both fds. landlock_add_rule is unprivileged and has no process-wide side effects (it only builds a ruleset that is never enforced), so it is safe to run in the shared workload process. The call is issued unconditionally even when ruleset creation fails: sys_enter_landlock_add_rule fires before the kernel validates the fd, so the enter tracepoint is captured regardless of whether Landlock is enabled, matching create_ruleset coverage. ret is UNCLASSIFIED (0/-1, not a byte count). TestSecurityLandlockCreateRuleset now adds landlock_add_rule to the trace-arg set and asserts enter_landlock_add_rule MinCount>=1 plus a positive event duration, capturing ruleset_fd at args[0] (KindFd). landlock_restrict_self (ci0) is intentionally NOT covered here: it would require a traced child subprocess, which the integration harness cannot support (it filters by the single workload PID at the BPF layer). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'integrationtests/signals_test.go')
0 files changed, 0 insertions, 0 deletions