Securing low-latency I/O in commodity systems forces a fundamental trade-off: rely on the kernel's high overhead mediated interface, or bypass it entirely, exposing sensitive hardware resources to userspace and creating new vulnerabilities. This dilemma stems from a hardware granularity mismatch: standard MMUs operate at page boundaries, making it impossible to selectively expose safe device registers without also exposing the sensitive control registers colocated on the same page. Existing solutions to driver isolation enforce an isolation model that cannot protect sub-page device resources. This paper presents CAPIO, the first architecture to leverage hardware capabilities to enforce fine-grained access control on memory-mapped I/O. Unlike prior page-based protections, CAPIO utilizes unforgeable capabilities to create precise, sub-page "slices" of device memory. This mechanism enables the kernel to delegate latency-critical hardware access to userspace applications while strictly preventing interaction with co-located privileged registers. We implement CAPIO based on CHERI on the ARM Morello platform and demonstrate a proof-of-concept safe-access driver for a commodity network card which was not originally designed for kernel bypass. We demonstrate that CAPIO achieves the latency improvements of kernel bypass while enforcing byte-level access control of privileged resources.
翻译:在商用系统中保障低延迟I/O面临根本性权衡:要么依赖内核高开销的间接接口,要么完全绕过内核,将敏感硬件资源暴露给用户空间并产生新的安全漏洞。这一困境源于硬件粒度的不匹配:标准内存管理单元以页边界为单位操作,无法在暴露安全设备寄存器的同时,避免暴露同页共存的敏感控制寄存器。现有驱动程序隔离方案采用的隔离模型均无法保护亚页级设备资源。本文提出CAPIO——首个利用硬件能力对内存映射I/O实施细粒度访问控制的架构。与传统的页级保护机制不同,CAPIO通过不可伪造的能力机制创建精确的亚页级设备内存"切片"。该机制使内核能够将延迟敏感的硬件访问权安全委派给用户空间应用程序,同时严格阻止对同页特权寄存器的访问。我们在ARM Morello平台上基于CHERI实现了CAPIO原型,并为未设计内核旁路功能的商用网卡开发了概念验证型安全访问驱动程序。实验表明,CAPIO在实现内核旁路延迟优化的同时,能够对特权资源实施字节级访问控制。