Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Modal 7 min read Case study mediumAdept

How to catch crypto miners using syscall signatures

Modal detects cryptominers abusing its GPU serverless platform by analyzing container syscalls at runtime rather than relying only on user metadata, which abusers can fake with stolen credit cards. Source and binary analysis and image scanning are ruled out because containers run arbitrary x86 code fetched at runtime, and ptrace-based strace costs about 10µs per context switch, which can slow syscall-heavy programs by more than 100x. Instead, gVisor's sentry kernel already intercepts every syscall, so Modal streams its seccheck tracepoints over a Unix socket to a per-container Rust thread. That thread matches events such as non-Python execve calls against rules, kills flagged containers and feeds auto-banning, with zero false positives reported so far.

Assumes: Linux syscallscontainersstrace/ptrace basics

Related posts

  • Modal becomes a gVisor maintainer

    Modal mediumAdept

    Google is donating gVisor to the CNCF under maintainer-led governance, and Modal, which launches over 40 million gVisor containers a day for GPU inference, training, and AI sandboxes, is joining as a maintainer. gVisor's Go-based Sentry application kernel implements the Linux syscall interface and is itself confined by namespaces, cgroups and seccomp, giving tenant isolation without hardware virtualization: about 25 ms boot and 12 MB overhead. Modal's upstream work includes nvproxy support for new NVIDIA GPUs, NVLink, MPS and GPUDirect RDMA, plus a new rdmaproxy that reaches ~99% of native NCCL all-reduce bandwidth over InfiniBand, RoCE and EFA. Other contributions are huge-page recycling that lifts PyTorch shared-memory throughput from 2.9 to 22 GB/s and tmpfs work that makes SQLite 2.7x faster. Planned work covers multi-GPU memory snapshots, GPUDirect Storage, MIG/vGPU and sub-minute inference server startup.

  • Memory snapshots: Checkpoint/restore for sub-second startup

    Modal mediumAdept

    Modal cuts serverless container cold starts roughly 2.5x by checkpointing a gVisor container's full process tree and filesystem mutations just before it accepts a request, then restoring it instead of re-running Python's syscall-heavy import path (import torch alone makes 26,000 syscalls through OverlayFS and a FUSE lazy-loading server). Restore speed depends mostly on getting the main process's memory pages into the page cache. gVisor loads pages in the background, prioritizing faulting pages, while the FUSE layer aggressively preloads the pages file. Snapshots are created on demand per worker because of CPU feature, NVIDIA driver and runtime compatibility. GPU state can't be saved, so models are loaded into CPU RAM before the snapshot and moved to the GPU after restore via snap=True/snap=False lifecycle hooks.

  • Scaling real-time file monitoring with eBPF: How we filtered billions of kernel events per minute

    Datadog Engineering mediumAdept

    Datadog built file integrity monitoring on eBPF to capture file changes with process and container context, which periodic scans, inotify and auditd could not provide at scale. Their infrastructure produces over 10 billion file events per minute at roughly 5 KB each. Agent-side rule matching cuts what reaches the backend to about one million events per minute. In-kernel prefiltering goes further: static approvers are derived from detection rules, and dynamic discarders are pushed at runtime into LRU eBPF maps. Together they drop up to 94% of events before they hit the ring buffer, which lowers CPU use and prevents dropped events.

  • Server-side sandboxing: Containers and seccomp

    Figma mediumAdept

    Containers and seccomp offer lighter-weight sandboxing than VMs, but both shift much more configuration responsibility onto the user. Container escape risk depends on the runtime implementation, kernel primitives and configuration, and a sandboxed container still needs network, credential and data isolation to limit damage if compromised. Seccomp-only sandboxes suit pure-compute programs: Figma allows only writing to already-open file descriptors, exiting, memory allocation and fetching the time. Building allowlists with strace, restructuring programs so risky syscalls happen before untrusted input is processed, and maintaining brittle allowlists are the main costs, in exchange for very low overhead.

  • Keeping 20,000 GPUs healthy

    Modal mediumAdept

    Modal keeps a multi-cloud fleet of over 20,000 concurrent GPUs reliable through instance-type benchmarking, continuously tested machine images, light boot checks, and passive plus active lifetime healthchecks. Anonymized cloud comparisons reveal large differences: PCIe H100s deliver about 40% fewer matmul FLOP/s than SXM, one provider ran H100s above 90°C and lost roughly half of peak performance, and one provider's L4s flake at CUDA init 0.1% of the time. Boot checks stay shallow (systemctl, nvidia-smi, a GPU read/write) to avoid slowing autoscaling. Passive monitoring uses dcgmi and dmesg Xid errors, weekly active checks run DCGM diag level 2, GPU burn and NCCL all-reduce, and unhealthy hosts are drained and replaced rather than repaired.

The quest for software engineering knowledge.

Look:
Layout: