一句话:用未修改的 Rust 语言与编译器,通过类型系统与过程宏实现静态信息流控制库,保证非干扰且无运行时开销。
信息流控制(IFC)通过强制非干扰来保障机密性,即高密级值不能影响低密级值。已有细粒度 IFC 方案往往需要修改编程语言或使用非标准编译工具,或引入运行时开销,或产生虚假的机密性泄漏报告,这些缺陷都妨碍了其实际采用。本文提出 Cocoon:一个基于静态类型的 IFC Rust 库,完全使用未经修改的 Rust 语言与编译器。其核心洞见在于借助 Rust 的类型系统与过程宏(procedural macros)构建一个 effect 系统,从而在编译期强制非干扰。性能评估表明,使用 Cocoon 会增加编译时间,但对应用程序的运行时性能没有影响。为展示其实用性,作者将两个流行的 Rust 程序——Spotify TUI 客户端与 Mozilla 的 Servo 浏览器引擎——改造为使用 Cocoon,以强制实施有限的机密性策略。
Information flow control (IFC) provides confidentiality by enforcing noninterference, which ensures that high-secrecy values cannot affect low-secrecy values. Prior work introduces fine-grained IFC approaches that modify the programming language and use non-standard compilation tools, impose run-time overhead, or report false secrecy leaks—all of which hinder adoption. This paper presents Cocoon, a Rust library for static type-based IFC that uses the unmodified Rust language and compiler. The key insight of Cocoon lies in leveraging Rust’s type system and procedural macros to establish an effect system that enforces noninterference. A performance evaluation shows that using Cocoon increases compile time but has no impact on application performance. To demonstrate Cocoon’s utility, we retrofitted two popular Rust programs, the Spotify TUI client and Mozilla’s Servo browser engine, to use Cocoon to enforce limited confidentiality policies
@article{paperbot2571,
title = {Cocoon: Static Information Flow Control in Rust},
author = {Ada Lamba and Max Taylor and Vincent Beardsley and Jacob Bambeck and Michael D. Bond and Zhiqiang Lin},
journal = {Proceedings of the ACM on Programming Languages},
volume = {8},
number = {OOPSLA1},
year = {2024},
doi = {10.1145/3649817}
}