Skip to content

Add Landlock filesystem access control for bare-metal jobs (#99 PR 4/6)#104

Merged
powderluv merged 1 commit intomainfrom
users/powderluv/isolation-pr4-landlock
Apr 18, 2026
Merged

Add Landlock filesystem access control for bare-metal jobs (#99 PR 4/6)#104
powderluv merged 1 commit intomainfrom
users/powderluv/isolation-pr4-landlock

Conversation

@powderluv
Copy link
Copy Markdown
Collaborator

Summary

Fourth PR in the isolation series (#99). Adds Landlock LSM filesystem restrictions for bare-metal jobs, inspired by the AXIS sandbox.

Changes

  • New landlock.rs module using Linux Landlock ABI v1+ (kernel 5.13+)
  • Read-only: /usr, /lib, /bin, /etc, /opt/rocm, /proc, /sys
  • Read-write: job work_dir, /tmp, /dev/shm, GPU devices
  • No access: other users' home dirs, shared NFS paths
  • Applied via pre_exec for bare-metal jobs only (container path uses chroot)
  • Best-effort: graceful skip on older kernels

GPU access

GPU device paths (/dev/dri, /dev/kfd, /dev/nvidia*) are explicitly granted read-write access in the Landlock ruleset.

Test plan

  • 50 spurd tests pass (3 new Landlock tests)
  • Full suite passes
  • CI: job can read /usr/bin, write to work_dir
  • CI: job cannot access /home/other_user

🤖 Generated with Claude Code

@powderluv powderluv force-pushed the users/powderluv/isolation-pr4-landlock branch from f0a118d to c10edbe Compare April 18, 2026 20:08
Landlock LSM restricts filesystem access (kernel 5.13+). Read-only
system paths, read-write work_dir + GPU devices. Opt-in via
SPUR_LANDLOCK=1 env var. Bare-metal only (container uses chroot).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant