Skip to content

refactor(sandbox): remove the unused Landlock root allow-list helper - #5221

Merged
FrostGod merged 1 commit into
NVIDIA:mainfrom
EmilienM:refactor/5190-single-root-allowlist/EmilienM
Nov 4, 2026
Merged

FrostGod merged 1 commit into
NVIDIA:mainfrom
EmilienM:refactor/5190-single-root-allowlist/EmilienM

Conversation

@EmilienM

@EmilienM EmilienM commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the unused Landlock root allow-list helper from the audited linux module so the root enumeration has one implementation, and rewords the capability-free baseline's private-root comment to match what the code does.

Related Issue

Closes #5190

Changes

  • Deleted open_root_allowlist, RootEntryHandle, validate_component, and their tests from crates/openshell-sandbox/src/linux/landlock.rs. abi_version stays; it backs probe_availability. Dead imports pruned, module doc rewritten.
  • Reworded the _private_root comment in capability_free_baseline_entries: the descriptor backs only the eager O_DIRECTORY|O_NOFOLLOW validation and is dropped before any per-entry descriptor is opened; exclusion during enumeration is by name plus O_NOFOLLOW.

Release Notes

None: dead-code removal and a comment fix, no behavior change.

Testing

  • Checks appropriate to the affected code and behavior pass
  • Unit tests added/updated (if applicable)
  • E2E tests added/updated (if applicable)

cargo fmt --check, cargo clippy -p openshell-sandbox --all-targets -- -D warnings, and cargo test -p openshell-sandbox (284 tests, 0 failures) on the branch rebased on current main, including the Landlock baseline regression tests (capability_free_baseline_*). Also merged locally with #5144 (touches the same file) and cargo check passes.

Checklist

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

The root allow-list was implemented twice: open_root_allowlist and
RootEntryHandle in linux/landlock.rs were documented as the audited
primitive but had no production caller, while the capability-free
baseline enumerates the root itself in sandbox/linux/landlock.rs. Remove
the unused helper, its handle type, their tests, and the dead imports,
so the audited module describes only what runs. abi_version stays; it
backs probe_availability.

Reword the baseline's private-root comment to match the code: the
descriptor backs only the eager O_DIRECTORY|O_NOFOLLOW validation and is
dropped before enumeration, which excludes the private name and opens
every entry with O_NOFOLLOW.

Closes NVIDIA#5190

Signed-off-by: Emilien Macchi <emacchi@redhat.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 3, 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.

@mrunalp

mrunalp commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

/ok to test 23165ba

@TaylorMutch TaylorMutch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the complete diff and verified that the removed root allow-list helper has no production callers. Runtime Landlock enforcement and ABI probing remain unchanged, and the revised comment accurately describes descriptor lifetime. CI has passed for this commit.

@TaylorMutch
TaylorMutch added this pull request to the merge queue Nov 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 3, 2026
@TaylorMutch
TaylorMutch added this pull request to the merge queue Nov 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 4, 2026
@FrostGod
FrostGod added this pull request to the merge queue Nov 4, 2026
Merged via the queue into NVIDIA:main with commit 74eacee Nov 4, 2026
85 of 86 checks passed
@FrostGod
FrostGod deleted the refactor/5190-single-root-allowlist/EmilienM branch November 4, 2026 03:16
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: the root allow-list is implemented twice and the audited helper has no caller

4 participants