通透式資安應用情境系統呼叫錄製重播與容器快照之整合
Transparent System Call Record/Replay and Process Snapshot/Restore Integration for Security Applications
摘要
多種資安應用,如惡意程式行為分析、事件取證與可回溯式在線模糊測試,需重現目標程式的執行,其技術基礎為系統呼叫層級的錄製與重播,搭配行程狀態的快照與還原。此類目標多為採用多執行緒並行、且部署於多樣處理器架構的網路服務。既有方案於此二需求各有侷限:Mozilla rr 為確定性重播的代表,其將所有執行緒序列化綁定至單一核心以保證重播確定性,犧牲多核運算能力;本研究所承接的前一代系統則以 zpoline 就地重寫系統呼叫指令作為攔截機制,而 zpoline 僅適用於 x86-64。
本研究以 Linux 核心內建的 Seccomp 機制實作系統呼叫層級的錄製與重播。Seccomp 不依賴處理器架構,其使用者通知介面使 Supervisor 得於獨立行程處理目標程式的系統呼叫、達成行程隔離,且每個執行緒可各自安裝過濾器、於多核環境正常運作。為與 CRIU 行程快照工具整合,本研究實作 Eraser 核心模組以解決 Seccomp 通知檔案描述符無法被 CRIU 序列化的問題,並設計連線重建機制使目標程式於還原後能與新建立的 Supervisor 銜接。於多個網路服務與 ARM64 平台之評估顯示:重播能重現目標程式的系統呼叫序列,並於跨越 CRIU 快照與還原後仍正確運作;錄製後的剩餘效能介於 1.5% 至 12.5%;系統並於 ARM64 平台確認其跨架構可行性。
本研究以 Linux 核心內建的 Seccomp 機制實作系統呼叫層級的錄製與重播。Seccomp 不依賴處理器架構,其使用者通知介面使 Supervisor 得於獨立行程處理目標程式的系統呼叫、達成行程隔離,且每個執行緒可各自安裝過濾器、於多核環境正常運作。為與 CRIU 行程快照工具整合,本研究實作 Eraser 核心模組以解決 Seccomp 通知檔案描述符無法被 CRIU 序列化的問題,並設計連線重建機制使目標程式於還原後能與新建立的 Supervisor 銜接。於多個網路服務與 ARM64 平台之評估顯示:重播能重現目標程式的系統呼叫序列,並於跨越 CRIU 快照與還原後仍正確運作;錄製後的剩餘效能介於 1.5% 至 12.5%;系統並於 ARM64 平台確認其跨架構可行性。
Many security applications must reproduce a target program's execution, for which system-call record and replay with process snapshot and restore is the foundation. Such targets are mostly multi-threaded network services running on increasingly diverse processor architectures. Existing solutions are limited on both fronts: Mozilla rr, representative of the determinism-first approach, serializes all target threads onto a single core to guarantee deterministic replay, sacrificing multi-core capability; the prior-generation system this work succeeds intercepts system calls by rewriting their instructions in place with zpoline, which works only on x86-64.
This work implements system-call record and replay on Linux's built-in Seccomp mechanism. Seccomp's user-notification interface lets a supervisor handle the target's system calls in a separate process for isolation, and each thread installs its own filter, operating on multiple cores. To integrate with CRIU, the Eraser kernel module resolves CRIU's inability to serialize Seccomp notification file descriptors, and a reconnection mechanism reattaches the target to a new supervisor after restore. Across several network services, replay reproduces the target's system-call sequence and remains correct across CRIU snapshot and restore; recording leaves 1.5\%--12.5\% residual performance; and the system runs correctly on ARM64, confirming cross-architecture feasibility.
This work implements system-call record and replay on Linux's built-in Seccomp mechanism. Seccomp's user-notification interface lets a supervisor handle the target's system calls in a separate process for isolation, and each thread installs its own filter, operating on multiple cores. To integrate with CRIU, the Eraser kernel module resolves CRIU's inability to serialize Seccomp notification file descriptors, and a reconnection mechanism reattaches the target to a new supervisor after restore. Across several network services, replay reproduces the target's system-call sequence and remains correct across CRIU snapshot and restore; recording leaves 1.5\%--12.5\% residual performance; and the system runs correctly on ARM64, confirming cross-architecture feasibility.