Skip to content

fix(supervisor): tailor Landlock rights by inode type#2380

Merged
drew merged 1 commit into
mainfrom
2218-landlock-device-rights/drew
Jul 21, 2026
Merged

fix(supervisor): tailor Landlock rights by inode type#2380
drew merged 1 commit into
mainfrom
2218-landlock-device-rights/drew

Conversation

@drew

@drew drew commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix Landlock hard_requirement sandbox startup when filesystem policy enrichment adds device files such as /dev/urandom. Rules now use inode-compatible access rights derived from the already-open path descriptor, avoiding both invalid directory-only rights on non-directories and pathname TOCTOU races.

Related Issue

Closes #2218

Changes

  • Inspect each opened Landlock path with fstat before constructing its rule.
  • Preserve the requested access mask for directories and intersect non-directory masks with file-compatible Landlock rights.
  • Add unit coverage for directories, regular files, character devices, symlink targets, and mixed hard-requirement policies.
  • Add a Docker-backed Rust E2E regression covering baseline enrichment of /dev/urandom.
  • Document inode-specific Landlock rule construction and hard-requirement behavior.

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)
  • OPENSHELL_E2E_DOCKER_TEST=landlock mise run e2e:docker
  • Regression verified to fail before the fix with incompatible directory-only access-rights ... ReadDir

Checklist

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

Closes #2218

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
@drew drew added area:supervisor Proxy and routing-path work topic:compatibility Compatibility-related work os:linux Bug affects Linux hosts labels Jul 21, 2026
@drew
drew requested review from a team, derekwaynecarr, maxamillion and mrunalp as code owners July 21, 2026 01:43
@copy-pr-bot

copy-pr-bot Bot commented Jul 21, 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.

@pimlock

pimlock commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

/ok to test ce3cc87

@pimlock pimlock 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.

LGTM!
Adding the e2e label, since this has a new E2E test.

@pimlock pimlock added the test:e2e Requires end-to-end coverage label Jul 21, 2026
@github-actions

Copy link
Copy Markdown

Label test:e2e applied for ce3cc87. Open the existing run and click Re-run all jobs to execute with the label set. The run will execute the standard E2E suite after building the required gateway and supervisor images once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

@drew
drew enabled auto-merge July 21, 2026 03:55
@drew
drew added this pull request to the merge queue Jul 21, 2026
Merged via the queue into main with commit f169084 Jul 21, 2026
69 of 70 checks passed
@drew
drew deleted the 2218-landlock-device-rights/drew branch July 21, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:supervisor Proxy and routing-path work os:linux Bug affects Linux hosts test:e2e Requires end-to-end coverage topic:compatibility Compatibility-related work

Projects

None yet

2 participants