Skip to main content
QUICK REVIEW

[論文レビュー] Programmable System Call Security with eBPF

Jinghao Jia, Zhu Yi-fei|arXiv (Cornell University)|Feb 20, 2023
Security and Verification in Computing被引用数 14
ひとこと要約

本論文は Seccomp-eBPF を紹介する。Seccomp を eBPF で拡張し、状態を持つ表現力豊かで同期された安全なユーザーメモリアクセス方針を可能にするプログラム可能なシステムコールフィルタリングアプローチであり、従来の Seccomp-cBPF および Notifier に比べてセキュリティとパフォーマンスを向上させる。

ABSTRACT

System call filtering is a widely used security mechanism for protecting a shared OS kernel against untrusted user applications. However, existing system call filtering techniques either are too expensive due to the context switch overhead imposed by userspace agents, or lack sufficient programmability to express advanced policies. Seccomp, Linux's system call filtering module, is widely used by modern container technologies, mobile apps, and system management services. Despite the adoption of the classic BPF language (cBPF), security policies in Seccomp are mostly limited to static allow lists, primarily because cBPF does not support stateful policies. Consequently, many essential security features cannot be expressed precisely and/or require kernel modifications. In this paper, we present a programmable system call filtering mechanism, which enables more advanced security policies to be expressed by leveraging the extended BPF language (eBPF). More specifically, we create a new Seccomp eBPF program type, exposing, modifying or creating new eBPF helper functions to safely manage filter state, access kernel and user state, and utilize synchronization primitives. Importantly, our system integrates with existing kernel privilege and capability mechanisms, enabling unprivileged users to install advanced filters safely. Our evaluation shows that our eBPF-based filtering can enhance existing policies (e.g., reducing the attack surface of early execution phase by up to 55.4% for temporal specialization), mitigate real-world vulnerabilities, and accelerate filters.

研究の動機と目的

  • ほとんど状態を持たず表現力が限られている Seccomp-cBPF の限界に対処する。
  • eBPF ベースの Seccomp プログラムタイプを介して高度なシステムコールセキュリティポリシーを有効にする。
  • 既存の Seccomp インターフェイスを維持しつつ、特権を持たないユーザーが高度なフィルタを安全にインストールできるようにする。
  • フィルタ内での安全な状態管理・同期・ユーザーメモリアクセスのメカニズムを提供する。
  • 実世界のユースケースを示し、以前の手法よりもパフォーマンスとセキュリティが改善されることを示す。

提案手法

  • Seccomp と拡張 BPF ツールを基盤とした新しい Seccomp プログラムタイプ (BPF_PROG_TYPE_SECCOMP) として Seccomp-eBPF を導入する。
  • 状態を持つフィルタリング、安全なユーザーメモリアクセス、同期、カーネルとのやり取りをサポートするように eBPF ヘルパを公開・修正する。
  • 特権タスク構造を公開せずに、特権のないフィルタでも使用できるように secure task storage ヘルパを再定義する。
  • TOCTTOU リスクを軽減しつつ、ユーザー空間ポインタへの安全な DPI (deep packet-like) メモリアクセスを実装する。
  • レースを防ぐために per-call atomic counters と API (bpf_wait_syscall) を導入し、システムコールのシリアライズプリミティブを追加する。
  • 二段階フィルタ読み込み (bpf_prog_load) と改竄保護を考慮した Seccomp のインストールを提供する。
Figure 1 . Features, helper interfaces, and their implementation of the Seccomp eBPF program type.
Figure 1 . Features, helper interfaces, and their implementation of the Seccomp eBPF program type.

実験結果

リサーチクエスチョン

  • RQ1Seccomp フィルタリングを状態保持型にして、システムコール回数制限、シーケンス検査、時間的特化といったポリシーをサポートするにはどうすればよいか。
  • RQ2権限を高めることなく、eBPF ベースの Seccomp フィルタで高度なポリシーを安全に特権のないインストールが可能か。
  • RQ3Seccomp-eBPF で状態管理・同期・安全なユーザーメモリアクセスを可能にするために、どのような新しい eBPF ヘルパが必要か。
  • RQ4Seccomp-eBPF は Seccomp-cBPF と比較して攻撃面をどれだけ削減し、実世界の脆弱性をどの程度緩和できるのか。
  • RQ5従来の Seccomp アプローチと比較した場合の Seccomp-eBPF のパフォーマンス影響は何か。

主な発見

  • eBPF ベースの Seccomp フィルタリングは、cBPF ベースのポリシーと比較して初期実行フェーズのシステムコール表面を最大 55.4% 削減できる。
  • Seccomp-eBPF は、cBPF では実現できないシステムコール回数制限、フロー整合性保護、シリアライズなどの機能を有効にする。
  • 安全なユーザーメモリアクセスヘルパとタスクストレージの再設計により、特権なしのフィルタが特権昇格なく動作できる。
  • Serialization ヘルパ (bpf_wait_syscall) は、競合するシステムコールを調整してレース条件を安全に緩和することを可能にする。
  • このアプローチは Seccomp の使用モデルとインターフェイスを維持しつつ、カーネルの特権機構と統合して特権昇格を防ぐ。
  • Seccomp-eBPF ベースのフィルタの適用は、検証キャッシュにより最大で 10% のパフォーマンス向上を含む、パフォーマンスを改善できる。
Figure 2 . Workflow of a Seccomp-eBPF filter
Figure 2 . Workflow of a Seccomp-eBPF filter

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。