Skip to content

fix(policy): harden landlock.compatibility validation - #2541

Open
letv1nnn wants to merge 2 commits into
NVIDIA:mainfrom
letv1nnn:policy-compatibility-bug
Open

fix(policy): harden landlock.compatibility validation#2541
letv1nnn wants to merge 2 commits into
NVIDIA:mainfrom
letv1nnn:policy-compatibility-bug

Conversation

@letv1nnn

Copy link
Copy Markdown
Contributor

Summary

  1. Invalid compatibility values (e.g. hard-requirement) were accepted without error and silently treated as best_effort. Fixed by parsing into an enum at YAML parse time and TryFrom implementation at the proto conversion layer.
  2. hard_requirement with no filesystem paths configured was a silent no-op, Landlock skipped entirely. Fixed by erroring before the early return when hard_requirement is set and both path lists are empty.

Related Issue

closes #2356

Changes

Two fixes to landlock.compatibility enforcement. Invalid values now fail at YAML parse time instead of silently falling back to best_effort. Configuring hard_requirement with no filesystem paths now aborts sandbox startup instead of skipping Landlock entirely. Docs updated to reflect the new behavior.

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

letv1nnn added 2 commits July 27, 2026 15:44
Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
…ystem paths

Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(policy): invalid landlock.compatibility values silently fall back to best_effort

1 participant