Secure containers isolate each container with its own kernel, mitigating shared-kernel attacks prevalent in traditional container systems. However, existing designs still face a fundamental isolation--performance trade-off. Nested-cloud deployments amplify the cost of VM exits and page-table management, while emerging agentic workloads expose bursty memory demand that requires fine-grained elasticity. We attribute this trade-off to two root causes. First, existing designs lack lightweight intra-container isolation primitives for frequent container user--kernel transitions. Second, the host treats container memory management as opaque, forcing reactive secondary faults and coarse-grained huge page mappings to amortize their cost. This paper presents ParaCell, a paravirtualized secure container runtime built on two insights. First, intra-address-space hardware protection primitives can provide lightweight intra-container isolation. ParaCell uses MPK-based XGates to isolate the container user and container kernel within a single address space, turning frequent user--kernel transitions into direct domain switches. Second, container kernel allocators already encode memory-management intent. ParaCell introduces Pager to interpose on allocation and free events, batch proactive GPA to HPA bindings and unbindings, and avoid reactive shadow page-table faults while preserving fine-grained memory elasticity. ParaCell is implemented as a drop-in replacement for RunV. Our experiments demonstrate that, across traditional cloud and emerging agent applications, ParaCell reduces latency by up to 57% and 79% over PVM, and by up to 33% and 88% over RunV, in bare-metal and nested setups, respectively. On agent workloads, ParaCell saves up to 35.6% memory compared with the state-of-the-art VM memory reclamation technique, HyperAlloc.
翻译:摘要:安全容器通过为每个容器配备独立内核实现隔离,从而缓解传统容器系统中普遍存在的共享内核攻击。然而,现有设计方案仍面临隔离性与性能之间的根本性权衡。嵌套云部署加剧了虚拟机退出和页表管理的开销,而新兴的代理工作负载则暴露出对突发性内存需求及细粒度弹性的要求。我们将此归因于两个根本原因:首先,现有设计缺乏用于频繁容器用户-内核切换的轻量级容器内隔离原语;其次,宿主机将容器内存管理视为黑盒,被迫采用被动式二级缺页处理和粗粒度大页映射来分摊开销。本文提出ParaCell——一种基于半虚拟化安全容器运行时系统,其构建于两个关键洞察:第一,地址空间内硬件保护原语可实现轻量级容器内隔离。ParaCell采用基于MPK的XGates技术,在单一地址空间内隔离容器用户与容器内核,将频繁的用户-内核切换转化为直接的域切换。第二,容器内核分配器已编码内存管理意图。ParaCell通过Pager组件拦截分配与释放事件,批量处理主动式GPA到HPA的绑定与解绑操作,在保持细粒度内存弹性的同时避免被动式影子页表缺页。ParaCell作为RunV的即插即用替代方案实现。实验结果表明:在裸机与嵌套部署场景下,面向传统云应用和新兴代理应用时,ParaCell相比PVM分别降低最高57%与79%的延迟,相比RunV分别降低最高33%与88%的延迟。在代理工作负载下,ParaCell相比最先进的虚拟机内存回收技术HyperAlloc可节省最高35.6%的内存。