Skip to main content
QUICK REVIEW

[논문 리뷰] Programmable System Call Security with eBPF

Jinghao Jia, Zhu Yi-fei|arXiv (Cornell University)|2023. 02. 20.
Security and Verification in ComputingComputer Science인용 수 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.

연구 동기 및 목표

  • 주로 상태 비저장(stateless)이고 표현력이 제한적인 Seccomp-cBPF의 한계를 해결한다.
  • eBPF 기반 Seccomp 프로그램 유형을 통해 고급 시스템 호출 보안 정책을 가능하게 한다.
  • 무권한 사용자가 안전하게 고급 필터를 설치할 수 있도록 하면서 기존 Seccomp 인터페이스를 유지한다.
  • 필터 내에서 상태 관리, 동기화 및 사용자 메모리 접근을 위한 안전한 메커니즘을 제공한다.
  • 이전 접근 방법에 비해 실제 사용 사례와 성능/보안 향상을 시연한다.

제안 방법

  • Seccomp 및 확장된 BPF 도구를 기반으로 한 새로운 Seccomp 프로그램 유형(BPF_PROG_TYPE_SECCOMP)으로 Seccomp-eBPF를 도입한다.
  • 상태 유지 필터링, 안전한 사용자 메모리 접근, 동기화 및 커널 상호작용을 지원하도록 eBPF 도우미를 노출하고 수정한다.
  • 권한이 없는 필터가 특권이 있는 태스크 구조를 노출하지 않으면서도 안전한 태스크 저장소 도우미를 재정의한다.
  • TOCTTOU 위험을 완화하면서 사용자 공간 포인터에 대한 안전한 DPI(깊은 패킷 유사) 메모리 접근을 구현한다.
  • 경합을 방지하기 위해 호출당 원자 카운터와 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와 비교하여 공격 표면을 줄이거나 실제 취약점을 완화하는 데 얼마나 효과적인가?
  • RQ5Seccomp-eBPF의 성능 영향은 기존 Seccomp 방식에 비해 어떤가?

주요 결과

  • eBPF 기반 Seccomp 필터링은 cBPF 기반 정책에 비해 초기 실행 단계의 시스템 호출 면을 최대 55.4%까지 감소시킬 수 있다.
  • Seccomp-eBPF는 cBPF로는 실현 불가능한 시스템 호출 개수 제한, 흐름 무결성 보호 및 직렬화와 같은 기능을 가능하게 한다.
  • 안전한 사용자 메모리 접근 도우미와 태스크 저장소 재설계로 무권한 필터가 권한 상승 없이 작동할 수 있다.
  • 직렬화 도우미(bpf_wait_syscall)는 충돌하는 시스템 호출을 조정하여 레이스 조건을 안전하게 완화할 수 있다.
  • 이 접근법은 Seccomp 사용 모델과 인터페이스를 보존하면서 커널 권한 메커니즘과 통합되어 권한 상승을 방지한다.
  • Seccomp-eBPF 기반 필터의 적용은 검증 캐싱을 통해 최대 10%의 성능 향상을 포함하여 성능을 개선할 수 있다.
Figure 2 . Workflow of a Seccomp-eBPF filter
Figure 2 . Workflow of a Seccomp-eBPF filter

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.