Skip to content

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

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

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

Conversation

@letv1nnn

Copy link
Copy Markdown
Owner

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 NVIDIA#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)

Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
Comment thread crates/openshell-supervisor-process/src/sandbox/linux/landlock.rs Outdated
…ystem paths

Signed-off-by: Artem Lytvyn <alytvyn@redhat.com>
@letv1nnn
letv1nnn force-pushed the policy-compatibility-bug branch from 574fc7c to 49a6eec Compare July 29, 2026 13:21
@letv1nnn

Copy link
Copy Markdown
Owner Author

pushed upstream

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

2 participants