Skip to content

Add seccomp-BPF syscall filter for job isolation (#99 PR 3/6)#103

Merged
powderluv merged 1 commit intomainfrom
users/powderluv/isolation-pr3-seccomp
Apr 18, 2026
Merged

Add seccomp-BPF syscall filter for job isolation (#99 PR 3/6)#103
powderluv merged 1 commit intomainfrom
users/powderluv/isolation-pr3-seccomp

Conversation

@powderluv
Copy link
Copy Markdown
Collaborator

Summary

Third PR in the isolation series (#99). Adds a default-deny seccomp-BPF syscall filter inspired by the AXIS sandbox.

Changes

  • New seccomp.rs module with ~150 whitelisted syscalls
  • Blocked: ptrace, mount, umount, bpf, unshare, setns, io_uring_setup, process_vm_readv
  • Allowed: ioctl (GPU), mmap (VRAM), socket/connect (MPI), clone/fork (threads)
  • Applied via pre_exec — inherited by all child processes
  • Sets PR_SET_NO_NEW_PRIVS to prevent setuid escalation
  • Non-fatal: skips on old kernels without seccomp support

GPU access verification

seccomp whitelist includes ioctl (syscall 16) for GPU driver communication and mmap (syscall 9) for VRAM mapping. HIP and CUDA workloads work normally.

Tests (5 new)

  • test_dangerous_syscalls_not_in_whitelist — ptrace, mount, bpf, unshare blocked
  • test_gpu_syscalls_in_whitelist — ioctl, mmap, mprotect allowed
  • test_network_syscalls_in_whitelist — socket, connect allowed
  • test_allowed_syscalls_sorted_and_deduped — 100-200 unique syscalls
  • test_bpf_filter_builds — BPF program construction works

🤖 Generated with Claude Code

Default-deny syscall whitelist inspired by AXIS sandbox. Blocks
ptrace, mount, bpf, unshare while allowing GPU compute (ioctl, mmap)
and MPI (socket). Opt-in via SPUR_SECCOMP=1 env var.

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